[chocolate-doom] 18/31: Guard against multiple video shutdowns better. Fix crash due to improper screen clear at startup.

Jonathan Dowland jmtd at moszumanska.debian.org
Mon Jan 30 15:07:01 UTC 2017


This is an automated email from the git hooks/post-receive script.

jmtd pushed a commit to annotated tag chocolate-doom-0.1.1
in repository chocolate-doom.

commit eb11f9bfbb35c9ea3f8c9bf4e238168c8254d131
Author: Simon Howard <fraggle at gmail.com>
Date:   Mon Oct 17 19:46:22 2005 +0000

    Guard against multiple video shutdowns better. Fix crash due to improper
    screen clear at startup.
    
    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 205
---
 src/i_video.c | 28 +++++++++++++++++++++-------
 1 file changed, 21 insertions(+), 7 deletions(-)

diff --git a/src/i_video.c b/src/i_video.c
index 1e89403..f1830c5 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 204 2005-10-16 20:55:50Z fraggle $
+// $Id: i_video.c 205 2005-10-17 19:46:22Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
 // 02111-1307, USA.
 //
 // $Log$
+// Revision 1.40  2005/10/17 19:46:22  fraggle
+// Guard against multiple video shutdowns better.  Fix crash due to improper
+// screen clear at startup.
+//
 // Revision 1.39  2005/10/16 20:55:50  fraggle
 // Fix the '-cdrom' command-line option.
 //
@@ -161,7 +165,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_video.c 204 2005-10-16 20:55:50Z fraggle $";
+rcsid[] = "$Id: i_video.c 205 2005-10-17 19:46:22Z fraggle $";
 
 #include <SDL.h>
 #include <ctype.h>
@@ -394,12 +398,15 @@ int TranslateKey(SDL_keysym *sym)
 
 void I_ShutdownGraphics(void)
 {
-    SDL_ShowCursor(1);
-    SDL_WM_GrabInput(SDL_GRAB_OFF);
+    if (initialised)
+    {
+        SDL_ShowCursor(1);
+        SDL_WM_GrabInput(SDL_GRAB_OFF);
 
-    SDL_QuitSubSystem(SDL_INIT_VIDEO);
+        SDL_QuitSubSystem(SDL_INIT_VIDEO);
     
-    initialised = false;
+        initialised = false;
+    }
 }
 
 
@@ -870,7 +877,14 @@ void I_InitGraphics(void)
 
     if (SDL_LockSurface(screen) >= 0)
     {
-        memset(screen->pixels, 0, screen->w * screen->pitch);
+        byte *screenpixels;
+        int y;
+
+        screenpixels = (byte *) screen->pixels;
+
+        for (y=0; y<screen->h; ++y)
+            memset(screenpixels + screen->pitch * y, 0, screen->w);
+
         SDL_UnlockSurface(screen);
     }
     

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/chocolate-doom.git



More information about the Pkg-games-commits mailing list