From 6dfceb2ce609dcf05ce4b94ebeb2407f7990374f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 15 Oct 2005 22:50:57 +0000 Subject: Fix pink icon on startup Subversion-branch: /trunk/chocolate-doom Subversion-revision: 201 --- src/i_video.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/i_video.c') diff --git a/src/i_video.c b/src/i_video.c index d6acc879..da8af154 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 195 2005-10-15 15:59:14Z fraggle $ +// $Id: i_video.c 201 2005-10-15 22:50:57Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.38 2005/10/15 22:50:57 fraggle +// Fix pink icon on startup +// // Revision 1.37 2005/10/15 15:59:14 fraggle // Map mouse buttons correctly. // @@ -155,7 +158,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 195 2005-10-15 15:59:14Z fraggle $"; +rcsid[] = "$Id: i_video.c 201 2005-10-15 22:50:57Z fraggle $"; #include #include @@ -856,10 +859,19 @@ void I_InitGraphics(void) I_Error("Error setting video mode: %s\n", SDL_GetError()); } - // start with a clear black screen + // Start with a clear black screen + // (screen will be flipped after we set the palette) + + if (SDL_LockSurface(screen) >= 0) + { + memset(screen->pixels, 0, screen->w * screen->pitch); + SDL_UnlockSurface(screen); + } + + // Set the palette I_SetPalette (W_CacheLumpName ("PLAYPAL",PU_CACHE)); - SDL_Flip(screen); + SDL_SetColors(screen, palette, 0, 256); // Setup title and icon -- cgit v1.2.3