shithub: choc

Download patch

ref: 90a455e539c3beb5c1c50117fba9b4c885eb0389
parent: 70b90f34d93eab3b1c0531a5881ffdbebfc30708
author: Simon Howard <fraggle@soulsphere.org>
date: Tue May 31 15:58:58 EDT 2016

diskicon: De-dupe icon dimension constants.

These were already defined in v_diskicon.h.

--- a/src/v_diskicon.c
+++ b/src/v_diskicon.c
@@ -27,9 +27,6 @@
 
 #include "v_diskicon.h"
 
-#define DISK_ICON_W 16
-#define DISK_ICON_H 16
-
 // Only display the disk icon if more then this much bytes have been read
 // during the previous tic.
 
@@ -75,14 +72,14 @@
     V_UseBuffer(tmpscreen);
 
     // Buffer where we'll save the disk data.
-    disk_data = Z_Malloc(DISK_ICON_W * DISK_ICON_H, PU_STATIC, NULL);
+    disk_data = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC, NULL);
 
     // Draw the patch and save the result to disk_data.
     disk = W_CacheLumpName(disk_lump, PU_STATIC);
     V_DrawPatch(loading_disk_xoffs, loading_disk_yoffs, disk);
-    CopyRegion(disk_data, DISK_ICON_W,
+    CopyRegion(disk_data, LOADING_DISK_W,
                tmpscreen + yoffs * SCREENWIDTH + xoffs, SCREENWIDTH,
-               DISK_ICON_W, DISK_ICON_H);
+               LOADING_DISK_W, LOADING_DISK_H);
     W_ReleaseLumpName(disk_lump);
 
     V_RestoreBuffer();
@@ -94,7 +91,8 @@
     loading_disk_xoffs = xoffs;
     loading_disk_yoffs = yoffs;
 
-    saved_background = Z_Malloc(DISK_ICON_W * DISK_ICON_H, PU_STATIC, NULL);
+    saved_background = Z_Malloc(LOADING_DISK_W * LOADING_DISK_H, PU_STATIC,
+                                NULL);
     SaveDiskData(lump_name, xoffs, yoffs);
 }
 
@@ -115,14 +113,14 @@
     if (disk_data != NULL && recent_bytes_read > diskicon_threshold)
     {
         // Save the background behind the disk before we draw it.
-        CopyRegion(saved_background, DISK_ICON_W,
+        CopyRegion(saved_background, LOADING_DISK_W,
                    DiskRegionPointer(), SCREENWIDTH,
-                   DISK_ICON_W, DISK_ICON_H);
+                   LOADING_DISK_W, LOADING_DISK_H);
 
         // Write the disk to the screen buffer.
         CopyRegion(DiskRegionPointer(), SCREENWIDTH,
-                   disk_data, DISK_ICON_W,
-                   DISK_ICON_W, DISK_ICON_H);
+                   disk_data, LOADING_DISK_W,
+                   LOADING_DISK_W, LOADING_DISK_H);
         disk_drawn = true;
     }
 
@@ -135,8 +133,8 @@
     {
         // Restore the background.
         CopyRegion(DiskRegionPointer(), SCREENWIDTH,
-                   saved_background, DISK_ICON_W,
-                   DISK_ICON_W, DISK_ICON_H);
+                   saved_background, LOADING_DISK_W,
+                   LOADING_DISK_W, LOADING_DISK_H);
 
         disk_drawn = false;
     }