changeset 2380:89cb93184175

Move dmC64DefaultPalettes from lib64gfx to lib64util.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 08 Jan 2020 13:08:53 +0200
parents 7011e11dad9a
children e61aaa51415c
files tools/lib64gfx.c tools/lib64gfx.h tools/lib64util.c tools/lib64util.h
diffstat 4 files changed, 85 insertions(+), 78 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Wed Jan 08 13:08:06 2020 +0200
+++ b/tools/lib64gfx.c	Wed Jan 08 13:08:53 2020 +0200
@@ -12,82 +12,6 @@
 #define BUF_SIZE_GROW      (4*1024)
 
 
-//
-// Some "default" C64 palettes
-//
-DMC64Palette dmC64DefaultPalettes[] =
-{
-    {
-        "pepto",
-        "Pepto's classic (default)",
-        {
-            { 0x00, 0x00, 0x00, 0xff },
-            { 0xFF, 0xFF, 0xFF, 0xff },
-            { 0x68, 0x37, 0x2B, 0xff },
-            { 0x70, 0xA4, 0xB2, 0xff },
-            { 0x6F, 0x3D, 0x86, 0xff },
-            { 0x58, 0x8D, 0x43, 0xff },
-            { 0x35, 0x28, 0x79, 0xff },
-            { 0xB8, 0xC7, 0x6F, 0xff },
-            { 0x6F, 0x4F, 0x25, 0xff },
-            { 0x43, 0x39, 0x00, 0xff },
-            { 0x9A, 0x67, 0x59, 0xff },
-            { 0x44, 0x44, 0x44, 0xff },
-            { 0x6C, 0x6C, 0x6C, 0xff },
-            { 0x9A, 0xD2, 0x84, 0xff },
-            { 0x6C, 0x5E, 0xB5, 0xff },
-            { 0x95, 0x95, 0x95, 0xff },
-        },
-    },
-    {
-        "colodore",
-        "Colodore",
-        {
-            { 0x00, 0x00, 0x00, 0xff },
-            { 0xff, 0xff, 0xff, 0xff },
-            { 0x96, 0x28, 0x2e, 0xff },
-            { 0x5b, 0xd6, 0xce, 0xff },
-            { 0x9f, 0x2d, 0xad, 0xff },
-            { 0x41, 0xb9, 0x36, 0xff },
-            { 0x27, 0x24, 0xc4, 0xff },
-            { 0xef, 0xf3, 0x47, 0xff },
-            { 0x9f, 0x48, 0x15, 0xff },
-            { 0x5e, 0x35, 0x00, 0xff },
-            { 0xda, 0x5f, 0x66, 0xff },
-            { 0x47, 0x47, 0x47, 0xff },
-            { 0x78, 0x78, 0x78, 0xff },
-            { 0x91, 0xff, 0x84, 0xff },
-            { 0x68, 0x64, 0xff, 0xff },
-            { 0xae, 0xae, 0xae, 0xff },
-        },
-    },
-    {
-        "vice3",
-        "VICE 3.3",
-        {
-            { 0x00, 0x00, 0x00, 0xff },
-            { 0xfd, 0xfe, 0xfc, 0xff },
-            { 0xbe, 0x1a, 0x24, 0xff },
-            { 0x30, 0xe6, 0xc6, 0xff },
-            { 0xb4, 0x1a, 0xe2, 0xff },
-            { 0x1f, 0xd2, 0x1e, 0xff },
-            { 0x21, 0x1b, 0xae, 0xff },
-            { 0xdf, 0xf6, 0x0a, 0xff },
-            { 0xb8, 0x41, 0x04, 0xff },
-            { 0x6a, 0x33, 0x04, 0xff },
-            { 0xfe, 0x4a, 0x57, 0xff },
-            { 0x42, 0x45, 0x40, 0xff },
-            { 0x70, 0x74, 0x6f, 0xff },
-            { 0x59, 0xfe, 0x59, 0xff },
-            { 0x5f, 0x53, 0xfe, 0xff },
-            { 0xa4, 0xa7, 0xa2, 0xff },
-        },
-    },
-};
-
-const int ndmC64DefaultPalettes = sizeof(dmC64DefaultPalettes) / sizeof(dmC64DefaultPalettes[0]);
-
-
 int dmC64PaletteFromC64Colors(DMPalette **ppal, const DMColor *colors, const BOOL mixed)
 {
     int res;
--- a/tools/lib64gfx.h	Wed Jan 08 13:08:06 2020 +0200
+++ b/tools/lib64gfx.h	Wed Jan 08 13:08:53 2020 +0200
@@ -377,8 +377,6 @@
 //
 // Global variables
 //
-extern DMC64Palette      dmC64DefaultPalettes[];
-extern const int         ndmC64DefaultPalettes;
 extern DMC64ImageFormat  dmC64ImageFormats[];
 extern const int         ndmC64ImageFormats;
 extern DMC64ImageFormat  **dmC64ImageFormatsSorted;
--- a/tools/lib64util.c	Wed Jan 08 13:08:06 2020 +0200
+++ b/tools/lib64util.c	Wed Jan 08 13:08:53 2020 +0200
@@ -9,6 +9,82 @@
 #include "dmfile.h"
 
 
+//
+// Some common C64 palettes
+//
+DMC64Palette dmC64DefaultPalettes[] =
+{
+    {
+        "pepto",
+        "Pepto's classic (default)",
+        {
+            { 0x00, 0x00, 0x00, 0xff },
+            { 0xFF, 0xFF, 0xFF, 0xff },
+            { 0x68, 0x37, 0x2B, 0xff },
+            { 0x70, 0xA4, 0xB2, 0xff },
+            { 0x6F, 0x3D, 0x86, 0xff },
+            { 0x58, 0x8D, 0x43, 0xff },
+            { 0x35, 0x28, 0x79, 0xff },
+            { 0xB8, 0xC7, 0x6F, 0xff },
+            { 0x6F, 0x4F, 0x25, 0xff },
+            { 0x43, 0x39, 0x00, 0xff },
+            { 0x9A, 0x67, 0x59, 0xff },
+            { 0x44, 0x44, 0x44, 0xff },
+            { 0x6C, 0x6C, 0x6C, 0xff },
+            { 0x9A, 0xD2, 0x84, 0xff },
+            { 0x6C, 0x5E, 0xB5, 0xff },
+            { 0x95, 0x95, 0x95, 0xff },
+        },
+    },
+    {
+        "colodore",
+        "Colodore",
+        {
+            { 0x00, 0x00, 0x00, 0xff },
+            { 0xff, 0xff, 0xff, 0xff },
+            { 0x96, 0x28, 0x2e, 0xff },
+            { 0x5b, 0xd6, 0xce, 0xff },
+            { 0x9f, 0x2d, 0xad, 0xff },
+            { 0x41, 0xb9, 0x36, 0xff },
+            { 0x27, 0x24, 0xc4, 0xff },
+            { 0xef, 0xf3, 0x47, 0xff },
+            { 0x9f, 0x48, 0x15, 0xff },
+            { 0x5e, 0x35, 0x00, 0xff },
+            { 0xda, 0x5f, 0x66, 0xff },
+            { 0x47, 0x47, 0x47, 0xff },
+            { 0x78, 0x78, 0x78, 0xff },
+            { 0x91, 0xff, 0x84, 0xff },
+            { 0x68, 0x64, 0xff, 0xff },
+            { 0xae, 0xae, 0xae, 0xff },
+        },
+    },
+    {
+        "vice3",
+        "VICE 3.3",
+        {
+            { 0x00, 0x00, 0x00, 0xff },
+            { 0xfd, 0xfe, 0xfc, 0xff },
+            { 0xbe, 0x1a, 0x24, 0xff },
+            { 0x30, 0xe6, 0xc6, 0xff },
+            { 0xb4, 0x1a, 0xe2, 0xff },
+            { 0x1f, 0xd2, 0x1e, 0xff },
+            { 0x21, 0x1b, 0xae, 0xff },
+            { 0xdf, 0xf6, 0x0a, 0xff },
+            { 0xb8, 0x41, 0x04, 0xff },
+            { 0x6a, 0x33, 0x04, 0xff },
+            { 0xfe, 0x4a, 0x57, 0xff },
+            { 0x42, 0x45, 0x40, 0xff },
+            { 0x70, 0x74, 0x6f, 0xff },
+            { 0x59, 0xfe, 0x59, 0xff },
+            { 0x5f, 0x53, 0xfe, 0xff },
+            { 0xa4, 0xa7, 0xa2, 0xff },
+        },
+    },
+};
+
+const int ndmC64DefaultPalettes = sizeof(dmC64DefaultPalettes) / sizeof(dmC64DefaultPalettes[0]);
+
+
 char * dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng)
 {
     static const char *fmtModesShort[] = { "*", "HiR", "MC", "ECM" };
--- a/tools/lib64util.h	Wed Jan 08 13:08:06 2020 +0200
+++ b/tools/lib64util.h	Wed Jan 08 13:08:53 2020 +0200
@@ -22,6 +22,15 @@
 
 
 //
+// Global variables
+//
+
+// Some C64 palettes
+extern DMC64Palette      dmC64DefaultPalettes[];
+extern const int         ndmC64DefaultPalettes;
+
+
+//
 // Functions
 //
 char *    dmC64GetImageTypeString(char *buf, const size_t len, const int type, const BOOL lng);