1
0
Fork 0
forked from len0rd/rockbox

Remove Whitespaces from chessbox

Remove 1616 Whitespaces from chessbox

Change-Id: I84c0dbd4a177eba50b9f7427f5695ae4b266aa5e
This commit is contained in:
William Wilgus 2017-01-31 01:07:47 +01:00
parent 324ad2483a
commit 37522ec63a
6 changed files with 1616 additions and 1616 deletions

View file

@ -7,7 +7,7 @@
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2006 Miguel A. Arévalo
* Copyright (C) 2006 Miguel A. Arévalo
* Color graphics from eboard
* GNUChess v2 chess engine Copyright (c) 1988 John Stanback
*
@ -20,7 +20,7 @@
* KIND, either express or implied.
*
****************************************************************************/
#include "plugin.h"
#if (MEMORYSIZE > 8) /* Lowmem doesn't have playback in chessbox */
@ -80,7 +80,7 @@ short plugin_mode;
/* level+1's string */
const char *level_string[] = { "Level 1: 60 moves / 5 min" ,
"Level 2: 60 moves / 15 min" ,
"Level 2: 60 moves / 15 min" ,
"Level 3: 60 moves / 30 min" ,
"Level 4: 40 moves / 30 min" ,
"Level 5: 40 moves / 60 min" ,
@ -120,7 +120,7 @@ static void cb_drawboard (void) {
short r , c , x , y ;
short l , piece , p_color ;
int b_color=1;
rb->lcd_clear_display();
for (r = 0; r < 8; r++) {
@ -132,8 +132,8 @@ static void cb_drawboard (void) {
if ( piece == no_piece ) {
rb->lcd_bitmap_part ( chessbox_pieces , 0 ,
TILE_HEIGHT * b_color ,
STRIDE( SCREEN_MAIN,
BMPWIDTH_chessbox_pieces,
STRIDE( SCREEN_MAIN,
BMPWIDTH_chessbox_pieces,
BMPHEIGHT_chessbox_pieces) ,
XOFS + x*TILE_WIDTH ,
YOFS + ( 7 - y )*TILE_HEIGHT ,
@ -146,8 +146,8 @@ static void cb_drawboard (void) {
4 * TILE_HEIGHT * ( piece - 1 ) +
2 * TILE_HEIGHT * p_color +
TILE_HEIGHT * b_color ,
STRIDE( SCREEN_MAIN,
BMPWIDTH_chessbox_pieces,
STRIDE( SCREEN_MAIN,
BMPWIDTH_chessbox_pieces,
BMPHEIGHT_chessbox_pieces) ,
XOFS + x*TILE_WIDTH ,
YOFS + (7 - y)*TILE_HEIGHT ,
@ -158,7 +158,7 @@ static void cb_drawboard (void) {
}
b_color = (b_color == 1) ? 0 : 1 ;
}
/* draw board limits */
#if (LCD_WIDTH > TILE_WIDTH*8) && (LCD_HEIGHT > TILE_HEIGHT*8)
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 ) {
/* ---- callback for capturing interaction while thinking ---- */
static void cb_wt_callback ( void ) {
int button = BUTTON_NONE;
wt_command = COMMAND_NOP;
button = rb->button_get(false);
switch (button) {
@ -270,7 +270,7 @@ static void cb_saveposition ( void ) {
int fd;
short sq,i,c;
unsigned short temp;
rb->splash ( 0 , "Saving position" );
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT, 0666);
@ -323,7 +323,7 @@ static void cb_restoreposition ( void ) {
int fd;
short sq;
unsigned short m;
if ( (fd = rb->open(SAVE_FILE, O_RDONLY)) >= 0 ) {
rb->splash ( 0 , "Loading position" );
rb->read(fd, &(computer), sizeof(computer));
@ -393,10 +393,10 @@ static int cb_menu_viewer(void)
int selection;
int result = 0;
bool menu_quit = false;
MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"Restart Game",
"Select Other Game", "Quit");
"Select Other Game", "Quit");
while(!menu_quit)
{
switch(rb->do_menu(&menu, &selection, NULL, false))
@ -422,7 +422,7 @@ static int cb_menu_viewer(void)
static struct cb_command cb_get_viewer_command (void) {
int button;
struct cb_command result = { 0, {0,0,0,0,0}, 0 };
/* main loop */
while ( true ) {
button = rb->button_get(true);
@ -476,7 +476,7 @@ static void cb_start_viewer(char* filename){
/* init board */
GNUChess_Initialize();
/* draw the board */
cb_drawboard();
@ -494,7 +494,7 @@ static void cb_start_viewer(char* filename){
rb->splash ( HZ*2 , "At the begining of the game" );
break;
}
board[locn[curr_ply->row_from][curr_ply->column_from]]
board[locn[curr_ply->row_from][curr_ply->column_from]]
= board[locn[curr_ply->row_to][curr_ply->column_to]];
color[locn[curr_ply->row_from][curr_ply->column_from]]
= color[locn[curr_ply->row_to][curr_ply->column_to]];
@ -601,14 +601,14 @@ static int cb_menu(void)
int selection;
int result = 0;
bool menu_quit = false;
MENUITEM_STRINGLIST(menu,"Chessbox Menu",NULL,"New Game","Resume Game",
"Save Game", "Restore Game",
#ifdef HAVE_PLAYBACK_CONTROL
"Playback Control",
#endif
"Quit");
"Quit");
while(!menu_quit)
{
switch(rb->do_menu(&menu, &selection, NULL, false))
@ -654,7 +654,7 @@ static struct cb_command cb_getcommand (void) {
int marked = false , from_marked = false ;
short marked_x = 0 , marked_y = 0 ;
struct cb_command result = { 0, {0,0,0,0,0}, 0 };
cb_switch ( x , y );
/* main loop */
while ( true ) {
@ -815,11 +815,11 @@ static void cb_play_game(void) {
/* init PGN history data structures */
game = pgn_init_game();
/* restore saved position, if saved */
cb_restoreposition();
/* TODO: save/restore the PGN history of unfinished games */
/* draw the board */
/* I don't like configscreens, start game inmediatly */
cb_drawboard();
@ -937,7 +937,7 @@ static void cb_play_game(void) {
break;
}
}
cb_saveposition();
/* TODO: save/restore the PGN history of unfinished games */
rb->lcd_setfont(FONT_UI);
@ -948,7 +948,7 @@ static void cb_play_game(void) {
* plugin entry point.
******************************************************************************/
enum plugin_status plugin_start(const void* parameter) {
/* plugin init */
#if LCD_DEPTH > 1
@ -957,7 +957,7 @@ enum plugin_status plugin_start(const void* parameter) {
/* end of plugin init */
/* if the plugin was invoked as a viewer, parse the file and show the game list
/* if the plugin was invoked as a viewer, parse the file and show the game list
* else, start playing a game
*/
if (parameter != NULL) {