diff tools/64vw.c @ 2200:dcd26cdc395e

Replace dmC64InitializeFormats() with dmLib64GFXInit() and dmLib64GFXClose(). Add in sorting of the C64 formats list.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 14 Jun 2019 00:00:27 +0300
parents f331cc750b37
children 9f3fb4004c20
line wrap: on
line diff
--- a/tools/64vw.c	Thu Jun 13 23:59:05 2019 +0300
+++ b/tools/64vw.c	Fri Jun 14 00:00:27 2019 +0300
@@ -61,7 +61,7 @@
     );
     for (int i = 0; i < ndmC64ImageFormats; i++)
     {
-        const DMC64ImageFormat *fmt = &dmC64ImageFormats[i];
+        const DMC64ImageFormat *fmt = dmC64ImageFormatsSorted[i];
         char buf[64];
         printf("%-6s| %-15s | %s%s\n",
             fmt->fext,
@@ -269,7 +269,14 @@
     size_t currIndex, prevIndex;
     int res;
 
-    dmC64InitializeFormats();
+    // Initialize pre-requisites
+    if ((res = dmLib64GFXInit()) != DMERR_OK)
+    {
+        dmErrorMsg("Could not initialize lib64gfx: %s\n",
+            dmErrorStr(res));
+        goto exit;
+    }
+
     dmSetScaleFactor(2.0);
     memset(&spec, 0, sizeof(spec));
     memset(&setCharROM, 0, sizeof(setCharROM));
@@ -599,5 +606,7 @@
     if (initSDL)
         SDL_Quit();
 
+    dmLib64GFXClose();
+
     return 0;
 }