From: Holger Schemel Date: Wed, 20 Mar 2019 21:00:34 +0000 (+0100) Subject: cleanup of obsolete client message event from SDL 1.2 X-Git-Tag: 4.1.3.0~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=eb201ff71896cf5291e3ad61ccc663d9cec1b825;p=rocksndiamonds.git cleanup of obsolete client message event from SDL 1.2 This event is only used for the "quit" event in SDL 2.0 now. --- diff --git a/src/events.c b/src/events.c index e4f3329e..05c4f2a0 100644 --- a/src/events.c +++ b/src/events.c @@ -233,10 +233,6 @@ void HandleOtherEvents(Event *event) { switch (event->type) { - case EVENT_CLIENTMESSAGE: - HandleClientMessageEvent((ClientMessageEvent *) event); - break; - case SDL_CONTROLLERBUTTONDOWN: case SDL_CONTROLLERBUTTONUP: // for any game controller button event, disable overlay buttons @@ -261,6 +257,10 @@ void HandleOtherEvents(Event *event) HandleDropEvent(event); break; + case EVENT_QUIT: + CloseAllAndExit(0); + break; + default: break; } @@ -1424,12 +1424,6 @@ void HandleKeyEvent(KeyEvent *event) HandleKey(key, key_status); } -void HandleClientMessageEvent(ClientMessageEvent *event) -{ - if (CheckCloseWindowEvent(event)) - CloseAllAndExit(0); -} - static int HandleDropFileEvent(char *filename) { Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename); diff --git a/src/events.h b/src/events.h index 0c8828c3..1294689f 100644 --- a/src/events.h +++ b/src/events.h @@ -31,7 +31,6 @@ void HandleTextEvent(TextEvent *); void HandlePauseResumeEvent(PauseResumeEvent *); boolean HandleKeysDebug(Key, int); void HandleKeyEvent(KeyEvent *); -void HandleClientMessageEvent(ClientMessageEvent *); void HandleDropEvent(Event *); void HandleToonAnimations(void); diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 688e79c7..627617d2 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -64,7 +64,6 @@ typedef SDL_TextInputEvent TextEvent; typedef SDL_Event PauseResumeEvent; typedef SDL_WindowEvent WindowEvent; typedef SDL_KeyboardEvent KeyEvent; -typedef SDL_Event ClientMessageEvent; // structure definitions @@ -107,7 +106,7 @@ struct MouseCursorInfo #define EVENT_TEXTINPUT SDL_TEXTINPUT #define EVENT_KEYPRESS SDL_KEYDOWN #define EVENT_KEYRELEASE SDL_KEYUP -#define EVENT_CLIENTMESSAGE SDL_QUIT +#define EVENT_QUIT SDL_QUIT #define KSYM_UNDEFINED SDLK_UNKNOWN diff --git a/src/libgame/system.c b/src/libgame/system.c index c7270d93..fc1e0c69 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -1733,14 +1733,6 @@ void StopTextInput(void) #endif } -boolean CheckCloseWindowEvent(ClientMessageEvent *event) -{ - if (event->type != EVENT_CLIENTMESSAGE) - return FALSE; - - return TRUE; // the only possible message here is SDL_QUIT -} - // ============================================================================ // joystick functions diff --git a/src/libgame/system.h b/src/libgame/system.h index 40f4b477..68e5a33e 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1854,7 +1854,6 @@ KeyMod GetKeyModState(void); KeyMod GetKeyModStateFromEvents(void); void StartTextInput(int, int, int, int); void StopTextInput(void); -boolean CheckCloseWindowEvent(ClientMessageEvent *); void InitJoysticks(void); boolean ReadJoystick(int, int *, int *, boolean *, boolean *);