summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2007-12-18 22:09:51 +0000
committerSimon Howard2007-12-18 22:09:51 +0000
commit2b733d6a90586187c7b7fe0bc184af182620c2d8 (patch)
treeb28a91a96370b2745a9b552db93d86816a8865a7
parent030b38de23f85b129e357ed97e2a58e21391fe92 (diff)
downloadchocolate-doom-2b733d6a90586187c7b7fe0bc184af182620c2d8.tar.gz
chocolate-doom-2b733d6a90586187c7b7fe0bc184af182620c2d8.tar.bz2
chocolate-doom-2b733d6a90586187c7b7fe0bc184af182620c2d8.zip
Don't center the mouse on startup if the mouse is disabled (thanks
Siggi) Reset the palette when the window is restored to clear any screen corruption (thanks Catoptromancy) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 994
-rw-r--r--NEWS4
-rw-r--r--src/i_video.c14
2 files changed, 15 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 869e0f69..c5d7094b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@
set properly (thanks Lemonzest)
* Don't grab the mouse if the mouse is disabled via -nomouse
or use_mouse in the configuration file (thanks MikeRS).
+ * Don't center the mouse on startup if the mouse is disabled
+ (thanks Siggi).
+ * Reset the palette when the window is restored to clear
+ any screen corruption (thanks Catoptromancy).
1.0.0 (2007-12-10):
diff --git a/src/i_video.c b/src/i_video.c
index 93548498..2ab3dd98 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -505,6 +505,10 @@ void I_GetEvent(void)
UpdateFocus();
break;
+ case SDL_VIDEOEXPOSE:
+ palette_to_set = true;
+ break;
+
default:
break;
}
@@ -813,7 +817,7 @@ void I_FinishUpdate (void)
if (palette_to_set)
{
SDL_SetColors(screen, palette, 0, 256);
- palette_to_set = 0;
+ palette_to_set = false;
}
else
{
@@ -845,7 +849,7 @@ void I_SetPalette (byte *doompalette)
palette[i].b = gammatable[usegamma][*doompalette++];
}
- palette_to_set = 1;
+ palette_to_set = true;
}
//
@@ -1387,7 +1391,11 @@ void I_InitGraphics(void)
// clear out any events waiting at the start and center the mouse
while (SDL_PollEvent(&dummy));
- CenterMouse();
+
+ if (usemouse && !nomouse && (fullscreen || grabmouse))
+ {
+ CenterMouse();
+ }
initialised = true;
}