From d41e698ea00a1922434a75d6ba8f3eaa3485abd3 Mon Sep 17 00:00:00 2001 From: Teruaki Kawashima Date: Sun, 6 Sep 2009 14:14:22 +0000 Subject: 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 --- apps/plugins/brickmania.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apps/plugins/brickmania.c') 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; 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); -- cgit v1.2.3