shithub: choc

Download patch

ref: 70b90f34d93eab3b1c0531a5881ffdbebfc30708
parent: 5bddaa7c571d0abf1543fbc9c735bc5054f568ef
author: Simon Howard <fraggle@soulsphere.org>
date: Tue May 31 15:56:16 EDT 2016

diskicon: Fix Strife disk icon.

Strife has no STCDROM lump; it always uses STDISK. Change the
V_EnableLoadingDisk() function to take the lump name as an argument,
as the lump to use for the loading disk is really game-specific.

Also fix the location where the Strife disk icon is shown on screen;
the vertical position wasn't quite right.

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -408,6 +408,8 @@
 //
 void D_DoomLoop (void)
 {
+    char *disk_lump_name;
+
     if (gamevariant == bfgedition &&
         (demorecording || (gameaction == ga_playdemo) || netgame))
     {
@@ -428,7 +430,14 @@
     I_GraphicsCheckCommandLine();
     I_SetGrabMouseCallback(D_GrabMouseCallback);
     I_InitGraphics();
-    V_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H);
+
+    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);
 
     V_RestoreBuffer();
     R_ExecuteSetViewSize();
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -511,7 +511,7 @@
         I_InitGraphics();
     }
 
-    V_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, 0);
+    V_EnableLoadingDisk("STDISK", SCREENWIDTH - LOADING_DISK_W, 3);
     I_SetGrabMouseCallback(D_GrabMouseCallback);
 
     V_RestoreBuffer();
--- a/src/v_diskicon.c
+++ b/src/v_diskicon.c
@@ -89,20 +89,13 @@
     Z_Free(tmpscreen);
 }
 
-void V_EnableLoadingDisk(int xoffs, int yoffs)
+void V_EnableLoadingDisk(char *lump_name, int xoffs, int yoffs)
 {
-    char *disk_name;
-
     loading_disk_xoffs = xoffs;
     loading_disk_yoffs = yoffs;
 
-    if (M_CheckParm("-cdrom") > 0)
-        disk_name = DEH_String("STCDROM");
-    else
-        disk_name = DEH_String("STDISK");
-
     saved_background = Z_Malloc(DISK_ICON_W * DISK_ICON_H, PU_STATIC, NULL);
-    SaveDiskData(disk_name, xoffs, yoffs);
+    SaveDiskData(lump_name, xoffs, yoffs);
 }
 
 void V_BeginRead(size_t nbytes)
--- a/src/v_diskicon.h
+++ b/src/v_diskicon.h
@@ -24,7 +24,7 @@
 #define LOADING_DISK_W 16
 #define LOADING_DISK_H 16
 
-extern void V_EnableLoadingDisk(int xoffs, int yoffs);
+extern void V_EnableLoadingDisk(char *lump_name, int xoffs, int yoffs);
 extern void V_BeginRead(size_t nbytes);
 extern void V_DrawDiskIcon(void);
 extern void V_RestoreDiskBackground(void);