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 e4f3329e32ab740df7fd18246735a97d19b7c4f2..05c4f2a019ff7ce1cbf7b3a9981a2184fe7303ab 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 0c8828c3f15228e57849f94661c56f87a9e0fd7e..1294689fe413128d32eb20d69840261f993aaed8 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 688e79c7502af13ee226269b81447f9990b7821d..627617d245594db15017f4ae75d14e92dac3fdf8 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 c7270d93f77540db4e19f1bd2392db493551e3ec..fc1e0c69110c72a49170dafc92b5db92fa1e9e38 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 40f4b4771d001e7bd365dc9cada4d1de13de02a2..68e5a33e31d6b1923cd4f85b9febacd106ed363b 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 *);