diff options
Diffstat (limited to 'apps/plugins/chessbox/chessbox.c')
-rw-r--r-- | apps/plugins/chessbox/chessbox.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 3bd9593e3a..906cc5d4c8 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c | |||
@@ -432,6 +432,11 @@ static struct cb_command cb_get_viewer_command (void) { | |||
432 | result.type = COMMAND_QUIT; | 432 | result.type = COMMAND_QUIT; |
433 | return result; | 433 | return result; |
434 | #endif | 434 | #endif |
435 | #ifdef CB_RESTART | ||
436 | case CB_RESTART: | ||
437 | result.type = COMMAND_RESTART; | ||
438 | return result; | ||
439 | #endif | ||
435 | case CB_MENU: | 440 | case CB_MENU: |
436 | result.type = cb_menu_viewer(); | 441 | result.type = cb_menu_viewer(); |
437 | return result; | 442 | return result; |
@@ -575,6 +580,7 @@ static void cb_start_viewer(char* filename){ | |||
575 | GNUChess_Initialize(); | 580 | GNUChess_Initialize(); |
576 | cb_drawboard(); | 581 | cb_drawboard(); |
577 | curr_ply = selected_game->first_ply; | 582 | curr_ply = selected_game->first_ply; |
583 | break; | ||
578 | case COMMAND_SELECT: | 584 | case COMMAND_SELECT: |
579 | exit_game = true; | 585 | exit_game = true; |
580 | break; | 586 | break; |
@@ -659,6 +665,11 @@ static struct cb_command cb_getcommand (void) { | |||
659 | result.type = COMMAND_QUIT; | 665 | result.type = COMMAND_QUIT; |
660 | return result; | 666 | return result; |
661 | #endif | 667 | #endif |
668 | #ifdef CB_RESTART | ||
669 | case CB_RESTART: | ||
670 | result.type = COMMAND_RESTART; | ||
671 | return result; | ||
672 | #endif | ||
662 | case CB_MENU: | 673 | case CB_MENU: |
663 | result.type = cb_menu(); | 674 | result.type = cb_menu(); |
664 | return result; | 675 | return result; |
@@ -673,6 +684,9 @@ static struct cb_command cb_getcommand (void) { | |||
673 | result.type = COMMAND_PLAY; | 684 | result.type = COMMAND_PLAY; |
674 | return result; | 685 | return result; |
675 | case CB_UP: | 686 | case CB_UP: |
687 | #ifdef CB_SCROLL_UP | ||
688 | case CB_SCROLL_UP: | ||
689 | #endif | ||
676 | if ( !from_marked ) cb_switch ( x , y ); | 690 | if ( !from_marked ) cb_switch ( x , y ); |
677 | y++; | 691 | y++; |
678 | if ( y == 8 ) { | 692 | if ( y == 8 ) { |
@@ -688,6 +702,9 @@ static struct cb_command cb_getcommand (void) { | |||
688 | } | 702 | } |
689 | break; | 703 | break; |
690 | case CB_DOWN: | 704 | case CB_DOWN: |
705 | #ifdef CB_SCROLL_DOWN | ||
706 | case CB_SCROLL_DOWN: | ||
707 | #endif | ||
691 | if ( !from_marked ) cb_switch ( x , y ); | 708 | if ( !from_marked ) cb_switch ( x , y ); |
692 | y--; | 709 | y--; |
693 | if ( y < 0 ) { | 710 | if ( y < 0 ) { |
@@ -703,6 +720,9 @@ static struct cb_command cb_getcommand (void) { | |||
703 | } | 720 | } |
704 | break; | 721 | break; |
705 | case CB_LEFT: | 722 | case CB_LEFT: |
723 | #ifdef CB_SCROLL_LEFT | ||
724 | case CB_SCROLL_LEFT: | ||
725 | #endif | ||
706 | if ( !from_marked ) cb_switch ( x , y ); | 726 | if ( !from_marked ) cb_switch ( x , y ); |
707 | x--; | 727 | x--; |
708 | if ( x < 0 ) { | 728 | if ( x < 0 ) { |
@@ -718,6 +738,9 @@ static struct cb_command cb_getcommand (void) { | |||
718 | } | 738 | } |
719 | break; | 739 | break; |
720 | case CB_RIGHT: | 740 | case CB_RIGHT: |
741 | #ifdef CB_SCROLL_RIGHT | ||
742 | case CB_SCROLL_RIGHT: | ||
743 | #endif | ||
721 | if ( !from_marked ) cb_switch ( x , y ); | 744 | if ( !from_marked ) cb_switch ( x , y ); |
722 | x++; | 745 | x++; |
723 | if ( x == 8 ) { | 746 | if ( x == 8 ) { |
@@ -842,13 +865,11 @@ static void cb_play_game(void) { | |||
842 | cb_drawboard(); | 865 | cb_drawboard(); |
843 | } | 866 | } |
844 | break; | 867 | break; |
845 | #ifdef COMMAND_RESTART | ||
846 | case COMMAND_RESTART: | 868 | case COMMAND_RESTART: |
847 | GNUChess_Initialize(); | 869 | GNUChess_Initialize(); |
848 | game = pgn_init_game(); | 870 | game = pgn_init_game(); |
849 | cb_drawboard(); | 871 | cb_drawboard(); |
850 | break; | 872 | break; |
851 | #endif | ||
852 | case COMMAND_RESUME: | 873 | case COMMAND_RESUME: |
853 | cb_drawboard(); | 874 | cb_drawboard(); |
854 | break; | 875 | break; |