X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=board.c;h=0941fc97e16c11a94d7e7f890e28b7c33e92e4a4;hb=b737badf310f917fb0f7d5657fe7418aa4a8e401;hp=a0aa2fc79e54caf0b04df061c6033b7950c9b784;hpb=053dc1f79f78ff5d5d4d0f625f68a7d8076a30a0;p=xboard.git diff --git a/board.c b/board.c index a0aa2fc..0941fc9 100644 --- a/board.c +++ b/board.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -163,7 +163,7 @@ SetHighlights (int fromX, int fromY, int toX, int toY) drawHighlight(hi2X, hi2Y, 0); } } - + if(arrow) // there currently is an arrow displayed ArrowDamage(hi1X, hi1Y, hi2X, hi2Y); // mark which squares it damaged @@ -771,7 +771,7 @@ DrawDragPiece () it's being dragged around the board. So we erase the square that the piece is on and draw it at the last known drag point. */ DrawOneSquare(anims[Player].startSquare.x, anims[Player].startSquare.y, - EmptySquare, anims[Player].startColor, 0, NULL, 0); + EmptySquare, anims[Player].startColor, 0, NULL, NULL, 0); AnimationFrame(Player, &anims[Player].prevFrame, anims[Player].dragPiece); damage[0][anims[Player].startBoardY][anims[Player].startBoardX] = TRUE; } @@ -781,7 +781,7 @@ DrawSquare (int row, int column, ChessSquare piece, int do_flash) { int square_color, x, y, align=0; int i; - char string[2]; + char tString[3], bString[2]; int flash_delay; /* Calculate delay in milliseconds (2-delays per complete flash) */ @@ -799,37 +799,37 @@ DrawSquare (int row, int column, ChessSquare piece, int do_flash) square_color = SquareColor(row, column); - string[1] = NULLCHAR; + bString[1] = bString[0] = NULLCHAR; if (appData.showCoords && row == (flipView ? BOARD_HEIGHT-1 : 0) && column >= BOARD_LEFT && column < BOARD_RGHT) { - string[0] = 'a' + column - BOARD_LEFT; + bString[0] = 'a' + column - BOARD_LEFT; align = 1; // coord in lower-right corner } if (appData.showCoords && column == (flipView ? BOARD_RGHT-1 : BOARD_LEFT)) { - string[0] = ONE + row; + snprintf(tString, 3, "%d", ONE - '0' + row); align = 2; // coord in upper-left corner } if (column == (flipView ? BOARD_LEFT-1 : BOARD_RGHT) && piece > 1 ) { - string[0] = '0' + piece; + snprintf(tString, 3, "%d", piece); align = 3; // holdings count in upper-right corner } if (column == (flipView ? BOARD_RGHT : BOARD_LEFT-1) && piece > 1) { - string[0] = '0' + piece; + snprintf(tString, 3, "%d", piece); align = 4; // holdings count in upper-left corner } if(square_color == 2 || appData.blindfold) piece = EmptySquare; if (do_flash && piece != EmptySquare && appData.flashCount > 0) { for (i=0; i= 0 && pm1Y >= 0) { drawHighlight(pm1X, pm1Y, 2); - damage[nr][pm1Y][pm1X] = False; + if(lineGap) damage[nr][pm1Y][pm1X] = False; } if (pm2X >= 0 && pm2Y >= 0) { drawHighlight(pm2X, pm2Y, 2); - damage[nr][pm2Y][pm2X] = False; + if(lineGap) damage[nr][pm2Y][pm2X] = False; } if (hi1X >= 0 && hi1Y >= 0) { drawHighlight(hi1X, hi1Y, 1); - damage[nr][hi1Y][hi1X] = False; + if(lineGap) damage[nr][hi1Y][hi1X] = False; } if (hi2X >= 0 && hi2Y >= 0) { drawHighlight(hi2X, hi2Y, 1); - damage[nr][hi2Y][hi2X] = False; + if(lineGap) damage[nr][hi2Y][hi2X] = False; } DrawArrowHighlight(hi1X, hi1Y, hi2X, hi2Y); } @@ -1034,7 +1034,7 @@ DrawPosition (int repaint, Board board) } FlashDelay(0); // this flushes drawing queue; - if(nr) SwitchWindow(); + if(nr) SwitchWindow(1); } /* [AS] Arrow highlighting support */ @@ -1242,5 +1242,3 @@ DrawArrowHighlight (int fromX, int fromY, int toX,int toY) if( IsDrawArrowEnabled() && fromX >= 0 && fromY >= 0 && toX >= 0 && toY >= 0) DrawArrowBetweenSquares(fromX, fromY, toX, toY); } - -