diff tools/lib64gfx.c @ 1822:9bec535956fd

Add indentation parameter to dmC64ImageDump().
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 22 Jun 2018 12:20:46 +0300
parents ee2383d1a21e
children adf9f05c26e1
line wrap: on
line diff
--- a/tools/lib64gfx.c	Fri Jun 22 11:20:15 2018 +0300
+++ b/tools/lib64gfx.c	Fri Jun 22 12:20:46 2018 +0300
@@ -48,7 +48,7 @@
 }
 
 
-void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt)
+void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt, const char *indent)
 {
     char typeStr[64], typeStr2[64];
 
@@ -57,8 +57,8 @@
     if (fmt != NULL)
     {
         fprintf(fh,
-            "Format              : %s [%s]\n",
-            fmt->name, fmt->fext);
+            "%sFormat              : %s [%s]\n",
+            indent, fmt->name, fmt->fext);
     }
 
     if (img != NULL)
@@ -66,10 +66,10 @@
         dmC64GetImageTypeString(typeStr2, sizeof(typeStr2), img->type, TRUE);
 
         fprintf(fh,
-            "Type                : %s [%s]\n"
-            "Banks               : %d\n",
-            typeStr, typeStr2,
-            img->nbanks);
+            "%sType                : %s [%s]\n"
+            "%sBanks               : %d\n",
+            indent, typeStr, typeStr2,
+            indent, img->nbanks);
 
         if (img->type & D64_FMT_ILACE)
         {
@@ -81,27 +81,27 @@
                 default: tmps = "ERROR"; break;
             }
             fprintf(fh,
-                "Interlace type      : %s\n",
-                tmps);
+                "%sInterlace type      : %s\n",
+                indent, tmps);
         }
 
         fprintf(fh,
-            "Width x Height      : %d x %d [%d x %d]\n"
-            "CHwidth x CHheight  : %d x %d [%d x %d]\n",
-            img->width, img->height,
+            "%sWidth x Height      : %d x %d [%d x %d]\n"
+            "%sCHwidth x CHheight  : %d x %d [%d x %d]\n",
+            indent, img->width, img->height,
             fmt->format->width, fmt->format->height,
-            img->chWidth, img->chHeight,
+            indent, img->chWidth, img->chHeight,
             fmt->format->chWidth, fmt->format->chHeight);
     }
     else
     {
         fprintf(fh,
-            "Type                : %s\n"
-            "Width x Height      : %d x %d\n"
-            "CHwidth x CHheight  : %d x %d\n",
-            typeStr,
-            fmt->format->width, fmt->format->height,
-            fmt->format->chWidth, fmt->format->chHeight);
+            "%sType                : %s\n"
+            "%sWidth x Height      : %d x %d\n"
+            "%sCHwidth x CHheight  : %d x %d\n",
+            indent, typeStr,
+            indent, fmt->format->width, fmt->format->height,
+            indent, fmt->format->chWidth, fmt->format->chHeight);
     }
 }