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/bubbles.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'apps/plugins/bubbles.c') diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c index da927de01c..3b28ced87d 100644 --- a/apps/plugins/bubbles.c +++ b/apps/plugins/bubbles.c @@ -1274,6 +1274,7 @@ struct highscore highscores[NUM_SCORES]; /* used to denote available resume info */ static bool resume = false; +static bool resume_file = false; static unsigned int highlevel = 0; /* the highest level beaten */ static unsigned int last_highlevel = 0; @@ -2393,14 +2394,15 @@ static int bubbles_menu(struct game_context* bb) { rb->splash(HZ/2, "Nothing to resume"); else startgame = true; - - if(rb->file_exists(SAVE_FILE)) - rb->remove(SAVE_FILE); + if(resume_file) + rb->remove(SAVE_FILE); + resume_file = false; break; case 1: /* new game */ bb->level = startlevel; startgame = true; resume = false; + resume_file = false; break; case 2: /* choose level */ startlevel++; @@ -2497,6 +2499,7 @@ enum plugin_status plugin_start(const void* parameter) { /* load files */ resume = bubbles_loadgame(&bb); + resume_file = resume; bubbles_loaddata(); highscore_load(SCORE_FILE, highscores, NUM_SCORES); rb->lcd_clear_display(); -- cgit v1.2.3