summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2005-09-25 00:31:32 +0000
committerSimon Howard2005-09-25 00:31:32 +0000
commit33fa8bcf625e35c8d9afbaf1f87b7f6b463baafd (patch)
tree2ace001d8ba643fde459eb74e1b61c8c6677993c /src
parenta74f73ec1309e789115cc8058d802adc8307047a (diff)
downloadchocolate-doom-33fa8bcf625e35c8d9afbaf1f87b7f6b463baafd.tar.gz
chocolate-doom-33fa8bcf625e35c8d9afbaf1f87b7f6b463baafd.tar.bz2
chocolate-doom-33fa8bcf625e35c8d9afbaf1f87b7f6b463baafd.zip
Fix disk icon appearing before palette is set (pink disk!)
Cleanup and commenting Subversion-branch: /trunk/chocolate-doom Subversion-revision: 133
Diffstat (limited to 'src')
-rw-r--r--src/i_video.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/i_video.c b/src/i_video.c
index cd569892..7de7977d 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_video.c 130 2005-09-24 23:44:49Z fraggle $
+// $Id: i_video.c 133 2005-09-25 00:31:32Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.31 2005/09/25 00:31:32 fraggle
+// Fix disk icon appearing before palette is set (pink disk!)
+// Cleanup and commenting
+//
// Revision 1.30 2005/09/24 23:44:49 fraggle
// Enforce sane screenmultiply values
//
@@ -130,7 +134,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_video.c 130 2005-09-24 23:44:49Z fraggle $";
+rcsid[] = "$Id: i_video.c 133 2005-09-25 00:31:32Z fraggle $";
#include <SDL.h>
#include <ctype.h>
@@ -591,8 +595,8 @@ static void UpdateArea(int x1, int y1, int x2, int y2, boolean always_update)
SDL_UpdateRect(screen,
x1 * screenmultiply,
y1 * screenmultiply,
- (x2-x1) * screenmultiply,
- (y2-y1) * screenmultiply);
+ w * screenmultiply,
+ h * screenmultiply);
}
}
@@ -812,6 +816,14 @@ void I_InitGraphics(void)
I_Error("Error setting video mode: %s\n", SDL_GetError());
}
+ // start with a clear black screen
+
+ memset(screens[0], 0, SCREENWIDTH * SCREENHEIGHT);
+ I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE));
+ SDL_Flip(screen);
+
+ // Setup title and icon
+
SetCaption();
SetIcon();
@@ -835,13 +847,13 @@ void I_InitGraphics(void)
else
screens[0] = (unsigned char *) Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
- LoadDiskImage();
+ // Loading from disk icon
- SDL_EnableUNICODE(1);
+ LoadDiskImage();
- // start with a clear black screen
+ // We need SDL to give us translated versions of keys as well
- memset(screens[0], 0, SCREENWIDTH * SCREENHEIGHT);
+ SDL_EnableUNICODE(1);
// clear out any events waiting at the start