From 858fea34613c837703c7d7248e77f5c6ea26404f Mon Sep 17 00:00:00 2001 From: sezero Date: Sat, 19 Jun 2010 22:45:18 +0000 Subject: [PATCH] * input.h: Removed the SDL_MAJOR_VERSION guards around BuildKeyMaps() and Key_Map() prototypes. Made Key_Map() to accept void* argument instead of SDL_KeyboardEvent* so that the code can compile even without SDL. * in_sdl.c (Key_Map): Adjusted for argument type change with proper cast to SDL_KeyboardEvent*. The assembler output is the same as before. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@194 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/in_sdl.c | 4 ++-- quakespasm/Quake/input.h | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/quakespasm/Quake/in_sdl.c b/quakespasm/Quake/in_sdl.c index c24d8b55..22cd50e0 100644 --- a/quakespasm/Quake/in_sdl.c +++ b/quakespasm/Quake/in_sdl.c @@ -348,9 +348,9 @@ MapKey Map from SDL to quake keynums ======= */ -int Key_Map (SDL_KeyboardEvent *event) +int Key_Map (void *event) /* SDL_KeyboardEvent *event */ { - return key_map[(*event).keysym.sym]; + return key_map[(*(SDL_KeyboardEvent *)event).keysym.sym]; /* TODO: keypad handling if (cl_keypad.value) { diff --git a/quakespasm/Quake/input.h b/quakespasm/Quake/input.h index b1b8a2d1..ba24c353 100644 --- a/quakespasm/Quake/input.h +++ b/quakespasm/Quake/input.h @@ -47,11 +47,9 @@ void IN_Activate (); // called when the app becomes inactive void IN_Deactivate (qboolean free_cursor); -#if defined(SDL_MAJOR_VERSION) /* for SDL builds only */ void BuildKeyMaps (void); -int Key_Map (SDL_KeyboardEvent *event); -#endif /* SDL_MAJOR_VERSION */ +int Key_Map (void *event); /* SDL_KeyboardEvent *event */ #endif /* _QUAKE_INPUT_H */