summaryrefslogtreecommitdiff
path: root/apps/plugins/brickmania.c
diff options
context:
space:
mode:
authorTeruaki Kawashima <teru@rockbox.org>2009-09-06 14:14:22 +0000
committerTeruaki Kawashima <teru@rockbox.org>2009-09-06 14:14:22 +0000
commitd41e698ea00a1922434a75d6ba8f3eaa3485abd3 (patch)
treedc4daf5cbcadef800e1a19a810c1ce3f776e813e /apps/plugins/brickmania.c
parentc17037a80266e9e97643e8c34459f3ac81510be0 (diff)
downloadrockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.tar.gz
rockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.zip
brickmania, blackjack, jewels, bubbles: Remove save file only if player resumed the game loaded from the file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22639 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/brickmania.c')
-rw-r--r--apps/plugins/brickmania.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 82a883c7a4..0eebd3f65c 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -619,6 +619,7 @@ int difficulty = NORMAL;
619int pad_width; 619int pad_width;
620int num_count; 620int num_count;
621bool resume = false; 621bool resume = false;
622bool resume_file = false;
622 623
623typedef struct cube { 624typedef struct cube {
624 int powertop; 625 int powertop;
@@ -751,8 +752,6 @@ static void brickmania_loadgame(void)
751 752
752 rb->close(fd); 753 rb->close(fd);
753 754
754 /* delete saved file */
755 rb->remove(SAVE_FILE);
756 return; 755 return;
757} 756}
758 757
@@ -922,6 +921,8 @@ static int brickmania_menu(void)
922 case 0: 921 case 0:
923 if(game_state!=ST_READY) 922 if(game_state!=ST_READY)
924 game_state = ST_PAUSE; 923 game_state = ST_PAUSE;
924 if(resume_file)
925 rb->remove(SAVE_FILE);
925 return 0; 926 return 0;
926 case 1: 927 case 1:
927 score=0; 928 score=0;
@@ -982,6 +983,7 @@ static int brickmania_game_loop(void)
982 return 1; 983 return 1;
983 } 984 }
984 resume = false; 985 resume = false;
986 resume_file = false;
985 987
986 while(true) { 988 while(true) {
987 /* Convert CYCLETIME (in ms) to HZ */ 989 /* Convert CYCLETIME (in ms) to HZ */
@@ -1778,6 +1780,7 @@ enum plugin_status plugin_start(const void* parameter)
1778 /* now go ahead and have fun! */ 1780 /* now go ahead and have fun! */
1779 rb->srand( *rb->current_tick ); 1781 rb->srand( *rb->current_tick );
1780 brickmania_loadgame(); 1782 brickmania_loadgame();
1783 resume_file = resume;
1781 while(brickmania_game_loop() == 0) { 1784 while(brickmania_game_loop() == 0) {
1782 if(!resume) { 1785 if(!resume) {
1783 int position = highscore_update(score, level+1, "", highest, NUM_SCORES); 1786 int position = highscore_update(score, level+1, "", highest, NUM_SCORES);