shithub: choc

Download patch

ref: 2730a06cf1fe70ea00d3cf7727ec5776d7abc809
parent: 90a455e539c3beb5c1c50117fba9b4c885eb0389
author: Simon Howard <fraggle@soulsphere.org>
date: Tue May 31 16:03:55 EDT 2016

video: Remove show_diskicon from video code.

Since this is game-specific there is no real reason for this to be
defined in the common video code. This also fixes the show_diskicon
variable which was broken by recent changes.

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -125,6 +125,7 @@
 char		mapdir[1024];           // directory of development maps
 
 int             show_endoom = 1;
+int             show_diskicon = 1;
 
 
 void D_ConnectNetGame(void);
@@ -328,6 +329,27 @@
     } while (!done);
 }
 
+static void EnableLoadingDisk(void)
+{
+    char *disk_lump_name;
+
+    if (show_diskicon)
+    {
+        if (M_CheckParm("-cdrom") > 0)
+        {
+            disk_lump_name = DEH_String("STCDROM");
+        }
+        else
+        {
+            disk_lump_name = DEH_String("STDISK");
+        }
+
+        V_EnableLoadingDisk(disk_lump_name,
+                            SCREENWIDTH - LOADING_DISK_W,
+                            SCREENHEIGHT - LOADING_DISK_H);
+    }
+}
+
 //
 // Add configuration file variable bindings.
 //
@@ -408,8 +430,6 @@
 //
 void D_DoomLoop (void)
 {
-    char *disk_lump_name;
-
     if (gamevariant == bfgedition &&
         (demorecording || (gameaction == ga_playdemo) || netgame))
     {
@@ -430,14 +450,7 @@
     I_GraphicsCheckCommandLine();
     I_SetGrabMouseCallback(D_GrabMouseCallback);
     I_InitGraphics();
-
-    if (M_CheckParm("-cdrom") > 0)
-        disk_lump_name = DEH_String("STCDROM");
-    else
-        disk_lump_name = DEH_String("STDISK");
-    V_EnableLoadingDisk(disk_lump_name,
-                        SCREENWIDTH - LOADING_DISK_W,
-                        SCREENHEIGHT - LOADING_DISK_H);
+    EnableLoadingDisk();
 
     V_RestoreBuffer();
     R_ExecuteSetViewSize();
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -171,10 +171,6 @@
 
 int png_screenshots = 0;
 
-// Display disk activity indicator.
-
-int show_diskicon = 1;
-
 // if true, I_VideoBuffer is screen->pixels
 
 static boolean native_surface;
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -152,7 +152,4 @@
 extern int fullscreen;
 extern int aspect_ratio_correct;
 
-extern int show_diskicon;
-extern int diskicon_readbytes;
-
 #endif
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -142,6 +142,7 @@
 char		mapdir[1024];           // directory of development maps
 
 int             show_endoom = 1;
+int             show_diskicon = 1;
 int             graphical_startup = 1;
 
 // If true, startup has completed and the main game loop has started.
@@ -511,7 +512,10 @@
         I_InitGraphics();
     }
 
-    V_EnableLoadingDisk("STDISK", SCREENWIDTH - LOADING_DISK_W, 3);
+    if (show_diskicon)
+    {
+        V_EnableLoadingDisk("STDISK", SCREENWIDTH - LOADING_DISK_W, 3);
+    }
     I_SetGrabMouseCallback(D_GrabMouseCallback);
 
     V_RestoreBuffer();