Mercurial > hg > forks > multipaint-js
annotate interface.pde @ 225:1c9deae71fb1
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 05 Sep 2018 20:28:23 +0300 |
parents | 2e077cfc4f38 |
children | 7401300452c2 |
rev | line source |
---|---|
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1 // This collects UI stuff, viewport |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
2 // i.e. Icons, color selectors and the like |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
3 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
4 //fixed raster parameters |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
5 int g_raster_offset_x; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
6 int g_raster_offset_y; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
7 int g_raster_no; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
8 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
9 byte[] g_depressed = new byte[256]; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
10 |
42 | 11 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
12 int g_fixedraster[] = { |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
13 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
14 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
15 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
16 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
17 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
18 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
19 1,0,0,0,1,0,0,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
20 0,0,1,0,0,0,1,0 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
21 }; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
22 |
42 | 23 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
24 int g_rasterpatterns[] = { |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
25 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
26 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
27 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
28 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
29 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
30 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
31 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
32 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
33 1,1,1,1,1,1,1,1, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
34 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
35 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
36 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
37 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
38 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
39 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
40 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
41 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
42 1,1,0,1,1,1,0,1, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
43 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
44 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
45 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
46 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
47 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
48 0,1,1,1,0,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
49 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
50 1,1,0,1,1,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
51 1,0,1,0,1,0,1,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
52 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
53 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
54 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
55 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
56 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
57 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
58 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
59 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
60 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
61 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
62 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
63 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
64 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
65 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
66 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
67 0,1,0,1,0,1,0,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
68 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
69 0,1,0,1,0,1,0,1, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
70 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
71 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
72 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
73 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
74 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
75 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
76 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
77 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
78 0,0,1,0,0,0,1,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
79 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
80 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
81 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
82 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
83 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
84 1,0,0,0,1,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
85 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
86 0,0,1,0,0,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
87 0,0,0,0,0,0,0,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
88 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
89 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
90 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
91 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
92 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
93 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
94 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
95 1,1,1,1,1,1,1,1, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
96 0,0,0,0,0,0,0,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
97 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
98 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
99 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
100 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
101 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
102 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
103 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
104 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
105 0,0,0,0,0,0,0,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
106 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
107 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
108 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
109 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
110 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
111 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
112 1,0,1,0,1,0,1,0, |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
113 1,0,1,0,1,0,1,0, |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
114 1,0,1,0,1,0,1,0 |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
115 }; |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
116 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
117 |
137 | 118 void setup_raster() |
119 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
120 g_raster_offset_x = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
121 g_raster_offset_y = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
122 g_raster_no = 3; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
123 set_fixed_raster(g_raster_no); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
124 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
125 |
42 | 126 |
137 | 127 void fixed_raster_command(int par) |
128 { | |
225 | 129 if (par == 'p') |
130 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
131 g_raster_no--; |
42 | 132 if (g_raster_no < 0) |
133 g_raster_no = 9; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
134 set_fixed_raster(g_raster_no); |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
135 g_data[int('r')] = 1; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
136 } |
137 | 137 else |
225 | 138 if (par == 'n') |
139 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
140 g_raster_no++; |
42 | 141 if (g_raster_no > 9) |
142 g_raster_no = 0; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
143 set_fixed_raster(g_raster_no); |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
144 g_data[int('r')] = 1; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
145 } |
137 | 146 else |
225 | 147 if (par == 'x') |
148 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
149 g_raster_offset_x++; |
42 | 150 if (g_raster_offset_x > 3) |
151 g_raster_offset_x = 0; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
152 } |
137 | 153 else |
225 | 154 if (par == 'y') |
155 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
156 g_raster_offset_y++; |
42 | 157 if (g_raster_offset_y > 3) |
158 g_raster_offset_y = 0; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
159 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
160 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
161 |
42 | 162 |
137 | 163 int magmode() |
164 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
165 // return the mode "number" based on g_uiscale and 'm' and 'M' |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
166 // currently valid outputs are 0,10,20,1,11,21,2,12,22 |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
167 // flat variants: 100,110,120,101,111,121,102,112,122 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
168 int base = 0; |
172
e77a726a587e
Rename FLATRATIO/SQUARERATIO and gridmode OLD/NEW constants to something more sane.
Matti Hamalainen <ccr@tnsp.org>
parents:
171
diff
changeset
|
169 if (g_aspect == AR_FLAT) base = 100; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
170 if (g_uiscale == 1) base += 10; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
171 if (g_uiscale == 3) base += 20; |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
172 if (g_data[int('M')] == 1 && g_data[int('m')] == 1) g_data[int('m')] = 0; |
144 | 173 if (g_data[int('m')] == 1) base += 1; |
174 if (g_data[int('M')] == 1) base += 2; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
175 return base; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
176 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
177 |
42 | 178 |
144 | 179 int magx() |
180 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
181 //return the amount of horizontal 8x8 characters in current mode ('m' or 'M') |
144 | 182 int mag = g_magpix[magmode()] * 8; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
183 return int((width - (33 * g_uiscale)) / mag); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
184 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
185 |
42 | 186 |
137 | 187 int magy() |
188 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
189 //return the amount of vertical 8x8 characters in current mode ('m' or 'M') |
144 | 190 int mag = g_magpiy[magmode()] * 8; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
191 return int((height - (33 * g_uiscale)) / mag); //how many chars in a magmode |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
192 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
193 |
42 | 194 |
131
9d17f991f102
Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
195 void sussborder() |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
196 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
197 makecolor(259, g_r[g_map[0]], g_g[g_map[0]], g_b[g_map[0]]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
198 g_boxreconstruct = 2; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
199 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
200 |
42 | 201 |
131
9d17f991f102
Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
202 void makecolor(int c, int rr, int gg, int bb) |
9d17f991f102
Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
203 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
204 //0-255 go to g_map[] up until 1021-1023 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
205 //the rest is not stored |
225 | 206 if (c < 256) |
207 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
208 g_map[256 + c * 3] = byte(rr); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
209 g_map[256 + c * 3 + 1] = byte(gg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
210 g_map[256 + c * 3 + 2] = byte(bb); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
211 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
212 g_r[c] = rr; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
213 g_g[c] = gg; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
214 g_b[c] = bb; |
8 | 215 |
216 g_rgb[c] = 0xff000000 | ((rr & 0xff) << 16) | ((gg & 0xff) << 8) | (bb & 0xff); | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
217 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
218 |
42 | 219 |
131
9d17f991f102
Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
220 int fylli() |
9d17f991f102
Move undo and spare page management into buffers.pde as in Multipaint 2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
109
diff
changeset
|
221 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
222 //for the animated rubberband thingy |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
223 g_rband++; |
225 | 224 if (g_rband > g_rbang) |
225 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
226 g_rband = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
227 g_rbang++; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
228 if (g_rbang > 12) g_rbang = 8; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
229 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
230 if (g_rband >= 3) return 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
231 return 1; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
232 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
233 |
42 | 234 |
152 | 235 void e_rect(int x1, int y1, int w, int h, int rgb) |
236 { | |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
237 if (y1 < 0 || x1 < 0 || y1 + h >= height || x1 + w >= width) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
238 return; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
239 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
240 int ad = x1 + y1 * width; |
152 | 241 for (int yy = 0; yy < h; yy++) |
242 { | |
243 for (int xx = 0; xx < w; xx++) | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
244 pixels[ad + xx] = rgb; |
152 | 245 |
8 | 246 ad += width; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
247 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
248 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
249 |
42 | 250 |
137 | 251 void d_rect(int x1, int y1, int w, int h, int rgb) |
252 { | |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
253 // if (y1 < 0 || x1 < 0 || y1 + h >= height || x1 + w >= width) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
254 if (y1 + h >= height || x1 + w >= width) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
255 return; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
256 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
257 int ad = x1 + y1 * width; |
152 | 258 for (int yy = 0; yy < h; yy++) |
259 { | |
260 for (int xx = 0; xx < w; xx++) | |
261 { | |
11 | 262 if (xx == 0 || yy == 0 || xx == w - 1 || yy == h - 1) |
263 pixels[ad + xx] = rgb; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
264 } |
8 | 265 ad += width; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
266 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
267 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
268 |
42 | 269 |
137 | 270 void t_rect(int x1, int y1, int w, int h, int rgb) |
271 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
272 // transparent rectangle |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
273 // fixed tp, for grid drawing |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
274 //the updatepixels rigmarole has to be handled elsewhere |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
275 int ad = x1 + y1 * width; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
276 |
172
e77a726a587e
Rename FLATRATIO/SQUARERATIO and gridmode OLD/NEW constants to something more sane.
Matti Hamalainen <ccr@tnsp.org>
parents:
171
diff
changeset
|
277 if (g_gridmode == GRIDMODE_NEW) |
137 | 278 { |
279 for (int yy = 0; yy < h; yy++) | |
280 { | |
154 | 281 for (int xx = 0; xx < w; xx++) |
282 { | |
283 int s = pixels[ad + xx], | |
284 fout = 0; | |
43
df6eecdf1cd4
Clean up g_spare related things.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
285 |
154 | 286 for (int qn = 0; qn < 16; qn++) |
287 { | |
288 if (g_rgb[qn] == s) | |
289 { | |
290 fout = g_grids[qn]; | |
291 break; | |
292 } | |
293 } | |
43
df6eecdf1cd4
Clean up g_spare related things.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
294 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
295 pixels[ad + xx] = fout; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
296 } |
154 | 297 ad += width; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
298 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
299 } |
137 | 300 else |
301 { | |
302 for (int yy = 0; yy < h; yy++) | |
303 { | |
304 for (int xx = 0; xx < w; xx++) | |
305 { | |
154 | 306 int s = pixels[ad + xx], |
307 r = (s >> 16) & 0xff, | |
308 g = (s >> 8) & 0xff, | |
309 b = (s) & 0xff; | |
8 | 310 |
154 | 311 g += 64; |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
312 |
137 | 313 r = int((r * 2) / 3); |
314 g = int((g * 2) / 3); | |
315 b = int((b * 2) / 3); | |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
316 |
137 | 317 pixels[ad + xx] = 0xff000000 + r * 0x10000 + g * 0x100 + b; |
318 } | |
154 | 319 ad += width; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
320 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
321 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
322 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
323 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
324 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
325 // parameter store/restore in case some functions need to bypass grid, attribute modes etc |
137 | 326 void storeparameters() |
327 { | |
225 | 328 for (int i = 0; i <= 255; i++) |
329 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
330 g_data[767 + i] = g_data[i]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
331 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
332 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
333 |
42 | 334 |
137 | 335 void restoreparameters() |
336 { | |
225 | 337 for (int i = 0; i <= 255; i++) |
338 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
339 g_data[i] = g_data[767 + i]; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
340 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
341 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
342 |
42 | 343 |
137 | 344 void drawtext(int xo, int yo, String ss) |
345 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
346 //draw a bunch of text maybe not needed |
141 | 347 for (int i = 0; i < ss.length(); i++) |
348 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
349 drawchar(xo + i * 8 * 2, yo, ss.charAt(i)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
350 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
351 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
352 |
42 | 353 |
137 | 354 void drawicon(int xo, int yo, int t, int mm) |
355 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
356 //draw one icon |
154 | 357 int cad, xx, yy, pop, far; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
358 int metal; |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
359 |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
360 yy = int(t / 16); |
137 | 361 xx = t - (yy * 16); |
8 | 362 |
363 xx *= 2; | |
364 yy *= 2; | |
365 | |
154 | 366 int ad = 1024 + xx * 8 + yy * 2048; |
8 | 367 |
137 | 368 for (int y = 0; y < 16; y++) |
369 { | |
370 for (int x = 0; x < 16; x++) | |
371 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
372 metal = 0xffa0a0a0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
373 far = 0xff000000; |
154 | 374 |
375 if (t == 18 || (t == 19 && g_backmode == 1)) | |
376 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
377 if (x < 15 && y < 15) far = int(g_rgb[g_farge]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
378 } |
154 | 379 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
380 if (g_depressed[t] > 0) metal = 0xff606060; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
381 |
154 | 382 if (x == 0 || y == 0) |
383 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
384 metal = 0xffe0e0e0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
385 if (g_depressed[t] > 0) metal = 0xff303030; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
386 if (t == 56 || t == 9) metal = 0xffa0a0a0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
387 } |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
388 |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
389 cad = 65536 + (xx + int(x / 8)) + yy * 256 + y * 32; |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
390 pop = (int(g_icons[cad]) == 0) ? 0 : 1; |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
391 |
154 | 392 if (int(g_icons[ad + x]) == pop) |
393 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
394 far = metal; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
395 if (mm == 1) far = 0xffffff80; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
396 } |
11 | 397 |
225 | 398 if (t == 66) |
399 { //raster icon | |
400 if (x >= 1 && y >= 2 && x <= 13 && y <= 12) | |
401 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
402 far = metal; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
403 if (mm == 1) far = 0xffffff80; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
404 if (get_raster(x + 1, y) == 1) far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
405 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
406 } |
11 | 407 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
408 e_rect(xo + x * g_uiscale, yo + y * g_uiscale, g_uiscale, g_uiscale, far); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
409 } |
154 | 410 ad += 256; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
411 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
412 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
413 |
42 | 414 |
137 | 415 void drawchar(int xo, int yo, int t) |
416 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
417 //characters at the help box |
10
80380099f1ad
Check for characters < 32 in drawchar() because 32 is deducted from the value.
Matti Hamalainen <ccr@tnsp.org>
parents:
9
diff
changeset
|
418 if (t < 32) return; |
11 | 419 |
420 t -= 32; | |
137 | 421 int yy = int(t / 32); |
422 int xx = t - (yy * 32); | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
423 yy = yy + 18; |
8 | 424 |
137 | 425 for (int y = 0; y < 8; y++) |
426 { | |
427 int ad = 1024 + xx * 8 + yy * 2048 + y * 256; | |
8 | 428 |
137 | 429 for (int x = 0; x < 8; x++) |
430 { | |
431 int far; | |
225 | 432 if (int(g_icons[ad + x]) != 0) |
433 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
434 far = 0xffb0b0b0; |
225 | 435 if (g_bsize < 4) |
436 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
437 if (g_bsize + (g_btype * 4) + 96 == t) far = 0xffffff80; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
438 } |
225 | 439 } |
440 else | |
441 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
442 far = 0xff000000; |
43
df6eecdf1cd4
Clean up g_spare related things.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
443 if (g_spare && t <= 95) far = 0xff008000; //different background color for spare mode |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
444 if (g_msgctr > 0 && t + 32 < 128) far = 0xff0000ff; //different background color |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
445 } |
11 | 446 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
447 e_rect(xo + x * g_uiscale, yo + y * g_uiscale, g_uiscale, g_uiscale, far); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
448 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
449 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
450 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
451 |
42 | 452 |
137 | 453 boolean moicon(int xx, int yy, int ww, int hh) |
454 { | |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
455 if (g_pgrab) |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
456 return false; |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
457 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
458 //check mouse/icon boundary without actually drawing the icon |
137 | 459 if (g_data[int('m')] == 0 && g_data[int('M')] == 0) |
460 { | |
39 | 461 if (g_mx + g_windowx >= xx && g_mx + g_windowx < xx + ww && |
462 g_my + g_windowy >= yy && g_my + g_windowy < yy + hh) | |
463 return true; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
464 } |
39 | 465 else |
466 { | |
467 if (g_mx >= xx && g_mx <= xx + ww && | |
468 g_my >= yy && g_my <= yy + hh) | |
469 return true; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
470 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
471 return false; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
472 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
473 |
42 | 474 |
137 | 475 boolean doicon_drag(int xx, int yy, int ww, int hh) |
476 { | |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
477 if (g_pgrab) |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
478 return false; |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
479 |
137 | 480 if (g_iconx >= xx && g_iconx < xx + ww && g_icony >= yy && g_icony < yy + hh) |
481 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
482 g_iconx = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
483 g_icony = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
484 g_repanel = -2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
485 return true; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
486 } |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
487 else |
137 | 488 if (g_piconx >= xx && g_piconx < xx + ww && g_picony >= yy && g_picony < yy + hh) |
489 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
490 g_piconx = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
491 g_picony = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
492 g_repanel = -2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
493 return true; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
494 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
495 return false; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
496 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
497 |
42 | 498 |
137 | 499 boolean doicon(int xx, int yy, int ww, int hh) |
500 { | |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
501 if (g_pgrab) |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
502 return false; |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
503 |
137 | 504 if (g_iconx >= xx && g_iconx < xx + ww && g_icony >= yy && g_icony < yy + hh) |
505 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
506 g_iconx = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
507 g_icony = -1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
508 g_repanel = -2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
509 return true; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
510 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
511 return false; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
512 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
513 |
42 | 514 |
141 | 515 void printat(int xc, int yc, String mstr) |
135 | 516 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
517 //creating text into the help box |
141 | 518 for (int index = 0; index < mstr.length(); index++) |
135 | 519 { |
141 | 520 if (mstr.charCodeAt(index) != '|') |
137 | 521 { |
141 | 522 if (g_data[256 + xc + yc * 12] != byte(mstr.charCodeAt(index))) |
523 { | |
524 g_data[256 + xc + yc * 12] = byte(mstr.charCodeAt(index)); | |
525 g_chaup[xc + yc * 16] = 1; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
526 } |
141 | 527 xc++; |
137 | 528 } |
529 else | |
530 { | |
141 | 531 xc = 0; |
532 yc++; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
533 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
534 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
535 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
536 |
42 | 537 |
135 | 538 void clearmsg() |
539 { | |
540 for (int y = 0; y < 4; y++) | |
541 for (int x = 0; x < 12; x++) | |
542 { | |
543 g_data[256 + x + y * 12] = byte(32); | |
544 g_chaup[x + y * 16] = 1; | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
545 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
546 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
547 |
42 | 548 |
141 | 549 void message(String mstr) |
550 { | |
551 if (mstr.equals("*")) | |
552 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
553 g_msgctr = 100; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
554 return; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
555 } |
142 | 556 |
141 | 557 console.log("MSG: " + mstr); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
558 clearmsg(); |
141 | 559 printat(0, 0, mstr); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
560 g_msgctr = 50; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
561 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
562 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
563 |
135 | 564 void help(int mode, int xc, int yc) |
565 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
566 String teks; |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
567 |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
568 if (g_msgctr > 0 || g_pgrab) |
135 | 569 return; |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
570 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
571 clearmsg(); |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
572 |
99 | 573 if (mode >= 1000) |
574 { | |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
575 xc = int(xc); |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
576 yc = int(yc); |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
577 |
99 | 578 if (g_phase == 1) |
579 switch (tool()) | |
580 { | |
581 case 4: | |
582 case 6: | |
583 xc = abs(g_rx2 - g_rx) + 1; | |
584 yc = abs(g_ry2 - g_ry) + 1; | |
585 break; | |
586 | |
587 case 7: | |
588 xc = abs(g_rx2 - g_rx) * 2 + 1; | |
589 yc = abs(g_ry2 - g_ry) * 2 + 1; | |
590 break; | |
591 | |
592 case 8: | |
593 if (g_data[int('c')] == 1 || g_shift) { | |
594 xc = abs(g_rx2 - g_rx); | |
595 yc = abs(g_ry2 - g_ry); | |
596 } //purkkaa | |
597 else { | |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
598 xc = abs(g_rx2 - g_rx) + 1; |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
599 yc = abs(g_ry2 - g_ry) + 1; |
99 | 600 } |
601 break; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
602 } |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
603 |
11 | 604 // coordinates |
99 | 605 if (xc < X && yc < Y) |
606 { | |
13
80727dab1359
Oops, fix the coordinate printing.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
607 printat(0, 0, "Px:"+ str(xc)); |
80727dab1359
Oops, fix the coordinate printing.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
608 printat(6, 0, ", "+ str(yc)); |
80727dab1359
Oops, fix the coordinate printing.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
609 printat(0, 1, "Ch:"+ str(int(xc / 8))); |
80727dab1359
Oops, fix the coordinate printing.
Matti Hamalainen <ccr@tnsp.org>
parents:
11
diff
changeset
|
610 printat(6, 1, ", "+ str(int(yc / 8))); |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
611 |
99 | 612 if (tool() == 6 && g_phase == 1) |
613 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
614 float av = getangel(g_rx2 - g_rx, g_ry2 - g_ry); |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
615 |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
616 printat(0, 2, nf(dist(0, 0, xc - 1, yc - 1), 0, 2)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
617 printat(0, 3, nf((av), 0, 2)); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
618 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
619 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
620 return; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
621 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
622 |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
623 printat(7, 3, "Key:" + str(char(mode))); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
624 |
141 | 625 switch (char(mode)) |
626 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
627 case '.': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
628 teks = "Preset pens|.=reset"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
629 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
630 case TAB: |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
631 teks = "Pick color"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
632 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
633 case '<': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
634 teks = "Swap colors|Right<>Left"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
635 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
636 case '>': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
637 teks = "Pick backgnd|shift=set"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
638 if (g_backmode == 0) teks = "Pick backgnd|not here"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
639 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
640 case '1': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
641 teks = "Draw"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
642 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
643 case '2': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
644 teks = "Spray can"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
645 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
646 case '3': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
647 teks = "Continuous|Draw"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
648 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
649 case '4': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
650 teks = "Grab brush"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
651 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
652 case '5': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
653 teks = "Flood fill"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
654 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
655 case '8': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
656 teks = "Rectangle"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
657 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
658 case '7': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
659 teks = "Ellipse"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
660 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
661 case '6': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
662 teks = "Line"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
663 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
664 case '9': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
665 teks = "Brush tool"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
666 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
667 case '0': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
668 teks = "Magnifier|m=direct"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
669 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
670 case 'b': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
671 teks = "A.I.|Behavior|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
672 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
673 case 'B': |
218 | 674 teks = "Set border|[Export="+ (g_data[int('Q')] ? "Y" : "N") +"]"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
675 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
676 case 'C': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
677 teks = "Set backgnd"; |
179
934934bb1fbb
Rename global variable s/machine/g_machine/g
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
678 if (g_machine == PLUS4M || g_machine == PLUS4) teks = "Set backgnd|V/RMB=back2"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
679 if (int(g_map[1]) == 255) teks = "Set backnd|-Not here"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
680 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
681 case 'i': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
682 teks = "Increase|luminance"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
683 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
684 case 'k': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
685 teks = "Decrease|luminance"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
686 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
687 case 'r': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
688 teks = "Fill raster|on/off|RMB=swap"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
689 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
690 case 'R': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
691 teks = "Raster from|brush|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
692 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
693 case 'd': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
694 teks = "Recolor|right->left|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
695 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
696 case 'p': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
697 teks = "Brush|recolor|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
698 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
699 case 'q': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
700 teks = "IQ mode|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
701 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
702 case 't': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
703 teks = "Tile mode|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
704 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
705 case 'x': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
706 teks = "Brush|flip X|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
707 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
708 case 'y': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
709 teks = "Brush|flip Y|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
710 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
711 case 'z': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
712 teks = "Brush|rotate"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
713 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
714 case 'h': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
715 teks = "Pen size " + (g_bsize + 1) + "|LMB/h=less|RMB/H=bigger"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
716 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
717 case 'j': |
43
df6eecdf1cd4
Clean up g_spare related things.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
718 teks = "Switch to|"+ (!g_spare ? "spare" : "front") +" page|RMB=CopyTo"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
719 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
720 case 'f': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
721 teks = "Geometry|fill|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
722 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
723 case 'c': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
724 teks = "Constrain|to grid|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
725 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
726 case 'm': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
727 teks = "Magnify|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
728 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
729 case 'g': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
730 teks = "Draw grid|on/off|G=size " + str(g_gridx); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
731 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
732 case 'X': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
733 teks = "Mirror X|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
734 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
735 case 'Y': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
736 teks = "Mirror Y|on/off"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
737 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
738 case 'l': |
203
b7c7b13b46c2
Improve save/load help texts.
Matti Hamalainen <ccr@tnsp.org>
parents:
183
diff
changeset
|
739 teks = "Load Multipaint [RMB=From Lstorage]"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
740 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
741 case 's': |
203
b7c7b13b46c2
Improve save/load help texts.
Matti Hamalainen <ccr@tnsp.org>
parents:
183
diff
changeset
|
742 teks = "Save as Multipaint [RMB=To Lstorage]"; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
743 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
744 case 'u': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
745 teks = "Undo u LMB|Redo U RMB"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
746 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
747 case 'U': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
748 teks = "Redo"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
749 break; |
218 | 750 case 'a': |
751 teks = "Bitmap only|on/off"; | |
752 break; | |
753 case 'A': | |
754 teks = "Export as|" + g_exportext; | |
755 break; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
756 case 'e': |
218 | 757 teks = "Export PNG|"+ (g_data[int('Q')] ? "w/border" : "w/o border"); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
758 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
759 case 'E': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
760 teks = "Export as|source"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
761 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
762 case 'o': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
763 teks = "Clear|screen"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
764 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
765 case 'O': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
766 teks = "Export|specific"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
767 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
768 case 'n': |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
769 teks = "Playbrush|on/off|RMB=speed"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
770 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
771 case 'w': |
218 | 772 if (g_formatname != "") |
773 teks = "Import as|" + g_formatname; | |
774 else | |
775 teks = "Format|Import:|no support"; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
776 break; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
777 case 'W': |
218 | 778 if (g_formatname != "") |
779 teks = "Export as|" + g_formatname; | |
780 else | |
781 teks = "Format|Export:|no support"; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
782 break; |
9
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
783 |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
784 default: |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
785 teks = "No Help"; |
dfdc18b62fab
Change the help() function and its usage to have more than one parameter to
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
786 break; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
787 } |
11 | 788 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
789 printat(0, 0, teks); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
790 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
791 |
11 | 792 |
135 | 793 void icontable(int xx, int yy, int tabletype, int realdraw) |
794 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
795 String pan = ""; |
154 | 796 int x = 0, y = 0; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
797 |
141 | 798 g_data[int('9')] = (g_btype == 9) ? 1 : 0; |
11 | 799 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
800 // the main and sideboard icon panel order |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
801 if (tabletype == 0) pan = ";;h9::123456::78::pzxy::XYtn::lsEAwW::jc0g::uo::"; //.b |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
802 if (tabletype == 1) pan = "BCrRfd"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
803 if (tabletype == 2) pan = "ik"; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
804 |
141 | 805 for (int tit = 0; tit < pan.length(); tit++) |
806 { | |
807 int ad = pan.charCodeAt(tit); | |
79 | 808 if (g_repanel <= 0 && realdraw == 1) |
809 { | |
141 | 810 if (ad != ';' && ad != ':' && ad != '.') |
811 { | |
79 | 812 int icolor; |
813 if (ad == 'j' && g_spare) | |
814 icolor = 1; | |
815 else | |
816 icolor = int(g_data[ad]); | |
43
df6eecdf1cd4
Clean up g_spare related things.
Matti Hamalainen <ccr@tnsp.org>
parents:
42
diff
changeset
|
817 |
79 | 818 drawicon(xx + x, yy + y, ad - 48, icolor); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
819 } |
79 | 820 else |
821 if (ad == ';') | |
822 { | |
823 //draw the preset brush box | |
824 drawchar(xx, yy, 128); | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
825 drawchar(xx + 8 * g_uiscale, yy, 129); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
826 drawchar(xx + 16 * g_uiscale, yy, 130); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
827 drawchar(xx + 24 * g_uiscale, yy, 131); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
828 drawchar(xx, yy + 8 * g_uiscale, 132); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
829 drawchar(xx + 8 * g_uiscale, yy + 8 * g_uiscale, 133); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
830 drawchar(xx + 16 * g_uiscale, yy + 8 * g_uiscale, 134); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
831 drawchar(xx + 24 * g_uiscale, yy + 8 * g_uiscale, 135); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
832 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
833 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
834 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
835 //tooltip |
141 | 836 if (ad != ':' && ad != ';' && ad != '.') |
837 { | |
225 | 838 if (realdraw == 0) |
839 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
840 if (moicon(xx + x, yy + y, 16 * g_uiscale, 16 * g_uiscale)) help(ad); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
841 } |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
842 if (doicon(xx + x, yy + y, 16 * g_uiscale, 16 * g_uiscale)) |
141 | 843 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
844 //println(g_realbutton); |
108
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
845 if (ad == 'C' && g_realbutton == RIGHT) ad = 'V'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
846 if (ad == 'B' && g_realbutton == RIGHT) ad = 'Q'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
847 if (ad == 'u' && g_realbutton == RIGHT) ad = 'U'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
848 if (ad == 'n' && g_realbutton == RIGHT) ad = 'N'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
849 if (ad == 'h' && g_realbutton == RIGHT) ad = 'H'; |
109
b9b60552667e
Make right-clicking work on the Load icon.
Matti Hamalainen <ccr@tnsp.org>
parents:
108
diff
changeset
|
850 if (ad == 'l' && g_realbutton == RIGHT) ad = 'L'; |
108
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
851 if (ad == 's' && g_realbutton == RIGHT) ad = 'S'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
852 if (ad == 'j' && g_realbutton == RIGHT) ad = 'J'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
853 if (ad == 'g' && g_realbutton == RIGHT) ad = 'G'; |
a9d8db1726c1
Use the constant for RIGHT mouse button instead of magic number.
Matti Hamalainen <ccr@tnsp.org>
parents:
99
diff
changeset
|
854 if (ad == 'r' && g_realbutton == RIGHT) ad = g_shift ? '(' : ')'; |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
855 command(int(ad)); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
856 g_msgctr = 50; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
857 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
858 } |
141 | 859 if (ad == ';') |
860 { | |
79 | 861 for (int ii = 0; ii <= 3; ii++) |
862 for (int jj = 0; jj <= 1; jj++) | |
863 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
864 if (doicon(xx + ii * 8 * g_uiscale, yy + jj * 8 * g_uiscale, |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
865 8 * g_uiscale, 8 * g_uiscale)) |
79 | 866 command(128 + ii + jj * 4); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
867 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
868 } |
154 | 869 |
141 | 870 if (tabletype == 0) |
871 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
872 x += 16 * g_uiscale; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
873 if (ad == '.') x = x - 8 * g_uiscale; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
874 if (x > 16 * g_uiscale) |
141 | 875 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
876 x = 0; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
877 y += 16 * g_uiscale; |
154 | 878 if (ad == ':') |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
879 y -= 14 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
880 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
881 } |
154 | 882 else |
141 | 883 if (tabletype == 1 || tabletype == 2) |
884 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
885 y += 16 * g_uiscale; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
886 if (y > 16 * g_uiscale) |
141 | 887 { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
888 y = 0; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
889 x += 16 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
890 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
891 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
892 } |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
893 g_data[int('9')] = 0; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
894 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
895 |
42 | 896 |
135 | 897 int nextluminance(int f, int d) |
898 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
899 int res = f + d; |
135 | 900 |
225 | 901 if (g_machine == PLUS4 || g_machine == PLUS4M) |
902 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
903 if (f + d * 15 > 120) return f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
904 if (f + d * 15 < 1) return f; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
905 if (d == 1) return f + 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
906 if (d == -1) return f - 15; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
907 return res; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
908 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
909 |
225 | 910 if (g_map[13] == C64) |
911 { //here the "C64" is generic across C64,C64M and potential FLI modes | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
912 int out[] = { |
135 | 913 6, 1, 11, 15, 8, 10, |
914 9, 13, 14, 2, 3, 4, | |
915 5, 1, 12, 7 | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
916 }; // from "Ptoing" |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
917 if (d == 1) res = out[f]; |
225 | 918 if (d == -1) |
919 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
920 if (f == 0) return 0; |
225 | 921 for (int i = 0; i < g_maxcolors; i++) |
922 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
923 if (out[i] == f) res = i; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
924 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
925 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
926 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
927 |
225 | 928 if (g_map[13] == MSX) |
929 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
930 int out[] = { |
135 | 931 1, 4, 9, 10, |
932 6, 12, 13, 14, | |
933 5, 3, 7, 15, | |
934 2, 8, 11, 15 | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
935 }; // calculated Y |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
936 if (d == 1) res = out[f]; |
225 | 937 if (d == -1) |
938 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
939 if (f == 0) return 0; |
225 | 940 for (int i = 0; i < g_maxcolors - 1; i++) |
941 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
942 if (out[i] == f) res = i; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
943 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
944 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
945 } |
141 | 946 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
947 return res; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
948 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
949 |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
950 |
135 | 951 int tool() |
952 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
953 //returns the current tool #, for convenience |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
954 //as there is no "tool" variable really |
141 | 955 for (int i = '0'; i <= '9'; i++) |
956 { | |
957 if (g_data[i] == 1) | |
958 return i - '0'; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
959 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
960 return 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
961 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
962 |
11 | 963 |
135 | 964 void set_tool(int s) |
965 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
966 //set current tool, for convenience |
225 | 967 for (int i = '0'; i <= '9'; i++) |
968 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
969 g_data[i] = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
970 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
971 g_data[48 + s] = byte(1); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
972 g_map[12] = byte(s); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
973 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
974 |
11 | 975 |
135 | 976 void selectcolor(int hand, int x) |
977 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
978 if (x >= g_maxcolors) x = x - g_maxcolors; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
979 if (x < 0) x = x + g_maxcolors; |
225 | 980 if (hand == 0) |
981 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
982 g_farge = x; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
983 g_ofarge = x; //kludgey, the colour and the "original colour" |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
984 if (g_btype == 9) g_data[int('p')] = 1; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
985 g_realfront = byte(g_farge); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
986 g_realback = byte(g_backg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
987 } |
225 | 988 if (hand == 1) |
989 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
990 g_backg = x; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
991 g_realback = byte(g_backg); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
992 g_realfront = byte(g_farge); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
993 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
994 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
995 |
42 | 996 |
135 | 997 void refresh() |
998 { | |
80
384b301970ac
Set g_dirty flag in refresh() to ensure screen update after certain
Matti Hamalainen <ccr@tnsp.org>
parents:
79
diff
changeset
|
999 g_dirty = true; |
135 | 1000 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1001 //refreshes all "dirty chars" and icon panels |
142 | 1002 for (int i = 0; i < MX * MY; i++) |
1003 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1004 g_redo[i] = byte(0); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1005 g_remdo[i] = byte(1); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1006 } |
135 | 1007 |
142 | 1008 if (g_boxreconstruct == 0) |
1009 g_boxreconstruct = 1; | |
1010 | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1011 //elsewhere use g_boxreconstruct=2 for complete window reconstruction |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1012 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1013 |
42 | 1014 |
135 | 1015 void refresh_all() |
1016 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1017 refresh(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1018 g_boxreconstruct = 2; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1019 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1020 |
42 | 1021 |
225 | 1022 void palettebox(float x0, int y0, float x1) |
1023 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1024 if (g_palsteps == 0) return; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1025 float expand = ((x1 - x0) / g_palsteps); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1026 int divs = int(255 / (g_palsteps - 1)); |
225 | 1027 for (int i = 0; i < g_palsteps; i++) |
1028 { | |
1029 if (doicon_drag(int(x0 + expand * i), y0, int(expand), 7 * g_uiscale)) | |
1030 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1031 g_r[g_farge] = int(i * divs); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1032 message("RED:" + i); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1033 makecolor(g_farge, g_r[g_farge], g_g[g_farge], g_b[g_farge]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1034 refresh(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1035 g_boxreconstruct = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1036 } |
225 | 1037 if (doicon_drag(int(x0 + expand * i), y0 + 10 * g_uiscale, int(expand), 7 * g_uiscale)) |
1038 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1039 g_g[g_farge] = int(i * divs); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1040 message("GREEN:" + i); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1041 makecolor(g_farge, g_r[g_farge], g_g[g_farge], g_b[g_farge]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1042 refresh(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1043 g_boxreconstruct = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1044 } |
225 | 1045 if (doicon_drag(int(x0 + expand * i), y0 + 20 * g_uiscale, int(expand), 7 * g_uiscale)) |
1046 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1047 g_b[g_farge] = int(i * divs); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1048 message("BLUE:" + i); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1049 makecolor(g_farge, g_r[g_farge], g_g[g_farge], g_b[g_farge]); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1050 refresh(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1051 g_boxreconstruct = 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1052 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1053 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1054 |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1055 for (int j = 0; j < 3; j++) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1056 { |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1057 e_rect(int(x0), y0 + j * 10 * g_uiscale, int(x1 - x0), 7 * g_uiscale, g_rgb[258]); |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1058 |
225 | 1059 for (int i = 1; i < g_palsteps; i++) |
1060 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1061 e_rect(int(x0 + expand * i), y0 + j * 10 * g_uiscale, g_uiscale, 2 * g_uiscale, g_rgb[257]); |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1062 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1063 } |
154 | 1064 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1065 e_rect(int(x0 + expand * g_r[g_farge] / divs), y0, int(expand), 7 * g_uiscale, g_rgb[260]); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1066 e_rect(int(x0 + expand * g_g[g_farge] / divs), y0 + 10 * g_uiscale, int(expand), 7 * g_uiscale, g_rgb[261]); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1067 e_rect(int(x0 + expand * g_b[g_farge] / divs), y0 + 20 * g_uiscale, int(expand), 7 * g_uiscale, g_rgb[262]); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1068 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1069 |
42 | 1070 |
135 | 1071 void colorselector(int xo, int yo) |
1072 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1073 int x, y, ad, yfat; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1074 int far, xonko, yhei, maxp, xloc, yloc; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1075 int bfat; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1076 float expand, divus; |
135 | 1077 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1078 xonko = 16 * g_uiscale; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1079 yhei = 16 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1080 expand = 1; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1081 yfat = 4 * g_uiscale; |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1082 bfat = 1 * g_uiscale; |
135 | 1083 |
225 | 1084 if (g_maxcolors > 60) |
1085 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1086 yhei = 4 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1087 yfat = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1088 bfat = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1089 } |
135 | 1090 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1091 divus = 255 / g_palsteps; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1092 x = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1093 y = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1094 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1095 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1096 maxp = g_maxcolors; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1097 xonko = int(int(512 / g_maxcolors) / 2) * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1098 |
225 | 1099 if (g_maxcolors > 32) |
1100 { | |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1101 maxp = int(g_maxcolors / 2); |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1102 xonko = int(1024 / g_maxcolors); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1103 } |
11 | 1104 |
179
934934bb1fbb
Rename global variable s/machine/g_machine/g
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1105 if (g_machine == PLUS4 || g_machine == PLUS4M) |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1106 xonko = 15 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1107 |
135 | 1108 for (x = 0; x < g_maxcolors; x++) |
1109 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1110 xloc = xo + x * xonko; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1111 yloc = yo + 8 * g_uiscale; |
135 | 1112 if (g_maxcolors > 60) |
1113 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1114 yloc = yo + yhei * 7; |
135 | 1115 |
225 | 1116 if (x > 15 && x <= 30) |
1117 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1118 xloc = xo + (x - 15) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1119 yloc = yo + yhei * 6 + yfat * 2; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1120 } |
225 | 1121 if (x > 30 && x <= 45) |
1122 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1123 xloc = xo + (x - 30) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1124 yloc = yo + yhei * 5 + yfat * 4; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1125 } |
225 | 1126 if (x > 45 && x <= 60) |
1127 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1128 xloc = xo + (x - 45) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1129 yloc = yo + yhei * 4 + yfat * 6; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1130 } |
225 | 1131 if (x > 60 && x <= 75) |
1132 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1133 xloc = xo + (x - 60) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1134 yloc = yo + yhei * 3 + yfat * 8; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1135 } |
225 | 1136 if (x > 75 && x <= 90) |
1137 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1138 xloc = xo + (x - 75) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1139 yloc = yo + yhei * 2 + yfat * 10; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1140 } |
225 | 1141 if (x > 90 && x <= 105) |
1142 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1143 xloc = xo + (x - 90) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1144 yloc = yo + yhei * 1 + yfat * 12; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1145 } |
225 | 1146 if (x > 105 && x <= 120) |
1147 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1148 xloc = xo + (x - 105) * xonko; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1149 yloc = yo + yhei * 0 + yfat * 14; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1150 } |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1151 |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1152 yloc--; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1153 } |
154 | 1154 |
1155 if (doicon_drag(xloc, yloc, xonko, yhei)) | |
1156 { | |
1157 if (mouseButton == LEFT || mouseButton == CENTER) | |
1158 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1159 selectcolor(0, x); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1160 } |
225 | 1161 if (mouseButton == RIGHT) |
1162 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1163 selectcolor(1, x); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1164 g_button = LEFT; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1165 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1166 } |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1167 |
154 | 1168 if (g_repanel <= 0) |
1169 { | |
1170 int index = x; | |
179
934934bb1fbb
Rename global variable s/machine/g_machine/g
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1171 if (g_machine == MSX && x == 0) index = g_map[1]; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1172 e_rect(xloc, yloc, xonko, yhei, g_rgb[index]); // the colour blocks |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1173 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1174 if (g_farge == x) far = 0xff808080; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1175 e_rect(xloc, yloc - yfat, xonko, yfat, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1176 if (doicon(xloc, yloc - yfat, xonko, yfat)) selectcolor(0, x); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1177 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1178 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1179 if (g_backg == x && yfat > 0) far = 0xff808080; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1180 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1181 e_rect(xloc, yloc + yhei, xonko, yfat, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1182 if (doicon(xloc, yloc + yhei, xonko, yfat)) selectcolor(1, x); |
225 | 1183 if (yfat == 0) |
1184 { | |
1185 if (g_farge == x) | |
1186 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1187 e_rect(xloc, yloc, xonko / 4, yhei / 4, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1188 e_rect(xloc, yloc + 1, xonko / 8, yhei / 4, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1189 } |
225 | 1190 if (g_backg == x) |
1191 { | |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1192 e_rect(xloc + xonko - xonko / 4, yloc + yhei - 2, int(xonko / 4), int(yhei / 4), far); |
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1193 e_rect(xloc + xonko - xonko / 8, yloc + yhei - 3, int(xonko / 8), int(yhei / 4), far); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1194 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1195 } |
225 | 1196 if (int(g_map[0]) == x) |
1197 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1198 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1199 if (dist(g_r[x], g_g[x], g_b[x], 0, 0, 0) < 1) far = 0xffffffff; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1200 e_rect(xloc, yloc, xonko, bfat, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1201 e_rect(xloc, yloc + yhei - bfat, xonko, bfat, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1202 e_rect(xloc, yloc, bfat, yhei, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1203 e_rect(xloc + xonko - bfat, yloc, bfat, yhei, far); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1204 } |
225 | 1205 if (int(g_map[1]) == x) |
1206 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1207 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1208 if (dist(g_r[x], g_g[x], g_b[x], 0, 0, 0) < 1) far = 0xffffffff; |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1209 e_rect(xloc + int(xonko / 4), yloc + int(yhei / 4), int(xonko / 4), int(yhei / 4), far); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1210 } |
225 | 1211 if (g_machine == PLUS4 || g_machine == PLUS4M) |
1212 { | |
1213 if (int(g_map[1]) != 255 && int(g_map[2]) == x) | |
1214 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1215 far = 0xff000000; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1216 if (dist(g_r[x], g_g[x], g_b[x], 0, 0, 0) < 1) far = 0xffffffff; |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1217 e_rect(xloc + xonko - int(xonko / 4) * 2, yloc + yhei - int(yhei / 4) * 2, int(xonko / 4), int(yhei / 4), far); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1218 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1219 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1220 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1221 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1222 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1223 |
42 | 1224 |
135 | 1225 void messagebox(int ox, int oy) |
1226 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1227 // lcd character display chardisplay textbox |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1228 // coordinates. has its own "dirtychar" |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1229 int cz = 8 * g_uiscale; |
135 | 1230 for (int xx = 0; xx < 12; xx++) |
1231 for (int yy = 0; yy < 4; yy++) | |
1232 { | |
154 | 1233 if (g_chaup[xx + yy * 16] == 1) |
1234 { | |
135 | 1235 g_chaup[xx + yy * 16] = 0; |
1236 drawchar(ox + xx * cz, oy + yy * cz, g_data[256 + xx + yy * 12]); | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1237 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1238 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1239 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1240 |
42 | 1241 |
135 | 1242 void colorindicator(int ox, int oy) |
1243 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1244 int bs = 8 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1245 int h = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1246 if (g_button == RIGHT) h = 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1247 e_rect(ox, oy, bs * 2, bs * 4, g_rgb[int(g_realback)]); |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1248 e_rect(ox + bs / 2, oy + 4 * g_uiscale, 12 * g_uiscale, bs * 2, g_rgb[int(g_realfront)]); |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
1249 if (doicon(ox, oy, bs * 2, bs * 3)) command(int('<')); |
225 | 1250 if (g_machine == C64M || g_machine == MSX || g_machine == AMIGA) |
1251 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1252 e_rect(ox, oy + bs * 3, bs * 2, bs, g_rgb[int(g_map[1])]); |
151 | 1253 d_rect(ox, oy + bs * 3, bs * 2, bs, g_rgb[257]); |
225 | 1254 if (doicon(ox, oy + bs * 3, bs * 2, bs)) |
1255 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1256 if (g_shift == false) selectcolor(h, int(g_map[1])); |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
1257 if (g_shift) command(int('C')); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1258 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1259 } |
225 | 1260 if (g_machine == PLUS4M) |
1261 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1262 e_rect(ox, oy + bs * 3, bs, bs, g_rgb[int(g_map[1])]); |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1263 e_rect(ox + 8 * g_uiscale, oy + bs * 3, bs, bs, g_rgb[int(g_map[2])]); |
151 | 1264 d_rect(ox, oy + bs * 3, bs, bs, g_rgb[257]); |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1265 d_rect(ox + 8 * g_uiscale, oy + bs * 3, bs, bs, g_rgb[257]); |
225 | 1266 if (doicon(ox, oy + bs * 3, bs, bs)) |
1267 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1268 if (g_shift == false) selectcolor(h, int(g_map[1])); |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
1269 if (g_shift) command(int('C')); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1270 } |
225 | 1271 if (doicon(ox + 8 * g_uiscale, oy + bs * 3, bs, bs)) |
1272 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1273 if (g_shift == false) selectcolor(h, int(g_map[2])); |
6
07ddf9cfc6c2
Cast char to int where needed and other related operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
4
diff
changeset
|
1274 if (g_shift) command(int('V')); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1275 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1276 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1277 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1278 |
42 | 1279 |
133
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1280 void update_ui(boolean forced) |
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1281 { |
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1282 if (g_repanel <= 0) |
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1283 g_repanel++; |
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1284 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1285 messagebox(width - 12 * 8 * g_uiscale, height - 4 * 8 * g_uiscale - g_uiscale); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1286 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1287 // when tooltipping, the panels are not really |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1288 // drawn but used for easy coordinate reference |
133
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1289 if (g_repanel > 0 && !forced) |
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1290 { |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1291 icontable(width - 32 * g_uiscale, 0, 0, 0); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1292 icontable(272 * g_uiscale, height - 32 * g_uiscale, 1, 0); |
133
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1293 //icontable(0,0,3,0); |
225 | 1294 if (g_machine == PLUS4M || g_machine == PLUS4) |
1295 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1296 icontable(240 * g_uiscale, height - 32 * g_uiscale, 2, 0); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1297 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1298 } |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1299 else |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1300 { |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1301 icontable(width - 32 * g_uiscale - 1, 0, 0, 1); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1302 icontable(272 * g_uiscale, height - 32 * g_uiscale, 1, 1); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1303 palettebox(g_uiscale * 324 + 4, height - 32 * g_uiscale, width - (96 * g_uiscale) - 4); |
152 | 1304 |
225 | 1305 if (g_machine == PLUS4M || g_machine == PLUS4) |
1306 { | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1307 icontable(240 * g_uiscale, height - 32 * g_uiscale, 2, 1); |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1308 } |
42 | 1309 |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1310 colorselector(0, height - 32 * g_uiscale); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1311 colorindicator(256 * g_uiscale, height - 32 * g_uiscale); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1312 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1313 } |
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1314 |
42 | 1315 |
154 | 1316 void viewport() |
1317 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1318 // formerly void redo() |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1319 // main machine screen redraw |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1320 // and dirty char update |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1321 int xx, yy, xo, yo, xwin, ywin, x, y, winsux, winsuy, rubx; |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1322 int ad, cad, a, b, c, mmode, fari, psizex, psizey; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1323 int maxx, mayy, xcmag, ycmag, raddr; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1324 int left = 32 * g_uiscale; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1325 raddr = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1326 winsux = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1327 winsuy = 0; |
154 | 1328 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1329 if (g_backmode == 0) g_map[1] = 0; //some computers have overall background |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1330 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1331 mmode = magmode(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1332 fari = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1333 makecolor(259, g_r[g_map[0]], g_g[g_map[0]], g_b[g_map[0]]); //use border color |
4
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
1334 if (g_data[int('M')] == 1 && g_data[int('m')] == 1) g_data[int('m')] = 0; |
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
1335 if (g_data[int('m')] == 1) makecolor(259, 48, 48, 48); //don't use border color in mag modes |
a1261cd4c676
Int-ize byte array index references when using character, e.g. arr['A'] -> arr[int('A')]
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
1336 if (g_data[int('M')] == 1) makecolor(259, 48, 48, 48); |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1337 |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1338 psizex = g_magpix[mmode]; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1339 psizey = g_magpiy[mmode]; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1340 xcmag = psizex * 8; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1341 ycmag = psizey * 8; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1342 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1343 maxx = magx(); |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1344 mayy = magy(); |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1345 //borders & ultimate background |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1346 |
225 | 1347 if (g_boxreconstruct == 1) |
1348 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1349 g_boxreconstruct = 0; |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1350 //between mag window and toolboxes |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1351 if (g_data['m'] == 1 || g_data['M'] == 1) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1352 { |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1353 e_rect(0, (mayy * psizex) * 8, maxx * psizex * 8, height - ((g_vedge + g_uiscale * 2) + (mayy * psizex * 8)), g_rgb[263]); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1354 e_rect((maxx * psizex) * 8, 0, width - (maxx * psizex * 8 + (g_hedge + g_uiscale * 2)), height - (g_vedge + g_uiscale), g_rgb[263]); |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1355 } |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1356 // e_rect(width-(g_hedge+g_uiscale*2),0,g_hedge+g_uiscale*2,height,g_rgb[263]); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1357 // e_rect(0,height-(g_vedge+g_uiscale*2),width,g_vedge+g_uiscale*2,g_rgb[263]); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1358 } |
142 | 1359 |
1360 if (g_boxreconstruct == 2) | |
1361 { | |
1362 //in case of full window update | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1363 g_boxreconstruct = 0; |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1364 e_rect(0, 0, width - (g_hedge + g_uiscale * 2 - 2), height - (g_vedge + g_uiscale * 2 - 2), g_rgb[259]); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1365 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1366 |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
1367 if (g_pgrab) |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
1368 { |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
1369 // avoid preview window embarassment |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1370 e_rect(width - (g_hedge + g_uiscale * 2), 0, g_hedge + g_uiscale * 2 - 1, height - 1, g_rgb[263]); |
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1371 e_rect(0, height - (g_vedge + g_uiscale * 2), width - 1, g_vedge + g_uiscale * 2 - 1, g_rgb[263]); |
145
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
1372 } |
5af8b5ddf349
Merge and clean up changes from v1.8.2018
Matti Hamalainen <ccr@tnsp.org>
parents:
144
diff
changeset
|
1373 |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1374 maxx--; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1375 mayy--; |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1376 |
156 | 1377 g_ofx = clampv(g_ofx, 0, MX - magx()); |
1378 g_ofy = clampv(g_ofy, 0, MY - magy()); | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1379 |
225 | 1380 if (mmode == 10) |
1381 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1382 g_ofx = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1383 g_ofy = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1384 maxx = MX - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1385 mayy = MY - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1386 winsux = g_windowx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1387 winsuy = g_windowy; |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1388 xcmag = 16; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1389 } //mini |
154 | 1390 else |
225 | 1391 if (mmode == 0) |
1392 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1393 g_ofx = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1394 g_ofy = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1395 maxx = MX - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1396 mayy = MY - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1397 winsux = g_windowx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1398 winsuy = g_windowy; |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1399 xcmag = 24; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1400 } //normal |
154 | 1401 else |
225 | 1402 if (mmode == 20) |
1403 { | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1404 g_ofx = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1405 g_ofy = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1406 maxx = MX - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1407 mayy = MY - 1; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1408 winsux = g_windowx; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1409 winsuy = g_windowy; |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1410 xcmag = 32; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1411 } //maxi |
155
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1412 else |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1413 if (mmode == 1 || mmode == 2 || |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1414 mmode == 11 || mmode == 12 || |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1415 mmode == 21 || mmode == 22) |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1416 { |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1417 winsux = 0; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1418 winsuy = 0; |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1419 fill(32, 32, 32); |
b9ad669fb025
Integrate more 1.8.2018 changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
154
diff
changeset
|
1420 } |
157
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1421 else |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1422 if (mmode == 110) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1423 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1424 g_ofx = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1425 g_ofy = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1426 maxx = MX - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1427 mayy = MY - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1428 winsux = g_windowx; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1429 winsuy = g_windowy; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1430 mag = 16; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1431 } //mini flat aspect |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1432 else |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1433 if (mmode == 100) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1434 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1435 g_ofx = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1436 g_ofy = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1437 maxx = MX - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1438 mayy = MY - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1439 winsux = g_windowx; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1440 winsuy = g_windowy; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1441 mag = 24; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1442 } //normal flat aspect |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1443 else |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1444 if (mmode == 120) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1445 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1446 g_ofx = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1447 g_ofy = 0; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1448 maxx = MX - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1449 mayy = MY - 1; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1450 winsux = g_windowx; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1451 winsuy = g_windowy; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1452 mag = 32; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1453 } //maxi flat aspect |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1454 |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1455 b = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1456 c = 0; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1457 a = 5; |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1458 |
8 | 1459 for (ywin = 0; ywin <= mayy; ywin++) |
154 | 1460 for (xwin = 0; xwin <= maxx; xwin++) |
1461 { | |
11 | 1462 // source coords: is 0,0 if not magged |
1463 xx = g_ofx + xwin; | |
1464 yy = g_ofy + ywin; | |
1465 // divided into character area blocks | |
1466 // which are only updated if necessary | |
1467 xo = xwin; | |
1468 yo = ywin; | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1469 |
11 | 1470 if (int(g_redo[xx + yy * MX]) == 0) { |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1471 |
11 | 1472 for (y = 0; y <= 7; y++) { //pixel rows inside "char" |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1473 |
11 | 1474 switch (g_multic) { |
1475 case 0: | |
1476 cad = 65536 + xx + ((yy * X) + y * MX); | |
1477 a = int(g_map[cad]); | |
1478 b = int(g_map[(MX * MY) * 8 + cad]); | |
1479 c = int(g_map[(MX * MY) * 8 + cad]); | |
1480 break; | |
1481 case 1: | |
1482 cad = 65536 + xx + (yy * MX); | |
1483 a = int(g_map[cad]); | |
1484 b = int(g_map[cad + 1000]); | |
1485 c = int(g_map[cad + 2000]); | |
179
934934bb1fbb
Rename global variable s/machine/g_machine/g
Matti Hamalainen <ccr@tnsp.org>
parents:
172
diff
changeset
|
1486 if (g_machine == PLUS4M) { |
11 | 1487 c = int(g_map[2]); |
1488 } | |
1489 break; | |
1490 case 2: | |
1491 cad = 65536 + xx + ((yy * X) + y * MX); | |
1492 a = int(g_map[cad]); | |
1493 b = int(g_map[(MX * MY) * 8 + cad]); | |
1494 c = int(g_map[(MX * MY) * 8 + cad]); | |
1495 break; | |
1496 } | |
1497 | |
1498 ad = 1024 + xx * 8 + yy * (X * 8) + y * X; | |
1499 | |
1500 int po, vop; | |
1501 | |
1502 for (x = 0; x <= 7; x++) { //pixel columns inside pixel row | |
1503 vop = int(x / 2); | |
1504 if (g_multic == 0) { | |
1505 if (int(g_map[ad + x]) == 1) { | |
1506 fari = a; | |
1507 if (fari == 0) fari = g_map[1]; | |
1508 } else { | |
1509 fari = b; | |
1510 if (fari == 0) fari = g_map[1]; | |
1511 } | |
1512 } | |
1513 if (g_multic == 1) { | |
1514 po = int(g_map[ad + vop * 2]) + int(g_map[ad + vop * 2 + 1] * 2); | |
1515 if (po == 0) fari = g_map[1]; //00 comes from $d021 in real c64 and background 1 in plus/4 | |
1516 if (po == 1) fari = a; //10 | |
1517 if (po == 2) fari = b; //01 | |
1518 if (po == 3) fari = c; //g_map[2];//11 // comes from $d800 in real c64 and background 2 in plus/4 | |
1519 } | |
1520 if (g_multic == 2) { // "amiga" mode | |
1521 fari = int(g_map[ad + x]); | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1522 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1523 |
11 | 1524 if (g_rubbermode == 1) { // rubberband mode |
1525 rubx = x; | |
133
f5c32f6470d0
Begin integrating more changes from Multipaint 1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
131
diff
changeset
|
1526 if (g_pixelw == 2) { |
11 | 1527 rubx = chop2(x); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1528 } |
11 | 1529 if (fylli() == 1) { |
1530 if (xx * 8 + rubx == g_rx || xx * 8 + rubx == g_rx2) { | |
1531 if (yy * 8 + y >= g_ry && yy * 8 + y <= g_ry2) fari = 256; | |
154 | 1532 // if (yy * 8 + y >= g_ry && yy * 8 + y <= g_ry2) fari = 256; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1533 } |
11 | 1534 if (yy * 8 + y == g_ry || yy * 8 + y == g_ry2) { |
1535 if (xx * 8 + x >= g_rx && xx * 8 + x <= g_rx2) fari = 256; | |
154 | 1536 // if (xx * 8 + x >= g_rx && xx * 8 + x <= g_rx2) fari = 256; |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1537 } |
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1538 } |
11 | 1539 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1540 |
11 | 1541 color ari = g_rgb[fari]; |
1542 switch (mmode) { | |
1543 case 0: | |
1544 raddr = (xo * 24 + x * 3) + (yo * 24 + y * 3) * width; | |
1545 raddr = raddr + g_windowx + g_windowy * width; | |
1546 pixels[raddr] = ari; | |
1547 pixels[raddr + 1] = ari; | |
1548 pixels[raddr + 2] = ari; | |
1549 raddr = raddr + width; | |
1550 pixels[raddr] = ari; | |
1551 pixels[raddr + 1] = ari; | |
1552 pixels[raddr + 2] = ari; | |
1553 raddr = raddr + width; | |
1554 pixels[raddr] = ari; | |
1555 pixels[raddr + 1] = ari; | |
1556 pixels[raddr + 2] = ari; | |
1557 break; | |
1558 case 1: | |
1559 raddr = (xo * 64 + x * 8) + (yo * 64 + y * 8) * width; | |
1560 pixels[raddr] = ari; | |
1561 pixels[raddr + 1] = ari; | |
1562 pixels[raddr + 2] = ari; | |
1563 pixels[raddr + 3] = ari; | |
1564 pixels[raddr + 4] = ari; | |
1565 pixels[raddr + 5] = ari; | |
1566 pixels[raddr + 6] = ari; | |
1567 pixels[raddr + 7] = ari; | |
1568 raddr = raddr + width; | |
1569 pixels[raddr] = ari; | |
1570 pixels[raddr + 1] = ari; | |
1571 pixels[raddr + 2] = ari; | |
1572 pixels[raddr + 3] = ari; | |
1573 pixels[raddr + 4] = ari; | |
1574 pixels[raddr + 5] = ari; | |
1575 pixels[raddr + 6] = ari; | |
1576 pixels[raddr + 7] = ari; | |
1577 raddr = raddr + width; | |
1578 pixels[raddr] = ari; | |
1579 pixels[raddr + 1] = ari; | |
1580 pixels[raddr + 2] = ari; | |
1581 pixels[raddr + 3] = ari; | |
1582 pixels[raddr + 4] = ari; | |
1583 pixels[raddr + 5] = ari; | |
1584 pixels[raddr + 6] = ari; | |
1585 pixels[raddr + 7] = ari; | |
1586 raddr = raddr + width; | |
1587 pixels[raddr] = ari; | |
1588 pixels[raddr + 1] = ari; | |
1589 pixels[raddr + 2] = ari; | |
1590 pixels[raddr + 3] = ari; | |
1591 pixels[raddr + 4] = ari; | |
1592 pixels[raddr + 5] = ari; | |
1593 pixels[raddr + 6] = ari; | |
1594 pixels[raddr + 7] = ari; | |
1595 raddr = raddr + width; | |
1596 pixels[raddr] = ari; | |
1597 pixels[raddr + 1] = ari; | |
1598 pixels[raddr + 2] = ari; | |
1599 pixels[raddr + 3] = ari; | |
1600 pixels[raddr + 4] = ari; | |
1601 pixels[raddr + 5] = ari; | |
1602 pixels[raddr + 6] = ari; | |
1603 pixels[raddr + 7] = ari; | |
1604 raddr = raddr + width; | |
1605 pixels[raddr] = ari; | |
1606 pixels[raddr + 1] = ari; | |
1607 pixels[raddr + 2] = ari; | |
1608 pixels[raddr + 3] = ari; | |
1609 pixels[raddr + 4] = ari; | |
1610 pixels[raddr + 5] = ari; | |
1611 pixels[raddr + 6] = ari; | |
1612 pixels[raddr + 7] = ari; | |
1613 raddr = raddr + width; | |
1614 pixels[raddr] = ari; | |
1615 pixels[raddr + 1] = ari; | |
1616 pixels[raddr + 2] = ari; | |
1617 pixels[raddr + 3] = ari; | |
1618 pixels[raddr + 4] = ari; | |
1619 pixels[raddr + 5] = ari; | |
1620 pixels[raddr + 6] = ari; | |
1621 pixels[raddr + 7] = ari; | |
1622 raddr = raddr + width; | |
1623 pixels[raddr] = ari; | |
1624 pixels[raddr + 1] = ari; | |
1625 pixels[raddr + 2] = ari; | |
1626 pixels[raddr + 3] = ari; | |
1627 pixels[raddr + 4] = ari; | |
1628 pixels[raddr + 5] = ari; | |
1629 pixels[raddr + 6] = ari; | |
1630 pixels[raddr + 7] = ari; | |
1631 break; | |
1632 case 2: | |
183
1cb7ecd73554
Rename global variable g_uizoom to g_uiscale and mpUIZoom -> mpUIScale.
Matti Hamalainen <ccr@tnsp.org>
parents:
179
diff
changeset
|
1633 e_rect(xo * (64 * g_uiscale) + x * (8 * g_uiscale), yo * (64 * g_uiscale) + y * (8 * g_uiscale), 8 * g_uiscale, 8 * g_uiscale, g_rgb[fari]); |
11 | 1634 break; |
1635 // mini modes | |
1636 case 10: | |
1637 raddr = (xo * 16 + x * 2) + (yo * 8 + y) * width * 2; | |
1638 raddr = raddr + g_windowx + g_windowy * width; | |
1639 pixels[raddr] = ari; | |
1640 pixels[raddr + 1] = ari; | |
1641 raddr = raddr + width; | |
1642 pixels[raddr] = ari; | |
1643 pixels[raddr + 1] = ari; | |
1644 break; | |
1645 case 11: | |
1646 raddr = (xo * 48 + x * 6) + (yo * 48 + y * 6) * width; | |
1647 pixels[raddr] = ari; | |
1648 pixels[raddr + 1] = ari; | |
1649 pixels[raddr + 2] = ari; | |
1650 pixels[raddr + 3] = ari; | |
1651 pixels[raddr + 4] = ari; | |
1652 pixels[raddr + 5] = ari; | |
1653 raddr = raddr + width; | |
1654 pixels[raddr] = ari; | |
1655 pixels[raddr + 1] = ari; | |
1656 pixels[raddr + 2] = ari; | |
1657 pixels[raddr + 3] = ari; | |
1658 pixels[raddr + 4] = ari; | |
1659 pixels[raddr + 5] = ari; | |
1660 raddr = raddr + width; | |
1661 pixels[raddr] = ari; | |
1662 pixels[raddr + 1] = ari; | |
1663 pixels[raddr + 2] = ari; | |
1664 pixels[raddr + 3] = ari; | |
1665 pixels[raddr + 4] = ari; | |
1666 pixels[raddr + 5] = ari; | |
1667 raddr = raddr + width; | |
1668 pixels[raddr] = ari; | |
1669 pixels[raddr + 1] = ari; | |
1670 pixels[raddr + 2] = ari; | |
1671 pixels[raddr + 3] = ari; | |
1672 pixels[raddr + 4] = ari; | |
1673 pixels[raddr + 5] = ari; | |
1674 raddr = raddr + width; | |
1675 pixels[raddr] = ari; | |
1676 pixels[raddr + 1] = ari; | |
1677 pixels[raddr + 2] = ari; | |
1678 pixels[raddr + 3] = ari; | |
1679 pixels[raddr + 4] = ari; | |
1680 pixels[raddr + 5] = ari; | |
1681 raddr = raddr + width; | |
1682 pixels[raddr] = ari; | |
1683 pixels[raddr + 1] = ari; | |
1684 pixels[raddr + 2] = ari; | |
1685 pixels[raddr + 3] = ari; | |
1686 pixels[raddr + 4] = ari; | |
1687 pixels[raddr + 5] = ari; | |
1688 break; | |
1689 case 12: | |
1690 e_rect(xo * (64 * g_wzoom) + x * (8 * g_wzoom), yo * (64 * g_wzoom) + y * (8 * g_wzoom), 8 * g_wzoom, 8 * g_wzoom, g_rgb[fari]); | |
1691 break; | |
1692 // maxi modes | |
1693 case 20: | |
1694 raddr = (xo * (8 * 4) + x * 4) + (yo * (8 * 4) + y * 4) * width; | |
1695 raddr = raddr + g_windowx + g_windowy * width; | |
1696 pixels[raddr] = ari; | |
1697 pixels[raddr + 1] = ari; | |
1698 pixels[raddr + 2] = ari; | |
1699 pixels[raddr + 3] = ari; | |
1700 raddr = raddr + width; | |
1701 pixels[raddr] = ari; | |
1702 pixels[raddr + 1] = ari; | |
1703 pixels[raddr + 2] = ari; | |
1704 pixels[raddr + 3] = ari; | |
1705 raddr = raddr + width; | |
1706 pixels[raddr] = ari; | |
1707 pixels[raddr + 1] = ari; | |
1708 pixels[raddr + 2] = ari; | |
1709 pixels[raddr + 3] = ari; | |
1710 raddr = raddr + width; | |
1711 pixels[raddr] = ari; | |
1712 pixels[raddr + 1] = ari; | |
1713 pixels[raddr + 2] = ari; | |
1714 pixels[raddr + 3] = ari; | |
1715 break; | |
1716 case 21: | |
1717 e_rect(xo * (32 * g_wzoom) + x * (4 * g_wzoom), yo * (32 * g_wzoom) + y * (4 * g_wzoom), 4 * g_wzoom, 4 * g_wzoom, g_rgb[fari]); | |
1718 break; | |
1719 case 22: | |
1720 e_rect(xo * (64 * g_wzoom) + x * (8 * g_wzoom), yo * (64 * g_wzoom) + y * (8 * g_wzoom), 8 * g_wzoom, 8 * g_wzoom, g_rgb[fari]); | |
1721 break; | |
157
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1722 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1723 //flat NORMI |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1724 case 100: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1725 raddr = (xo * 24 + x * 3) + (yo * 16 + y * 2) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1726 raddr = raddr + g_windowx; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1727 raddr = raddr + (g_windowy) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1728 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1729 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1730 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1731 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1732 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1733 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1734 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1735 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1736 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1737 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1738 case 101: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1739 raddr = (xo * 72 + x * 9) + (yo * 48 + y * 6) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1740 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1741 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1742 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1743 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1744 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1745 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1746 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1747 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1748 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1749 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1750 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1751 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1752 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1753 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1754 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1755 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1756 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1757 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1758 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1759 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1760 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1761 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1762 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1763 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1764 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1765 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1766 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1767 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1768 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1769 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1770 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1771 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1772 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1773 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1774 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1775 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1776 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1777 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1778 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1779 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1780 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1781 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1782 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1783 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1784 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1785 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1786 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1787 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1788 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1789 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1790 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1791 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1792 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1793 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1794 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1795 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1796 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1797 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1798 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1799 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1800 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1801 case 102: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1802 e_rect(xo * (8 * psizex) + x * (psizex), yo * (8 * psizey) + y * (psizey), psizex, psizey, g_rgb[fari]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1803 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1804 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1805 // flat mini modes = probably redundant |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1806 // mini modes |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1807 case 110: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1808 raddr = (xo * 24 + x * 3) + (yo * 16 + y * 2) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1809 raddr = raddr + g_windowx; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1810 raddr = raddr + (g_windowy) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1811 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1812 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1813 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1814 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1815 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1816 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1817 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1818 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1819 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1820 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1821 case 111: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1822 raddr = (xo * 72 + x * 9) + (yo * 48 + y * 6) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1823 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1824 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1825 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1826 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1827 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1828 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1829 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1830 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1831 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1832 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1833 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1834 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1835 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1836 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1837 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1838 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1839 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1840 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1841 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1842 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1843 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1844 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1845 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1846 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1847 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1848 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1849 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1850 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1851 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1852 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1853 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1854 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1855 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1856 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1857 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1858 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1859 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1860 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1861 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1862 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1863 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1864 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1865 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1866 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1867 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1868 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1869 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1870 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1871 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1872 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1873 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1874 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1875 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1876 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1877 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1878 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1879 pixels[raddr + 6] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1880 pixels[raddr + 7] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1881 pixels[raddr + 8] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1882 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1883 case 112: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1884 e_rect(xo * (8 * psizex) + x * (psizex), yo * (8 * psizey) + y * (psizey), psizex, psizey, g_rgb[fari]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1885 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1886 |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1887 // flat maxi modes |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1888 case 120: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1889 raddr = (xo * (8 * 6) + x * 6) + (yo * (8 * 4) + y * 4) * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1890 raddr = raddr + g_windowx + g_windowy * width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1891 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1892 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1893 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1894 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1895 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1896 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1897 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1898 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1899 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1900 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1901 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1902 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1903 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1904 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1905 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1906 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1907 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1908 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1909 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1910 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1911 raddr = raddr + width; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1912 pixels[raddr] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1913 pixels[raddr + 1] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1914 pixels[raddr + 2] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1915 pixels[raddr + 3] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1916 pixels[raddr + 4] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1917 pixels[raddr + 5] = ari; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1918 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1919 case 121: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1920 e_rect(xo * (8 * psizex) + x * (psizex), yo * (8 * psizey) + y * (psizey), psizex, psizey, g_rgb[fari]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1921 break; |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1922 case 122: |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1923 e_rect(xo * (8 * psizex) + x * (psizex), yo * (8 * psizey) + y * (psizey), psizex, psizey, g_rgb[fari]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1924 break; |
11 | 1925 } |
1926 } //one pixel inside pixel row | |
1927 } //one pixel row inside char | |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1928 |
11 | 1929 //draw grid |
1930 //can in principle be non-square | |
157
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1931 if (int(g_data[int('g')]) == 1) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1932 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1933 if (chopv(xx * 8, g_gridx) == (xx * 8)) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1934 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1935 t_rect(xo * psizex * 8 + winsux, yo * ycmag + winsuy, 1, ycmag, g_rgb[257]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1936 if (g_gridx == 4) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1937 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1938 t_rect(xo * psizex * 8 + winsux + 4 * psizex, yo * ycmag + winsuy + 1, 1, ycmag / 2 - 2, g_rgb[257]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1939 t_rect(xo * psizex * 8 + winsux + 4 * psizex, yo * ycmag + winsuy + ycmag - ycmag / 2 + 2, 1, ycmag / 2 - 2, g_rgb[257]); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1940 } |
11 | 1941 } |
7
c848a6133cfc
Fix many calculations (divisions) that assume integer variable division
Matti Hamalainen <ccr@tnsp.org>
parents:
6
diff
changeset
|
1942 |
157
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1943 if (chopv(yy * 8, g_gridy) == (yy * 8)) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1944 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1945 t_rect(xo * psizex * 8 + winsux + 1, yo * ycmag + winsuy, psizex * 8 - 1, 1, g_rgb[257]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1946 if (g_gridy == 4) |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1947 { |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1948 t_rect(xo * psizex * 8 + winsux + 1, yo * ycmag + winsuy + 4 * psizex, xcmag / 2 - 2, 1, g_rgb[257]); |
cdfda0354332
Integrate changes from v1.8.2018.
Matti Hamalainen <ccr@tnsp.org>
parents:
156
diff
changeset
|
1949 t_rect(xo * psizex * 8 + winsux + 2 + xcmag - xcmag / 2, yo * ycmag + winsuy + 4 * psizex, xcmag / 2 - 2, 1, g_rgb[257]); |
2
5eb3559e1778
Run everything through JS-beautifier and remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1950 } |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1951 } |
11 | 1952 } |
1953 g_redo[xx + yy * MX] = byte(1); | |
1954 } //dirty char? | |
1955 } //x char | |
0
ebd5689e2985
Initial import of Multipaint sketch version 22.5.2017.
Tero Heikkinen
parents:
diff
changeset
|
1956 } |