0ad/0ad-cs8833.patch

35 lines
1.1 KiB
Diff

Index: source/ps/KeyName.h
===================================================================
--- source/ps/KeyName.h (revision 8832)
+++ source/ps/KeyName.h (revision 8833)
@@ -34,8 +34,13 @@
MOUSE_MIDDLE = SDLK_LAST + SDL_BUTTON_MIDDLE,
MOUSE_WHEELUP = SDLK_LAST + SDL_BUTTON_WHEELUP,
MOUSE_WHEELDOWN = SDLK_LAST + SDL_BUTTON_WHEELDOWN,
+#if SDL_VERSION_ATLEAST(1, 2, 13)
MOUSE_X1 = SDLK_LAST + SDL_BUTTON_X1,
MOUSE_X2 = SDLK_LAST + SDL_BUTTON_X2,
+#else
+ MOUSE_X1 = SDLK_LAST + SDL_BUTTON_WHEELDOWN + 1,
+ MOUSE_X2 = SDLK_LAST + SDL_BUTTON_WHEELDOWN + 2,
+#endif
// 'Keycodes' for the unified modifier keys
UNIFIED_SHIFT,
Index: source/ps/Hotkey.cpp
===================================================================
--- source/ps/Hotkey.cpp (revision 8832)
+++ source/ps/Hotkey.cpp (revision 8833)
@@ -178,7 +178,11 @@
break;
case SDL_MOUSEBUTTONDOWN:
case SDL_MOUSEBUTTONUP:
+#if SDL_VERSION_ATLEAST(1, 2, 13)
if ((int)ev->ev.button.button <= SDL_BUTTON_X2)
+#else
+ if ((int)ev->ev.button.button <= SDL_BUTTON_WHEELDOWN)
+#endif
{
keycode = SDLK_LAST + (int)ev->ev.button.button;
break;