changeset 70:8cee0b34defe

Attempt to optimize makepoint() slightly.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Jul 2018 12:41:12 +0300
parents 3d40683b367a
children 15556815ebe2
files draw_outputs.pde
diffstat 1 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/draw_outputs.pde	Thu Jul 05 12:16:33 2018 +0300
+++ b/draw_outputs.pde	Thu Jul 05 12:41:12 2018 +0300
@@ -971,10 +971,12 @@
             x = int(qqx / 2);
             y = int(qqy / 2);
         }
+        else
         if (g_uizoom == 2) {
             x = int(qqx / 3);
             y = int(qqy / 3);
         }
+        else
         if (g_uizoom == 3) {
             x = int(qqx / 4);
             y = int(qqy / 4);
@@ -1058,9 +1060,10 @@
     if (g_phase > 0)
         help(1000, x, y);
 
-    if (tt == 1) craft(x, y, 0); //pixeller
-
-
+    if (tt == 1) {
+        craft(x, y, 0); //pixeller
+    }
+    else
     if (tt == 2) { //spraycan
         //if(random(100)<50){fixed_raster_command(int('x'));}
         //if(random(100)<50){fixed_raster_command(int('y'));}
@@ -1074,8 +1077,7 @@
             }
         }
     }
-
-
+    else
     if (tt == 3) { //cont line
         if (g_phase == 0) {
             g_prex = x;
@@ -1086,7 +1088,7 @@
         g_prex = x;
         g_prey = y;
     }
-
+    else
     if (tt == 5) { //floodfill
         if (g_klikkeri == 0) {
             g_klikkeri = 1;
@@ -1105,7 +1107,7 @@
             restoreparameters();
         }
     }
-
+    else
     if (tt == 6 || tt == 7 || tt == 8) { //line,circle,rect
         if (g_phase == 0) {
             g_rx = x;
@@ -1119,7 +1121,7 @@
             g_ry2 = y;
         }
     }
-
+    else
     if (tt == 0) { // magnifier graphic tool
         g_data[int('m')] = 1;
         g_orx = x;
@@ -1129,7 +1131,6 @@
         g_rx2 = x + (int(magx() / 2) + odd(magx())) * 8;
         g_ry2 = y + (int(magy() / 2) + odd(magy())) * 8;
         g_data[int('m')] = 0;
-        g_rubbermode = 1;
         if (g_phase == 1) {
             g_rubbermode = 0;
             g_data[int('m')] = 1;
@@ -1141,8 +1142,10 @@
             refresh();
             g_repanel = -2;
         }
+        else
+            g_rubbermode = 1;
     }
-
+    else
     if (tt == 4) { //brush grabber grab brush
         if (g_phase == 0) {
             g_rx = x;
@@ -1152,7 +1155,7 @@
             g_rx2 = x;
             g_ry2 = y;
         }
-
+        else
         if (g_phase == 1) {
             g_rx2 = x;
             g_rx = g_orx;