* 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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@194 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2010-06-19 22:45:18 +00:00
parent 7030aaf38c
commit a369e60679
2 changed files with 3 additions and 5 deletions

View file

@ -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) {

View file

@ -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 */