diff multipaint.pde @ 179:934934bb1fbb

Rename global variable s/machine/g_machine/g
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 23 Aug 2018 13:11:47 +0300
parents 66c1d15e335a
children 55a3fee48fe1
line wrap: on
line diff
--- a/multipaint.pde	Thu Aug 23 13:08:34 2018 +0300
+++ b/multipaint.pde	Thu Aug 23 13:11:47 2018 +0300
@@ -36,7 +36,7 @@
 final int PEESEE = 0, MACOSX = 1, PSJS = 2;
 final int COMMAND = 157; // Marq's cmd/ctrl solution
 
-int machine = -1; // change this to autoselect
+int g_machine = -1; // change this to autoselect
 int platform = PSJS;
 
 int[] g_grids = new int[16];
@@ -106,8 +106,8 @@
 void setup()
 {
     // Get settings from Javascript runner, or use defaults
-    machine = (mpMachine >= 0) ? mpMachine : C64;
-    g_uizoom = (g_uizoom >= 1 && g_uizoom <= 3) ? g_uizoom : 2;
+    g_machine = (mpMachine >= 0) ? mpMachine : C64;
+    g_uizoom = (mpUIZoom >= 1 && mpUIZoom <= 3) ? mpUIZoom : 2;
     g_animspeed = 1;
 
     //normi
@@ -176,8 +176,6 @@
     g_data[int('m')] = 0;
     g_data[int('M')] = 0; // mags off
 
-    g_icons = mpLoadBinaryFile("icons.bin");
-
     set_tool(3);
 
     g_gridx = 8;
@@ -185,8 +183,10 @@
     g_multic = 0;
     g_repanel = -2;
 
+    mpSetupMachine(g_machine);
     mpSetUIColors();
-    mpSetupMachine(machine);
+
+    g_icons = mpLoadBinaryFile("icons.bin");
 
     if (g_forced_palette.length() > 3)
         mpLoadPalette(g_forced_palette);
@@ -472,7 +472,7 @@
 byte[] mpGetNativeImage()
 {
     //save the picture page g_map[], make sure some essential parameters are correct
-    g_map[3] = byte(machine);
+    g_map[3] = byte(g_machine);
     g_map[5] = byte(MX);
     g_map[7] = byte(MY);
 
@@ -485,7 +485,7 @@
     if (data == null)
         return -1;
 
-    if (data[3] != machine && !noError)
+    if (data[3] != g_machine && !noError)
         return -2;
 
     store_undo();