From ed69390542e8d4a1d8b46853807db28db28e4b46 Mon Sep 17 00:00:00 2001 From: Eric Linenberg Date: Thu, 16 Jan 2003 14:50:34 +0000 Subject: fixed bug with undo and switching levels git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3109 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/sokoban.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/sokoban.c b/apps/recorder/sokoban.c index 810cf22c11..e5c99a2136 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(); } } -- cgit v1.2.3