From c2a5e9675e41feddadb6e06544dedc3afdc6ae66 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 3 Jul 2013 15:59:41 +0200 Subject: [PATCH] Expand number of marker colors to 8 The markers for -showTargetSquares are now no longer tied to the highlight and premove highlight colors, but are hard-coded RGB, YCM and BW. --- backend.c | 12 +++++++++--- draw.c | 4 +++- winboard/winboard.c | 14 ++++++++------ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/backend.c b/backend.c index b8ebf8f..abc4495 100644 --- a/backend.c +++ b/backend.c @@ -7020,7 +7020,7 @@ MarkByFEN(char *fen) { int r, f; if(!appData.markers || !appData.highlightDragging) return; - for(r=0; r BOARD_LEFT) f = BOARD_LEFT, r--; else if(*fen == 'T') marker[r][f++] = 0; else if(*fen == 'Y') marker[r][f++] = 1; else + if(*fen == 'G') marker[r][f++] = 3; else + if(*fen == 'B') marker[r][f++] = 4; else + if(*fen == 'C') marker[r][f++] = 5; else + if(*fen == 'M') marker[r][f++] = 6; else + if(*fen == 'W') marker[r][f++] = 7; else + if(*fen == 'D') marker[r][f++] = 8; else if(*fen == 'R') marker[r][f++] = 2; else { while(*fen <= '9' && *fen >= '0') s = 10*s + *fen++ - '0'; f += s; fen -= s>0; @@ -7109,8 +7115,8 @@ void ReportClick(char *action, int x, int y) { char buf[MSG_SIZ]; // Inform engine of what user does int r, f; - if(action[0] == 'l') // mark any target square of a lifted piece as legal to-square - for(r=0; r 0 ) { fontBitmapSquareSize = 0; } @@ -3620,7 +3623,7 @@ void DrawSeekDot(int x, int y, int color) { int square = color & 0x80; HBRUSH oldBrush = SelectObject(hdcSeek, - color == 0 ? markerBrush : color == 1 ? darkSquareBrush : explodeBrush); + color == 0 ? markerBrush[1] : color == 1 ? darkSquareBrush : explodeBrush); color &= 0x7F; if(square) Rectangle(hdcSeek, boardRect.left+x - squareSize/9, boardRect.top+y - squareSize/9, @@ -3913,8 +3916,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) for (row = 0; row < BOARD_HEIGHT; row++) { for (column = 0; column < BOARD_WIDTH; column++) { if (marker[row][column]) { // marker changes only occur with full repaint! - HBRUSH oldBrush = SelectObject(hdcmem, - marker[row][column] == 2 ? markerBrush : explodeBrush); + HBRUSH oldBrush = SelectObject(hdcmem, markerBrush[marker[row][column]-1]); SquareToPos(row, column, &x, &y); Ellipse(hdcmem, x + squareSize/4, y + squareSize/4, x + 3*squareSize/4, y + 3*squareSize/4); -- 1.7.0.4