shithub: choc

Download patch

ref: bd41935ec4bbd8aa287a870cca8cfd33064665fc
parent: df4cb5af90a67d02c2e64b02462d39edfadf469f
author: Simon Howard <fraggle@gmail.com>
date: Sat Oct 14 09:59:28 EDT 2006

Disable the "loading from disk" icon on MacOS.

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

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1,7 +1,7 @@
 // Emacs style mode select   -*- C++ -*- 
 //-----------------------------------------------------------------------------
 //
-// $Id: i_video.c 653 2006-09-22 20:32:00Z fraggle $
+// $Id: i_video.c 700 2006-10-14 13:59:28Z fraggle $
 //
 // Copyright(C) 1993-1996 Id Software, Inc.
 // Copyright(C) 2005 Simon Howard
@@ -175,7 +175,7 @@
 //-----------------------------------------------------------------------------
 
 static const char
-rcsid[] = "$Id: i_video.c 653 2006-09-22 20:32:00Z fraggle $";
+rcsid[] = "$Id: i_video.c 700 2006-10-14 13:59:28Z fraggle $";
 
 #include <SDL.h>
 #include <ctype.h>
@@ -265,6 +265,7 @@
 // disk image data and background overwritten by the disk to be
 // restored by EndRead
 
+static boolean use_loading_disk;
 static byte *disk_image = NULL;
 static int disk_image_w, disk_image_h;
 static byte *saved_background;
@@ -1053,12 +1054,11 @@
 void I_InitGraphics(void)
 {
     SDL_Event dummy;
+    char buf[20];
     int flags = 0;
 
     SDL_Init(SDL_INIT_VIDEO);
 
-    flags |= SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF;
-
     // mouse grabbing
 
     if (M_CheckParm("-grabmouse"))
@@ -1082,11 +1082,6 @@
         fullscreen = FULLSCREEN_ON;
     }
 
-    if (fullscreen != FULLSCREEN_OFF)
-    {
-        flags |= SDL_FULLSCREEN;
-    }
-
     nomouse = M_CheckParm("-nomouse") > 0;
 
     // scale-by-2 mode
@@ -1182,6 +1177,13 @@
 
     GetWindowDimensions(&windowwidth, &windowheight);
 
+    flags |= SDL_SWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF;
+
+    if (fullscreen != FULLSCREEN_OFF)
+    {
+        flags |= SDL_FULLSCREEN;
+    }
+
     screen = SDL_SetVideoMode(windowwidth, windowheight, 8, flags);
 
     if (screen == NULL)
@@ -1254,9 +1256,25 @@
 	screens[0] = (unsigned char *) Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
     }
 
-    // Loading from disk icon
+    use_loading_disk = true;
 
-    LoadDiskImage();
+    SDL_VideoDriverName(buf, 15);
+
+    if (!strcmp(buf, "Quartz"))
+    {
+        // MacOS Quartz gives us pageflipped graphics that screw up the 
+        // display when we use the loading disk.  Disable it.
+        // This is a gross hack.
+
+        use_loading_disk = false;
+    }
+
+    // "Loading from disk" icon
+
+    if (use_loading_disk)
+    {
+        LoadDiskImage();
+    }
 
     memset(screens[0], 0, SCREENWIDTH * SCREENHEIGHT);