1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Teruaki Kawashima 2009-09-06 14:14:22 +00:00
parent c17037a802
commit d41e698ea0
4 changed files with 34 additions and 25 deletions

View file

@ -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();