diff tools/lib64gfx.c @ 2223:5477e792def3

Remove useless DMC64ImageFormat parameter from some conversion functions.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 14 Jun 2019 12:12:19 +0300
parents 90ec1ec89c56
children a36c81c3df85
line wrap: on
line diff
--- a/tools/lib64gfx.c	Fri Jun 14 12:08:59 2019 +0300
+++ b/tools/lib64gfx.c	Fri Jun 14 12:12:19 2019 +0300
@@ -1382,13 +1382,12 @@
 
 // Convert a generic "C64" format bitmap in DMC64Image struct to
 // a indexed/paletted bitmap image.
-int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src,
-    const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec)
+int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec)
 {
     DMC64GetPixelFunc getPixel;
 
     // Sanity check arguments
-    if (dst == NULL || src == NULL || fmt == NULL || spec == NULL)
+    if (dst == NULL || src == NULL || spec == NULL)
         return DMERR_NULLPTR;
 
     if (dst->width != src->fmt->width || dst->height != src->fmt->height)
@@ -1433,13 +1432,12 @@
 }
 
 
-int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src,
-    const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec)
+int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *spec)
 {
     int res;
     DMImage *dst;
 
-    if (pdst == NULL || src == NULL || fmt == NULL || spec == NULL)
+    if (pdst == NULL || src == NULL || spec == NULL)
         return DMERR_NULLPTR;
 
     // Allocate image structure
@@ -1452,10 +1450,10 @@
         return res;
 
     // Convert
-    if (fmt->format->convertFrom != NULL)
-        res = fmt->format->convertFrom(dst, src, fmt, spec);
+    if (src->fmt->convertFrom != NULL)
+        res = src->fmt->convertFrom(dst, src, spec);
     else
-        res = dmC64ConvertGenericBMP2Image(dst, src, fmt, spec);
+        res = dmC64ConvertGenericBMP2Image(dst, src, spec);
 
     return res;
 }