removed drag-and-drop support if compiled with SDL version older than 2.0.5
authorHolger Schemel <info@artsoft.org>
Sat, 2 Feb 2019 10:29:29 +0000 (11:29 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 2 Feb 2019 10:29:29 +0000 (11:29 +0100)
src/events.c
src/libgame/system.h

index 0d1f6baf371a34982db7915ebd947e531bc96ca7..b3e4c81f599fe00ab070f7353b040a7fa573ff58 100644 (file)
@@ -268,12 +268,14 @@ void HandleOtherEvents(Event *event)
       HandleJoystickEvent(event);
       break;
 
+#if defined(USE_DRAG_AND_DROP)
     case SDL_DROPBEGIN:
     case SDL_DROPCOMPLETE:
     case SDL_DROPFILE:
     case SDL_DROPTEXT:
       HandleDropEvent(event);
       break;
+#endif
 
     default:
       break;
@@ -1525,6 +1527,7 @@ void HandleClientMessageEvent(ClientMessageEvent *event)
     CloseAllAndExit(0);
 }
 
+#if defined(USE_DRAG_AND_DROP)
 static boolean HandleDropFileEvent(char *filename)
 {
   Error(ERR_DEBUG, "DROP FILE EVENT: '%s'", filename);
@@ -1643,6 +1646,7 @@ void HandleDropEvent(Event *event)
   if (event->drop.file != NULL)
     SDL_free(event->drop.file);
 }
+#endif
 
 void HandleButton(int mx, int my, int button, int button_nr)
 {
index bab4957e9f861437e39851d7b8fb945dbe7bf8b5..73fc371603eaf3d6afb3953e1f7b2908137ad545 100644 (file)
 #define SCREEN_KEYBOARD_POS(h)         ((h) / 2)
 #endif
 
+// values for drag-and-drop support (some parts not added before SDL 2.0.5)
+#if SDL_VERSION_ATLEAST(2,0,5)
+#define USE_DRAG_AND_DROP
+#endif
+
 // default input keys
 #define DEFAULT_KEY_LEFT               KSYM_Left
 #define DEFAULT_KEY_RIGHT              KSYM_Right