diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-10-15 22:31:09 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-10-15 22:31:09 +0000 |
commit | 45e3eed60d2f2f3f2d4279d771d241ec45bded96 (patch) | |
tree | c8bb5081604706472fbc2dc41f3a3dd3d5bdd833 /apps | |
parent | e0710b2af13cc7a4994cbcb0e50af97c02055c5b (diff) | |
download | rockbox-45e3eed60d2f2f3f2d4279d771d241ec45bded96.tar.gz rockbox-45e3eed60d2f2f3f2d4279d771d241ec45bded96.zip |
FlipIt graphics rework: * Adjusted token sizes to make them fit better on the various LCDs (4 different sizes, a 5th size is planned). Correct aspect ratio for archos bitmap LCD. Graphics work by Marianne Arnold.* Major code cleanup, use bitmap build system for all sizes. Info panel is now always displayed below.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11228 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
18 files changed, 74 insertions, 154 deletions
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index 9dfc312348..75b85d1546 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES | |||
@@ -32,4 +32,13 @@ brickmania_powerups.112x64x1.bmp | |||
32 | rockblox_background.112x64x1.bmp | 32 | rockblox_background.112x64x1.bmp |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* Flip it */ | ||
36 | #ifndef HAVE_LCD_COLOR | ||
37 | #if LCD_WIDTH >= 125 && LCD_HEIGHT >= 110 | ||
38 | flipit_cursor.25x25x1.bmp | ||
39 | #elif LCD_WIDTH >= 80 && LCD_HEIGHT >= 62 | ||
40 | flipit_cursor.16x13x1.bmp | ||
41 | #endif | ||
42 | #endif | ||
43 | |||
35 | #endif /* HAVE_LCD_BITMAP */ | 44 | #endif /* HAVE_LCD_BITMAP */ |
diff --git a/apps/plugins/bitmaps/mono/flipit_cursor.16x13x1.bmp b/apps/plugins/bitmaps/mono/flipit_cursor.16x13x1.bmp new file mode 100755 index 0000000000..38db15aa95 --- /dev/null +++ b/apps/plugins/bitmaps/mono/flipit_cursor.16x13x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/flipit_cursor.25x25x1.bmp b/apps/plugins/bitmaps/mono/flipit_cursor.25x25x1.bmp new file mode 100755 index 0000000000..5445f8b01d --- /dev/null +++ b/apps/plugins/bitmaps/mono/flipit_cursor.25x25x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index c5729a09b7..c7eaa91751 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES | |||
@@ -127,18 +127,23 @@ sokoban_tiles.6x6x2.bmp | |||
127 | 127 | ||
128 | /* Flip it */ | 128 | /* Flip it */ |
129 | #ifdef HAVE_LCD_COLOR | 129 | #ifdef HAVE_LCD_COLOR |
130 | #if LCD_HEIGHT >= 200 | 130 | #if LCD_WIDTH >= 280 && LCD_HEIGHT >= 234 |
131 | flipit_tokens.50x50.bmp | 131 | flipit_cursor.56x56x16.bmp |
132 | #elif LCD_HEIGHT >= 160 | 132 | flipit_tokens.56x112x16.bmp |
133 | flipit_tokens.40x40.bmp | 133 | #elif LCD_WIDTH >= 200 && LCD_HEIGHT >= 170 |
134 | #else | 134 | flipit_cursor.40x40x16.bmp |
135 | flipit_tokens.30x30.bmp | 135 | flipit_tokens.40x80x16.bmp |
136 | #elif LCD_WIDTH >= 125 && LCD_HEIGHT >= 110 | ||
137 | flipit_cursor.25x25x16.bmp | ||
138 | flipit_tokens.25x50x16.bmp | ||
136 | #endif | 139 | #endif |
137 | #elif LCD_DEPTH >= 2 | 140 | #elif LCD_DEPTH > 1 /* greyscale */ |
138 | #if LCD_WIDTH >= 150 | 141 | #if LCD_WIDTH >= 125 && LCD_HEIGHT >= 110 |
139 | flipit_tokens.30x30x2.bmp | 142 | flipit_tokens.25x50x2.bmp |
140 | #else | 143 | #endif |
141 | flipit_tokens.20x20x2.bmp | 144 | #else /* monochrome */ |
145 | #if LCD_WIDTH >= 80 && LCD_HEIGHT >= 62 | ||
146 | flipit_tokens.16x26x1.bmp | ||
142 | #endif | 147 | #endif |
143 | #endif | 148 | #endif |
144 | 149 | ||
diff --git a/apps/plugins/bitmaps/native/flipit_cursor.25x25x16.bmp b/apps/plugins/bitmaps/native/flipit_cursor.25x25x16.bmp new file mode 100755 index 0000000000..faa81518f8 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_cursor.25x25x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_cursor.40x40x16.bmp b/apps/plugins/bitmaps/native/flipit_cursor.40x40x16.bmp new file mode 100755 index 0000000000..d91a363a99 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_cursor.40x40x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_cursor.56x56x16.bmp b/apps/plugins/bitmaps/native/flipit_cursor.56x56x16.bmp new file mode 100755 index 0000000000..7fffb25a15 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_cursor.56x56x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.16x26x1.bmp b/apps/plugins/bitmaps/native/flipit_tokens.16x26x1.bmp new file mode 100755 index 0000000000..fcf164b336 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_tokens.16x26x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp b/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp deleted file mode 100644 index 5dbae762c9..0000000000 --- a/apps/plugins/bitmaps/native/flipit_tokens.20x20x2.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.25x50x16.bmp b/apps/plugins/bitmaps/native/flipit_tokens.25x50x16.bmp new file mode 100755 index 0000000000..deca4c7410 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_tokens.25x50x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.25x50x2.bmp b/apps/plugins/bitmaps/native/flipit_tokens.25x50x2.bmp new file mode 100755 index 0000000000..e2db260483 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_tokens.25x50x2.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.30x30.bmp b/apps/plugins/bitmaps/native/flipit_tokens.30x30.bmp deleted file mode 100644 index 7aa7748282..0000000000 --- a/apps/plugins/bitmaps/native/flipit_tokens.30x30.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp b/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp deleted file mode 100644 index 63262b5f65..0000000000 --- a/apps/plugins/bitmaps/native/flipit_tokens.30x30x2.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.40x40.bmp b/apps/plugins/bitmaps/native/flipit_tokens.40x40.bmp deleted file mode 100644 index b50245edde..0000000000 --- a/apps/plugins/bitmaps/native/flipit_tokens.40x40.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.40x80x16.bmp b/apps/plugins/bitmaps/native/flipit_tokens.40x80x16.bmp new file mode 100755 index 0000000000..38975020fd --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_tokens.40x80x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.50x50.bmp b/apps/plugins/bitmaps/native/flipit_tokens.50x50.bmp deleted file mode 100644 index bc2c543b39..0000000000 --- a/apps/plugins/bitmaps/native/flipit_tokens.50x50.bmp +++ /dev/null | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/flipit_tokens.56x112x16.bmp b/apps/plugins/bitmaps/native/flipit_tokens.56x112x16.bmp new file mode 100755 index 0000000000..c56f9daae2 --- /dev/null +++ b/apps/plugins/bitmaps/native/flipit_tokens.56x112x16.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c index 7d423335d3..0b9878856c 100644 --- a/apps/plugins/flipit.c +++ b/apps/plugins/flipit.c | |||
@@ -105,169 +105,73 @@ static struct plugin_api* rb; | |||
105 | static int spots[20]; | 105 | static int spots[20]; |
106 | static int toggle[20]; | 106 | static int toggle[20]; |
107 | static int cursor_pos, moves; | 107 | static int cursor_pos, moves; |
108 | static char s[5]; | ||
109 | 108 | ||
110 | #if LCD_DEPTH >= 2 | 109 | #include "flipit_cursor.h" |
111 | 110 | #include "flipit_tokens.h" | |
112 | #ifdef HAVE_LCD_COLOR | ||
113 | |||
114 | #if LCD_HEIGHT >= 200 | ||
115 | #define tksize 50 | ||
116 | #elif LCD_HEIGHT >=160 | ||
117 | #define tksize 40 | ||
118 | #else | ||
119 | #define tksize 30 | ||
120 | #endif | ||
121 | |||
122 | #else | ||
123 | |||
124 | #if LCD_WIDTH >= 150 | ||
125 | #define tksize 30 | ||
126 | #else | ||
127 | #define tksize 20 | ||
128 | #endif | ||
129 | |||
130 | #endif | ||
131 | |||
132 | extern const fb_data flipit_tokens[]; | ||
133 | |||
134 | #else | ||
135 | |||
136 | static char *ptr; | ||
137 | |||
138 | #define tksize 16 | ||
139 | |||
140 | static unsigned char spot_pic[2][28] = { | ||
141 | { 0xe0, 0xf8, 0xfc, 0xfe, 0xfe, 0xff, 0xff, | ||
142 | 0xff, 0xff, 0xfe, 0xfe, 0xfc, 0xf8, 0xe0, | ||
143 | 0x01, 0x07, 0x0f, 0x1f, 0x1f, 0x3f, 0x3f, | ||
144 | 0x3f, 0x3f, 0x1f, 0x1f, 0x0f, 0x07, 0x01 }, | ||
145 | { 0xe0, 0x18, 0x04, 0x02, 0x02, 0x01, 0x01, | ||
146 | 0x01, 0x01, 0x02, 0x02, 0x04, 0x18, 0xe0, | ||
147 | 0x01, 0x06, 0x08, 0x10, 0x10, 0x20, 0x20, | ||
148 | 0x20, 0x20, 0x10, 0x10, 0x08, 0x06, 0x01 } | ||
149 | }; | ||
150 | static unsigned char cursor_pic[32] = { | ||
151 | 0x55, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, | ||
152 | 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xaa, | ||
153 | 0x55, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, | ||
154 | 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xaa }; | ||
155 | #endif | ||
156 | |||
157 | #define INFO_WIDTH 32 | ||
158 | |||
159 | #if LCD_WIDTH - 5*tksize - INFO_WIDTH < 0 | ||
160 | # define INFO_UNDER | ||
161 | # undef INFO_WIDTH | ||
162 | # define INFO_WIDTH 60 | ||
163 | # define GRID_LEFT ((LCD_WIDTH-5*tksize)/2) | ||
164 | # define GRID_TOP 0 | ||
165 | #else | ||
166 | # define GRID_LEFT 0 | ||
167 | # define GRID_TOP ((LCD_HEIGHT-4*tksize)/2) | ||
168 | #endif | ||
169 | 111 | ||
112 | #define PANEL_HEIGHT 12 | ||
113 | #define TK_WIDTH BMPWIDTH_flipit_cursor | ||
114 | #define TK_HEIGHT BMPHEIGHT_flipit_cursor | ||
115 | #define TK_SPACE MAX(0, MIN((LCD_WIDTH - 5*TK_WIDTH)/4, \ | ||
116 | (LCD_HEIGHT - PANEL_HEIGHT - 4*TK_HEIGHT)/4)) | ||
117 | #define GRID_WIDTH (5*TK_WIDTH + 4*TK_SPACE) | ||
118 | #define GRID_LEFT ((LCD_WIDTH - GRID_WIDTH)/2) | ||
119 | #define GRID_HEIGHT (4*TK_HEIGHT + 4*TK_SPACE) /* includes grid-panel space */ | ||
120 | #define GRID_TOP MAX(0, ((LCD_HEIGHT - PANEL_HEIGHT - GRID_HEIGHT)/2)) | ||
170 | 121 | ||
171 | /* draw a spot at the coordinates (x,y), range of p is 0-19 */ | 122 | /* draw a spot at the coordinates (x,y), range of p is 0-19 */ |
172 | static void draw_spot(int p) { | 123 | static void draw_spot(int p) |
173 | #if LCD_DEPTH >= 2 | 124 | { |
174 | rb->lcd_bitmap_part( flipit_tokens, 0, spots[p]*tksize, tksize, | 125 | rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT, TK_WIDTH, |
175 | (p%5)*tksize+GRID_LEFT, (p/5)*tksize+GRID_TOP, | 126 | GRID_LEFT + (p%5) * (TK_WIDTH+TK_SPACE), |
176 | tksize, tksize ); | 127 | GRID_TOP + (p/5) * (TK_HEIGHT+TK_SPACE), |
177 | #else | 128 | TK_WIDTH, TK_HEIGHT ); |
178 | ptr = spot_pic[spots[p]]; | ||
179 | rb->lcd_mono_bitmap (ptr, (p%5)*16+1, (p/5)*16+1, 14, 8); | ||
180 | ptr += 14; | ||
181 | rb->lcd_mono_bitmap (ptr, (p%5)*16+1, (p/5)*16+9, 14, 6); | ||
182 | #endif | ||
183 | } | 129 | } |
184 | 130 | ||
185 | /* draw the cursor at the current cursor position */ | 131 | /* draw the cursor at the current cursor position */ |
186 | static void draw_cursor(void) { | 132 | static void draw_cursor(void) |
187 | 133 | { | |
188 | #ifdef HAVE_LCD_COLOR | 134 | #ifdef HAVE_LCD_COLOR |
189 | rb->lcd_bitmap_transparent_part( flipit_tokens, 0, 2*tksize, tksize, | 135 | rb->lcd_bitmap_transparent( flipit_cursor, |
190 | (cursor_pos%5)*tksize+GRID_LEFT, | 136 | GRID_LEFT + (cursor_pos%5) * (TK_WIDTH+TK_SPACE), |
191 | (cursor_pos/5)*tksize+GRID_TOP, | 137 | GRID_TOP + (cursor_pos/5) * (TK_HEIGHT+TK_SPACE), |
192 | tksize, tksize ); | 138 | TK_WIDTH, TK_HEIGHT ); |
193 | #elif LCD_DEPTH >= 2 | ||
194 | /* grayscale doesn't have transparent bitmap ... */ | ||
195 | int i,j; | ||
196 | i = ( cursor_pos%5 )*tksize; | ||
197 | j = ( cursor_pos/5 )*tksize; | ||
198 | rb->lcd_set_drawmode( DRMODE_SOLID ); | ||
199 | rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP, | ||
200 | i+tksize-1+GRID_LEFT, j+GRID_TOP ); | ||
201 | rb->lcd_drawline( i+GRID_LEFT, j+tksize-1+GRID_TOP, | ||
202 | i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP ); | ||
203 | rb->lcd_drawline( i+GRID_LEFT, j+GRID_TOP, | ||
204 | i+GRID_LEFT, j+tksize-1+GRID_TOP ); | ||
205 | rb->lcd_drawline( i+tksize-1+GRID_LEFT, j+GRID_TOP, | ||
206 | i+tksize-1+GRID_LEFT, j+tksize-1+GRID_TOP ); | ||
207 | #else | 139 | #else |
208 | int i,j; | ||
209 | i = (cursor_pos%5)*16; | ||
210 | j = (cursor_pos/5)*16; | ||
211 | rb->lcd_set_drawmode(DRMODE_FG); | 140 | rb->lcd_set_drawmode(DRMODE_FG); |
212 | ptr = cursor_pic; | 141 | rb->lcd_mono_bitmap( flipit_cursor, |
213 | rb->lcd_mono_bitmap (ptr, i, j, 16, 8); | 142 | GRID_LEFT + (cursor_pos%5) * (TK_WIDTH+TK_SPACE), |
214 | ptr += 16; | 143 | GRID_TOP + (cursor_pos/5) * (TK_HEIGHT+TK_SPACE), |
215 | rb->lcd_mono_bitmap (ptr, i, j+8, 16, 8); | 144 | TK_WIDTH, TK_HEIGHT ); |
216 | rb->lcd_set_drawmode(DRMODE_SOLID); | 145 | rb->lcd_set_drawmode(DRMODE_SOLID); |
217 | #endif | 146 | #endif |
218 | } | 147 | } |
219 | 148 | ||
220 | /* clear the cursor where it is */ | 149 | /* clear the cursor where it is */ |
221 | static void clear_cursor(void) { | 150 | static inline void clear_cursor(void) |
222 | #if LCD_DEPTH >= 2 | 151 | { |
223 | draw_spot( cursor_pos ); | 152 | draw_spot( cursor_pos ); |
224 | #else | ||
225 | int i,j; | ||
226 | i = (cursor_pos%5)*16; | ||
227 | j = (cursor_pos/5)*16; | ||
228 | rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | ||
229 | rb->lcd_drawline(i, j, i+15, j); | ||
230 | rb->lcd_drawline(i, j+15, i+15, j+15); | ||
231 | rb->lcd_drawline(i, j, i, j+15); | ||
232 | rb->lcd_drawline(i+15, j, i+15, j+15); | ||
233 | rb->lcd_set_drawmode(DRMODE_SOLID); | ||
234 | #endif | ||
235 | } | 153 | } |
236 | 154 | ||
237 | /* draw the info panel ... duh */ | 155 | /* draw the info panel ... duh */ |
238 | static void draw_info_panel(void) | 156 | static void draw_info_panel(void) |
239 | { | 157 | { |
240 | #ifdef INFO_UNDER | 158 | char s[32]; |
241 | # define HEIGHT ( LCD_HEIGHT - 4*tksize ) | 159 | |
242 | # define LEFT ( ( LCD_WIDTH - INFO_WIDTH ) / 2 ) | ||
243 | # define TOP ( LCD_HEIGHT - HEIGHT ) | ||
244 | #else | ||
245 | # define HEIGHT 64 | ||
246 | # define LEFT ( LCD_WIDTH - (LCD_WIDTH- 5*tksize-INFO_WIDTH)/2 - INFO_WIDTH ) | ||
247 | # define TOP ( ( LCD_HEIGHT - HEIGHT ) / 2 ) | ||
248 | #endif | ||
249 | rb->lcd_set_drawmode( DRMODE_SOLID|DRMODE_INVERSEVID ); | 160 | rb->lcd_set_drawmode( DRMODE_SOLID|DRMODE_INVERSEVID ); |
250 | rb->lcd_fillrect( LEFT, TOP, INFO_WIDTH, HEIGHT ); | 161 | rb->lcd_fillrect( GRID_LEFT, GRID_TOP + 4*(TK_HEIGHT+TK_SPACE), |
162 | GRID_WIDTH, PANEL_HEIGHT ); | ||
251 | rb->lcd_set_drawmode( DRMODE_SOLID ); | 163 | rb->lcd_set_drawmode( DRMODE_SOLID ); |
252 | rb->lcd_drawrect( LEFT, TOP, INFO_WIDTH, HEIGHT ); | 164 | rb->lcd_drawrect( GRID_LEFT, GRID_TOP + 4*(TK_HEIGHT+TK_SPACE), |
253 | #ifdef INFO_UNDER | 165 | GRID_WIDTH, PANEL_HEIGHT ); |
254 | rb->lcd_putsxy( LEFT+1, TOP+1, "Flips" ); | 166 | |
255 | #else | 167 | rb->snprintf( s, sizeof(s), "Flips: %d", moves ); |
256 | rb->lcd_putsxy( LEFT+1, TOP+10, "Flips" ); | 168 | rb->lcd_putsxy( (LCD_WIDTH - rb->lcd_getstringsize(s, NULL, NULL)) / 2, |
257 | #endif | 169 | GRID_TOP + 4*(TK_HEIGHT+TK_SPACE) + 2, s ); |
258 | rb->snprintf( s, sizeof(s), "%d", moves ); | ||
259 | #ifdef INFO_UNDER | ||
260 | rb->lcd_putsxy( LEFT+32, TOP+1, s ); | ||
261 | #else | ||
262 | rb->lcd_putsxy( LEFT+1, TOP+20, s ); | ||
263 | #endif | ||
264 | # undef HEIGHT | ||
265 | # undef LEFT | ||
266 | # undef TOP | ||
267 | } | 170 | } |
268 | 171 | ||
269 | /* check if the puzzle is finished */ | 172 | /* check if the puzzle is finished */ |
270 | static bool flipit_finished(void) { | 173 | static bool flipit_finished(void) |
174 | { | ||
271 | int i; | 175 | int i; |
272 | for (i=0; i<20; i++) | 176 | for (i=0; i<20; i++) |
273 | if (!spots[i]) | 177 | if (!spots[i]) |
@@ -277,7 +181,8 @@ static bool flipit_finished(void) { | |||
277 | } | 181 | } |
278 | 182 | ||
279 | /* draws the toggled spots */ | 183 | /* draws the toggled spots */ |
280 | static void flipit_toggle(void) { | 184 | static void flipit_toggle(void) |
185 | { | ||
281 | spots[cursor_pos] = 1-spots[cursor_pos]; | 186 | spots[cursor_pos] = 1-spots[cursor_pos]; |
282 | toggle[cursor_pos] = 1-toggle[cursor_pos]; | 187 | toggle[cursor_pos] = 1-toggle[cursor_pos]; |
283 | draw_spot(cursor_pos); | 188 | draw_spot(cursor_pos); |
@@ -306,7 +211,8 @@ static void flipit_toggle(void) { | |||
306 | } | 211 | } |
307 | 212 | ||
308 | /* move the cursor in any direction */ | 213 | /* move the cursor in any direction */ |
309 | static void move_cursor(int x, int y) { | 214 | static void move_cursor(int x, int y) |
215 | { | ||
310 | if (!(flipit_finished())) { | 216 | if (!(flipit_finished())) { |
311 | clear_cursor(); | 217 | clear_cursor(); |
312 | cursor_pos = ( x + 5 + cursor_pos%5 )%5 | 218 | cursor_pos = ( x + 5 + cursor_pos%5 )%5 |
@@ -317,7 +223,8 @@ static void move_cursor(int x, int y) { | |||
317 | } | 223 | } |
318 | 224 | ||
319 | /* initialize the board */ | 225 | /* initialize the board */ |
320 | static void flipit_init(void) { | 226 | static void flipit_init(void) |
227 | { | ||
321 | int i; | 228 | int i; |
322 | rb->lcd_clear_display(); | 229 | rb->lcd_clear_display(); |
323 | moves = 0; | 230 | moves = 0; |
@@ -340,7 +247,8 @@ static void flipit_init(void) { | |||
340 | } | 247 | } |
341 | 248 | ||
342 | /* the main game loop */ | 249 | /* the main game loop */ |
343 | static bool flipit_loop(void) { | 250 | static bool flipit_loop(void) |
251 | { | ||
344 | int i; | 252 | int i; |
345 | int button; | 253 | int button; |
346 | int lastbutton = BUTTON_NONE; | 254 | int lastbutton = BUTTON_NONE; |
@@ -398,9 +306,7 @@ static bool flipit_loop(void) { | |||
398 | /* toggle the pieces */ | 306 | /* toggle the pieces */ |
399 | if (!flipit_finished()) { | 307 | if (!flipit_finished()) { |
400 | flipit_toggle(); | 308 | flipit_toggle(); |
401 | #if LCD_DEPTH >= 2 | ||
402 | draw_cursor(); | 309 | draw_cursor(); |
403 | #endif | ||
404 | rb->lcd_update(); | 310 | rb->lcd_update(); |
405 | } | 311 | } |
406 | break; | 312 | break; |