From dc4799f48a5b621aaf2ecb30488e62cdc717bae6 Mon Sep 17 00:00:00 2001 From: Sander van Dijk Date: Mon, 8 Sep 2014 20:29:16 +0000 Subject: [PATCH] in_sdl.c: Rename the mouse filter functions for consistency. Also surround the SDL version by "#if defined(USE_SDL2)" and "#endif", this suppresses an unused function warning when building for SDL1. (Building for SDL2 still gives an unused variable "modstate" warning though.) git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1002 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/in_sdl.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Quake/in_sdl.c b/Quake/in_sdl.c index 55b71342..cb547985 100644 --- a/Quake/in_sdl.c +++ b/Quake/in_sdl.c @@ -65,7 +65,7 @@ cvar_t m_filter = {"m_filter","0",CVAR_NONE}; * gets updated from the main game loop via IN_MouseMove */ static int total_dx, total_dy = 0; -static int FilterMouseEvents (const SDL_Event *event) +static int IN_FilterMouseEvents (const SDL_Event *event) { switch (event->type) { @@ -78,10 +78,12 @@ static int FilterMouseEvents (const SDL_Event *event) return 1; } -static int FilterMouseEvents_SDL2 (void *userdata, SDL_Event *event) +#if defined(USE_SDL2) +static int IN_SDL2_FilterMouseEvents (void *userdata, SDL_Event *event) { - return FilterMouseEvents (event); + return IN_FilterMouseEvents (event); } +#endif static void IN_BeginIgnoringMouseEvents() { @@ -90,11 +92,11 @@ static void IN_BeginIgnoringMouseEvents() void *currentUserdata = NULL; SDL_GetEventFilter(¤tFilter, ¤tUserdata); - if (currentFilter != FilterMouseEvents_SDL2) - SDL_SetEventFilter(FilterMouseEvents_SDL2, NULL); + if (currentFilter != IN_SDL2_FilterMouseEvents) + SDL_SetEventFilter(IN_SDL2_FilterMouseEvents, NULL); #else - if (SDL_GetEventFilter() != FilterMouseEvents) - SDL_SetEventFilter(FilterMouseEvents); + if (SDL_GetEventFilter() != IN_FilterMouseEvents) + SDL_SetEventFilter(IN_FilterMouseEvents); #endif } @@ -367,7 +369,6 @@ void IN_UpdateForKeydest (void) } #if defined(USE_SDL2) - static qboolean IN_SDL2_QuakeKeyHandledAsTextInput(int qkey) { return (qkey >= 32 && qkey <= 126) && qkey != '`';