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;
}
{
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) */
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(piece == DarkSquare) square_color = 2;
if(square_color == 2 || appData.blindfold) piece = EmptySquare;
if (do_flash && piece != EmptySquare && appData.flashCount > 0) {
for (i=0; i<appData.flashCount; ++i) {
- DrawOneSquare(x, y, piece, square_color, 0, string, 0);
+ DrawOneSquare(x, y, piece, square_color, 0, tString, bString, 0);
GraphExpose(currBoard, x, y, squareSize, squareSize);
FlashDelay(flash_delay);
- DrawOneSquare(x, y, EmptySquare, square_color, 0, string, 0);
+ DrawOneSquare(x, y, EmptySquare, square_color, 0, tString, bString, 0);
GraphExpose(currBoard, x, y, squareSize, squareSize);
FlashDelay(flash_delay);
}
}
- DrawOneSquare(x, y, piece, square_color, partnerUp ? 0 : marker[row][column], string, align);
+ DrawOneSquare(x, y, piece, square_color, partnerUp ? 0 : marker[row][column], tString, bString, align);
}
/* Returns 1 if there are "too many" differences between b1 and b2
MarkMenuItem("View.Flip View", flipView);
}
- if(nr) { SlavePopUp(); SwitchWindow(); } // [HGM] popup board if not yet popped up, and switch drawing to it.
+ if(nr) { SlavePopUp(); SwitchWindow(0); } // [HGM] popup board if not yet popped up, and switch drawing to it.
/*
* It would be simpler to clear the window with XClearWindow()
GraphExpose(currBoard, x - lineGap, y - lineGap, squareSize + 2*lineGap, squareSize + 2*lineGap);
else
GraphExpose(currBoard, x, y, squareSize, squareSize);
- damage[nr][i][j] &= ~2; // remember damage by newly drawn error in '2' bit, to schedule it for erasure next draw
+ damage[nr][i][j] &= 2; // remember damage by newly drawn error in '2' bit, to schedule it for erasure next draw
}
}
FlashDelay(0); // this flushes drawing queue;
- if(nr) SwitchWindow();
+ if(nr) SwitchWindow(1);
}
/* [AS] Arrow highlighting support */