diff events.pde @ 232:ea6eb6541607

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 06 Sep 2018 12:58:41 +0300
parents 2d2e313882b4
children 7401300452c2
line wrap: on
line diff
--- a/events.pde	Thu Sep 06 01:15:29 2018 +0300
+++ b/events.pde	Thu Sep 06 12:58:41 2018 +0300
@@ -363,6 +363,7 @@
 
 void command(int ckey)
 {
+    int tt = tool();
     g_dirty = true;
 
     //keypresses change g_data[] values directly as 1/0 switches
@@ -565,8 +566,8 @@
     {
         if (g_data[int('m')] == 0 && g_data[int('M')] == 0)
         {
-            if (tool() != 0)
-                g_prevtool = tool();
+            if (tt != 0)
+                g_prevtool = tt;
         }
         else
             ckey = 'm';
@@ -659,7 +660,7 @@
                 g_data[int('m')] = 0;
                 message("Super|Magnify");
 
-                if (tool() == 0)
+                if (tt == 0)
                 {
                     set_tool(g_prevtool);
                     g_phase = 0;
@@ -850,7 +851,7 @@
                 g_ofx = int(g_storedcoordx / 8) - int(magx() / 2);
                 g_ofy = int(g_storedcoordy / 8) - int(magy() / 2);
                 message("Magnify");
-                if (tool() == 0)
+                if (tt == 0)
                 {
                     set_tool(g_prevtool);
                     g_phase = 0;
@@ -914,15 +915,15 @@
             g_map[1024 + xx] = 0;
         }
 
+        g_farge = g_backg;
         for (int xx = 0; xx < X; xx++)
         {
             for (int yy = 0; yy < Y; yy++)
             {
-                g_farge = g_backg;
                 makepoint(xx, yy);
-                g_farge = g_ofarge;
             }
         }
+        g_farge = g_ofarge;
 
         restoreparameters();
     }