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