shithub: choc

Download patch

ref: 96e3baf08dd5c704a607eab36cf62a50f386a9a6
parent: 165b0bddfdbd55c07f86895bd14d6725bff9e61d
author: Fabian Greffrath <fabian@greffrath.com>
date: Tue Sep 1 11:27:01 EDT 2015

prevent saving a background which already has the disk icon drawn upon

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1005,15 +1005,16 @@
     if (!initialized || disk_image == NULL)
         return;
 
-    readtic = gametic;
-
     // save background and copy the disk image in
 
     for (y=0; y<LOADING_DISK_H; ++y)
     {
-        memcpy(saved_background + y * LOADING_DISK_W,
-               screenloc,
-               LOADING_DISK_W);
+        if (!readtic)
+        {
+            memcpy(saved_background + y * LOADING_DISK_W,
+                   screenloc,
+                   LOADING_DISK_W);
+        }
         memcpy(screenloc,
                disk_image + y * LOADING_DISK_W,
                LOADING_DISK_W);
@@ -1020,6 +1021,8 @@
 
         screenloc += SCREENWIDTH;
     }
+
+    readtic = gametic;
 }
 
 void I_EndRead(void)
@@ -1032,8 +1035,6 @@
     if (!initialized || disk_image == NULL)
         return;
 
-    readtic = 0;
-
     // save background and copy the disk image in
 
     for (y=0; y<LOADING_DISK_H; ++y)
@@ -1044,6 +1045,8 @@
 
         screenloc += SCREENWIDTH;
     }
+
+    readtic = 0;
 }
 
 //