summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
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 810cf22c11..e5c99a2136 100644
--- a/apps/recorder/sokoban.c
+++ b/apps/recorder/sokoban.c
@@ -64,7 +64,6 @@ static char current_spot= ' ';
64static char undo_current_spot=' '; 64static char undo_current_spot=' ';
65 65
66 66
67
68static void copy_current_state_to_undo(void) { 67static void copy_current_state_to_undo(void) {
69 int a = 0; 68 int a = 0;
70 int b = 0; 69 int b = 0;
@@ -226,9 +225,12 @@ static bool sokoban_loop(void)
226 load_level(current_level); 225 load_level(current_level);
227 lcd_clear_display(); 226 lcd_clear_display();
228 update_screen(); 227 update_screen();
228 copy_current_state_to_undo();
229 copy_current_undo_to_state();
229 break; 230 break;
230 231
231 case BUTTON_F1: 232 case BUTTON_F1:
233
232 /* previous level */ 234 /* previous level */
233 if (current_level) 235 if (current_level)
234 current_level--; 236 current_level--;
@@ -238,6 +240,8 @@ static bool sokoban_loop(void)
238 load_level(current_level); 240 load_level(current_level);
239 lcd_clear_display(); 241 lcd_clear_display();
240 update_screen(); 242 update_screen();
243 copy_current_state_to_undo();
244 copy_current_undo_to_state();
241 break; 245 break;
242 246
243 case BUTTON_LEFT: 247 case BUTTON_LEFT:
@@ -535,10 +539,9 @@ static bool sokoban_loop(void)
535 moves=0; 539 moves=0;
536 current_level++; 540 current_level++;
537 if (current_level == NUM_LEVELS) { 541 if (current_level == NUM_LEVELS) {
538 for(ii=0; ii<300 ; ii++) { 542 lcd_clear_display();
539 lcd_clear_display(); 543 lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN));
540 lcd_putsxy(10, 20, str(LANG_SOKOBAN_WIN)); 544 for(ii=0; ii<30000 ; ii++) {
541 lcd_update();
542 lcd_invertrect(0,0,111,63); 545 lcd_invertrect(0,0,111,63);
543 lcd_update(); 546 lcd_update();
544 if ( button_get(false) ) 547 if ( button_get(false) )
@@ -549,6 +552,8 @@ static bool sokoban_loop(void)
549 load_level(current_level); 552 load_level(current_level);
550 lcd_clear_display(); 553 lcd_clear_display();
551 update_screen(); 554 update_screen();
555 copy_current_state_to_undo();
556 copy_current_undo_to_state();
552 } 557 }
553 } 558 }
554 559