# HG changeset patch # User Matti Hamalainen # Date 1530891751 -10800 # Node ID f87c6577e69666bc56c9a06065429504fb43ff53 # Parent a0d0994e9bace744438f64bc3780a904d9fe628a Cleanups and few comments added. diff -r a0d0994e9bac -r f87c6577e696 multipaint.pde --- 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++; }