changeset 162:ca07bdf66a70

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 20 Aug 2018 13:16:28 +0300
parents 4b1690fbddf0
children 23646d796c93
files multipaint.pde
diffstat 1 files changed, 23 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/multipaint.pde	Mon Aug 20 13:12:50 2018 +0300
+++ b/multipaint.pde	Mon Aug 20 13:16:28 2018 +0300
@@ -213,19 +213,8 @@
     g_multic = 0;
     g_repanel = -2;
 
-    // UI colors
-    makecolor(256, 0xff, 0, 0xff);
-    makecolor(257, 180, 180, 180);
-//    g_rgb[257] = 0xff808080;
-    makecolor(258, 0, 0, 0);
-    makecolor(259, 48, 48, 48);
 
-    // R,G and B for the palette sliders
-    makecolor(260, 255, 0, 0);
-    makecolor(261, 0, 255, 0);
-    makecolor(262, 0, 0, 255);
-    makecolor(263, 48, 48, 48); //backest UI background
-
+    mpSetUIColors();
     mpSetupMachine(machine);
 
     if (g_forcedpalette.length() > 3)
@@ -304,6 +293,23 @@
 }
 
 
+void mpSetUIColors()
+{
+    // UI colors
+    makecolor(256, 0xff, 0, 0xff);
+    makecolor(257, 180, 180, 180);
+//    g_rgb[257] = 0xff808080;
+    makecolor(258, 0, 0, 0);
+    makecolor(259, 48, 48, 48);
+
+    // R,G and B for the palette sliders
+    makecolor(260, 255, 0, 0);
+    makecolor(261, 0, 255, 0);
+    makecolor(262, 0, 0, 255);
+    makecolor(263, 48, 48, 48); //backest UI background
+
+}
+
 void mpSetTitle(String str)
 {
     console.log("TITLE: '" + str + "'");
@@ -538,7 +544,9 @@
 boolean mpLoadPalette(String fname)
 {
     if (g_map[13] != C64)
+    {
         return false;
+    }
 
     byte fdata[] = mpLoadbinaryFile(fname);
     if (fdata == null ||
@@ -546,7 +554,9 @@
         fdata[0x301] != byte(0x10) ||
         fdata[0x302] != byte(0xff) ||
         fdata[0x303] != byte(0xff))
+    {
         return false;
+    }
 
     for (int n = 0; n < 16; n++)
     {
@@ -556,14 +566,7 @@
             int(fdata[n * 3 + 2]));
     }
 
-    makecolor(256, 0xff, 0, 0xff);
-    makecolor(257, 180, 180, 180);
-//    g_rgb[257] = 0xff808080;
-    makecolor(258, 0, 0, 0);
-    makecolor(259, 48, 48, 48);
-    makecolor(260, 255, 0, 0);
-    makecolor(261, 0, 255, 0);
-    makecolor(262, 0, 0, 255);
+    mpSetUIColors();
 
     sussborder();
     refresh_all();