diff tools/lib64gfx.c @ 1933:c5a46cb4cce5

Change DMC64ImageFormat parameter of dmC64GetSubjectSize() and dmC64GetOpSubjectSize() to DMC64ImageCommonFormat.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 28 Jun 2018 18:55:21 +0300
parents 410679d2fe8a
children d9a0a4bccf5d
line wrap: on
line diff
--- a/tools/lib64gfx.c	Thu Jun 28 18:39:26 2018 +0300
+++ b/tools/lib64gfx.c	Thu Jun 28 18:55:21 2018 +0300
@@ -767,17 +767,17 @@
 }
 
 
-size_t dmC64GetSubjectSize(const int subject, const DMC64ImageFormat *fmt)
+size_t dmC64GetSubjectSize(const int subject, const DMC64ImageCommonFormat *fmt)
 {
     switch (subject)
     {
         case DS_SCREEN_RAM:
         case DS_COLOR_RAM:
-            return fmt->format->chHeight * fmt->format->chWidth;
+            return fmt->chHeight * fmt->chWidth;
             break;
 
         case DS_BITMAP_RAM:
-            return fmt->format->chHeight * fmt->format->chWidth * 8;
+            return fmt->chHeight * fmt->chWidth * 8;
             break;
 
         case DS_CHAR_DATA:
@@ -801,7 +801,7 @@
 }
 
 
-size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt)
+size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageCommonFormat *fmt)
 {
     size_t size = dmC64GetSubjectSize(op->subject, fmt);
 
@@ -888,7 +888,7 @@
             return res;
 
         // Is the operation inside the bounds?
-        size = dmC64GetOpSubjectSize(op, fmt);
+        size = dmC64GetOpSubjectSize(op, fmt->format);
         if (op->type == DO_COPY && op->offs + size > buf->len + 1)
         {
             return dmError(DMERR_INVALID_DATA,
@@ -1093,7 +1093,7 @@
             goto err;
 
         // Do we need to reallocate some more space?
-        size = dmC64GetOpSubjectSize(op, fmt);
+        size = dmC64GetOpSubjectSize(op, fmt->format);
         chksize = buf->offs + op->offs + size;
         if (!dmGrowBufCheckGrow(buf, chksize))
         {