shithub: choc

Download patch

ref: b3f6b7715c613aa96a7192d8385a6af471b3fc2f
parent: 9057c76ed035e112248288c89bcff51bfd72f88c
parent: 9913f4f4d3729aea9ce116924aacc54e7482ba14
author: Fabian Greffrath <fabian@greffrath.com>
date: Fri Sep 4 09:33:31 EDT 2015

Merge pull request #606 from jmtd/diskicon-strife

Fix STDISK offset for strife

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -429,7 +429,7 @@
     I_GraphicsCheckCommandLine();
     I_SetGrabMouseCallback(D_GrabMouseCallback);
     I_InitGraphics();
-    I_EnableLoadingDisk();
+    I_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H);
 
     V_RestoreBuffer();
     R_ExecuteSetViewSize();
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -92,8 +92,8 @@
 };
 
 
-#define LOADING_DISK_W 16
-#define LOADING_DISK_H 16
+static int loading_disk_xoffs = 0;
+static int loading_disk_yoffs = 0;
 
 // Non aspect ratio-corrected modes (direct multiples of 320x200)
 
@@ -393,10 +393,13 @@
     }
 }
 
-void I_EnableLoadingDisk(void)
+void I_EnableLoadingDisk(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
@@ -937,8 +940,8 @@
 void I_PrepareRead(void)
 {
     byte *screenloc = I_VideoBuffer
-                    + (SCREENHEIGHT - LOADING_DISK_H) * SCREENWIDTH
-                    + (SCREENWIDTH - LOADING_DISK_W);
+                    + loading_disk_yoffs * SCREENWIDTH
+                    + loading_disk_xoffs;
     int y;
 
     if (!initialized || saved_background == NULL)
@@ -969,13 +972,8 @@
     }
 
     // Draw the disk to the screen
+    V_DrawPatch(loading_disk_xoffs, loading_disk_yoffs, disk);
 
-    V_DrawPatch(
-        SCREENWIDTH - LOADING_DISK_W,
-        SCREENHEIGHT - LOADING_DISK_H,
-        disk
-    );
-
     readtic = gametic;
 }
 
@@ -982,8 +980,8 @@
 void I_EndRead(void)
 {
     byte *screenloc = I_VideoBuffer
-                    + (SCREENHEIGHT - LOADING_DISK_H) * SCREENWIDTH
-                    + (SCREENWIDTH - LOADING_DISK_W);
+                    + loading_disk_yoffs * SCREENWIDTH
+                    + loading_disk_xoffs;
     int y;
 
     if (!initialized || saved_background == NULL)
--- a/src/i_video.h
+++ b/src/i_video.h
@@ -35,6 +35,11 @@
 
 #define SCREENHEIGHT_4_3 240
 
+// Dimensions of the flashing "loading" disk icon
+
+#define LOADING_DISK_W 16
+#define LOADING_DISK_H 16
+
 #define MAX_MOUSE_BUTTONS 8
 
 typedef struct
@@ -136,7 +141,7 @@
 
 // Enable the loading disk image displayed when reading from disk.
 
-void I_EnableLoadingDisk(void);
+void I_EnableLoadingDisk(int xoffs, int yoffs);
 
 extern char *video_driver;
 extern boolean screenvisible;
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -509,7 +509,7 @@
         I_InitGraphics();
     }
 
-    I_EnableLoadingDisk();
+    I_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, 0);
     I_SetGrabMouseCallback(D_GrabMouseCallback);
 
     V_RestoreBuffer();