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
{ "autoLogo", ArgBoolean, (LPVOID) &appData.autoLogo, TRUE },\r
{ "firstOptions", ArgString, (LPVOID) &appData.firstOptions, FALSE },\r
{ "secondOptions", ArgString, (LPVOID) &appData.secondOptions, FALSE },\r
+ { "firstNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride1, FALSE },\r
+ { "secondNeedsNoncompliantFEN", ArgString, (LPVOID) &appData.fenOverride2, FALSE },\r
\r
#ifdef ZIPPY\r
{ "zippyTalk", ArgBoolean, (LPVOID) &appData.zippyTalk, FALSE },\r
{ "zippyVariants", ArgString, (LPVOID) &appData.zippyVariants, FALSE },\r
{ "zippyMaxGames", ArgInt, (LPVOID)&appData.zippyMaxGames, FALSE },\r
{ "zippyReplayTimeout", ArgInt, (LPVOID)&appData.zippyReplayTimeout, FALSE },\r
+ { "zippyShortGame", ArgInt, (LPVOID)&appData.zippyShortGame, FALSE },\r
/* Kludge to allow winboard.ini files from buggy 4.0.4 to be read: */\r
{ "zippyReplyTimeout", ArgInt, (LPVOID)&junk, FALSE },\r
#endif\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
/* [AS] Also move "attached" child windows */\r
case WM_WINDOWPOSCHANGING:\r
+\r
if( hwnd == hwndMain && appData.useStickyWindows ) {\r
LPWINDOWPOS lpwp = (LPWINDOWPOS) lParam;\r
\r
/* Window is moving */\r
RECT rcMain;\r
\r
- GetWindowRect( hwnd, &rcMain );\r
+// GetWindowRect( hwnd, &rcMain ); //[HGM] sticky: in XP this returned new position, not old\r
+ rcMain.left = boardX; // replace by these 4 lines to reconstruct old rect\r
+ rcMain.right = boardX + winWidth;\r
+ rcMain.top = boardY;\r
+ rcMain.bottom = boardY + winHeight;\r
\r
ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, moveHistoryDialog, &wpMoveHistory );\r
ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, evalGraphDialog, &wpEvalGraph );\r
ReattachAfterMove( &rcMain, lpwp->x, lpwp->y, engineOutputDialog, &wpEngineOutput );\r
+ boardX = lpwp->x;\r
+ boardY = lpwp->y;\r
}\r
}\r
break;\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