VOID NewVariantPopup(HWND hwnd);\r
int FinishMove P((ChessMove moveType, int fromX, int fromY, int toX, int toY,\r
/*char*/int promoChar));\r
-void AnimateAtomicCapture(int toX, int toY, int nFrames);\r
+void AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames);\r
\r
typedef struct {\r
ChessSquare piece; \r
static HighlightInfo premoveHighlightInfo = { {{-1, -1}, {-1, -1}} };\r
\r
typedef struct { // [HGM] atomic\r
- int x, y, radius;\r
+ int fromX, fromY, toX, toY, radius;\r
} ExplodeInfo;\r
\r
-static ExplodeInfo explodeInfo = {0, 0, 0};\r
+static ExplodeInfo explodeInfo;\r
\r
/* Window class names */\r
char szAppName[] = "WinBoard";\r
if(explodeInfo.radius) { // [HGM] atomic\r
HBRUSH oldBrush;\r
int x, y, r=(explodeInfo.radius * squareSize)/100;\r
- SquareToPos(explodeInfo.y, explodeInfo.x, &x, &y);\r
+ board[explodeInfo.fromY][explodeInfo.fromX] = EmptySquare; // suppress display of capturer\r
+ SquareToPos(explodeInfo.toY, explodeInfo.toX, &x, &y);\r
x += squareSize/2;\r
y += squareSize/2;\r
if(!fullrepaint) {\r
PromotionPopup(hwnd); /* [HGM] Popup now calls FinishMove */\r
} else {\r
if(saveAnimate /* ^$!%@#$!$ */ && gameInfo.variant == VariantAtomic \r
- && boards[currentMove][toY][toX] != EmptySquare) AnimateAtomicCapture(toX, toY, 20);\r
+ && (boards[currentMove][toY][toX] != EmptySquare || \r
+ moveType == WhiteCapturesEnPassant || \r
+ moveType == BlackCapturesEnPassant ) )\r
+ AnimateAtomicCapture(fromX, fromY, toX, toY, 20);\r
FinishMove(moveType, fromX, fromY, toX, toY, NULLCHAR);\r
}\r
}\r
\r
\r
void\r
-AnimateAtomicCapture(int toX, int toY, int nFrames)\r
+AnimateAtomicCapture(int fromX, int fromY, int toX, int toY, int nFrames)\r
{ // [HGM] atomic: animate blast wave\r
int i;\r
if(appData.debugMode) fprintf(debugFP, "exploding (%d,%d)\n", toX, toY);\r
- explodeInfo.x = toX;\r
- explodeInfo.y = toY;\r
- for(i=0; i<nFrames; i++) {\r
+ explodeInfo.fromX = fromX;\r
+ explodeInfo.fromY = fromY;\r
+ explodeInfo.toX = toX;\r
+ explodeInfo.toY = toY;\r
+ for(i=1; i<nFrames; i++) {\r
explodeInfo.radius = (i*180)/(nFrames-1);\r
DrawPosition(FALSE, NULL);\r
Sleep(appData.animSpeed);\r
animInfo.pos = finish;\r
DrawPosition(FALSE, NULL);\r
animInfo.piece = EmptySquare;\r
- if(gameInfo.variant == VariantAtomic && board[toY][toX] != EmptySquare)\r
- AnimateAtomicCapture(toX, toY, 2*nFrames);\r
+ if(gameInfo.variant == VariantAtomic && \r
+ (board[toY][toX] != EmptySquare || fromX != toX && (piece == WhitePawn || piece == BlackPawn) ) )\r
+ AnimateAtomicCapture(fromX, fromY, toX, toY, 2*nFrames);\r
}\r
\r
/* Convert board position to corner of screen rect and color */\r