}\r
\r
\r
+\r
VOID\r
HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board)\r
{\r
explodes. The old and new positions both had an empty square\r
at the destination, but animation has drawn a piece there and\r
we have to remember to erase it. [HGM] moved until after setting lastDrawn */\r
+\r
lastDrawn[0][animInfo.to.y][animInfo.to.x] = animInfo.piece;\r
}\r
}\r
*/\r
if (nice < -15) return 0x00000080;\r
if (nice < 0) return 0x00008000;\r
+\r
if (nice == 0) return 0x00000020;\r
if (nice < 15) return 0x00004000;\r
return 0x00000040;\r
int toX;\r
int toY;\r
{\r
- ChessSquare piece;\r
- int x = toX, y = toY;\r
+ ChessSquare piece, victim = EmptySquare, victim2 = EmptySquare;\r
+ int x = toX, y = toY, x2 = kill2X;\r
POINT start, finish, mid;\r
POINT frames[kFactor * 2 + 1];\r
int nFrames, n;\r
piece = board[fromY][fromX];\r
if (piece >= EmptySquare) return;\r
\r
- if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square\r
+ if(x2 >= 0) toX = kill2X, toY = kill2Y, victim = board[killY][killX], victim2 = board[kill2Y][kill2X]; else\r
+ if(killX >= 0) toX = killX, toY = killY, victim = board[killY][killX]; // [HGM] lion: first to kill square\r
+\r
+ animInfo.from.x = fromX;\r
+ animInfo.from.y = fromY;\r
\r
again:\r
\r
else\r
Tween(&start, &mid, &finish, kFactor, frames, &nFrames);\r
\r
- animInfo.from.x = fromX;\r
- animInfo.from.y = fromY;\r
animInfo.to.x = toX;\r
animInfo.to.y = toY;\r
animInfo.lastpos = start;\r
animInfo.pos = finish;\r
DrawPosition(FALSE, NULL);\r
\r
- if(toX != x || toY != y) { fromX = toX; fromY = toY; toX = x; toY = y; goto again; } // second leg\r
+ if(toX == x2 && toY == kill2Y) {\r
+ fromX = toX; fromY = toY; toX = killX; toY = killY; x2 = -1;\r
+ board[kill2Y][kill2X] = EmptySquare; goto again;\r
+ } // second leg\r
+ if(toX != x || toY != y) {\r
+ fromX = toX; fromY = toY; toX = x; toY = y;\r
+ board[killY][killX] = EmptySquare; goto again;\r
+ } // second leg\r
+\r
+if(victim2 != EmptySquare) board[kill2Y][kill2X] = victim2;\r
+if(victim != EmptySquare) board[killY][killX] = victim;\r
\r
animInfo.piece = EmptySquare;\r
Explode(board, fromX, fromY, toX, toY);\r