shithub: choc

Download patch

ref: bc38703ac6063a7888f538ae7662487fe1e8cb37
parent: 0ff16d8ff1d13bb7793aa5fbfee6b6a364397a1d
author: Simon Howard <[email protected]>
date: Sun Aug 7 16:01:00 EDT 2005

Clear the screen on startup

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 49

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 47 2005-08-07 03:09:33Z fraggle $
+// $Id: i_video.c 49 2005-08-07 20:01:00Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,9 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.17  2005/08/07 20:01:00  fraggle
+// Clear the screen on startup
+//
 // Revision 1.16  2005/08/07 03:09:33  fraggle
 // Fix gamma correction
 //
@@ -81,7 +84,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_video.c 47 2005-08-07 03:09:33Z fraggle $";
+rcsid[] = "$Id: i_video.c 49 2005-08-07 20:01:00Z fraggle $";
 
 #include <ctype.h>
 #include <SDL.h>
@@ -649,6 +652,7 @@
 
 void I_InitGraphics(void)
 {
+    SDL_Event dummy;
     int flags = 0;
 
     SDL_Init(SDL_INIT_VIDEO);
@@ -687,10 +691,13 @@
 
     LoadDiskImage();
 
-    {
-        SDL_Event dummy;
-        while (SDL_PollEvent(&dummy));
-    }
+    // start with a clear black screen
+
+    memset(screens[0], 0, SCREENWIDTH * SCREENHEIGHT);
+
+    // clear out any events waiting at the start
+  
+    while (SDL_PollEvent(&dummy));
 }
 
 unsigned	exptable[256];