diff options
author | Hristo Kovachev <bger@rockbox.org> | 2006-03-21 11:18:40 +0000 |
---|---|---|
committer | Hristo Kovachev <bger@rockbox.org> | 2006-03-21 11:18:40 +0000 |
commit | 7c7c03a2b9ecbd265d913c81b374e13eaa4f1078 (patch) | |
tree | ee8449bb2eea05f5abf90e4fc5228b8b3ad366e0 /apps/plugins | |
parent | d694a21b7f3a044304d4dc1ba2a3d015c01ff6cf (diff) | |
download | rockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.tar.gz rockbox-7c7c03a2b9ecbd265d913c81b374e13eaa4f1078.zip |
Patch #4872 by Mikael Magnusson: fixes bubbles game overflowing stack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9155 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rwxr-xr-x | apps/plugins/bubbles.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index f40f91ee58..03f3b767c9 100755 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c | |||
@@ -1769,6 +1769,8 @@ static int bubbles_searchgroup(struct game_context* bb, int row, int col) { | |||
1769 | int adj = row%2; | 1769 | int adj = row%2; |
1770 | int mytype = bb->playboard[row][col].type; | 1770 | int mytype = bb->playboard[row][col].type; |
1771 | 1771 | ||
1772 | if (bb->playboard[row][col].ingroup) | ||
1773 | return 0; | ||
1772 | bb->playboard[row][col].ingroup = true; | 1774 | bb->playboard[row][col].ingroup = true; |
1773 | 1775 | ||
1774 | /* recursively call neighbors */ | 1776 | /* recursively call neighbors */ |
@@ -1875,6 +1877,8 @@ static int bubbles_remove(struct game_context* bb) { | |||
1875 | static void bubbles_anchored(struct game_context* bb, int row, int col) { | 1877 | static void bubbles_anchored(struct game_context* bb, int row, int col) { |
1876 | int adj = row%2; | 1878 | int adj = row%2; |
1877 | 1879 | ||
1880 | if (bb->playboard[row][col].anchored) | ||
1881 | return; | ||
1878 | /* mark bubble */ | 1882 | /* mark bubble */ |
1879 | bb->playboard[row][col].anchored = true; | 1883 | bb->playboard[row][col].anchored = true; |
1880 | 1884 | ||
@@ -2289,7 +2293,6 @@ static int bubbles(struct game_context* bb) { | |||
2289 | int button; | 2293 | int button; |
2290 | int buttonres; | 2294 | int buttonres; |
2291 | unsigned int startlevel = 0; | 2295 | unsigned int startlevel = 0; |
2292 | char str[30]; | ||
2293 | char *title = "Bubbles"; | 2296 | char *title = "Bubbles"; |
2294 | bool startgame = false; | 2297 | bool startgame = false; |
2295 | bool showscores = false; | 2298 | bool showscores = false; |
@@ -2304,6 +2307,7 @@ static int bubbles(struct game_context* bb) { | |||
2304 | * menu * | 2307 | * menu * |
2305 | ********************/ | 2308 | ********************/ |
2306 | while(!startgame){ | 2309 | while(!startgame){ |
2310 | char str[30]; | ||
2307 | rb->lcd_clear_display(); | 2311 | rb->lcd_clear_display(); |
2308 | 2312 | ||
2309 | if(!showscores) { | 2313 | if(!showscores) { |
@@ -2466,7 +2470,6 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
2466 | struct game_context bb; | 2470 | struct game_context bb; |
2467 | bool exit = false; | 2471 | bool exit = false; |
2468 | int position; | 2472 | int position; |
2469 | char str[19]; | ||
2470 | 2473 | ||
2471 | /* plugin init */ | 2474 | /* plugin init */ |
2472 | (void)parameter; | 2475 | (void)parameter; |
@@ -2486,6 +2489,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { | |||
2486 | 2489 | ||
2487 | while(!exit) { | 2490 | while(!exit) { |
2488 | switch(bubbles(&bb)){ | 2491 | switch(bubbles(&bb)){ |
2492 | char str[19]; | ||
2489 | case BB_WIN: | 2493 | case BB_WIN: |
2490 | rb->splash(HZ*2, true, "You Win!"); | 2494 | rb->splash(HZ*2, true, "You Win!"); |
2491 | 2495 | ||