annotate buffers.pde @ 193:7a9dc175ece5

Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 23 Aug 2018 18:01:16 +0300
parents 72ae62f2036b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 // undo / spare
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 final int UNDOSTEPS = 20; // max # of undo steps
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 byte[] g_sparepage = new byte[88000];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 byte[] g_swappage = new byte[88000];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 byte[][] g_undob = new byte[UNDOSTEPS + 1][88000];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 byte[][] g_undobs = new byte[UNDOSTEPS + 1][88000];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 int[] g_uindex = new int[8];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 int[] g_ubottom = new int[8];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 int[] g_utop = new int[8];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 void ustats()
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 {
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 //a debug thingie in case the step undo does not work
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 //println("UINDEX:"+g_uindex[g_spare]);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 //println("UTOP:"+g_utop[g_spare]);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 //println("UBOTTOM:"+g_ubottom[g_spare]);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 void store_undo()
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 {
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 if (g_spare)
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
26 g_undobs[g_uindex[g_spare]] = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 else
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
28 g_undob[g_uindex[g_spare]] = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 g_uindex[g_spare]++;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 if (g_uindex[g_spare] > UNDOSTEPS)
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 g_uindex[g_spare] = 0;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
132
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
34 if (g_uindex[g_spare] == g_ubottom[g_spare])
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
35 {
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 g_ubottom[g_spare]++;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 if (g_ubottom[g_spare] > UNDOSTEPS)
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 g_ubottom[g_spare] = 0;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 g_utop[g_spare] = g_uindex[g_spare];
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 refreshpalette();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 ustats();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47 void restore_undo()
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 {
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 if (g_uindex[g_spare] == g_ubottom[g_spare])
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 return;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 if (g_spare)
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
53 g_undobs[g_uindex[g_spare]] = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 else
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
55 g_undob[g_uindex[g_spare]] = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 g_uindex[g_spare]--;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 if (g_uindex[g_spare] < 0)
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 g_uindex[g_spare] = UNDOSTEPS;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 if (g_spare)
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
62 g_map = g_undobs[g_uindex[g_spare]].slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 else
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
64 g_map = g_undob[g_uindex[g_spare]].slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 refreshpalette();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 ustats();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 void redo_undo()
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 {
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 if (g_uindex[g_spare] == g_utop[g_spare])
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 return;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 g_uindex[g_spare]++;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 if (g_uindex[g_spare] > UNDOSTEPS)
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 g_uindex[g_spare] = 0;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 if (g_spare)
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
81 g_map = g_undobs[g_uindex[g_spare]].slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 else
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
83 g_map = g_undob[g_uindex[g_spare]].slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 refreshpalette();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 ustats();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 void spare() //dpaint style spare page
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 {
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
92 g_swappage = g_sparepage.slice(0);
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
93 g_sparepage = g_map.slice(0);
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
94 g_map = g_swappage.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 mpSetTitle(g_spare ? sfilename : filename);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 g_spare = 1 - g_spare;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 g_realfront = byte(g_farge);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 g_realback = byte(g_backg);
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 refreshpalette();
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104
135
72ae62f2036b Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 132
diff changeset
105 void switcher(int mode)
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106 {
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 // this achieves varieties of whole screen copying
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 // needed for brush copy and pre-drawing the shapes when a
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 // tool is active etc.
135
72ae62f2036b Cosmetic cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 132
diff changeset
110 switch (mode)
132
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
111 {
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 case 0:
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
113 g_rmap = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 break;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 case 1:
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
116 g_map = g_rmap.slice(0);
132
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
117 for (int i = 0; i < 1024; i++)
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
118 {
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
119 if (g_remdo[i] == 1)
e32cc01bdb23 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 131
diff changeset
120 {
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 g_remdo[i] = 0;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 g_redo[i] = 0;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 break;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126 case 2:
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
127 g_brush = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 break;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 case 3:
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
130 g_sparepage = g_map.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 break;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 case 4:
193
7a9dc175ece5 Use dst = src.slice(0) instead of Processing arrayCopy(src, dst) for cloning arrays. Should be faster, but if not, this can be reverted later.
Matti Hamalainen <ccr@tnsp.org>
parents: 135
diff changeset
133 g_mapm = g_sparepage.slice(0);
131
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 break;
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 }
9d17f991f102 Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136 }