changeset 167:8d239bd81584

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 20 Aug 2018 15:56:33 +0300
parents c50b9c35fcf0
children 1166505afd5f
files draw_inputs.pde
diffstat 1 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/draw_inputs.pde	Mon Aug 20 14:14:20 2018 +0300
+++ b/draw_inputs.pde	Mon Aug 20 15:56:33 2018 +0300
@@ -24,29 +24,33 @@
 {
     //something that allows different zx brightness colors treated logically as the same
     //i.e. bright red and dark red the same. handy for brush transparency
-    if (g_britemode == 0) return col;
-    return (col > 7) ? col - 8 : col;
+    if (g_britemode == 0)
+        return col;
+    else
+        return (col > 7) ? col - 8 : col;
 }
 
 
 //the "slow" call to mark "dirty block"
 void updatepoint(int xx, int yy)
 {
-    if (yy < 0 || xx < 0 || xx >= X || yy >= Y) return;
+    if (yy < 0 || xx < 0 || xx >= X || yy >= Y)
+        return;
+
     int ad = int(xx / 8) + int(yy / 8) * MX;
     g_redo[ad] = byte(0); //block update
     g_remdo[ad] = byte(1); //block update
 }
 
 
-int getmultibrush(int x1, int y1)
+int getmultibrush(int xc, int yc)
 {
-    //returns the multicolor color on point x1,y1 at brush
+    //returns the multicolor color on point xc,yc at brush
     int ad, looks, mmc;
-    if (g_multic == 2) return g_brush[1024 + x1 + y1 * X];
+    if (g_multic == 2) return g_brush[1024 + xc + yc * X];
 
-    ad = 1024 + x1 + y1 * X;
-    looks = 65536 + int(x1 / 8) + int(y1 / 8) * MX;
+    ad = 1024 + xc + yc * X;
+    looks = 65536 + int(xc / 8) + int(yc / 8) * MX;
     mmc = g_brush[ad] + g_brush[ad + 1] * 2;
     switch (mmc) {
         case 0:
@@ -63,11 +67,11 @@
 }
 
 
-int getmultic(int x1, int y1, int mode) //mode 0=screen 1=brush
+int getmultic(int xc, int yc, int mode) //mode 0=screen 1=brush
 {
-    //returns the multicolor color on point x1,y1
+    //returns the multicolor color on point xc,yc
     int ad, looks, mmc, source1, source2;
-    ad = 1024 + x1 + y1 * X;
+    ad = 1024 + xc + yc * X;
 
     if (g_multic == 2)
     {
@@ -78,8 +82,8 @@
     source1 = 0;
     source2 = 0;
 
-    x1 = chop2(x1);
-    looks = 65536 + int(x1 / 8) + int(y1 / 8) * MX;
+    xc = chop2(xc);
+    looks = 65536 + int(xc / 8) + int(yc / 8) * MX;
 
     if (mode == 0)
     {
@@ -92,6 +96,7 @@
         source1 = g_brush[ad];
         source2 = g_brush[ad + 1];
     }
+
     mmc = source1 + source2 * 2;
 
     //source1=0