changeset 71:15556815ebe2

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Jul 2018 12:41:35 +0300
parents 8cee0b34defe
children 5e7553e9aee0
files draw_outputs.pde
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/draw_outputs.pde	Thu Jul 05 12:41:12 2018 +0300
+++ b/draw_outputs.pde	Thu Jul 05 12:41:35 2018 +0300
@@ -14,9 +14,11 @@
 
 void createpoint(int x, int y, int mo) {
     if (mo == LEFT) makepoint(x, y);
+    else
     if (mo == RIGHT) clearpoint(x, y);
 }
 
+
 void doborx(int xf, int yf, int xt, int yt) {
     //rectangle for brush drawing
     for (int ii = xf; ii <= xt; ii++)
@@ -24,6 +26,7 @@
         createpoint(ii, jj, g_button);
 }
 
+
 void docircx(int xf, int yf, int hh, int vv) {
     //circle for brush drawing
     float prop, fh = hh, fv = vv;
@@ -43,6 +46,7 @@
     }
 }
 
+
 void craft(int x, int y, int c) {
     //foundational brush control
     //whether hard coded, circular or bitmap brush
@@ -347,15 +351,15 @@
         prop = 1;
     }
     hh++;
-    for (int ii = -hh; ii <= hh; ii++) {
-        for (int jj = -vv; jj <= vv; jj++) {
-            if (dist(xf + ii, yf + jj * prop, xf, yf) <= hh - 1) {
-                createpoint(xf + ii, yf + jj, g_button);
-            }
-        }
+    for (int ii = -hh; ii <= hh; ii++)
+    for (int jj = -vv; jj <= vv; jj++)
+    {
+        if (dist(xf + ii, yf + jj * prop, xf, yf) <= hh - 1)
+            createpoint(xf + ii, yf + jj, g_button);
     }
 }
 
+
 void docircle(int x1, int y1, int x2, int y2) {
     float dds, a, t, sx, sy, gear1, gear2, x0, y0;
     int prex, prey;
@@ -393,6 +397,7 @@
     }
 }
 
+
 void rectangle(int x1, int y1, int x2, int y2) {
     int x0, y0, molox;
     int yt, xt;
@@ -472,6 +477,7 @@
     g_farge = g_ofarge;
 }
 
+
 void makepoint(int xx, int yy) {
     //central pixelmaking function
     //has become very messy but what are you gonna do