X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=aa138368e3c59b68a0b9ea5f6464449cf5d528be;hb=d138c95b1f4dad365548a9d77321f626ef704c90;hp=c3dcf9774bbbec3e8227ea609f8d8e8ef4c2908f;hpb=ac647cc1aa823dd59b600245e5cc014ae85e1ce9;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index c3dcf97..aa13836 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -191,6 +191,7 @@ static HBITMAP pieceBitmap[3][(int) BlackPawn]; /* [HGM] nr of bitmaps referred static HBRUSH lightSquareBrush, darkSquareBrush, blackSquareBrush, /* [HGM] for band between board and holdings */ explodeBrush, /* [HGM] atomic */ + markerBrush, /* [HGM] markers */ whitePieceBrush, blackPieceBrush, iconBkgndBrush /*, outlineBrush*/; static POINT gridEndpoints[(BOARD_RANKS + BOARD_FILES + 2) * 2]; static DWORD gridVertexCounts[BOARD_RANKS + BOARD_FILES + 2]; @@ -1853,6 +1854,7 @@ InitDrawingColors() blackPieceBrush = CreateSolidBrush(blackPieceColor); iconBkgndBrush = CreateSolidBrush(GetSysColor(COLOR_BACKGROUND)); explodeBrush = CreateSolidBrush(highlightSquareColor); // [HGM] atomic + markerBrush = CreateSolidBrush(premoveHighlightColor); // [HGM] markers /* [AS] Force rendering of the font-based pieces */ if( fontBitmapSquareSize > 0 ) { fontBitmapSquareSize = 0; @@ -3312,6 +3314,18 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) DrawHighlightsOnDC(hdcmem); DrawBoardOnDC(hdcmem, board, tmphdc); } + 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); + SquareToPos(row, column, &x, &y); + Ellipse(hdcmem, x + squareSize/4, y + squareSize/4, + x + 3*squareSize/4, y + 3*squareSize/4); + SelectObject(hdcmem, oldBrush); + } + } + } if(logoHeight) { HBITMAP whiteLogo = (HBITMAP) first.programLogo, blackLogo = (HBITMAP) second.programLogo; if(appData.autoLogo) { @@ -3772,8 +3786,10 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) DrawPosition(TRUE, NULL); switch (gameMode) { - case EditPosition: case IcsExamining: + if(x < BOARD_LEFT || x >= BOARD_RGHT) break; + case EditPosition: + if (x == BOARD_LEFT-1 || x == BOARD_RGHT) break; if (x < 0 || y < 0) break; fromX = x; fromY = y;