cleanup of obsolete client message event from SDL 1.2
authorHolger Schemel <info@artsoft.org>
Wed, 20 Mar 2019 21:00:34 +0000 (22:00 +0100)
committerHolger Schemel <info@artsoft.org>
Wed, 20 Mar 2019 21:00:34 +0000 (22:00 +0100)
This event is only used for the "quit" event in SDL 2.0 now.

src/events.c
src/events.h
src/libgame/sdl.h
src/libgame/system.c
src/libgame/system.h

index e4f3329..05c4f2a 100644 (file)
@@ -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);
index 0c8828c..1294689 100644 (file)
@@ -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);
index 688e79c..627617d 100644 (file)
@@ -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
 
index c7270d9..fc1e0c6 100644 (file)
@@ -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
index 40f4b47..68e5a33 100644 (file)
@@ -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 *);