foxygit / doom Log in
commit 2730a06cf1fe70ea00d3cf7727ec5776d7abc809
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Tue May 31 20:03:55 2016 +0100
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Tue May 31 20:03:55 2016 +0100

    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.
---
 src/doom/d_main.c   | 33 +++++++++++++++++++++++----------
 src/i_video.c       |  4 ----
 src/i_video.h       |  3 ---
 src/strife/d_main.c |  6 +++++-
 4 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index c6eea37d..1b708381 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -125,6 +125,7 @@ char		wadfile[1024];		// primary wad file
 char		mapdir[1024];           // directory of development maps

 int             show_endoom = 1;
+int             show_diskicon = 1;


 void D_ConnectNetGame(void);
@@ -328,6 +329,27 @@ void D_Display (void)
     } 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 @@ boolean D_GrabMouseCallback(void)
 //
 void D_DoomLoop (void)
 {
-    char *disk_lump_name;
-
     if (gamevariant == bfgedition &&
         (demorecording || (gameaction == ga_playdemo) || netgame))
     {
@@ -430,14 +450,7 @@ void D_DoomLoop (void)
     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();
diff --git a/src/i_video.c b/src/i_video.c
index dd3166dd..8004b539 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -171,10 +171,6 @@ int novert = 0;

 int png_screenshots = 0;

-// Display disk activity indicator.
-
-int show_diskicon = 1;
-
 // if true, I_VideoBuffer is screen->pixels

 static boolean native_surface;
diff --git a/src/i_video.h b/src/i_video.h
index 0663796e..49ccb607 100644
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -152,7 +152,4 @@ extern int screen_bpp;
 extern int fullscreen;
 extern int aspect_ratio_correct;

-extern int show_diskicon;
-extern int diskicon_readbytes;
-
 #endif
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index ac4aac46..240cc064 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -142,6 +142,7 @@ char		wadfile[1024];          // primary wad file
 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 @@ void D_DoomLoop (void)
         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();