summaryrefslogtreecommitdiff
path: root/apps/plugins/jewels.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/jewels.c
parentc17037a80266e9e97643e8c34459f3ac81510be0 (diff)
downloadrockbox-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/jewels.c')
-rw-r--r--apps/plugins/jewels.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index f049fdc..a55b1b2 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -420,6 +420,7 @@ struct puzzle_level puzzle_levels[NUM_PUZZLE_LEVELS] = {
#define HIGH_SCORE PLUGIN_GAMES_DIR "/jewels.score"
struct highscore highest[NUM_SCORES];
+static bool resume_file = false;
/*****************************************************************************
* jewels_setcolors() set the foreground and background colors.
@@ -458,8 +459,6 @@ static bool jewels_loadgame(struct game_context* bj)
rb->close(fd);
- /* delete saved file */
- rb->remove(SAVE_FILE);
return loaded;
}
@@ -1361,6 +1360,8 @@ static int jewels_game_menu(struct game_context* bj, bool ingame)
switch (rb->do_menu(&main_menu, &choice, NULL, false)) {
case 0:
jewels_setcolors();
+ if(resume_file)
+ rb->remove(SAVE_FILE);
return 0;
case 1:
jewels_init(bj);
@@ -1402,9 +1403,11 @@ static int jewels_main(struct game_context* bj) {
int x=0, y=0;
bool loaded = jewels_loadgame(bj);
+ resume_file = loaded;
if (jewels_game_menu(bj, loaded)!=0)
return 0;
+ resume_file = false;
while(true) {
no_movesavail = false;