From: Holger Schemel Date: Sat, 2 Feb 2019 10:29:29 +0000 (+0100) Subject: removed drag-and-drop support if compiled with SDL version older than 2.0.5 X-Git-Tag: 4.1.2.0~40 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c2db569638939bd90635f738953f81168421a41e;p=rocksndiamonds.git removed drag-and-drop support if compiled with SDL version older than 2.0.5 --- diff --git a/src/events.c b/src/events.c index 0d1f6baf..b3e4c81f 100644 --- a/src/events.c +++ b/src/events.c @@ -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) { diff --git a/src/libgame/system.h b/src/libgame/system.h index bab4957e..73fc3716 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -118,6 +118,11 @@ #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