From: H.G. Muller Date: Sat, 13 Jun 2009 16:07:07 +0000 (-0700) Subject: Fixed bug in atomic patch that interfered with non-atomic variants X-Git-Tag: v4.4.0.alpha6~12 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d397edb934a78bb4d0ceec02cd3768cc7244be99;hp=3278933131ffc6d325e57eb6a131aee06d624b97;p=xboard.git Fixed bug in atomic patch that interfered with non-atomic variants --- diff --git a/winboard/winboard.c b/winboard/winboard.c index 7d8c272..49df8ee 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -4481,7 +4481,14 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) x2 = boardRect.left + animInfo.pos.x; y2 = boardRect.top + animInfo.pos.y; clips[num_clips++] = CreateRectRgn(MIN(x,x2), MIN(y,y2), MAX(x,x2)+squareSize, MAX(y,y2)+squareSize); - /* [HGM] old location of "slight kludge" below */ + /* Slight kludge. The real problem is that after AnimateMove is + done, the position on the screen does not match lastDrawn. + This currently causes trouble only on e.p. captures in + atomic, where the piece moves to an empty square and then + explodes. The old and new positions both had an empty square + at the destination, but animation has drawn a piece there and + we have to remember to erase it. [HGM] moved until after setting lastDrawn */ + lastDrawn[animInfo.to.y][animInfo.to.x] = animInfo.piece; } } @@ -4558,14 +4565,6 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) DrawPieceOnDC(hdcmem, animInfo.piece, ((int) animInfo.piece < (int) BlackPawn), (animInfo.from.y + animInfo.from.x) % 2, x, y, tmphdc); - /* Slight kludge. The real problem is that after AnimateMove is - done, the position on the screen does not match lastDrawn. - This currently causes trouble only on e.p. captures in - atomic, where the piece moves to an empty square and then - explodes. The old and new positions both had an empty square - at the destination, but animation has drawn a piece there and - we have to remember to erase it. [HGM] moved until after setting lastDrawn */ - lastDrawn[animInfo.to.y][animInfo.to.x] = animInfo.piece; } /* Release the bufferBitmap by selecting in the old bitmap