diff options
| author | Teruaki Kawashima <teru@rockbox.org> | 2009-09-06 14:14:22 +0000 |
|---|---|---|
| committer | Teruaki Kawashima <teru@rockbox.org> | 2009-09-06 14:14:22 +0000 |
| commit | d41e698ea00a1922434a75d6ba8f3eaa3485abd3 (patch) | |
| tree | dc4daf5cbcadef800e1a19a810c1ce3f776e813e /apps/plugins/brickmania.c | |
| parent | c17037a80266e9e97643e8c34459f3ac81510be0 (diff) | |
| download | rockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.zip rockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.tar.gz rockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.tar.bz2 rockbox-d41e698ea00a1922434a75d6ba8f3eaa3485abd3.tar.xz | |
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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 82a883c..0eebd3f 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c @@ -619,6 +619,7 @@ int difficulty = NORMAL; int pad_width; int num_count; bool resume = false; +bool resume_file = false; typedef struct cube { int powertop; @@ -751,8 +752,6 @@ static void brickmania_loadgame(void) rb->close(fd); - /* delete saved file */ - rb->remove(SAVE_FILE); return; } @@ -922,6 +921,8 @@ static int brickmania_menu(void) case 0: if(game_state!=ST_READY) game_state = ST_PAUSE; + if(resume_file) + rb->remove(SAVE_FILE); return 0; case 1: score=0; @@ -982,6 +983,7 @@ static int brickmania_game_loop(void) return 1; } resume = false; + resume_file = false; while(true) { /* Convert CYCLETIME (in ms) to HZ */ @@ -1778,6 +1780,7 @@ enum plugin_status plugin_start(const void* parameter) /* now go ahead and have fun! */ rb->srand( *rb->current_tick ); brickmania_loadgame(); + resume_file = resume; while(brickmania_game_loop() == 0) { if(!resume) { int position = highscore_update(score, level+1, "", highest, NUM_SCORES); |