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
This commit is contained in:
Sander van Dijk 2014-09-08 20:29:16 +00:00
parent d6949cd03b
commit dc4799f48a

View file

@ -65,7 +65,7 @@ cvar_t m_filter = {"m_filter","0",CVAR_NONE};
* gets updated from the main game loop via IN_MouseMove */ * gets updated from the main game loop via IN_MouseMove */
static int total_dx, total_dy = 0; 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) switch (event->type)
{ {
@ -78,10 +78,12 @@ static int FilterMouseEvents (const SDL_Event *event)
return 1; 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() static void IN_BeginIgnoringMouseEvents()
{ {
@ -90,11 +92,11 @@ static void IN_BeginIgnoringMouseEvents()
void *currentUserdata = NULL; void *currentUserdata = NULL;
SDL_GetEventFilter(&currentFilter, &currentUserdata); SDL_GetEventFilter(&currentFilter, &currentUserdata);
if (currentFilter != FilterMouseEvents_SDL2) if (currentFilter != IN_SDL2_FilterMouseEvents)
SDL_SetEventFilter(FilterMouseEvents_SDL2, NULL); SDL_SetEventFilter(IN_SDL2_FilterMouseEvents, NULL);
#else #else
if (SDL_GetEventFilter() != FilterMouseEvents) if (SDL_GetEventFilter() != IN_FilterMouseEvents)
SDL_SetEventFilter(FilterMouseEvents); SDL_SetEventFilter(IN_FilterMouseEvents);
#endif #endif
} }
@ -367,7 +369,6 @@ void IN_UpdateForKeydest (void)
} }
#if defined(USE_SDL2) #if defined(USE_SDL2)
static qboolean IN_SDL2_QuakeKeyHandledAsTextInput(int qkey) static qboolean IN_SDL2_QuakeKeyHandledAsTextInput(int qkey)
{ {
return (qkey >= 32 && qkey <= 126) && qkey != '`'; return (qkey >= 32 && qkey <= 126) && qkey != '`';