summaryrefslogtreecommitdiff
path: root/apps/plugins/chessbox/chessbox.c
diff options
context:
space:
mode:
authorWilliam Wilgus <me.theuser@yahoo.com>2017-01-31 01:07:47 +0100
committerWilliam Wilgus <me.theuser@yahoo.com>2017-01-31 01:09:23 +0100
commit37522ec63ae8fd2f88a66ed3d7020ebe95e9980e (patch)
treed2091480782de19368d4f03e6933c3b586e2c680 /apps/plugins/chessbox/chessbox.c
parent324ad2483aa8c64c7c4d38e00f190d3a72c16d78 (diff)
downloadrockbox-37522ec63ae8fd2f88a66ed3d7020ebe95e9980e.tar.gz
rockbox-37522ec63ae8fd2f88a66ed3d7020ebe95e9980e.zip
Remove Whitespaces from chessbox
Remove 1616 Whitespaces from chessbox Change-Id: I84c0dbd4a177eba50b9f7427f5695ae4b266aa5e
Diffstat (limited to 'apps/plugins/chessbox/chessbox.c')
-rw-r--r--apps/plugins/chessbox/chessbox.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index be69f672e4..86ca5a355e 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -7,7 +7,7 @@
7* \/ \/ \/ \/ \/ 7* \/ \/ \/ \/ \/
8* $Id$ 8* $Id$
9* 9*
10* Copyright (C) 2006 Miguel A. Arévalo 10* Copyright (C) 2006 Miguel A. Arévalo
11* Color graphics from eboard 11* Color graphics from eboard
12* GNUChess v2 chess engine Copyright (c) 1988 John Stanback 12* GNUChess v2 chess engine Copyright (c) 1988 John Stanback
13* 13*
@@ -20,7 +20,7 @@
20* KIND, either express or implied. 20* KIND, either express or implied.
21* 21*
22****************************************************************************/ 22****************************************************************************/
23 23
24#include "plugin.h" 24#include "plugin.h"
25 25
26#if (MEMORYSIZE > 8) /* Lowmem doesn't have playback in chessbox */ 26#if (MEMORYSIZE > 8) /* Lowmem doesn't have playback in chessbox */
@@ -80,7 +80,7 @@ short plugin_mode;
80 80
81/* level+1's string */ 81/* level+1's string */
82const char *level_string[] = { "Level 1: 60 moves / 5 min" , 82const char *level_string[] = { "Level 1: 60 moves / 5 min" ,
83 "Level 2: 60 moves / 15 min" , 83 "Level 2: 60 moves / 15 min" ,
84 "Level 3: 60 moves / 30 min" , 84 "Level 3: 60 moves / 30 min" ,
85 "Level 4: 40 moves / 30 min" , 85 "Level 4: 40 moves / 30 min" ,
86 "Level 5: 40 moves / 60 min" , 86 "Level 5: 40 moves / 60 min" ,
@@ -120,7 +120,7 @@ static void cb_drawboard (void) {
120 short r , c , x , y ; 120 short r , c , x , y ;
121 short l , piece , p_color ; 121 short l , piece , p_color ;
122 int b_color=1; 122 int b_color=1;
123 123
124 rb->lcd_clear_display(); 124 rb->lcd_clear_display();
125 125
126 for (r = 0; r < 8; r++) { 126 for (r = 0; r < 8; r++) {
@@ -132,8 +132,8 @@ static void cb_drawboard (void) {
132 if ( piece == no_piece ) { 132 if ( piece == no_piece ) {
133 rb->lcd_bitmap_part ( chessbox_pieces , 0 , 133 rb->lcd_bitmap_part ( chessbox_pieces , 0 ,
134 TILE_HEIGHT * b_color , 134 TILE_HEIGHT * b_color ,
135 STRIDE( SCREEN_MAIN, 135 STRIDE( SCREEN_MAIN,
136 BMPWIDTH_chessbox_pieces, 136 BMPWIDTH_chessbox_pieces,
137 BMPHEIGHT_chessbox_pieces) , 137 BMPHEIGHT_chessbox_pieces) ,
138 XOFS + x*TILE_WIDTH , 138 XOFS + x*TILE_WIDTH ,
139 YOFS + ( 7 - y )*TILE_HEIGHT , 139 YOFS + ( 7 - y )*TILE_HEIGHT ,
@@ -146,8 +146,8 @@ static void cb_drawboard (void) {
146 4 * TILE_HEIGHT * ( piece - 1 ) + 146 4 * TILE_HEIGHT * ( piece - 1 ) +
147 2 * TILE_HEIGHT * p_color + 147 2 * TILE_HEIGHT * p_color +
148 TILE_HEIGHT * b_color , 148 TILE_HEIGHT * b_color ,
149 STRIDE( SCREEN_MAIN, 149 STRIDE( SCREEN_MAIN,
150 BMPWIDTH_chessbox_pieces, 150 BMPWIDTH_chessbox_pieces,
151 BMPHEIGHT_chessbox_pieces) , 151 BMPHEIGHT_chessbox_pieces) ,
152 XOFS + x*TILE_WIDTH , 152 XOFS + x*TILE_WIDTH ,
153 YOFS + (7 - y)*TILE_HEIGHT , 153 YOFS + (7 - y)*TILE_HEIGHT ,
@@ -158,7 +158,7 @@ static void cb_drawboard (void) {
158 } 158 }
159 b_color = (b_color == 1) ? 0 : 1 ; 159 b_color = (b_color == 1) ? 0 : 1 ;
160 } 160 }
161 161
162 /* draw board limits */ 162 /* draw board limits */
163#if (LCD_WIDTH > TILE_WIDTH*8) && (LCD_HEIGHT > TILE_HEIGHT*8) 163#if (LCD_WIDTH > TILE_WIDTH*8) && (LCD_HEIGHT > TILE_HEIGHT*8)
164 rb->lcd_drawrect(XOFS - 1, YOFS - 1, TILE_WIDTH*8 + 2, TILE_HEIGHT*8 + 2); 164 rb->lcd_drawrect(XOFS - 1, YOFS - 1, TILE_WIDTH*8 + 2, TILE_HEIGHT*8 + 2);
@@ -186,7 +186,7 @@ static void cb_switch ( short x , short y ) {
186/* ---- callback for capturing interaction while thinking ---- */ 186/* ---- callback for capturing interaction while thinking ---- */
187static void cb_wt_callback ( void ) { 187static void cb_wt_callback ( void ) {
188 int button = BUTTON_NONE; 188 int button = BUTTON_NONE;
189 189
190 wt_command = COMMAND_NOP; 190 wt_command = COMMAND_NOP;
191 button = rb->button_get(false); 191 button = rb->button_get(false);
192 switch (button) { 192 switch (button) {
@@ -270,7 +270,7 @@ static void cb_saveposition ( void ) {
270 int fd; 270 int fd;
271 short sq,i,c; 271 short sq,i,c;
272 unsigned short temp; 272 unsigned short temp;
273 273
274 rb->splash ( 0 , "Saving position" ); 274 rb->splash ( 0 , "Saving position" );
275 275
276 fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666); 276 fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
@@ -323,7 +323,7 @@ static void cb_restoreposition ( void ) {
323 int fd; 323 int fd;
324 short sq; 324 short sq;
325 unsigned short m; 325 unsigned short m;
326 326
327 if ( (fd = rb->open(SAVE_FILE, O_RDONLY)) >= 0 ) { 327 if ( (fd = rb->open(SAVE_FILE, O_RDONLY)) >= 0 ) {
328 rb->splash ( 0 , "Loading position" ); 328 rb->splash ( 0 , "Loading position" );
329 rb->read(fd, &(computer), sizeof(computer)); 329 rb->read(fd, &(computer), sizeof(computer));
@@ -393,10 +393,10 @@ static int cb_menu_viewer(void)
393 int selection; 393 int selection;
394 int result = 0; 394 int result = 0;
395 bool menu_quit = false; 395 bool menu_quit = false;
396 396
397 MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"Restart Game", 397 MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"Restart Game",
398 "Select Other Game", "Quit"); 398 "Select Other Game", "Quit");
399 399
400 while(!menu_quit) 400 while(!menu_quit)
401 { 401 {
402 switch(rb->do_menu(&menu, &selection, NULL, false)) 402 switch(rb->do_menu(&menu, &selection, NULL, false))
@@ -422,7 +422,7 @@ static int cb_menu_viewer(void)
422static struct cb_command cb_get_viewer_command (void) { 422static struct cb_command cb_get_viewer_command (void) {
423 int button; 423 int button;
424 struct cb_command result = { 0, {0,0,0,0,0}, 0 }; 424 struct cb_command result = { 0, {0,0,0,0,0}, 0 };
425 425
426 /* main loop */ 426 /* main loop */
427 while ( true ) { 427 while ( true ) {
428 button = rb->button_get(true); 428 button = rb->button_get(true);
@@ -476,7 +476,7 @@ static void cb_start_viewer(char* filename){
476 476
477 /* init board */ 477 /* init board */
478 GNUChess_Initialize(); 478 GNUChess_Initialize();
479 479
480 /* draw the board */ 480 /* draw the board */
481 cb_drawboard(); 481 cb_drawboard();
482 482
@@ -494,7 +494,7 @@ static void cb_start_viewer(char* filename){
494 rb->splash ( HZ*2 , "At the begining of the game" ); 494 rb->splash ( HZ*2 , "At the begining of the game" );
495 break; 495 break;
496 } 496 }
497 board[locn[curr_ply->row_from][curr_ply->column_from]] 497 board[locn[curr_ply->row_from][curr_ply->column_from]]
498 = board[locn[curr_ply->row_to][curr_ply->column_to]]; 498 = board[locn[curr_ply->row_to][curr_ply->column_to]];
499 color[locn[curr_ply->row_from][curr_ply->column_from]] 499 color[locn[curr_ply->row_from][curr_ply->column_from]]
500 = color[locn[curr_ply->row_to][curr_ply->column_to]]; 500 = color[locn[curr_ply->row_to][curr_ply->column_to]];
@@ -601,14 +601,14 @@ static int cb_menu(void)
601 int selection; 601 int selection;
602 int result = 0; 602 int result = 0;
603 bool menu_quit = false; 603 bool menu_quit = false;
604 604
605 MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game", 605 MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game",
606 "Save Game", "Restore Game", 606 "Save Game", "Restore Game",
607#ifdef HAVE_PLAYBACK_CONTROL 607#ifdef HAVE_PLAYBACK_CONTROL
608 "Playback Control", 608 "Playback Control",
609#endif 609#endif
610 "Quit"); 610 "Quit");
611 611
612 while(!menu_quit) 612 while(!menu_quit)
613 { 613 {
614 switch(rb->do_menu(&menu, &selection, NULL, false)) 614 switch(rb->do_menu(&menu, &selection, NULL, false))
@@ -654,7 +654,7 @@ static struct cb_command cb_getcommand (void) {
654 int marked = false , from_marked = false ; 654 int marked = false , from_marked = false ;
655 short marked_x = 0 , marked_y = 0 ; 655 short marked_x = 0 , marked_y = 0 ;
656 struct cb_command result = { 0, {0,0,0,0,0}, 0 }; 656 struct cb_command result = { 0, {0,0,0,0,0}, 0 };
657 657
658 cb_switch ( x , y ); 658 cb_switch ( x , y );
659 /* main loop */ 659 /* main loop */
660 while ( true ) { 660 while ( true ) {
@@ -815,11 +815,11 @@ static void cb_play_game(void) {
815 815
816 /* init PGN history data structures */ 816 /* init PGN history data structures */
817 game = pgn_init_game(); 817 game = pgn_init_game();
818 818
819 /* restore saved position, if saved */ 819 /* restore saved position, if saved */
820 cb_restoreposition(); 820 cb_restoreposition();
821 /* TODO: save/restore the PGN history of unfinished games */ 821 /* TODO: save/restore the PGN history of unfinished games */
822 822
823 /* draw the board */ 823 /* draw the board */
824 /* I don't like configscreens, start game inmediatly */ 824 /* I don't like configscreens, start game inmediatly */
825 cb_drawboard(); 825 cb_drawboard();
@@ -937,7 +937,7 @@ static void cb_play_game(void) {
937 break; 937 break;
938 } 938 }
939 } 939 }
940 940
941 cb_saveposition(); 941 cb_saveposition();
942 /* TODO: save/restore the PGN history of unfinished games */ 942 /* TODO: save/restore the PGN history of unfinished games */
943 rb->lcd_setfont(FONT_UI); 943 rb->lcd_setfont(FONT_UI);
@@ -948,7 +948,7 @@ static void cb_play_game(void) {
948* plugin entry point. 948* plugin entry point.
949******************************************************************************/ 949******************************************************************************/
950enum plugin_status plugin_start(const void* parameter) { 950enum plugin_status plugin_start(const void* parameter) {
951 951
952 /* plugin init */ 952 /* plugin init */
953 953
954#if LCD_DEPTH > 1 954#if LCD_DEPTH > 1
@@ -957,7 +957,7 @@ enum plugin_status plugin_start(const void* parameter) {
957 957
958 /* end of plugin init */ 958 /* end of plugin init */
959 959
960 /* if the plugin was invoked as a viewer, parse the file and show the game list 960 /* if the plugin was invoked as a viewer, parse the file and show the game list
961 * else, start playing a game 961 * else, start playing a game
962 */ 962 */
963 if (parameter != NULL) { 963 if (parameter != NULL) {