From 33fa8bcf625e35c8d9afbaf1f87b7f6b463baafd Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 25 Sep 2005 00:31:32 +0000 Subject: Fix disk icon appearing before palette is set (pink disk!) Cleanup and commenting Subversion-branch: /trunk/chocolate-doom Subversion-revision: 133 --- src/i_video.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/i_video.c') 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 #include @@ -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 -- cgit v1.2.3