Mercurial > hg > dmlib
diff tools/gfxconv.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 | c26a51ea70be |
children | 9f3fb4004c20 |
line wrap: on
line diff
--- a/tools/gfxconv.c Thu Jun 13 23:59:05 2019 +0300 +++ b/tools/gfxconv.c Fri Jun 14 00:00:27 2019 +0300 @@ -204,7 +204,7 @@ for (int i = 0; i < ndmC64ImageFormats; i++) { - const DMC64ImageFormat *fmt = &dmC64ImageFormats[i]; + const DMC64ImageFormat *fmt = dmC64ImageFormatsSorted[i]; char buf[64]; printf("%-6s| %c%c | %-15s | %s%s\n", fmt->fext, @@ -1930,7 +1930,13 @@ memset(&imageSpecC64, 0, sizeof(imageSpecC64)); // Initialize list of additional conversion formats - dmC64InitializeFormats(); + if ((res = dmLib64GFXInit()) != DMERR_OK) + { + dmErrorMsg("Could not initialize lib64gfx: %s\n", + dmErrorStr(res)); + goto exit; + } + nconvFormatList = ndmImageFormatList + nbaseFormatList; convFormatList = dmCalloc(nconvFormatList, sizeof(DMConvFormat)); @@ -2314,6 +2320,7 @@ dmC64ImageFree(outC64Image); dmImageFree(inImage); dmImageFree(outImage); + dmLib64GFXClose(); return 0; }