mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
InputSystem: rework CInputStackSystem::PopInputContext()
The method in the engine now takes a pointer to a context and pops it if its found in the stack by index. Adjusted SDK rebuild to reflect this change. The rest of the input stack system remained unchanged.
This commit is contained in:
parent
18545ec422
commit
7114bc6a40
@ -31,16 +31,30 @@ InputContextHandle_t CInputStackSystem::PushInputContext()
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pops the top input context off the input stack, and destroys it.
|
||||
// Pops the provided input context off the input stack, and destroys it.
|
||||
//-----------------------------------------------------------------------------
|
||||
void CInputStackSystem::PopInputContext( InputContextHandle_t hContext )
|
||||
void CInputStackSystem::PopInputContext( InputContextHandle_t& hContext )
|
||||
{
|
||||
if ( m_ContextStack.Count() == 0 )
|
||||
const int nCount = m_ContextStack.Count();
|
||||
|
||||
if ( nCount == 0 )
|
||||
return;
|
||||
|
||||
InputContext_t *pContext = NULL;
|
||||
m_ContextStack.Pop( pContext );
|
||||
delete pContext;
|
||||
int i = 0;
|
||||
InputContext_t *pContext = *m_ContextStack.Base();
|
||||
|
||||
// Find the context.
|
||||
for ( ; pContext != (InputContext_t*)hContext; pContext++ )
|
||||
{
|
||||
if ( ++i == nCount )
|
||||
{
|
||||
Assert( 0 );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
m_ContextStack.PopAt( i );
|
||||
hContext = INPUT_CONTEXT_HANDLE_INVALID;
|
||||
|
||||
UpdateCursorState();
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
// Methods of IInputStackSystem
|
||||
public:
|
||||
virtual InputContextHandle_t PushInputContext();
|
||||
virtual void PopInputContext( InputContextHandle_t hContext );
|
||||
virtual void PopInputContext( InputContextHandle_t& hContext );
|
||||
virtual void EnableInputContext( InputContextHandle_t hContext, bool bEnable );
|
||||
virtual void SetCursorVisible( InputContextHandle_t hContext, bool bVisible );
|
||||
virtual void SetCursorIcon( InputContextHandle_t hContext, InputCursorHandle_t hCursor );
|
||||
|
Loading…
x
Reference in New Issue
Block a user