diff tools/64vw.c @ 1775:4e4d54135baf

Refactor the c64 bitmap format definitions handling to be more flexible. Again.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 12 Jun 2018 17:12:48 +0300
parents b940b72d1b4d
children 5ea4713e9e0f
line wrap: on
line diff
--- a/tools/64vw.c	Tue Jun 12 15:36:00 2018 +0300
+++ b/tools/64vw.c	Tue Jun 12 17:12:48 2018 +0300
@@ -61,7 +61,7 @@
         char buf[64];
         printf("%-6s| %-15s | %s%s\n",
             fmt->fext,
-            dmC64GetImageTypeString(buf, sizeof(buf), fmt->type, FALSE),
+            dmC64GetImageTypeString(buf, sizeof(buf), fmt->format->type, FALSE),
             fmt->name,
             fmt->flags & DM_FMT_BROKEN ? " [BROKEN]" : "");
     }
@@ -221,8 +221,8 @@
     bmap.constpal = TRUE;
     bmap.pal      = dmDefaultC64Palette;
 
-    if (fmt->convertFrom != NULL)
-        ret = fmt->convertFrom(&bmap, cimage, fmt);
+    if (fmt->format->convertFrom != NULL)
+        ret = fmt->format->convertFrom(&bmap, cimage, fmt);
     else
         ret = dmC64ConvertGenericBMP2Image(&bmap, cimage, fmt);
 
@@ -243,6 +243,7 @@
     size_t currIndex, prevIndex;
     int ret;
 
+    dmC64InitializeFormats();
     dmSetScaleFactor(2.0);
 
     dmInitProg("64vw", "Display some C64 bitmap graphics formats", "0.3", NULL, NULL);
@@ -275,7 +276,7 @@
     {
         forced = &dmC64ImageFormats[optForcedFormat];
         dmMsg(0, "Forced %s format image, type %d, %s\n",
-            forced->name, forced->type, forced->fext);
+            forced->name, forced->format->type, forced->fext);
     }
     else
         forced = NULL;