changeset 1929:b49814dd8469

Only copy memory blocks that do not already exist in destination.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Jun 2018 14:48:50 +0300
parents 0b2a2da4c7e7
children c048da352279
files tools/gfxconv.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Thu Jun 28 14:47:54 2018 +0300
+++ b/tools/gfxconv.c	Thu Jun 28 14:48:50 2018 +0300
@@ -1142,9 +1142,14 @@
         dmMsg(1, "Upconverting multicolor to FLI.\n");
         for (int i = 0; i < dst->nbanks; i++)
         {
-            dmC64MemBlockCopy(&dst->color[i], &src->color[0]);
-            dmC64MemBlockCopy(&dst->screen[i], &src->screen[0]);
-            dmC64MemBlockCopy(&dst->bitmap[i], &src->bitmap[0]);
+            if (dst->color[i].data == NULL)
+                dmC64MemBlockCopy(&dst->color[i], &src->color[0]);
+
+            if (dst->screen[i].data == NULL)
+                dmC64MemBlockCopy(&dst->screen[i], &src->screen[0]);
+
+            if (dst->bitmap[i].data == NULL)
+                dmC64MemBlockCopy(&dst->bitmap[i], &src->bitmap[0]);
         }
     }
     else