engine: input: hide SDL_ functions under XASH_SDL macro
This commit is contained in:
parent
94c42160b7
commit
62cdf2ae5b
1 changed files with 6 additions and 0 deletions
|
@ -204,11 +204,13 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
Platform_SetMousePos( host.window_center_x, host.window_center_y );
|
Platform_SetMousePos( host.window_center_x, host.window_center_y );
|
||||||
|
#if XASH_SDL
|
||||||
SDL_SetWindowGrab( host.hWnd, SDL_TRUE );
|
SDL_SetWindowGrab( host.hWnd, SDL_TRUE );
|
||||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||||
if( clgame.dllFuncs.pfnLookEvent )
|
if( clgame.dllFuncs.pfnLookEvent )
|
||||||
SDL_SetRelativeMouseMode( SDL_TRUE );
|
SDL_SetRelativeMouseMode( SDL_TRUE );
|
||||||
#endif
|
#endif
|
||||||
|
#endif // XASH_SDL
|
||||||
}
|
}
|
||||||
if( cls.initialized )
|
if( cls.initialized )
|
||||||
clgame.dllFuncs.IN_ActivateMouse();
|
clgame.dllFuncs.IN_ActivateMouse();
|
||||||
|
@ -216,11 +218,13 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
|
||||||
|
|
||||||
if( ( newstate == key_menu || newstate == key_console || newstate == key_message ) && ( !CL_IsBackgroundMap() || CL_IsBackgroundDemo( )))
|
if( ( newstate == key_menu || newstate == key_console || newstate == key_message ) && ( !CL_IsBackgroundMap() || CL_IsBackgroundDemo( )))
|
||||||
{
|
{
|
||||||
|
#ifdef XASH_SDL
|
||||||
SDL_SetWindowGrab(host.hWnd, SDL_FALSE);
|
SDL_SetWindowGrab(host.hWnd, SDL_FALSE);
|
||||||
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
#if SDL_VERSION_ATLEAST( 2, 0, 0 )
|
||||||
if( clgame.dllFuncs.pfnLookEvent )
|
if( clgame.dllFuncs.pfnLookEvent )
|
||||||
SDL_SetRelativeMouseMode( SDL_FALSE );
|
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||||
#endif
|
#endif
|
||||||
|
#endif // XASH_SDL
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
Android_ShowMouse( true );
|
Android_ShowMouse( true );
|
||||||
#endif
|
#endif
|
||||||
|
@ -318,7 +322,9 @@ void IN_DeactivateMouse( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
in_mouseactive = false;
|
in_mouseactive = false;
|
||||||
|
#ifdef XASH_SDL
|
||||||
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
SDL_SetWindowGrab( host.hWnd, SDL_FALSE );
|
||||||
|
#endif // XASH_SDL
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue