From 8f20863e40e5f721adc616817eae8442898b9a70 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 2 Oct 2005 03:03:40 +0000 Subject: Make sure loading disk is only shown if the display is initialised Subversion-branch: /trunk/chocolate-doom Subversion-revision: 145 --- src/i_video.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/i_video.c b/src/i_video.c index d89c8561..c811ac32 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: i_video.c 140 2005-09-27 22:33:42Z fraggle $ +// $Id: i_video.c 145 2005-10-02 03:03:40Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.34 2005/10/02 03:03:40 fraggle +// Make sure loading disk is only shown if the display is initialised +// // Revision 1.33 2005/09/27 22:33:42 fraggle // Always use SDL_Flip to update the screen. Fixes problems in Windows when // running fullscreen, introduced by fixes to the disk icon code. @@ -141,7 +144,7 @@ //----------------------------------------------------------------------------- static const char -rcsid[] = "$Id: i_video.c 140 2005-09-27 22:33:42Z fraggle $"; +rcsid[] = "$Id: i_video.c 145 2005-10-02 03:03:40Z fraggle $"; #include #include @@ -172,6 +175,10 @@ static boolean palette_to_set; static int windowwidth, windowheight; +// display has been set up? + +static boolean initialised = false; + // if true, screens[0] is screen->pixel static boolean native_surface; @@ -371,6 +378,8 @@ void I_ShutdownGraphics(void) SDL_WM_GrabInput(SDL_GRAB_OFF); SDL_QuitSubSystem(SDL_INIT_VIDEO); + + initialised = false; } @@ -602,7 +611,7 @@ void I_BeginRead(void) { int y; - if (disk_image == NULL) + if (!initialised || disk_image == NULL) return; // save background and copy the disk image in @@ -628,7 +637,7 @@ void I_EndRead(void) { int y; - if (disk_image == NULL) + if (!initialised || disk_image == NULL) return; // save background and copy the disk image in @@ -657,6 +666,9 @@ void I_FinishUpdate (void) int i; // UNUSED static unsigned char *bigscreen=0; + if (!initialised) + return; + UpdateGrab(); // Don't update the screen if the window isn't visible. @@ -870,5 +882,7 @@ void I_InitGraphics(void) // clear out any events waiting at the start while (SDL_PollEvent(&dummy)); + + initialised = true; } -- cgit v1.2.3