diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/sokoban.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c index 6e671d09ef..8082ef6cce 100644 --- a/apps/plugins/sokoban.c +++ b/apps/plugins/sokoban.c | |||
@@ -388,14 +388,15 @@ static int load_level(void) | |||
388 | 388 | ||
389 | static void update_screen(void) | 389 | static void update_screen(void) |
390 | { | 390 | { |
391 | short b = 0, c = 0; | 391 | int b = 0, c = 0; |
392 | short rows = 0, cols = 0; | 392 | int rows = 0, cols = 0; |
393 | int i, j; | ||
393 | char s[25]; | 394 | char s[25]; |
394 | 395 | ||
395 | #if CONFIG_KEYPAD == IRIVER_H100_PAD | 396 | #if LCD_HEIGHT >= 128 |
396 | short magnify = 6; | 397 | int magnify = 6; |
397 | #else | 398 | #else |
398 | short magnify = 4; | 399 | int magnify = 4; |
399 | #endif | 400 | #endif |
400 | 401 | ||
401 | /* load the board to the screen */ | 402 | /* load the board to the screen */ |
@@ -407,13 +408,17 @@ static void update_screen(void) | |||
407 | switch(current_info.board[rows][cols]) { | 408 | switch(current_info.board[rows][cols]) { |
408 | case 'X': /* black space */ | 409 | case 'X': /* black space */ |
409 | break; | 410 | break; |
410 | 411 | ||
411 | case '#': /* this is a wall */ | 412 | case '#': /* this is a wall */ |
412 | rb->lcd_fillrect(c, b, magnify, magnify); | 413 | for (i = c; i < c + magnify; i++) |
414 | for (j = b; j < b + magnify; j++) | ||
415 | if ((i ^ j) & 1) | ||
416 | rb->lcd_drawpixel(i, j); | ||
413 | break; | 417 | break; |
414 | 418 | ||
415 | case '.': /* this is a home location */ | 419 | case '.': /* this is a home location */ |
416 | rb->lcd_drawrect(c+(magnify/2)-1, b+(magnify/2)-1, magnify/2, magnify/2); | 420 | rb->lcd_drawrect(c+(magnify/2)-1, b+(magnify/2)-1, magnify/2, |
421 | magnify/2); | ||
417 | break; | 422 | break; |
418 | 423 | ||
419 | case '$': /* this is a box */ | 424 | case '$': /* this is a box */ |
@@ -430,8 +435,9 @@ static void update_screen(void) | |||
430 | break; | 435 | break; |
431 | 436 | ||
432 | case '%': /* this is a box on a home spot */ | 437 | case '%': /* this is a box on a home spot */ |
433 | rb->lcd_drawrect(c, b, magnify, magnify); | 438 | rb->lcd_drawrect(c, b, magnify, magnify); |
434 | rb->lcd_drawrect(c+(magnify/2)-1, b+(magnify/2)-1, magnify/2, magnify/2); | 439 | rb->lcd_drawrect(c+(magnify/2)-1, b+(magnify/2)-1, magnify/2, |
440 | magnify/2); | ||
435 | break; | 441 | break; |
436 | } | 442 | } |
437 | } | 443 | } |
@@ -815,7 +821,7 @@ static bool sokoban_loop(void) | |||
815 | init_undo(); | 821 | init_undo(); |
816 | 822 | ||
817 | rb->lcd_clear_display(); | 823 | rb->lcd_clear_display(); |
818 | 824 | ||
819 | if (current_info.level.level > current_info.max_level) { | 825 | if (current_info.level.level > current_info.max_level) { |
820 | rb->lcd_putsxy(10, 20, "You WIN!!"); | 826 | rb->lcd_putsxy(10, 20, "You WIN!!"); |
821 | 827 | ||