changeset 1725:40a5ba0b3838

Return size of subject in dmC64GetOpSize() despite what the operator type is.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 07 Jun 2018 14:47:37 +0300
parents 12504f179749
children f9128665a47e
files tools/lib64gfx.c
diffstat 1 files changed, 25 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Wed Jun 06 15:41:00 2018 +0300
+++ b/tools/lib64gfx.c	Thu Jun 07 14:47:37 2018 +0300
@@ -691,38 +691,34 @@
 
 BOOL dmC64GetOpSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt, size_t *size)
 {
-    // Default to size of 0
-    *size = 0;
-
-    switch (op->type)
+    switch (op->subject)
     {
-        case DO_COPY:
-        case DO_SET_MEM:
-        case DO_SET_OP:
-            switch (op->subject)
-            {
-                case DS_SCREEN_RAM:
-                case DS_COLOR_RAM:
-                    *size = fmt->chHeight * fmt->chWidth;
-                    break;
+        case DS_SCREEN_RAM:
+        case DS_COLOR_RAM:
+            *size = fmt->chHeight * fmt->chWidth;
+            break;
+
+        case DS_BITMAP_RAM:
+            *size = fmt->chHeight * fmt->chWidth * 8;
+            break;
 
-                case DS_BITMAP_RAM:
-                    *size = fmt->chHeight * fmt->chWidth * 8;
-                    break;
-
-                case DS_CHAR_DATA:
-                    *size = C64_MAX_CHARS * C64_CHR_SIZE;
-                    break;
+        case DS_CHAR_DATA:
+            *size = C64_MAX_CHARS * C64_CHR_SIZE;
+            break;
 
-                case DS_D020:
-                case DS_BGCOL:
-                case DS_D021:
-                case DS_D022:
-                case DS_D023:
-                case DS_D024:
-                    *size = 1;
-                    break;
-            }
+        case DS_D020:
+        case DS_BGCOL:
+        case DS_D021:
+        case DS_D022:
+        case DS_D023:
+        case DS_D024:
+            *size = 1;
+            break;
+
+        default:
+            // Default to size of 0
+            *size = 0;
+            break;
     }
 
     // If the operator specified size is larger, use it.