diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-04-15 11:27:47 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-04-15 11:27:47 +0000 |
commit | 7b22e99bd82a751f542fd8a1290d923510cfb381 (patch) | |
tree | a17d2814e3ca7fd5629b12ed3d04fa1c297b8e84 /apps/plugins/chessbox/chessbox.c | |
parent | 7aac7520ac369282202a753419a2dd3a2c9623b1 (diff) |
Chessbox: Patch #5052 by Miguel A. Arevalo: opening book. * Simplified drawing of board borders, and fixed a graphical glitch only visible on targets where all 4 borders are visible (ipod mini).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9676 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/chessbox/chessbox.c')
-rw-r--r-- | apps/plugins/chessbox/chessbox.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c index 5e1f53503e..edebbf234b 100644 --- a/apps/plugins/chessbox/chessbox.c +++ b/apps/plugins/chessbox/chessbox.c @@ -24,6 +24,7 @@ #ifdef HAVE_LCD_BITMAP #include "gnuchess.h" +#include "opening.h" /* type definitions */ struct cb_command { @@ -249,20 +250,16 @@ static void cb_drawboard (void) { } /* draw board limits */ - if ( LCD_WIDTH > TILE_WIDTH*8 ) { - rb->lcd_set_drawmode ( DRMODE_FG ); - rb->lcd_drawline ( XOFS - 1 , YOFS , - XOFS - 1 , YOFS + TILE_HEIGHT*8 ); - rb->lcd_drawline ( XOFS + 8*TILE_WIDTH , YOFS , - XOFS + 8*TILE_WIDTH , YOFS + TILE_HEIGHT*8 ); - } - if ( LCD_HEIGHT > TILE_HEIGHT*8 ) { - rb->lcd_set_drawmode ( DRMODE_FG ); - rb->lcd_drawline ( XOFS , YOFS - 1 , - XOFS + TILE_WIDTH*8 , YOFS - 1 ); - rb->lcd_drawline ( XOFS , YOFS + TILE_HEIGHT*8 , - XOFS + 8*TILE_WIDTH , YOFS + TILE_HEIGHT*8 ); - } +#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); +#elif LCD_WIDTH > TILE_WIDTH*8 + rb->lcd_vline(XOFS - 1, 0, LCD_HEIGHT - 1); + rb->lcd_vline(XOFS + 8*TILE_WIDTH, 0, LCD_HEIGHT - 1); +#elif LCD_HEIGHT > TILE_HEIGHT*8 + rb->lcd_hline(0, LCD_WIDTH - 1, YOFS - 1); + rb->lcd_hline(0, LCD_WIDTH - 1, YOFS + TILE_HEIGHT*8); +#endif + rb->lcd_update(); } @@ -273,6 +270,7 @@ void cb_switch ( short x , short y ) { YOFS + ( 7 - y )*TILE_HEIGHT +1 , TILE_WIDTH-2 , TILE_HEIGHT-2 ); rb->lcd_update(); + rb->lcd_set_drawmode ( DRMODE_SOLID ); } /* ---- callback for capturing interaction while thinking ---- */ @@ -370,6 +368,7 @@ void cb_saveposition ( void ) { rb->write(fd, &(kingmoved[white]), sizeof(kingmoved[white])); rb->write(fd, &(kingmoved[black]), sizeof(kingmoved[black])); + rb->write(fd, &(withbook), sizeof(withbook)); rb->write(fd, &(Level), sizeof(Level)); rb->write(fd, &(TCflag), sizeof(TCflag)); rb->write(fd, &(OperatorTime), sizeof(OperatorTime)); @@ -421,6 +420,7 @@ void cb_restoreposition ( void ) { rb->read(fd, &(kingmoved[white]), sizeof(kingmoved[white])); rb->read(fd, &(kingmoved[black]), sizeof(kingmoved[black])); + rb->read(fd, &(withbook), sizeof(withbook)); rb->read(fd, &(Level), sizeof(Level)); rb->read(fd, &(TCflag), sizeof(TCflag)); rb->read(fd, &(OperatorTime), sizeof(OperatorTime)); |