summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2009-10-26 19:28:12 +0000
committerSimon Howard2009-10-26 19:28:12 +0000
commit3771126689527293eb4ad658b338d7910bf79012 (patch)
treeefcb7658b6496289e34f0099dd973971ad9b4f0a /src
parent42454af827d204444874558ccb340fc6e65f9ac1 (diff)
downloadchocolate-doom-3771126689527293eb4ad658b338d7910bf79012.tar.gz
chocolate-doom-3771126689527293eb4ad658b338d7910bf79012.tar.bz2
chocolate-doom-3771126689527293eb4ad658b338d7910bf79012.zip
Initial hacks for compiling under SDL 1.3.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1726
Diffstat (limited to 'src')
-rw-r--r--src/i_video.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/i_video.c b/src/i_video.c
index 062c9c9c..481ee0ea 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -334,7 +334,9 @@ static int TranslateKey(SDL_keysym *sym)
case SDLK_PAUSE: return KEY_PAUSE;
+#if !SDL_VERSION_ATLEAST(1, 3, 0)
case SDLK_EQUALS: return KEY_EQUALS;
+#endif
case SDLK_MINUS: return KEY_MINUS;
@@ -347,9 +349,11 @@ static int TranslateKey(SDL_keysym *sym)
return KEY_RCTRL;
case SDLK_LALT:
- case SDLK_LMETA:
case SDLK_RALT:
+#if !SDL_VERSION_ATLEAST(1, 3, 0)
+ case SDLK_LMETA:
case SDLK_RMETA:
+#endif
return KEY_RALT;
case SDLK_CAPSLOCK: return KEY_CAPSLOCK;
@@ -420,9 +424,15 @@ void I_StartFrame (void)
static int MouseButtonState(void)
{
- Uint8 state = SDL_GetMouseState(NULL, NULL);
+ Uint8 state;
int result = 0;
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+ state = SDL_GetMouseState(0, NULL, NULL);
+#else
+ state = SDL_GetMouseState(NULL, NULL);
+#endif
+
// Note: button "0" is left, button "1" is right,
// button "2" is middle for Doom. This is different
// to how SDL sees things.
@@ -585,7 +595,11 @@ static void CenterMouse(void)
// Clear any relative movement caused by warping
SDL_PumpEvents();
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+ SDL_GetRelativeMouseState(0, NULL, NULL);
+#else
SDL_GetRelativeMouseState(NULL, NULL);
+#endif
}
//
@@ -599,7 +613,11 @@ static void I_ReadMouse(void)
int x, y;
event_t ev;
+#if SDL_VERSION_ATLEAST(1, 3, 0)
+ SDL_GetRelativeMouseState(0, &x, &y);
+#else
SDL_GetRelativeMouseState(&x, &y);
+#endif
if (x != 0 || y != 0)
{
@@ -1553,7 +1571,9 @@ void I_InitGraphics(void)
// has to be done before the call to SDL_SetVideoMode.
I_SetWindowCaption();
+#if !SDL_VERSION_ATLEAST(1, 3, 0)
I_SetWindowIcon();
+#endif
// Set the video mode.