1
0
Fork 0
forked from len0rd/rockbox

fixed bug with undo and switching levels

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3109 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Eric Linenberg 2003-01-16 14:50:34 +00:00
parent 4a144859a0
commit ed69390542

View file

@ -64,7 +64,6 @@ static char current_spot= ' ';
static char undo_current_spot=' '; static char undo_current_spot=' ';
static void copy_current_state_to_undo(void) { static void copy_current_state_to_undo(void) {
int a = 0; int a = 0;
int b = 0; int b = 0;
@ -226,9 +225,12 @@ static bool sokoban_loop(void)
load_level(current_level); load_level(current_level);
lcd_clear_display(); lcd_clear_display();
update_screen(); update_screen();
copy_current_state_to_undo();
copy_current_undo_to_state();
break; break;
case BUTTON_F1: case BUTTON_F1:
/* previous level */ /* previous level */
if (current_level) if (current_level)
current_level--; current_level--;
@ -238,6 +240,8 @@ static bool sokoban_loop(void)
load_level(current_level); load_level(current_level);
lcd_clear_display(); lcd_clear_display();
update_screen(); update_screen();
copy_current_state_to_undo();
copy_current_undo_to_state();
break; break;
case BUTTON_LEFT: case BUTTON_LEFT:
@ -535,10 +539,9 @@ static bool sokoban_loop(void)
moves=0; moves=0;
current_level++; current_level++;
if (current_level == NUM_LEVELS) { if (current_level == NUM_LEVELS) {
for(ii=0; ii<300 ; ii++) { lcd_clear_display();
lcd_clear_display(); lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN));
lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN)); for(ii=0; ii<30000 ; ii++) {
lcd_update();
lcd_invertrect(0,0,111,63); lcd_invertrect(0,0,111,63);
lcd_update(); lcd_update();
if ( button_get(false) ) if ( button_get(false) )
@ -549,6 +552,8 @@ static bool sokoban_loop(void)
load_level(current_level); load_level(current_level);
lcd_clear_display(); lcd_clear_display();
update_screen(); update_screen();
copy_current_state_to_undo();
copy_current_undo_to_state();
} }
} }