Mercurial > hg > forks > multipaint-js
comparison multipaint.pde @ 186:74e1616ca38e
Micro-optimize draw().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 23 Aug 2018 14:27:28 +0300 |
parents | 1cb7ecd73554 |
children | 6fba2c255319 |
comparison
equal
deleted
inserted
replaced
185:b4e8b8c1c3e3 | 186:74e1616ca38e |
---|---|
596 for (int i = 0; i < 1024; i++) | 596 for (int i = 0; i < 1024; i++) |
597 g_remdo[i] = 0; | 597 g_remdo[i] = 0; |
598 | 598 |
599 // Tool drawing for shows | 599 // Tool drawing for shows |
600 int savebut = g_button; | 600 int savebut = g_button; |
601 if (tool() != 5) | 601 int tt = tool(); |
602 if (tt != 5) | |
602 { | 603 { |
603 if (g_phase == 0) | 604 if (g_phase == 0) |
604 g_button = LEFT; | 605 g_button = LEFT; |
605 do_tool(g_mx, g_my, LEFT); | 606 do_tool(g_mx, g_my, LEFT); |
606 } | 607 } |
607 else | 608 else |
608 storecoords(g_mx, g_my); | 609 storecoords(g_mx, g_my); |
609 | 610 |
610 if (tool() == 6) do_line(g_rx, g_ry, g_rx2, g_ry2, 0); | 611 if (tt == 6) do_line(g_rx, g_ry, g_rx2, g_ry2, 0); |
611 if (tool() == 7) do_circle(g_rx, g_ry, g_rx2, g_ry2); | 612 if (tt == 7) do_circle(g_rx, g_ry, g_rx2, g_ry2); |
612 if (tool() == 8) do_rectangle(g_rx, g_ry, g_rx2, g_ry2); | 613 if (tt == 8) do_rectangle(g_rx, g_ry, g_rx2, g_ry2); |
613 g_button = savebut; | 614 g_button = savebut; |
614 | 615 |
615 // Screen update stuff | 616 // Screen update stuff |
616 loadPixels(); | 617 loadPixels(); |
617 viewport(); | 618 viewport(); |