foxygit / doom Log in
commit 96e3baf08dd5c704a607eab36cf62a50f386a9a6
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Tue Sep 1 15:27:01 2015 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Tue Sep 1 15:27:01 2015 +0200

    prevent saving a background which already has the disk icon drawn upon
---
 src/i_video.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/i_video.c b/src/i_video.c
index f60b5414..93e96836 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -1005,21 +1005,24 @@ void I_BeginRead(void)
     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);

         screenloc += SCREENWIDTH;
     }
+
+    readtic = gametic;
 }

 void I_EndRead(void)
@@ -1032,8 +1035,6 @@ void I_EndRead(void)
     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 @@ void I_EndRead(void)

         screenloc += SCREENWIDTH;
     }
+
+    readtic = 0;
 }

 //