changeset 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 10e82be38b8b
children 23a344b5e4f1
files tools/gfxconv.c tools/lib64gfx.c tools/lib64gfx.h
diffstat 3 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Thu Jun 28 18:39:26 2018 +0300
+++ b/tools/gfxconv.c	Thu Jun 28 18:55:21 2018 +0300
@@ -1167,7 +1167,7 @@
         if (op->type == DO_LAST)
             break;
 
-        size = dmC64GetOpSubjectSize(op, dstFmt);
+        size = dmC64GetOpSubjectSize(op, dstFmt->format);
         switch (op->type)
         {
             case DO_COPY:
--- 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))
         {
--- a/tools/lib64gfx.h	Thu Jun 28 18:39:26 2018 +0300
+++ b/tools/lib64gfx.h	Thu Jun 28 18:55:21 2018 +0300
@@ -330,8 +330,8 @@
 void      dmC64GetOpMemBlock(const DMC64Image *img, const int subject, const int bank, const DMC64MemBlock **blk);
 int       dmC64SanityCheckEncDecOp(const int i, const DMC64EncDecOp *op, const DMC64Image *img);
 
-size_t    dmC64GetSubjectSize(const int subject, const DMC64ImageFormat *fmt);
-size_t    dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt);
+size_t    dmC64GetSubjectSize(const int subject, const DMC64ImageCommonFormat *fmt);
+size_t    dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageCommonFormat *fmt);
 
 
 int       dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt);