From a2f741fe8afd6a05956d9d009c42e199cd7a9590 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Tue, 4 Jan 2022 08:26:41 +0300 Subject: [PATCH] engine: platform: sdl: try to fix 1.2 build --- engine/client/input.c | 4 ++-- engine/common/crashhandler.c | 2 +- engine/platform/sdl/events.c | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/client/input.c b/engine/client/input.c index b5756ec0..e90a5848 100644 --- a/engine/client/input.c +++ b/engine/client/input.c @@ -221,7 +221,7 @@ void IN_CheckMouseState( qboolean active ) { if( !s_bRawInput ) { -#if XASH_SDL >= 2 +#if XASH_SDL == 2 SDL_GetRelativeMouseState( NULL, NULL ); SDL_SetRelativeMouseMode( SDL_TRUE ); #endif @@ -234,7 +234,7 @@ void IN_CheckMouseState( qboolean active ) { if( s_bRawInput ) { -#if XASH_SDL >= 2 +#if XASH_SDL == 2 SDL_GetRelativeMouseState( NULL, NULL ); SDL_SetRelativeMouseMode( SDL_FALSE ); #endif diff --git a/engine/common/crashhandler.c b/engine/common/crashhandler.c index f8cbc542..fac7474a 100644 --- a/engine/common/crashhandler.c +++ b/engine/common/crashhandler.c @@ -178,7 +178,7 @@ static void Sys_StackTrace( PEXCEPTION_POINTERS pInfo ) len += Q_snprintf( message + len, 1024 - len, ")\n"); } -#if XASH_SDL >= 2 +#if XASH_SDL == 2 if( host.type != HOST_DEDICATED ) // let system to restart server automaticly SDL_ShowSimpleMessageBox( SDL_MESSAGEBOX_ERROR, "Sys_Crash", message, host.hWnd ); #endif diff --git a/engine/platform/sdl/events.c b/engine/platform/sdl/events.c index 6e84ae26..54e36e87 100644 --- a/engine/platform/sdl/events.c +++ b/engine/platform/sdl/events.c @@ -273,8 +273,10 @@ static void SDLash_MouseEvent( SDL_MouseButtonEvent button ) int down = button.state != SDL_RELEASED; uint mstate = 0; +#if SDL_VERSION_ATLEAST( 2, 0, 0 ) if( button.which == SDL_TOUCH_MOUSEID ) return; +#endif switch( button.button ) {