diff options
author | Björn Stenberg <bjorn@haxx.se> | 2006-03-19 12:31:13 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2006-03-19 12:31:13 +0000 |
commit | 958d6ac278dc589ffc02ac994d0699de05cf20c8 (patch) | |
tree | c76c685e63be4679b4b421bb4dc9231012067114 /apps | |
parent | 5b4307ed0c341cad2ad5b95b2b205a68743e4716 (diff) | |
download | rockbox-958d6ac278dc589ffc02ac994d0699de05cf20c8.tar.gz rockbox-958d6ac278dc589ffc02ac994d0699de05cf20c8.zip |
Renamed Bejeweled to Jewels, for trademark reasons.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9116 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/SOURCES | 2 | ||||
-rw-r--r-- | apps/plugins/bitmaps/native/SOURCES | 18 | ||||
-rw-r--r-- | apps/plugins/jewels.c | 330 |
3 files changed, 175 insertions, 175 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index d89a524444..9f93d1f1b9 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -30,7 +30,7 @@ mandelbrot.c | |||
30 | plasma.c | 30 | plasma.c |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | bejeweled.c | 33 | jewels.c |
34 | bounce.c | 34 | bounce.c |
35 | 35 | ||
36 | #if (LCD_WIDTH != 138) && (LCD_WIDTH != 128) | 36 | #if (LCD_WIDTH != 138) && (LCD_WIDTH != 128) |
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 83c522e053..f2d3076418 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES | |||
@@ -2,23 +2,23 @@ | |||
2 | 2 | ||
3 | /* Bejeweled */ | 3 | /* Bejeweled */ |
4 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | 4 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) |
5 | bejeweled_jewels.112x64x1.bmp | 5 | jewels.112x64x1.bmp |
6 | #elif (LCD_WIDTH == 128) && (LCD_HEIGHT == 64) | 6 | #elif (LCD_WIDTH == 128) && (LCD_HEIGHT == 64) |
7 | bejeweled_jewels.112x64x1.bmp | 7 | jewels.112x64x1.bmp |
8 | #elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110) | 8 | #elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110) |
9 | bejeweled_jewels.138x110x1.bmp | 9 | jewels.138x110x1.bmp |
10 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) | 10 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && !defined(HAVE_LCD_COLOR) |
11 | bejeweled_jewels.160x128x1.bmp | 11 | jewels.160x128x1.bmp |
12 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && defined(HAVE_LCD_COLOR) | 12 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && defined(HAVE_LCD_COLOR) |
13 | bejeweled_jewels.160x128x16.bmp | 13 | jewels.160x128x16.bmp |
14 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) | 14 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) |
15 | bejeweled_jewels.160x128x16.bmp | 15 | jewels.160x128x16.bmp |
16 | #elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176) | 16 | #elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176) |
17 | bejeweled_jewels.220x176x16.bmp | 17 | jewels.220x176x16.bmp |
18 | #elif (LCD_WIDTH == 240) && (LCD_HEIGHT == 320) | 18 | #elif (LCD_WIDTH == 240) && (LCD_HEIGHT == 320) |
19 | bejeweled_jewels.220x176x16.bmp | 19 | jewels.220x176x16.bmp |
20 | #elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) | 20 | #elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) |
21 | bejeweled_jewels.320x240x16.bmp | 21 | jewels.320x240x16.bmp |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | /* ChessBox */ | 24 | /* ChessBox */ |
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c index 666827668f..2fe86e8826 100644 --- a/apps/plugins/jewels.c +++ b/apps/plugins/jewels.c | |||
@@ -27,67 +27,67 @@ PLUGIN_HEADER | |||
27 | 27 | ||
28 | /* button definitions, every keypad must only have directions & select */ | 28 | /* button definitions, every keypad must only have directions & select */ |
29 | #if CONFIG_KEYPAD == RECORDER_PAD | 29 | #if CONFIG_KEYPAD == RECORDER_PAD |
30 | #define BEJEWELED_UP BUTTON_UP | 30 | #define JEWELS_UP BUTTON_UP |
31 | #define BEJEWELED_DOWN BUTTON_DOWN | 31 | #define JEWELS_DOWN BUTTON_DOWN |
32 | #define BEJEWELED_LEFT BUTTON_LEFT | 32 | #define JEWELS_LEFT BUTTON_LEFT |
33 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 33 | #define JEWELS_RIGHT BUTTON_RIGHT |
34 | #define BEJEWELED_SELECT BUTTON_PLAY | 34 | #define JEWELS_SELECT BUTTON_PLAY |
35 | #define BEJEWELED_CANCEL BUTTON_OFF | 35 | #define JEWELS_CANCEL BUTTON_OFF |
36 | 36 | ||
37 | #elif CONFIG_KEYPAD == ONDIO_PAD | 37 | #elif CONFIG_KEYPAD == ONDIO_PAD |
38 | #define BEJEWELED_UP BUTTON_UP | 38 | #define JEWELS_UP BUTTON_UP |
39 | #define BEJEWELED_DOWN BUTTON_DOWN | 39 | #define JEWELS_DOWN BUTTON_DOWN |
40 | #define BEJEWELED_LEFT BUTTON_LEFT | 40 | #define JEWELS_LEFT BUTTON_LEFT |
41 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 41 | #define JEWELS_RIGHT BUTTON_RIGHT |
42 | #define BEJEWELED_SELECT BUTTON_MENU | 42 | #define JEWELS_SELECT BUTTON_MENU |
43 | #define BEJEWELED_CANCEL BUTTON_OFF | 43 | #define JEWELS_CANCEL BUTTON_OFF |
44 | 44 | ||
45 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) | 45 | #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) |
46 | #define BEJEWELED_UP BUTTON_UP | 46 | #define JEWELS_UP BUTTON_UP |
47 | #define BEJEWELED_DOWN BUTTON_DOWN | 47 | #define JEWELS_DOWN BUTTON_DOWN |
48 | #define BEJEWELED_LEFT BUTTON_LEFT | 48 | #define JEWELS_LEFT BUTTON_LEFT |
49 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 49 | #define JEWELS_RIGHT BUTTON_RIGHT |
50 | #define BEJEWELED_SELECT BUTTON_SELECT | 50 | #define JEWELS_SELECT BUTTON_SELECT |
51 | #define BEJEWELED_CANCEL BUTTON_OFF | 51 | #define JEWELS_CANCEL BUTTON_OFF |
52 | 52 | ||
53 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD) | 53 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD) |
54 | #define BEJEWELED_SCROLLWHEEL | 54 | #define JEWELS_SCROLLWHEEL |
55 | #define BEJEWELED_UP BUTTON_MENU | 55 | #define JEWELS_UP BUTTON_MENU |
56 | #define BEJEWELED_DOWN BUTTON_PLAY | 56 | #define JEWELS_DOWN BUTTON_PLAY |
57 | #define BEJEWELED_LEFT BUTTON_LEFT | 57 | #define JEWELS_LEFT BUTTON_LEFT |
58 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 58 | #define JEWELS_RIGHT BUTTON_RIGHT |
59 | #define BEJEWELED_PREV BUTTON_SCROLL_BACK | 59 | #define JEWELS_PREV BUTTON_SCROLL_BACK |
60 | #define BEJEWELED_NEXT BUTTON_SCROLL_FWD | 60 | #define JEWELS_NEXT BUTTON_SCROLL_FWD |
61 | #define BEJEWELED_SELECT BUTTON_SELECT | 61 | #define JEWELS_SELECT BUTTON_SELECT |
62 | 62 | ||
63 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD | 63 | #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD |
64 | #define BEJEWELED_UP BUTTON_UP | 64 | #define JEWELS_UP BUTTON_UP |
65 | #define BEJEWELED_DOWN BUTTON_DOWN | 65 | #define JEWELS_DOWN BUTTON_DOWN |
66 | #define BEJEWELED_LEFT BUTTON_LEFT | 66 | #define JEWELS_LEFT BUTTON_LEFT |
67 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 67 | #define JEWELS_RIGHT BUTTON_RIGHT |
68 | #define BEJEWELED_SELECT BUTTON_SELECT | 68 | #define JEWELS_SELECT BUTTON_SELECT |
69 | #define BEJEWELED_CANCEL BUTTON_PLAY | 69 | #define JEWELS_CANCEL BUTTON_PLAY |
70 | 70 | ||
71 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD | 71 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD |
72 | #define BEJEWELED_UP BUTTON_UP | 72 | #define JEWELS_UP BUTTON_UP |
73 | #define BEJEWELED_DOWN BUTTON_DOWN | 73 | #define JEWELS_DOWN BUTTON_DOWN |
74 | #define BEJEWELED_LEFT BUTTON_LEFT | 74 | #define JEWELS_LEFT BUTTON_LEFT |
75 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 75 | #define JEWELS_RIGHT BUTTON_RIGHT |
76 | #define BEJEWELED_SELECT BUTTON_SELECT | 76 | #define JEWELS_SELECT BUTTON_SELECT |
77 | #define BEJEWELED_CANCEL BUTTON_PLAY | 77 | #define JEWELS_CANCEL BUTTON_PLAY |
78 | 78 | ||
79 | #elif CONFIG_KEYPAD == GIGABEAT_PAD | 79 | #elif CONFIG_KEYPAD == GIGABEAT_PAD |
80 | #define BEJEWELED_UP BUTTON_UP | 80 | #define JEWELS_UP BUTTON_UP |
81 | #define BEJEWELED_DOWN BUTTON_DOWN | 81 | #define JEWELS_DOWN BUTTON_DOWN |
82 | #define BEJEWELED_LEFT BUTTON_LEFT | 82 | #define JEWELS_LEFT BUTTON_LEFT |
83 | #define BEJEWELED_RIGHT BUTTON_RIGHT | 83 | #define JEWELS_RIGHT BUTTON_RIGHT |
84 | #define BEJEWELED_QUIT BUTTON_A | 84 | #define JEWELS_QUIT BUTTON_A |
85 | #define BEJEWELED_START BUTTON_POWER | 85 | #define JEWELS_START BUTTON_POWER |
86 | #define BEJEWELED_SELECT BUTTON_SELECT | 86 | #define JEWELS_SELECT BUTTON_SELECT |
87 | #define BEJEWELED_RESUME BUTTON_MENU | 87 | #define JEWELS_RESUME BUTTON_MENU |
88 | 88 | ||
89 | #else | 89 | #else |
90 | #error BEJEWELED: Unsupported keypad | 90 | #error JEWELS: Unsupported keypad |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | /* use 30x30 tiles (iPod Video) */ | 93 | /* use 30x30 tiles (iPod Video) */ |
@@ -140,12 +140,12 @@ PLUGIN_HEADER | |||
140 | #define NUM_SCORES 8 | 140 | #define NUM_SCORES 8 |
141 | 141 | ||
142 | #else | 142 | #else |
143 | #error BEJEWELED: Unsupported LCD | 143 | #error JEWELS: Unsupported LCD |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | /* save files */ | 146 | /* save files */ |
147 | #define SCORE_FILE PLUGIN_DIR "/bejeweled.score" | 147 | #define SCORE_FILE PLUGIN_DIR "/jewels.score" |
148 | #define SAVE_FILE PLUGIN_DIR "/bejeweled.save" | 148 | #define SAVE_FILE PLUGIN_DIR "/jewels.save" |
149 | 149 | ||
150 | /* final game return status */ | 150 | /* final game return status */ |
151 | #define BJ_END 3 | 151 | #define BJ_END 3 |
@@ -194,17 +194,17 @@ enum menu_cmd { | |||
194 | }; | 194 | }; |
195 | 195 | ||
196 | /* menus */ | 196 | /* menus */ |
197 | struct bejeweled_menu { | 197 | struct jewels_menu { |
198 | char *title; | 198 | char *title; |
199 | bool hasframe; | 199 | bool hasframe; |
200 | int selected; | 200 | int selected; |
201 | int itemcnt; | 201 | int itemcnt; |
202 | struct bejeweled_menuitem { | 202 | struct jewels_menuitem { |
203 | char *text; | 203 | char *text; |
204 | enum menu_result res; | 204 | enum menu_result res; |
205 | } items[MAX_MITEMS]; | 205 | } items[MAX_MITEMS]; |
206 | } bjmenu[] = { | 206 | } bjmenu[] = { |
207 | {"Bejeweled", false, 0, 5, | 207 | {"Jewels", false, 0, 5, |
208 | {{"New Game", MRES_NEW}, | 208 | {{"New Game", MRES_NEW}, |
209 | {"Resume Game", MRES_RESUME}, | 209 | {"Resume Game", MRES_RESUME}, |
210 | {"High Scores", MRES_SCORES}, | 210 | {"High Scores", MRES_SCORES}, |
@@ -220,11 +220,11 @@ struct bejeweled_menu { | |||
220 | static struct plugin_api* rb; | 220 | static struct plugin_api* rb; |
221 | 221 | ||
222 | /* external bitmaps */ | 222 | /* external bitmaps */ |
223 | extern const fb_data bejeweled_jewels[]; | 223 | extern const fb_data jewels[]; |
224 | 224 | ||
225 | /* tile background colors */ | 225 | /* tile background colors */ |
226 | #ifdef HAVE_LCD_COLOR | 226 | #ifdef HAVE_LCD_COLOR |
227 | static const unsigned bejeweled_bkgd[2] = { | 227 | static const unsigned jewels_bkgd[2] = { |
228 | LCD_RGBPACK(104, 63, 63), | 228 | LCD_RGBPACK(104, 63, 63), |
229 | LCD_RGBPACK(83, 44, 44) | 229 | LCD_RGBPACK(83, 44, 44) |
230 | }; | 230 | }; |
@@ -261,9 +261,9 @@ struct game_context { | |||
261 | }; | 261 | }; |
262 | 262 | ||
263 | /***************************************************************************** | 263 | /***************************************************************************** |
264 | * bejeweled_init() initializes bejeweled data structures. | 264 | * jewels_init() initializes jewels data structures. |
265 | ******************************************************************************/ | 265 | ******************************************************************************/ |
266 | static void bejeweled_init(struct game_context* bj) { | 266 | static void jewels_init(struct game_context* bj) { |
267 | /* seed the rand generator */ | 267 | /* seed the rand generator */ |
268 | rb->srand(*rb->current_tick); | 268 | rb->srand(*rb->current_tick); |
269 | 269 | ||
@@ -283,9 +283,9 @@ static void bejeweled_init(struct game_context* bj) { | |||
283 | } | 283 | } |
284 | 284 | ||
285 | /***************************************************************************** | 285 | /***************************************************************************** |
286 | * bejeweled_setcolors() set the foreground and background colors. | 286 | * jewels_setcolors() set the foreground and background colors. |
287 | ******************************************************************************/ | 287 | ******************************************************************************/ |
288 | static inline void bejeweled_setcolors(void) { | 288 | static inline void jewels_setcolors(void) { |
289 | #ifdef HAVE_LCD_COLOR | 289 | #ifdef HAVE_LCD_COLOR |
290 | rb->lcd_set_background(LCD_RGBPACK(49, 26, 26)); | 290 | rb->lcd_set_background(LCD_RGBPACK(49, 26, 26)); |
291 | rb->lcd_set_foreground(LCD_RGBPACK(210, 181, 181)); | 291 | rb->lcd_set_foreground(LCD_RGBPACK(210, 181, 181)); |
@@ -293,9 +293,9 @@ static inline void bejeweled_setcolors(void) { | |||
293 | } | 293 | } |
294 | 294 | ||
295 | /***************************************************************************** | 295 | /***************************************************************************** |
296 | * bejeweled_drawboard() redraws the entire game board. | 296 | * jewels_drawboard() redraws the entire game board. |
297 | ******************************************************************************/ | 297 | ******************************************************************************/ |
298 | static void bejeweled_drawboard(struct game_context* bj) { | 298 | static void jewels_drawboard(struct game_context* bj) { |
299 | int i, j; | 299 | int i, j; |
300 | int w, h; | 300 | int w, h; |
301 | unsigned int tempscore; | 301 | unsigned int tempscore; |
@@ -316,15 +316,15 @@ static void bejeweled_drawboard(struct game_context* bj) { | |||
316 | for(i=0; i<BJ_HEIGHT-1; i++){ | 316 | for(i=0; i<BJ_HEIGHT-1; i++){ |
317 | for(j=0; j<BJ_WIDTH; j++){ | 317 | for(j=0; j<BJ_WIDTH; j++){ |
318 | #ifdef HAVE_LCD_COLOR | 318 | #ifdef HAVE_LCD_COLOR |
319 | rb->lcd_set_foreground(bejeweled_bkgd[(i+j)%2]); | 319 | rb->lcd_set_foreground(jewels_bkgd[(i+j)%2]); |
320 | rb->lcd_fillrect(j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, | 320 | rb->lcd_fillrect(j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, |
321 | TILE_WIDTH, TILE_HEIGHT); | 321 | TILE_WIDTH, TILE_HEIGHT); |
322 | rb->lcd_bitmap_transparent_part(bejeweled_jewels, | 322 | rb->lcd_bitmap_transparent_part(jewels, |
323 | 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), | 323 | 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), |
324 | TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, | 324 | TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, |
325 | TILE_WIDTH, TILE_HEIGHT); | 325 | TILE_WIDTH, TILE_HEIGHT); |
326 | #else | 326 | #else |
327 | rb->lcd_bitmap_part(bejeweled_jewels, | 327 | rb->lcd_bitmap_part(jewels, |
328 | 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), | 328 | 0, TILE_HEIGHT*(bj->playboard[i+1][j].type), |
329 | TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, | 329 | TILE_WIDTH, j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, |
330 | TILE_WIDTH, TILE_HEIGHT); | 330 | TILE_WIDTH, TILE_HEIGHT); |
@@ -348,7 +348,7 @@ static void bejeweled_drawboard(struct game_context* bj) { | |||
348 | tempscore/LEVEL_PTS)+1, | 348 | tempscore/LEVEL_PTS)+1, |
349 | (LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/2-2, | 349 | (LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/2-2, |
350 | ((LCD_HEIGHT-10)-18)*tempscore/LEVEL_PTS-1); | 350 | ((LCD_HEIGHT-10)-18)*tempscore/LEVEL_PTS-1); |
351 | bejeweled_setcolors(); | 351 | jewels_setcolors(); |
352 | rb->lcd_drawrect(BJ_WIDTH*TILE_WIDTH+(LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/4, | 352 | rb->lcd_drawrect(BJ_WIDTH*TILE_WIDTH+(LCD_WIDTH-BJ_WIDTH*TILE_WIDTH)/4, |
353 | (LCD_HEIGHT-10)-(((LCD_HEIGHT-10)-18)* | 353 | (LCD_HEIGHT-10)-(((LCD_HEIGHT-10)-18)* |
354 | tempscore/LEVEL_PTS), | 354 | tempscore/LEVEL_PTS), |
@@ -373,10 +373,10 @@ static void bejeweled_drawboard(struct game_context* bj) { | |||
373 | } | 373 | } |
374 | 374 | ||
375 | /***************************************************************************** | 375 | /***************************************************************************** |
376 | * bejeweled_showmenu() displays the chosen menu after performing the chosen | 376 | * jewels_showmenu() displays the chosen menu after performing the chosen |
377 | * menu command. | 377 | * menu command. |
378 | ******************************************************************************/ | 378 | ******************************************************************************/ |
379 | static enum menu_result bejeweled_showmenu(struct bejeweled_menu* menu, | 379 | static enum menu_result jewels_showmenu(struct jewels_menu* menu, |
380 | enum menu_cmd cmd) { | 380 | enum menu_cmd cmd) { |
381 | int i; | 381 | int i; |
382 | int w, h; | 382 | int w, h; |
@@ -438,10 +438,10 @@ static enum menu_result bejeweled_showmenu(struct bejeweled_menu* menu, | |||
438 | } | 438 | } |
439 | 439 | ||
440 | /***************************************************************************** | 440 | /***************************************************************************** |
441 | * bejeweled_putjewels() makes the jewels fall to fill empty spots and adds | 441 | * jewels_putjewels() makes the jewels fall to fill empty spots and adds |
442 | * new random jewels at the empty spots at the top of each row. | 442 | * new random jewels at the empty spots at the top of each row. |
443 | ******************************************************************************/ | 443 | ******************************************************************************/ |
444 | static void bejeweled_putjewels(struct game_context* bj){ | 444 | static void jewels_putjewels(struct game_context* bj){ |
445 | int i, j, k; | 445 | int i, j, k; |
446 | bool mark, done; | 446 | bool mark, done; |
447 | long lasttick, currenttick; | 447 | long lasttick, currenttick; |
@@ -485,12 +485,12 @@ static void bejeweled_putjewels(struct game_context* bj){ | |||
485 | if(i == 0 && YOFS) { | 485 | if(i == 0 && YOFS) { |
486 | rb->lcd_set_foreground(rb->lcd_get_background()); | 486 | rb->lcd_set_foreground(rb->lcd_get_background()); |
487 | } else { | 487 | } else { |
488 | rb->lcd_set_foreground(bejeweled_bkgd[(i-1+j)%2]); | 488 | rb->lcd_set_foreground(jewels_bkgd[(i-1+j)%2]); |
489 | } | 489 | } |
490 | rb->lcd_fillrect(j*TILE_WIDTH, (i-1)*TILE_HEIGHT+YOFS, | 490 | rb->lcd_fillrect(j*TILE_WIDTH, (i-1)*TILE_HEIGHT+YOFS, |
491 | TILE_WIDTH, TILE_HEIGHT); | 491 | TILE_WIDTH, TILE_HEIGHT); |
492 | if(bj->playboard[i+1][j].type == 0) { | 492 | if(bj->playboard[i+1][j].type == 0) { |
493 | rb->lcd_set_foreground(bejeweled_bkgd[(i+j)%2]); | 493 | rb->lcd_set_foreground(jewels_bkgd[(i+j)%2]); |
494 | rb->lcd_fillrect(j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, | 494 | rb->lcd_fillrect(j*TILE_WIDTH, i*TILE_HEIGHT+YOFS, |
495 | TILE_WIDTH, TILE_HEIGHT); | 495 | TILE_WIDTH, TILE_HEIGHT); |
496 | } | 496 | } |
@@ -507,14 +507,14 @@ static void bejeweled_putjewels(struct game_context* bj){ | |||
507 | 507 | ||
508 | /* draw new position */ | 508 | /* draw new position */ |
509 | #ifdef HAVE_LCD_COLOR | 509 | #ifdef HAVE_LCD_COLOR |
510 | rb->lcd_bitmap_transparent_part(bejeweled_jewels, 0, | 510 | rb->lcd_bitmap_transparent_part(jewels, 0, |
511 | TILE_HEIGHT*(bj->playboard[i][j].type), | 511 | TILE_HEIGHT*(bj->playboard[i][j].type), |
512 | TILE_WIDTH, j*TILE_WIDTH, | 512 | TILE_WIDTH, j*TILE_WIDTH, |
513 | (i-1)*TILE_HEIGHT+YOFS+ | 513 | (i-1)*TILE_HEIGHT+YOFS+ |
514 | ((((TILE_HEIGHT<<10)*k)/8)>>10), | 514 | ((((TILE_HEIGHT<<10)*k)/8)>>10), |
515 | TILE_WIDTH, TILE_HEIGHT); | 515 | TILE_WIDTH, TILE_HEIGHT); |
516 | #else | 516 | #else |
517 | rb->lcd_bitmap_part(bejeweled_jewels, 0, | 517 | rb->lcd_bitmap_part(jewels, 0, |
518 | TILE_HEIGHT*(bj->playboard[i][j].type), | 518 | TILE_HEIGHT*(bj->playboard[i][j].type), |
519 | TILE_WIDTH, j*TILE_WIDTH, | 519 | TILE_WIDTH, j*TILE_WIDTH, |
520 | (i-1)*TILE_HEIGHT+YOFS+ | 520 | (i-1)*TILE_HEIGHT+YOFS+ |
@@ -526,7 +526,7 @@ static void bejeweled_putjewels(struct game_context* bj){ | |||
526 | } | 526 | } |
527 | 527 | ||
528 | rb->lcd_update_rect(0, 0, TILE_WIDTH*8, LCD_HEIGHT); | 528 | rb->lcd_update_rect(0, 0, TILE_WIDTH*8, LCD_HEIGHT); |
529 | bejeweled_setcolors(); | 529 | jewels_setcolors(); |
530 | 530 | ||
531 | /* framerate limiting */ | 531 | /* framerate limiting */ |
532 | currenttick = *rb->current_tick; | 532 | currenttick = *rb->current_tick; |
@@ -562,10 +562,10 @@ static void bejeweled_putjewels(struct game_context* bj){ | |||
562 | } | 562 | } |
563 | 563 | ||
564 | /***************************************************************************** | 564 | /***************************************************************************** |
565 | * bejeweled_clearjewels() finds all the connected rows and columns and | 565 | * jewels_clearjewels() finds all the connected rows and columns and |
566 | * calculates and returns the points earned. | 566 | * calculates and returns the points earned. |
567 | ******************************************************************************/ | 567 | ******************************************************************************/ |
568 | static unsigned int bejeweled_clearjewels(struct game_context* bj) { | 568 | static unsigned int jewels_clearjewels(struct game_context* bj) { |
569 | int i, j; | 569 | int i, j; |
570 | int last, run; | 570 | int last, run; |
571 | unsigned int points = 0; | 571 | unsigned int points = 0; |
@@ -636,29 +636,29 @@ static unsigned int bejeweled_clearjewels(struct game_context* bj) { | |||
636 | } | 636 | } |
637 | 637 | ||
638 | /***************************************************************************** | 638 | /***************************************************************************** |
639 | * bejeweled_runboard() runs the board until it settles in a fixed state and | 639 | * jewels_runboard() runs the board until it settles in a fixed state and |
640 | * returns points earned. | 640 | * returns points earned. |
641 | ******************************************************************************/ | 641 | ******************************************************************************/ |
642 | static unsigned int bejeweled_runboard(struct game_context* bj) { | 642 | static unsigned int jewels_runboard(struct game_context* bj) { |
643 | unsigned int points = 0; | 643 | unsigned int points = 0; |
644 | unsigned int ret; | 644 | unsigned int ret; |
645 | 645 | ||
646 | bj->segments = 0; | 646 | bj->segments = 0; |
647 | 647 | ||
648 | while((ret = bejeweled_clearjewels(bj)) > 0) { | 648 | while((ret = jewels_clearjewels(bj)) > 0) { |
649 | points += ret; | 649 | points += ret; |
650 | bejeweled_drawboard(bj); | 650 | jewels_drawboard(bj); |
651 | bejeweled_putjewels(bj); | 651 | jewels_putjewels(bj); |
652 | } | 652 | } |
653 | 653 | ||
654 | return points; | 654 | return points; |
655 | } | 655 | } |
656 | 656 | ||
657 | /***************************************************************************** | 657 | /***************************************************************************** |
658 | * bejeweled_swapjewels() swaps two jewels as long as it results in points and | 658 | * jewels_swapjewels() swaps two jewels as long as it results in points and |
659 | * returns points earned. | 659 | * returns points earned. |
660 | ******************************************************************************/ | 660 | ******************************************************************************/ |
661 | static unsigned int bejeweled_swapjewels(struct game_context* bj, | 661 | static unsigned int jewels_swapjewels(struct game_context* bj, |
662 | int x, int y, int direc) { | 662 | int x, int y, int direc) { |
663 | int k; | 663 | int k; |
664 | int horzmod, vertmod; | 664 | int horzmod, vertmod; |
@@ -710,11 +710,11 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
710 | for(k=0; k<=8; k++) { | 710 | for(k=0; k<=8; k++) { |
711 | /* clear old position */ | 711 | /* clear old position */ |
712 | #ifdef HAVE_LCD_COLOR | 712 | #ifdef HAVE_LCD_COLOR |
713 | rb->lcd_set_foreground(bejeweled_bkgd[(x+y)%2]); | 713 | rb->lcd_set_foreground(jewels_bkgd[(x+y)%2]); |
714 | rb->lcd_fillrect(x*TILE_WIDTH, | 714 | rb->lcd_fillrect(x*TILE_WIDTH, |
715 | y*TILE_HEIGHT+YOFS, | 715 | y*TILE_HEIGHT+YOFS, |
716 | TILE_WIDTH, TILE_HEIGHT); | 716 | TILE_WIDTH, TILE_HEIGHT); |
717 | rb->lcd_set_foreground(bejeweled_bkgd[(x+horzmod+y+vertmod)%2]); | 717 | rb->lcd_set_foreground(jewels_bkgd[(x+horzmod+y+vertmod)%2]); |
718 | rb->lcd_fillrect((x+horzmod)*TILE_WIDTH, | 718 | rb->lcd_fillrect((x+horzmod)*TILE_WIDTH, |
719 | (y+vertmod)*TILE_HEIGHT+YOFS, | 719 | (y+vertmod)*TILE_HEIGHT+YOFS, |
720 | TILE_WIDTH, TILE_HEIGHT); | 720 | TILE_WIDTH, TILE_HEIGHT); |
@@ -730,7 +730,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
730 | #endif | 730 | #endif |
731 | /* draw new position */ | 731 | /* draw new position */ |
732 | #ifdef HAVE_LCD_COLOR | 732 | #ifdef HAVE_LCD_COLOR |
733 | rb->lcd_bitmap_transparent_part(bejeweled_jewels, | 733 | rb->lcd_bitmap_transparent_part(jewels, |
734 | 0, TILE_HEIGHT*(bj->playboard | 734 | 0, TILE_HEIGHT*(bj->playboard |
735 | [y+1+vertmod][x+horzmod].type), TILE_WIDTH, | 735 | [y+1+vertmod][x+horzmod].type), TILE_WIDTH, |
736 | (x+horzmod)*TILE_WIDTH-horzmod* | 736 | (x+horzmod)*TILE_WIDTH-horzmod* |
@@ -738,7 +738,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
738 | (y+vertmod)*TILE_HEIGHT-vertmod* | 738 | (y+vertmod)*TILE_HEIGHT-vertmod* |
739 | ((((movelen<<10)*k)/8)>>10)+YOFS, | 739 | ((((movelen<<10)*k)/8)>>10)+YOFS, |
740 | TILE_WIDTH, TILE_HEIGHT); | 740 | TILE_WIDTH, TILE_HEIGHT); |
741 | rb->lcd_bitmap_transparent_part(bejeweled_jewels, | 741 | rb->lcd_bitmap_transparent_part(jewels, |
742 | 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), | 742 | 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), |
743 | TILE_WIDTH, x*TILE_WIDTH+horzmod* | 743 | TILE_WIDTH, x*TILE_WIDTH+horzmod* |
744 | ((((movelen<<10)*k)/8)>>10), | 744 | ((((movelen<<10)*k)/8)>>10), |
@@ -746,7 +746,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
746 | ((((movelen<<10)*k)/8)>>10)+YOFS, | 746 | ((((movelen<<10)*k)/8)>>10)+YOFS, |
747 | TILE_WIDTH, TILE_HEIGHT); | 747 | TILE_WIDTH, TILE_HEIGHT); |
748 | #else | 748 | #else |
749 | rb->lcd_bitmap_part(bejeweled_jewels, | 749 | rb->lcd_bitmap_part(jewels, |
750 | 0, TILE_HEIGHT*(bj->playboard | 750 | 0, TILE_HEIGHT*(bj->playboard |
751 | [y+1+vertmod][x+horzmod].type), TILE_WIDTH, | 751 | [y+1+vertmod][x+horzmod].type), TILE_WIDTH, |
752 | (x+horzmod)*TILE_WIDTH-horzmod* | 752 | (x+horzmod)*TILE_WIDTH-horzmod* |
@@ -755,7 +755,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
755 | ((((movelen<<10)*k)/8)>>10)+YOFS, | 755 | ((((movelen<<10)*k)/8)>>10)+YOFS, |
756 | TILE_WIDTH, TILE_HEIGHT); | 756 | TILE_WIDTH, TILE_HEIGHT); |
757 | rb->lcd_set_drawmode(DRMODE_FG); | 757 | rb->lcd_set_drawmode(DRMODE_FG); |
758 | rb->lcd_bitmap_part(bejeweled_jewels, | 758 | rb->lcd_bitmap_part(jewels, |
759 | 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), | 759 | 0, TILE_HEIGHT*(bj->playboard[y+1][x].type), |
760 | TILE_WIDTH, x*TILE_WIDTH+horzmod* | 760 | TILE_WIDTH, x*TILE_WIDTH+horzmod* |
761 | ((((movelen<<10)*k)/8)>>10), | 761 | ((((movelen<<10)*k)/8)>>10), |
@@ -766,7 +766,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
766 | #endif | 766 | #endif |
767 | 767 | ||
768 | rb->lcd_update_rect(0, 0, TILE_WIDTH*8, LCD_HEIGHT); | 768 | rb->lcd_update_rect(0, 0, TILE_WIDTH*8, LCD_HEIGHT); |
769 | bejeweled_setcolors(); | 769 | jewels_setcolors(); |
770 | 770 | ||
771 | /* framerate limiting */ | 771 | /* framerate limiting */ |
772 | currenttick = *rb->current_tick; | 772 | currenttick = *rb->current_tick; |
@@ -786,7 +786,7 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
786 | 786 | ||
787 | if(undo) break; | 787 | if(undo) break; |
788 | 788 | ||
789 | points = bejeweled_runboard(bj); | 789 | points = jewels_runboard(bj); |
790 | if(points == 0) { | 790 | if(points == 0) { |
791 | undo = true; | 791 | undo = true; |
792 | } else { | 792 | } else { |
@@ -798,10 +798,10 @@ static unsigned int bejeweled_swapjewels(struct game_context* bj, | |||
798 | } | 798 | } |
799 | 799 | ||
800 | /***************************************************************************** | 800 | /***************************************************************************** |
801 | * bejeweled_movesavail() uses pattern matching to see if there are any | 801 | * jewels_movesavail() uses pattern matching to see if there are any |
802 | * available move left. | 802 | * available move left. |
803 | ******************************************************************************/ | 803 | ******************************************************************************/ |
804 | static bool bejeweled_movesavail(struct game_context* bj) { | 804 | static bool jewels_movesavail(struct game_context* bj) { |
805 | int i, j; | 805 | int i, j; |
806 | bool moves = false; | 806 | bool moves = false; |
807 | int mytype; | 807 | int mytype; |
@@ -894,10 +894,10 @@ static bool bejeweled_movesavail(struct game_context* bj) { | |||
894 | } | 894 | } |
895 | 895 | ||
896 | /***************************************************************************** | 896 | /***************************************************************************** |
897 | * bejeweled_nextlevel() advances the game to the next level and returns | 897 | * jewels_nextlevel() advances the game to the next level and returns |
898 | * points earned. | 898 | * points earned. |
899 | ******************************************************************************/ | 899 | ******************************************************************************/ |
900 | static unsigned int bejeweled_nextlevel(struct game_context* bj) { | 900 | static unsigned int jewels_nextlevel(struct game_context* bj) { |
901 | int i, x, y; | 901 | int i, x, y; |
902 | unsigned int points = 0; | 902 | unsigned int points = 0; |
903 | 903 | ||
@@ -906,7 +906,7 @@ static unsigned int bejeweled_nextlevel(struct game_context* bj) { | |||
906 | bj->score -= LEVEL_PTS; | 906 | bj->score -= LEVEL_PTS; |
907 | bj->level++; | 907 | bj->level++; |
908 | rb->splash(HZ*2, true, "Level %d", bj->level); | 908 | rb->splash(HZ*2, true, "Level %d", bj->level); |
909 | bejeweled_drawboard(bj); | 909 | jewels_drawboard(bj); |
910 | } | 910 | } |
911 | 911 | ||
912 | /* randomly clear some jewels */ | 912 | /* randomly clear some jewels */ |
@@ -919,11 +919,11 @@ static unsigned int bejeweled_nextlevel(struct game_context* bj) { | |||
919 | bj->playboard[y][x].type = 0; | 919 | bj->playboard[y][x].type = 0; |
920 | } | 920 | } |
921 | } | 921 | } |
922 | bejeweled_drawboard(bj); | 922 | jewels_drawboard(bj); |
923 | 923 | ||
924 | /* run the play board */ | 924 | /* run the play board */ |
925 | bejeweled_putjewels(bj); | 925 | jewels_putjewels(bj); |
926 | points += bejeweled_runboard(bj); | 926 | points += jewels_runboard(bj); |
927 | return points; | 927 | return points; |
928 | } | 928 | } |
929 | 929 | ||
@@ -931,7 +931,7 @@ static unsigned int bejeweled_nextlevel(struct game_context* bj) { | |||
931 | * bejeweld_recordscore() inserts a high score into the high scores list and | 931 | * bejeweld_recordscore() inserts a high score into the high scores list and |
932 | * returns the high score position. | 932 | * returns the high score position. |
933 | ******************************************************************************/ | 933 | ******************************************************************************/ |
934 | static int bejeweled_recordscore(struct game_context* bj) { | 934 | static int jewels_recordscore(struct game_context* bj) { |
935 | int i; | 935 | int i; |
936 | int position = 0; | 936 | int position = 0; |
937 | unsigned short current, temp; | 937 | unsigned short current, temp; |
@@ -957,9 +957,9 @@ static int bejeweled_recordscore(struct game_context* bj) { | |||
957 | } | 957 | } |
958 | 958 | ||
959 | /***************************************************************************** | 959 | /***************************************************************************** |
960 | * bejeweled_loadscores() loads the high scores saved file. | 960 | * jewels_loadscores() loads the high scores saved file. |
961 | ******************************************************************************/ | 961 | ******************************************************************************/ |
962 | static void bejeweled_loadscores(struct game_context* bj) { | 962 | static void jewels_loadscores(struct game_context* bj) { |
963 | int fd; | 963 | int fd; |
964 | 964 | ||
965 | bj->dirty = false; | 965 | bj->dirty = false; |
@@ -981,9 +981,9 @@ static void bejeweled_loadscores(struct game_context* bj) { | |||
981 | } | 981 | } |
982 | 982 | ||
983 | /***************************************************************************** | 983 | /***************************************************************************** |
984 | * bejeweled_savescores() saves the high scores saved file. | 984 | * jewels_savescores() saves the high scores saved file. |
985 | ******************************************************************************/ | 985 | ******************************************************************************/ |
986 | static void bejeweled_savescores(struct game_context* bj) { | 986 | static void jewels_savescores(struct game_context* bj) { |
987 | int fd; | 987 | int fd; |
988 | 988 | ||
989 | /* write out the high scores to the save file */ | 989 | /* write out the high scores to the save file */ |
@@ -994,9 +994,9 @@ static void bejeweled_savescores(struct game_context* bj) { | |||
994 | } | 994 | } |
995 | 995 | ||
996 | /***************************************************************************** | 996 | /***************************************************************************** |
997 | * bejeweled_loadgame() loads the saved game and returns load success. | 997 | * jewels_loadgame() loads the saved game and returns load success. |
998 | ******************************************************************************/ | 998 | ******************************************************************************/ |
999 | static bool bejeweled_loadgame(struct game_context* bj) { | 999 | static bool jewels_loadgame(struct game_context* bj) { |
1000 | int fd; | 1000 | int fd; |
1001 | bool loaded = false; | 1001 | bool loaded = false; |
1002 | 1002 | ||
@@ -1022,9 +1022,9 @@ static bool bejeweled_loadgame(struct game_context* bj) { | |||
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | /***************************************************************************** | 1024 | /***************************************************************************** |
1025 | * bejeweled_savegame() saves the current game state. | 1025 | * jewels_savegame() saves the current game state. |
1026 | ******************************************************************************/ | 1026 | ******************************************************************************/ |
1027 | static void bejeweled_savegame(struct game_context* bj) { | 1027 | static void jewels_savegame(struct game_context* bj) { |
1028 | int fd; | 1028 | int fd; |
1029 | 1029 | ||
1030 | /* write out the game state to the save file */ | 1030 | /* write out the game state to the save file */ |
@@ -1038,14 +1038,14 @@ static void bejeweled_savegame(struct game_context* bj) { | |||
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | /***************************************************************************** | 1040 | /***************************************************************************** |
1041 | * bejeweled_callback() is the default event handler callback which is called | 1041 | * jewels_callback() is the default event handler callback which is called |
1042 | * on usb connect and shutdown. | 1042 | * on usb connect and shutdown. |
1043 | ******************************************************************************/ | 1043 | ******************************************************************************/ |
1044 | static void bejeweled_callback(void* param) { | 1044 | static void jewels_callback(void* param) { |
1045 | struct game_context* bj = (struct game_context*) param; | 1045 | struct game_context* bj = (struct game_context*) param; |
1046 | if(bj->dirty) { | 1046 | if(bj->dirty) { |
1047 | rb->splash(HZ, true, "Saving high scores..."); | 1047 | rb->splash(HZ, true, "Saving high scores..."); |
1048 | bejeweled_savescores(bj); | 1048 | jewels_savescores(bj); |
1049 | } | 1049 | } |
1050 | } | 1050 | } |
1051 | 1051 | ||
@@ -1075,7 +1075,7 @@ static int bejeweled(struct game_context* bj) { | |||
1075 | rb->lcd_clear_display(); | 1075 | rb->lcd_clear_display(); |
1076 | 1076 | ||
1077 | while(!startgame) { | 1077 | while(!startgame) { |
1078 | res = bejeweled_showmenu(&bjmenu[0], cmd); | 1078 | res = jewels_showmenu(&bjmenu[0], cmd); |
1079 | cmd = MCMD_NONE; | 1079 | cmd = MCMD_NONE; |
1080 | 1080 | ||
1081 | rb->snprintf(str, 18, "High Score: %d", bj->highscores[0]); | 1081 | rb->snprintf(str, 18, "High Score: %d", bj->highscores[0]); |
@@ -1089,7 +1089,7 @@ static int bejeweled(struct game_context* bj) { | |||
1089 | continue; | 1089 | continue; |
1090 | 1090 | ||
1091 | case MRES_RESUME: | 1091 | case MRES_RESUME: |
1092 | if(!bejeweled_loadgame(bj)) { | 1092 | if(!jewels_loadgame(bj)) { |
1093 | rb->splash(HZ*2, true, "Nothing to resume"); | 1093 | rb->splash(HZ*2, true, "Nothing to resume"); |
1094 | rb->lcd_clear_display(); | 1094 | rb->lcd_clear_display(); |
1095 | } else { | 1095 | } else { |
@@ -1170,34 +1170,34 @@ static int bejeweled(struct game_context* bj) { | |||
1170 | /* handle menu button presses */ | 1170 | /* handle menu button presses */ |
1171 | button = rb->button_get(true); | 1171 | button = rb->button_get(true); |
1172 | switch(button){ | 1172 | switch(button){ |
1173 | #ifdef BEJEWELED_SCROLLWHEEL | 1173 | #ifdef JEWELS_SCROLLWHEEL |
1174 | case BEJEWELED_PREV: | 1174 | case JEWELS_PREV: |
1175 | #endif | 1175 | #endif |
1176 | case BEJEWELED_UP: | 1176 | case JEWELS_UP: |
1177 | case (BEJEWELED_UP|BUTTON_REPEAT): | 1177 | case (JEWELS_UP|BUTTON_REPEAT): |
1178 | cmd = MCMD_PREV; | 1178 | cmd = MCMD_PREV; |
1179 | break; | 1179 | break; |
1180 | 1180 | ||
1181 | #ifdef BEJEWELED_SCROLLWHEEL | 1181 | #ifdef JEWELS_SCROLLWHEEL |
1182 | case BEJEWELED_NEXT: | 1182 | case JEWELS_NEXT: |
1183 | #endif | 1183 | #endif |
1184 | case BEJEWELED_DOWN: | 1184 | case JEWELS_DOWN: |
1185 | case (BEJEWELED_DOWN|BUTTON_REPEAT): | 1185 | case (JEWELS_DOWN|BUTTON_REPEAT): |
1186 | cmd = MCMD_NEXT; | 1186 | cmd = MCMD_NEXT; |
1187 | break; | 1187 | break; |
1188 | 1188 | ||
1189 | case BEJEWELED_SELECT: | 1189 | case JEWELS_SELECT: |
1190 | case BEJEWELED_RIGHT: | 1190 | case JEWELS_RIGHT: |
1191 | cmd = MCMD_SELECT; | 1191 | cmd = MCMD_SELECT; |
1192 | break; | 1192 | break; |
1193 | 1193 | ||
1194 | #ifdef BEJEWELED_CANCEL | 1194 | #ifdef JEWELS_CANCEL |
1195 | case BEJEWELED_CANCEL: | 1195 | case JEWELS_CANCEL: |
1196 | return BJ_QUIT; | 1196 | return BJ_QUIT; |
1197 | #endif | 1197 | #endif |
1198 | 1198 | ||
1199 | default: | 1199 | default: |
1200 | if(rb->default_event_handler_ex(button, bejeweled_callback, | 1200 | if(rb->default_event_handler_ex(button, jewels_callback, |
1201 | (void*) bj) == SYS_USB_CONNECTED) | 1201 | (void*) bj) == SYS_USB_CONNECTED) |
1202 | return BJ_USB; | 1202 | return BJ_USB; |
1203 | break; | 1203 | break; |
@@ -1207,15 +1207,15 @@ static int bejeweled(struct game_context* bj) { | |||
1207 | /******************** | 1207 | /******************** |
1208 | * init * | 1208 | * init * |
1209 | ********************/ | 1209 | ********************/ |
1210 | bejeweled_init(bj); | 1210 | jewels_init(bj); |
1211 | 1211 | ||
1212 | /******************** | 1212 | /******************** |
1213 | * setup the board * | 1213 | * setup the board * |
1214 | ********************/ | 1214 | ********************/ |
1215 | bejeweled_drawboard(bj); | 1215 | jewels_drawboard(bj); |
1216 | bejeweled_putjewels(bj); | 1216 | jewels_putjewels(bj); |
1217 | bj->score += bejeweled_runboard(bj); | 1217 | bj->score += jewels_runboard(bj); |
1218 | if (!bejeweled_movesavail(bj)) return BJ_LOSE; | 1218 | if (!jewels_movesavail(bj)) return BJ_LOSE; |
1219 | 1219 | ||
1220 | /********************** | 1220 | /********************** |
1221 | * play * | 1221 | * play * |
@@ -1223,7 +1223,7 @@ static int bejeweled(struct game_context* bj) { | |||
1223 | while(true) { | 1223 | while(true) { |
1224 | if(!inmenu) { | 1224 | if(!inmenu) { |
1225 | /* refresh the board */ | 1225 | /* refresh the board */ |
1226 | bejeweled_drawboard(bj); | 1226 | jewels_drawboard(bj); |
1227 | 1227 | ||
1228 | /* display the cursor */ | 1228 | /* display the cursor */ |
1229 | if(selected) { | 1229 | if(selected) { |
@@ -1238,7 +1238,7 @@ static int bejeweled(struct game_context* bj) { | |||
1238 | rb->lcd_update_rect(x*TILE_WIDTH, y*TILE_HEIGHT+YOFS, | 1238 | rb->lcd_update_rect(x*TILE_WIDTH, y*TILE_HEIGHT+YOFS, |
1239 | TILE_WIDTH, TILE_HEIGHT); | 1239 | TILE_WIDTH, TILE_HEIGHT); |
1240 | } else { | 1240 | } else { |
1241 | res = bejeweled_showmenu(&bjmenu[1], cmd); | 1241 | res = jewels_showmenu(&bjmenu[1], cmd); |
1242 | cmd = MCMD_NONE; | 1242 | cmd = MCMD_NONE; |
1243 | switch(res) { | 1243 | switch(res) { |
1244 | case MRES_RESUME: | 1244 | case MRES_RESUME: |
@@ -1248,7 +1248,7 @@ static int bejeweled(struct game_context* bj) { | |||
1248 | 1248 | ||
1249 | case MRES_SAVE: | 1249 | case MRES_SAVE: |
1250 | rb->splash(HZ, true, "Saving game..."); | 1250 | rb->splash(HZ, true, "Saving game..."); |
1251 | bejeweled_savegame(bj); | 1251 | jewels_savegame(bj); |
1252 | return BJ_END; | 1252 | return BJ_END; |
1253 | 1253 | ||
1254 | case MRES_QUIT: | 1254 | case MRES_QUIT: |
@@ -1262,24 +1262,24 @@ static int bejeweled(struct game_context* bj) { | |||
1262 | /* handle game button presses */ | 1262 | /* handle game button presses */ |
1263 | button = rb->button_get(true); | 1263 | button = rb->button_get(true); |
1264 | switch(button){ | 1264 | switch(button){ |
1265 | case BEJEWELED_LEFT: /* move cursor left */ | 1265 | case JEWELS_LEFT: /* move cursor left */ |
1266 | case (BEJEWELED_LEFT|BUTTON_REPEAT): | 1266 | case (JEWELS_LEFT|BUTTON_REPEAT): |
1267 | if(selected) { | 1267 | if(selected) { |
1268 | bj->score += bejeweled_swapjewels(bj, x, y, SWAP_LEFT); | 1268 | bj->score += jewels_swapjewels(bj, x, y, SWAP_LEFT); |
1269 | selected = false; | 1269 | selected = false; |
1270 | if (!bejeweled_movesavail(bj)) return BJ_LOSE; | 1270 | if (!jewels_movesavail(bj)) return BJ_LOSE; |
1271 | } else { | 1271 | } else { |
1272 | x = (x+BJ_WIDTH-1)%BJ_WIDTH; | 1272 | x = (x+BJ_WIDTH-1)%BJ_WIDTH; |
1273 | } | 1273 | } |
1274 | break; | 1274 | break; |
1275 | 1275 | ||
1276 | case BEJEWELED_RIGHT: /* move cursor right */ | 1276 | case JEWELS_RIGHT: /* move cursor right */ |
1277 | case (BEJEWELED_RIGHT|BUTTON_REPEAT): | 1277 | case (JEWELS_RIGHT|BUTTON_REPEAT): |
1278 | if(!inmenu) { | 1278 | if(!inmenu) { |
1279 | if(selected) { | 1279 | if(selected) { |
1280 | bj->score += bejeweled_swapjewels(bj, x, y, SWAP_RIGHT); | 1280 | bj->score += jewels_swapjewels(bj, x, y, SWAP_RIGHT); |
1281 | selected = false; | 1281 | selected = false; |
1282 | if (!bejeweled_movesavail(bj)) return BJ_LOSE; | 1282 | if (!jewels_movesavail(bj)) return BJ_LOSE; |
1283 | } else { | 1283 | } else { |
1284 | x = (x+1)%BJ_WIDTH; | 1284 | x = (x+1)%BJ_WIDTH; |
1285 | } | 1285 | } |
@@ -1288,13 +1288,13 @@ static int bejeweled(struct game_context* bj) { | |||
1288 | } | 1288 | } |
1289 | break; | 1289 | break; |
1290 | 1290 | ||
1291 | case BEJEWELED_DOWN: /* move cursor down */ | 1291 | case JEWELS_DOWN: /* move cursor down */ |
1292 | case (BEJEWELED_DOWN|BUTTON_REPEAT): | 1292 | case (JEWELS_DOWN|BUTTON_REPEAT): |
1293 | if(!inmenu) { | 1293 | if(!inmenu) { |
1294 | if(selected) { | 1294 | if(selected) { |
1295 | bj->score += bejeweled_swapjewels(bj, x, y, SWAP_DOWN); | 1295 | bj->score += jewels_swapjewels(bj, x, y, SWAP_DOWN); |
1296 | selected = false; | 1296 | selected = false; |
1297 | if (!bejeweled_movesavail(bj)) return BJ_LOSE; | 1297 | if (!jewels_movesavail(bj)) return BJ_LOSE; |
1298 | } else { | 1298 | } else { |
1299 | y = (y+1)%(BJ_HEIGHT-1); | 1299 | y = (y+1)%(BJ_HEIGHT-1); |
1300 | } | 1300 | } |
@@ -1303,13 +1303,13 @@ static int bejeweled(struct game_context* bj) { | |||
1303 | } | 1303 | } |
1304 | break; | 1304 | break; |
1305 | 1305 | ||
1306 | case BEJEWELED_UP: /* move cursor up */ | 1306 | case JEWELS_UP: /* move cursor up */ |
1307 | case (BEJEWELED_UP|BUTTON_REPEAT): | 1307 | case (JEWELS_UP|BUTTON_REPEAT): |
1308 | if(!inmenu) { | 1308 | if(!inmenu) { |
1309 | if(selected) { | 1309 | if(selected) { |
1310 | bj->score += bejeweled_swapjewels(bj, x, y, SWAP_UP); | 1310 | bj->score += jewels_swapjewels(bj, x, y, SWAP_UP); |
1311 | selected = false; | 1311 | selected = false; |
1312 | if (!bejeweled_movesavail(bj)) return BJ_LOSE; | 1312 | if (!jewels_movesavail(bj)) return BJ_LOSE; |
1313 | } else { | 1313 | } else { |
1314 | y = (y+(BJ_HEIGHT-1)-1)%(BJ_HEIGHT-1); | 1314 | y = (y+(BJ_HEIGHT-1)-1)%(BJ_HEIGHT-1); |
1315 | } | 1315 | } |
@@ -1318,9 +1318,9 @@ static int bejeweled(struct game_context* bj) { | |||
1318 | } | 1318 | } |
1319 | break; | 1319 | break; |
1320 | 1320 | ||
1321 | #ifdef BEJEWELED_SCROLLWHEEL | 1321 | #ifdef JEWELS_SCROLLWHEEL |
1322 | case BEJEWELED_PREV: /* scroll backwards */ | 1322 | case JEWELS_PREV: /* scroll backwards */ |
1323 | case (BEJEWELED_PREV|BUTTON_REPEAT): | 1323 | case (JEWELS_PREV|BUTTON_REPEAT): |
1324 | if(!inmenu) { | 1324 | if(!inmenu) { |
1325 | if(!selected) { | 1325 | if(!selected) { |
1326 | if(x == 0) { | 1326 | if(x == 0) { |
@@ -1333,8 +1333,8 @@ static int bejeweled(struct game_context* bj) { | |||
1333 | } | 1333 | } |
1334 | break; | 1334 | break; |
1335 | 1335 | ||
1336 | case BEJEWELED_NEXT: /* scroll forwards */ | 1336 | case JEWELS_NEXT: /* scroll forwards */ |
1337 | case (BEJEWELED_NEXT|BUTTON_REPEAT): | 1337 | case (JEWELS_NEXT|BUTTON_REPEAT): |
1338 | if(!inmenu) { | 1338 | if(!inmenu) { |
1339 | if(!selected) { | 1339 | if(!selected) { |
1340 | if(x == BJ_WIDTH-1) { | 1340 | if(x == BJ_WIDTH-1) { |
@@ -1348,7 +1348,7 @@ static int bejeweled(struct game_context* bj) { | |||
1348 | break; | 1348 | break; |
1349 | #endif | 1349 | #endif |
1350 | 1350 | ||
1351 | case BEJEWELED_SELECT: /* toggle selected */ | 1351 | case JEWELS_SELECT: /* toggle selected */ |
1352 | if(!inmenu) { | 1352 | if(!inmenu) { |
1353 | selected = !selected; | 1353 | selected = !selected; |
1354 | } else { | 1354 | } else { |
@@ -1356,25 +1356,25 @@ static int bejeweled(struct game_context* bj) { | |||
1356 | } | 1356 | } |
1357 | break; | 1357 | break; |
1358 | 1358 | ||
1359 | case (BEJEWELED_SELECT|BUTTON_REPEAT): /* show menu */ | 1359 | case (JEWELS_SELECT|BUTTON_REPEAT): /* show menu */ |
1360 | if(!inmenu) inmenu = true; | 1360 | if(!inmenu) inmenu = true; |
1361 | break; | 1361 | break; |
1362 | 1362 | ||
1363 | #ifdef BEJEWELED_CANCEL | 1363 | #ifdef JEWELS_CANCEL |
1364 | case BEJEWELED_CANCEL: /* toggle menu */ | 1364 | case JEWELS_CANCEL: /* toggle menu */ |
1365 | inmenu = !inmenu; | 1365 | inmenu = !inmenu; |
1366 | selected = false; | 1366 | selected = false; |
1367 | break; | 1367 | break; |
1368 | #endif | 1368 | #endif |
1369 | 1369 | ||
1370 | default: | 1370 | default: |
1371 | if(rb->default_event_handler_ex(button, bejeweled_callback, | 1371 | if(rb->default_event_handler_ex(button, jewels_callback, |
1372 | (void*) bj) == SYS_USB_CONNECTED) | 1372 | (void*) bj) == SYS_USB_CONNECTED) |
1373 | return BJ_USB; | 1373 | return BJ_USB; |
1374 | break; | 1374 | break; |
1375 | } | 1375 | } |
1376 | 1376 | ||
1377 | if(bj->score >= LEVEL_PTS) bj->score = bejeweled_nextlevel(bj); | 1377 | if(bj->score >= LEVEL_PTS) bj->score = jewels_nextlevel(bj); |
1378 | } | 1378 | } |
1379 | } | 1379 | } |
1380 | 1380 | ||
@@ -1393,10 +1393,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
1393 | /* end of plugin init */ | 1393 | /* end of plugin init */ |
1394 | 1394 | ||
1395 | /* load high scores */ | 1395 | /* load high scores */ |
1396 | bejeweled_loadscores(&bj); | 1396 | jewels_loadscores(&bj); |
1397 | 1397 | ||
1398 | rb->lcd_setfont(FONT_SYSFIXED); | 1398 | rb->lcd_setfont(FONT_SYSFIXED); |
1399 | bejeweled_setcolors(); | 1399 | jewels_setcolors(); |
1400 | 1400 | ||
1401 | while(!exit) { | 1401 | while(!exit) { |
1402 | switch(bejeweled(&bj)){ | 1402 | switch(bejeweled(&bj)){ |
@@ -1406,7 +1406,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
1406 | 1406 | ||
1407 | case BJ_END: | 1407 | case BJ_END: |
1408 | if(!bj.resume) { | 1408 | if(!bj.resume) { |
1409 | if((position = bejeweled_recordscore(&bj))) { | 1409 | if((position = jewels_recordscore(&bj))) { |
1410 | rb->snprintf(str, 19, "New high score #%d!", position); | 1410 | rb->snprintf(str, 19, "New high score #%d!", position); |
1411 | rb->splash(HZ*2, true, str); | 1411 | rb->splash(HZ*2, true, str); |
1412 | } | 1412 | } |
@@ -1420,7 +1420,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
1420 | case BJ_QUIT: | 1420 | case BJ_QUIT: |
1421 | if(bj.dirty) { | 1421 | if(bj.dirty) { |
1422 | rb->splash(HZ, true, "Saving high scores..."); | 1422 | rb->splash(HZ, true, "Saving high scores..."); |
1423 | bejeweled_savescores(&bj); | 1423 | jewels_savescores(&bj); |
1424 | } | 1424 | } |
1425 | exit = true; | 1425 | exit = true; |
1426 | break; | 1426 | break; |