changeset 44:041cb75875af

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 04 Jul 2018 14:55:46 +0300
parents df6eecdf1cd4
children 9b77ed046003
files draw_outputs.pde draw_smart.pde
diffstat 2 files changed, 25 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/draw_outputs.pde	Wed Jul 04 14:50:11 2018 +0300
+++ b/draw_outputs.pde	Wed Jul 04 14:55:46 2018 +0300
@@ -1097,11 +1097,10 @@
             g_data[int('t')] = 0;
             if (ox >= 0 && ox < X && oy >= 0 & oy < Y) {
                 store_undo(); // exceptional!
-                if (g_multic != 0) {
-                    floodfillmc(ox, oy, mb);
-                } else {
+                if (g_multic)
+                    floodfill_mc(ox, oy, mb);
+                else
                     floodfill_iq(ox, oy, mb);
-                }
             }
             restoreparameters();
         }
--- a/draw_smart.pde	Wed Jul 04 14:50:11 2018 +0300
+++ b/draw_smart.pde	Wed Jul 04 14:55:46 2018 +0300
@@ -4,17 +4,24 @@
 void consistency() {
     int xx, yy, ad, a, b, x0, y0, x2, y2;
     int pat, mat, fad, bad, maxxy, mulu, ymax;
-    if (g_multic == 1 || g_multic == 2) return;
-    maxxy = MY;
-    mat = 64;
-    mulu = 8;
-    ymax = 7;
+
+    if (g_multic == 1 || g_multic == 2)
+        return;
+
     if (g_attrimode == 0) {
         mat = 8;
         mulu = 1;
         maxxy = Y;
         ymax = 0;
     }
+    else
+    {
+        mat = 64;
+        mulu = 8;
+        maxxy = MY;
+        ymax = 7;
+    }
+
     for (yy = 0; yy < MY; yy++) {
         for (xx = 0; xx < MX; xx++) {
             a = getattra(xx * 8, yy * mulu, 0);
@@ -46,7 +53,8 @@
     }
 }
 
-void floodfillmc(int xx, int yy, int mou) {
+
+void floodfill_mc(int xx, int yy, int mou) {
     int x, y, molox, ax, ay, valid, okay, par, npar;
     npar = 0;
     par = 0;
@@ -144,6 +152,7 @@
     }
 }
 
+
 void transchar(int xx, int yy) {
     int fad, bad, ad, pt, x0, y0;
     int aa, bb, pp, ya, yb;
@@ -179,6 +188,7 @@
     }
 }
 
+
 void prepare_char(int xx, int yy, int farbe) {
 
     //changes the char foreg/backg into "favorable" relative to used color
@@ -221,6 +231,7 @@
     }
 }
 
+
 void floodfill_iq(int xx, int yy, int mou) {
     int x, y, ax, ay, valid, okay, par, npar;
     npar = 0;
@@ -295,6 +306,7 @@
     g_farge = g_ofarge;
 }
 
+
 //adaptive color helper for low-attribute modes
 //reasons the background color for each char as you draw
 //=changed
@@ -333,6 +345,7 @@
     updatepoint(x, y);
 }
 
+
 //multicolor color behavior
 //different behavior depending on whether color area already has max colors,
 //or if forcecolor is pressed.
@@ -355,6 +368,7 @@
     updatepoint(x, y);
 }
 
+
 void mkaveri(int x, int y, int foreg, int backg) {
     int mx = int(x / 8);
     int my = int(y / 8);
@@ -567,6 +581,7 @@
     updatepoint(x, y);
 }
 
+
 void kaveri(int x, int y, int foreg, int backg) {
     int k_max;
     int maxy, miny;
@@ -698,6 +713,7 @@
     updatepoint(x, y);
 }
 
+
 void kaveri_iq(int x, int y, int f1, int f2) {
     int k_xx, k_yy, k_ad, k_bad, k_ojox, k_ojoy, k_miny, k_maxy, k_xv, k_yv;
     int k_c1, k_c2, k_v0, k_v1, k_tipping, k_maximum;