changeset 172:e77a726a587e

Rename FLATRATIO/SQUARERATIO and gridmode OLD/NEW constants to something more sane. This also removes conflict from the keycode defs.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 23 Aug 2018 11:09:20 +0300
parents 9afc78ea82b2
children 9bbed9b6df8d
files exporters.pde interface.pde multipaint.pde
diffstat 3 files changed, 19 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/exporters.pde	Wed Aug 22 21:38:20 2018 +0300
+++ b/exporters.pde	Thu Aug 23 11:09:20 2018 +0300
@@ -1350,7 +1350,7 @@
         makecolor(i, (rgb[i] >> 16) & 0xff, (rgb[i] >> 8) & 0xff, rgb[i] & 0xff);
     }
     g_grids[1] = 0xffd0d0d0;
-    g_gridmode = NEW;
+    g_gridmode = GRIDMODE_NEW;
     g_map[13] = byte(C64);
 }
 
@@ -1551,7 +1551,7 @@
         // if(i<=8){g_grids[i]=rgb[i]+0xff282828;}
         makecolor(i, (rgb[i] >> 16) & 0xff, (rgb[i] >> 8) & 0xff, rgb[i] & 0xff);
     }
-    g_gridmode = NEW;
+    g_gridmode = GRIDMODE_NEW;
 }
 
 
@@ -1587,7 +1587,7 @@
     g_grids[7] = 0xff84faEF;
     g_grids[9] = 0xffffa99d;
     g_grids[15] = 0xffd8d8d8;
-    g_gridmode = NEW;
+    g_gridmode = GRIDMODE_NEW;
 }
 
 
@@ -1628,7 +1628,7 @@
 
         makecolor(i, (rgb[i] >> 16) & 0xff, (rgb[i] >> 8) & 0xff, rgb[i] & 0xff);
     }
-    g_gridmode = NEW;
+    g_gridmode = GRIDMODE_NEW;
 }
 
 
@@ -1644,6 +1644,8 @@
     g_formatname = "";
     g_formatext = "";
 
+    g_aspect = AR_SQUARE;
+
     g_map[3] = byte(machine);
     g_map[13] = byte(machine);
     g_palsteps = 0;
@@ -1719,7 +1721,7 @@
         Y = 192;
         g_attrimode = 0;
         g_backmode = 1;
-        g_aspect = FLATRATIO;
+        g_aspect = AR_FLAT;
         g_farge = 15;
         g_backg = 0;
 
@@ -1859,7 +1861,7 @@
         g_name = "QL";
         g_multic = 2;
         g_attrimode = 2;
-        g_aspect = FLATRATIO;
+        g_aspect = AR_FLAT;
         g_map[1] = byte(0);
         make_ql_palette();
     }
@@ -1874,7 +1876,7 @@
         g_name = "BK";
         g_multic = 2;
         g_attrimode = 2;
-        g_aspect = FLATRATIO;
+        g_aspect = AR_FLAT;
         g_map[1] = byte(0);
         make_bk_palette();
     }
--- a/interface.pde	Wed Aug 22 21:38:20 2018 +0300
+++ b/interface.pde	Thu Aug 23 11:09:20 2018 +0300
@@ -162,7 +162,7 @@
     // currently valid outputs are 0,10,20,1,11,21,2,12,22
     // flat variants: 100,110,120,101,111,121,102,112,122
     int base = 0;
-    if (g_aspect == FLATRATIO) base = 100;
+    if (g_aspect == AR_FLAT) base = 100;
     if (g_uizoom == 1) base += 10;
     if (g_uizoom == 3) base += 20;
     if (g_data[int('M')] == 1 && g_data[int('m')] == 1) g_data[int('m')] = 0;
@@ -268,7 +268,7 @@
     //the updatepixels rigmarole has to be handled elsewhere
     int ad = x1 + y1 * width;
 
-    if (g_gridmode == NEW)
+    if (g_gridmode == GRIDMODE_NEW)
     {
         for (int yy = 0; yy < h; yy++)
         {
--- a/multipaint.pde	Wed Aug 22 21:38:20 2018 +0300
+++ b/multipaint.pde	Thu Aug 23 11:09:20 2018 +0300
@@ -47,13 +47,13 @@
     g_exportname = "", g_keymacro = "",
     g_forcedpalette = "";
 
-final int OLD = 0;
-final int NEW = 1;
-final int FLATRATIO = 1;
-final int SQUARERATIO = 0;
-int g_gridmode = OLD;
+final int GRIDMODE_OLD = 0;
+final int GRIDMODE_NEW = 1;
+final int AR_FLAT = 1;
+final int AR_SQUARE = 0;
+int g_gridmode = GRIDMODE_OLD;
 int g_pixelw = 1;
-int g_aspect = SQUARERATIO;
+int g_aspect = AR_SQUARE;
 
 int[] g_grids = new int[16];
 
@@ -231,10 +231,10 @@
 */
 
     if (g_inhibit_aspect)
-        g_aspect = SQUARERATIO;
+        g_aspect = AR_SQUARE;
 
     int paspect = g_wzoom;
-    if (g_aspect == FLATRATIO)
+    if (g_aspect == AR_FLAT)
     {
         if (g_wzoom == 2) paspect = 1;
         if (g_wzoom == 3) paspect = 2;