changeset 1543:416d7b3ba3b2

Rename libgfx IMGFMT_* constants to DM_IMGFMT_*.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 12 May 2018 17:48:56 +0300
parents 69fa95707e65
children 48823642c4fb
files tools/gfxconv.c tools/libgfx.c tools/libgfx.h
diffstat 3 files changed, 25 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gfxconv.c	Sat May 12 05:31:40 2018 +0300
+++ b/tools/gfxconv.c	Sat May 12 17:48:56 2018 +0300
@@ -67,27 +67,27 @@
     },
     {
         "PNG image file", "png", TRUE, TRUE,
-        FFMT_IMAGE  , IMGFMT_PNG,
+        FFMT_IMAGE  , DM_IMGFMT_PNG,
     },
     {
         "PPM image file", "ppm", FALSE, TRUE,
-        FFMT_IMAGE  , IMGFMT_PPM,
+        FFMT_IMAGE  , DM_IMGFMT_PPM,
     },
     {
         "PCX image file", "pcx", TRUE, TRUE,
-        FFMT_IMAGE  , IMGFMT_PCX,
+        FFMT_IMAGE  , DM_IMGFMT_PCX,
     },
     {
         "IFF ILBM file", "lbm", TRUE, FALSE,
-        FFMT_IMAGE  , IMGFMT_ILBM,
+        FFMT_IMAGE  , DM_IMGFMT_ILBM,
     },
     {
         "Bitplaned RAW (intl/non-intl) image file", "raw", FALSE, TRUE,
-        FFMT_IMAGE  , IMGFMT_RAW,
+        FFMT_IMAGE  , DM_IMGFMT_RAW,
     },
     {
         "IFFMaster RAW image file", "araw", FALSE, TRUE,
-        FFMT_IMAGE  , IMGFMT_ARAW,
+        FFMT_IMAGE  , DM_IMGFMT_ARAW,
     },
 
     {
@@ -122,8 +122,8 @@
 
 int     optInFormat = FFMT_AUTO,
         optOutFormat = FFMT_ASCII,
-        optInSubFormat = IMGFMT_PNG,
-        optOutSubFormat = IMGFMT_PNG,
+        optInSubFormat = DM_IMGFMT_PNG,
+        optOutSubFormat = DM_IMGFMT_PNG,
         optItemCount = -1,
         optPlanedWidth = 1,
         optForcedFormat = -1;
@@ -1154,27 +1154,27 @@
     switch (iformat)
     {
 #ifdef DM_USE_LIBPNG
-        case IMGFMT_PNG:
+        case DM_IMGFMT_PNG:
             spec->format = spec->paletted ? DM_IFMT_PALETTE : DM_IFMT_RGBA;
             dmOutputImageBitFormat(spec->format, info);
             res = dmWritePNGImage(filename, image, spec);
             break;
 #endif
 
-        case IMGFMT_PPM:
+        case DM_IMGFMT_PPM:
             spec->format = DM_IFMT_RGB;
             dmOutputImageBitFormat(spec->format, info);
             res = dmWritePPMImage(filename, image, spec);
             break;
 
-        case IMGFMT_PCX:
+        case DM_IMGFMT_PCX:
             spec->format = spec->paletted ? DM_IFMT_PALETTE : DM_IFMT_RGB;
             dmOutputImageBitFormat(spec->format, info);
             res = dmWritePCXImage(filename, image, spec);
             break;
 
-        case IMGFMT_RAW:
-        case IMGFMT_ARAW:
+        case DM_IMGFMT_RAW:
+        case DM_IMGFMT_ARAW:
             {
                 // Open data file for writing
                 FILE *fp;
@@ -1202,7 +1202,7 @@
                             palID[i] = '_';
                     }
 
-                    if (iformat == IMGFMT_ARAW)
+                    if (iformat == DM_IMGFMT_ARAW)
                     {
                         fprintf(fp,
                         "%s_width: dw.w %d\n"
@@ -1629,7 +1629,7 @@
         exit(1);
 
 #ifndef DM_USE_LIBPNG
-    if (optOutFormat == IMGFMT_PNG)
+    if (optOutFormat == DM_IMGFMT_PNG)
     {
         dmErrorMsg("PNG output format support not compiled in, sorry.\n");
         goto error;
--- a/tools/libgfx.c	Sat May 12 05:31:40 2018 +0300
+++ b/tools/libgfx.c	Sat May 12 17:48:56 2018 +0300
@@ -1989,7 +1989,7 @@
 }
 
 
-DMImageFormat dmImageFormatList[IMGFMT_LAST] =
+DMImageFormat dmImageFormatList[DM_IMGFMT_LAST] =
 {
     {
         "PNG", "Portable Network Graphics",
@@ -2039,7 +2039,7 @@
 {
     int i, scoreMax = DM_PROBE_SCORE_FALSE, scoreIndex = -1;
 
-    for (i = 0; i < IMGFMT_LAST; i++)
+    for (i = 0; i < DM_IMGFMT_LAST; i++)
     {
         DMImageFormat *fmt = &dmImageFormatList[i];
         if (fmt->probe != NULL)
--- a/tools/libgfx.h	Sat May 12 05:31:40 2018 +0300
+++ b/tools/libgfx.h	Sat May 12 17:48:56 2018 +0300
@@ -18,14 +18,14 @@
 
 enum
 {
-    IMGFMT_PNG,
-    IMGFMT_PPM,
-    IMGFMT_PCX,
-    IMGFMT_ILBM,
-    IMGFMT_RAW,
-    IMGFMT_ARAW,
+    DM_IMGFMT_PNG,
+    DM_IMGFMT_PPM,
+    DM_IMGFMT_PCX,
+    DM_IMGFMT_ILBM,
+    DM_IMGFMT_RAW,
+    DM_IMGFMT_ARAW,
 
-    IMGFMT_LAST
+    DM_IMGFMT_LAST
 };
 
 
@@ -92,7 +92,7 @@
 #define DM_PROBE_SCORE_FALSE   0
 
 
-extern DMImageFormat dmImageFormatList[IMGFMT_LAST];
+extern DMImageFormat dmImageFormatList[DM_IMGFMT_LAST];
 extern int dmGFXErrorMode;