changeset 113:f87c6577e696

Cleanups and few comments added.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 06 Jul 2018 18:42:31 +0300
parents a0d0994e9bac
children 019909b7ab6e
files multipaint.pde
diffstat 1 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/multipaint.pde	Fri Jul 06 18:40:11 2018 +0300
+++ b/multipaint.pde	Fri Jul 06 18:42:31 2018 +0300
@@ -12,12 +12,12 @@
 final int FAKEX = 32; // Commodore 64 without attribute limitations
 final int UNIA = 33;
 final int PEESEE = 0, MACOSX = 1, PSJS = 2;
+final int COMMAND = 157; // Marq's cmd/ctrl solution
 
 //-1 & -1 for normal operation
 int machine = -1; // change this to autoselect
 int platform = PSJS;
 
-final int COMMAND = 157; // Marq's cmd/ctrl solution
 
 int g_active, g_tooltrigger, g_prevtool;
 int g_rband, g_rbang, g_boxreconstruct, g_charlimit;
@@ -431,7 +431,8 @@
 
 void draw()
 {
-    if (!focused) {
+    if (!focused)
+    {
         g_control = false;
         g_shift = false;
     }
@@ -442,19 +443,23 @@
     g_dirty = false;
 
     // Animate animbrush
-    if (g_data[int('n')] == 1) {
-        if (++g_animtime > 8 - g_animspeed * 2) {
+    if (g_data[int('n')] == 1)
+    {
+        if (++g_animtime > 8 - g_animspeed * 2)
+        {
             animbrush_do();
             g_animtime = 0;
         }
     }
 
-
     // Update some mouse variables
-    if (g_data[int('m')] == 0 && g_data[int('M')] == 0) {
+    if (g_data[int('m')] == 0 && g_data[int('M')] == 0)
+    {
         g_mx = g_msx - g_windowx;
         g_my = g_msy - g_windowy;
-    } else {
+    }
+    else
+    {
         g_mx = mouseX;
         g_my = mouseY;
     }
@@ -463,7 +468,9 @@
     g_msy = mouseY;
 
     // Actual tool drawing
-    if (g_tooltrigger == 1) { // comes from mousepressed, or mousedragged
+    if (g_tooltrigger == 1)
+    {
+        // comes from mousepressed, or mousedragged
         if (g_mx <= width - g_hedge && g_my <= height - g_vedge)
             do_tool(g_mx, g_my, g_button);
     }
@@ -476,7 +483,8 @@
 
     // Tool drawing for shows
     int lipo = g_button;
-    if (tool() != 5) {
+    if (tool() != 5)
+    {
         if (g_phase == 0)
             g_button = LEFT;
         do_tool(g_mx, g_my, LEFT);
@@ -494,10 +502,13 @@
     update_ui();
     updatePixels();
 
+    // Message control
     if (g_msgctr > 0)
         g_msgctr--;
 
-    if (g_keymacro.length() > g_keymacpos) {
+    // Macro handling
+    if (g_keymacro.length() > g_keymacpos)
+    {
         macro_command(g_keymacro.charAt(g_keymacpos));
         g_keymacpos++;
     }