From 47524a844ae9bc092a790ebbfbdff2716e40f14f Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Wed, 14 Nov 2001 10:43:10 +0000 Subject: [PATCH] remove cruft, fix formatting, begin joystick stuff --- arch/sdl/event.c | 75 ++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 34 deletions(-) diff --git a/arch/sdl/event.c b/arch/sdl/event.c index 97c8d827..38ca99a4 100644 --- a/arch/sdl/event.c +++ b/arch/sdl/event.c @@ -1,12 +1,15 @@ /* * $Source: /cvs/cvsroot/d2x/arch/sdl/event.c,v $ - * $Revision: 1.2 $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-10-31 07:41:54 $ + * $Date: 2001-11-14 10:43:10 $ * * SDL Event related stuff * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/10/31 07:41:54 bradleyb + * Sync with d1x + * * Revision 1.1 2001/10/24 09:25:05 bradleyb * Moved input stuff to arch subdirs, as in d1x. * @@ -25,48 +28,52 @@ #include extern void key_handler(SDL_KeyboardEvent *event); -//added on 10/17/98 by Hans de Goede for mouse functionality extern void mouse_button_handler(SDL_MouseButtonEvent *mbe); extern void mouse_motion_handler(SDL_MouseMotionEvent *mme); -//end this section addition - Hans static int initialised=0; void event_poll() { - SDL_Event event; - while (SDL_PollEvent(&event)) - { -// if( (event.type == SDL_KEYEVENT) { -//added/changed on 10/17/98 by Hans de Goede for mouse functionality -//-killed- if( (event.type == SDL_KEYDOWN) || (event.type == SDL_KEYUP) ) { - switch(event.type) - { - case SDL_KEYDOWN: - case SDL_KEYUP: - key_handler((SDL_KeyboardEvent *)&event); - break; - case SDL_MOUSEBUTTONDOWN: - case SDL_MOUSEBUTTONUP: - mouse_button_handler((SDL_MouseButtonEvent *)&event); - break; - case SDL_MOUSEMOTION: - mouse_motion_handler((SDL_MouseMotionEvent *)&event); - break; -//-killed- return; -//end this section addition/change - Hans - case SDL_QUIT: { - void quit_request(); - quit_request(); - } break; - } - } + SDL_Event event; + + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_KEYDOWN: + case SDL_KEYUP: + key_handler((SDL_KeyboardEvent *)&event); + break; + case SDL_MOUSEBUTTONDOWN: + case SDL_MOUSEBUTTONUP: + mouse_button_handler((SDL_MouseButtonEvent *)&event); + break; + case SDL_MOUSEMOTION: + mouse_motion_handler((SDL_MouseMotionEvent *)&event); + break; +#if 0 + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + joy_button_handler((SDL_JoyButtonEvent *)&event); + break; + case SDL_JOYAXISMOTION: + joy_motion_handler((SDL_JoyAxisEvent *)&event); + break; + case SDL_JOYBALLMOTION: + case SDL_JOYHATMOTION: + break; +#endif + case SDL_QUIT: { + void quit_request(); + quit_request(); + } break; + } + } } int event_init() { - // We should now be active and responding to events. - initialised = 1; + // We should now be active and responding to events. + initialised = 1; - return 0; + return 0; } -- 2.39.2