summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorEric Linenberg <elinenbe@umich.edu>2003-01-16 14:50:34 +0000
committerEric Linenberg <elinenbe@umich.edu>2003-01-16 14:50:34 +0000
commited69390542e8d4a1d8b46853807db28db28e4b46 (patch)
tree23f081b934c036bfd26fe607fc08e47ed9ecc4bd /apps
parent4a144859a0660f11e43d11719e8eb20e627a43c3 (diff)
downloadrockbox-ed69390542e8d4a1d8b46853807db28db28e4b46.zip
rockbox-ed69390542e8d4a1d8b46853807db28db28e4b46.tar.gz
rockbox-ed69390542e8d4a1d8b46853807db28db28e4b46.tar.bz2
rockbox-ed69390542e8d4a1d8b46853807db28db28e4b46.tar.xz
fixed bug with undo and switching levels
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3109 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/sokoban.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c
index 810cf22..e5c99a2 100644
--- a/apps/recorder/sokoban.c
+++ b/apps/recorder/sokoban.c
@@ -64,7 +64,6 @@ static char current_spot= ' ';
static char undo_current_spot=' ';
-
static void copy_current_state_to_undo(void) {
int a = 0;
int b = 0;
@@ -226,9 +225,12 @@ static bool sokoban_loop(void)
load_level(current_level);
lcd_clear_display();
update_screen();
+ copy_current_state_to_undo();
+ copy_current_undo_to_state();
break;
case BUTTON_F1:
+
/* previous level */
if (current_level)
current_level--;
@@ -238,6 +240,8 @@ static bool sokoban_loop(void)
load_level(current_level);
lcd_clear_display();
update_screen();
+ copy_current_state_to_undo();
+ copy_current_undo_to_state();
break;
case BUTTON_LEFT:
@@ -535,10 +539,9 @@ static bool sokoban_loop(void)
moves=0;
current_level++;
if (current_level == NUM_LEVELS) {
- for(ii=0; ii<300 ; ii++) {
- lcd_clear_display();
- lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN));
- lcd_update();
+ lcd_clear_display();
+ lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN));
+ for(ii=0; ii<30000 ; ii++) {
lcd_invertrect(0,0,111,63);
lcd_update();
if ( button_get(false) )
@@ -549,6 +552,8 @@ static bool sokoban_loop(void)
load_level(current_level);
lcd_clear_display();
update_screen();
+ copy_current_state_to_undo();
+ copy_current_undo_to_state();
}
}