diff tools/lib64gfx.h @ 2201:9f3fb4004c20

Improvements to the lib64gfx palette handling.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 14 Jun 2019 00:42:36 +0300
parents dcd26cdc395e
children b259312ddb59
line wrap: on
line diff
--- a/tools/lib64gfx.h	Fri Jun 14 00:00:27 2019 +0300
+++ b/tools/lib64gfx.h	Fri Jun 14 00:42:36 2019 +0300
@@ -153,8 +153,18 @@
 
 typedef struct
 {
+    char *name;
+    DMColor colors[D64_NCOLORS];
+} DMC64Palette;
+
+
+typedef struct
+{
     int dither;      // Dither mode (D64_DITH_*)
     BOOL aspect;     // Correct pixel aspect ratio?
+
+    DMPalette *pal;     // Use this palette
+    DMC64Palette *cpal; // If ^pal == NULL, use this C64 palette
 } DMC64ImageConvSpec;
 
 
@@ -167,13 +177,6 @@
 
 typedef struct
 {
-    char *name;
-    DMColor colors[D64_NCOLORS];
-} DMC64Palette;
-
-
-typedef struct
-{
     BOOL multicolor, xexpand, yexpand;
     int color, xc, yc;
     Uint8 data[D64_SPR_HEIGHT_UT][D64_SPR_WIDTH_UT];
@@ -357,8 +360,7 @@
 char *    dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng);
 void      dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt, const char *indent);
 
-int       dmSetDefaultC64Palette(DMImage *img);
-int       dmSetMixedColorC64Palette(DMImage *img);
+int       dmC64SetImagePalette(DMImage *img, const DMC64Palette *cpal, const BOOL mixed);
 
 BOOL      dmCompareAddr16(const DMGrowBuf *buf, const size_t offs, const Uint16 addr);
 int       dmC64ImageGetNumBlocks(const DMC64ImageFormat *fmt);