* Massachusetts.\r
*\r
* Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006,\r
- * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.\r
+ * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free\r
+ * Software Foundation, Inc.\r
*\r
* Enhancements Copyright 2005 Alessandro Scotti\r
*\r
pieceBitmap[0][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "s");\r
pieceBitmap[1][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "o");\r
pieceBitmap[2][WhiteLion] = DoLoadBitmap(hInst, "ln", squareSize, "w");\r
+ pieceBitmap[0][WhiteCub] = DoLoadBitmap(hInst, "ln", squareSize, "s");\r
+ pieceBitmap[1][WhiteCub] = DoLoadBitmap(hInst, "ln", squareSize, "o");\r
+ pieceBitmap[2][WhiteCub] = DoLoadBitmap(hInst, "ln", squareSize, "w");\r
+ pieceBitmap[0][WhiteWolf] = DoLoadBitmap(hInst, "wolf", squareSize, "s");\r
+ pieceBitmap[1][WhiteWolf] = DoLoadBitmap(hInst, "wolf", squareSize, "o");\r
+ pieceBitmap[2][WhiteWolf] = DoLoadBitmap(hInst, "wolf", squareSize, "w");\r
+ pieceBitmap[0][WhiteCamel] = DoLoadBitmap(hInst, "camel", squareSize, "s");\r
+ pieceBitmap[1][WhiteCamel] = DoLoadBitmap(hInst, "camel", squareSize, "o");\r
+ pieceBitmap[2][WhiteCamel] = DoLoadBitmap(hInst, "camel", squareSize, "w");\r
+ pieceBitmap[0][WhiteZebra] = DoLoadBitmap(hInst, "zebra", squareSize, "s");\r
+ pieceBitmap[1][WhiteZebra] = DoLoadBitmap(hInst, "zebra", squareSize, "o");\r
+ pieceBitmap[2][WhiteZebra] = DoLoadBitmap(hInst, "n", squareSize, "w");\r
\r
if(gameInfo.variant == VariantShogi && BOARD_HEIGHT != 7) { /* promoted Gold representations (but not in Tori!)*/\r
pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "s");\r
{\r
}\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
if(saveDiagFlag) { \r
BITMAP b; int i, j=0, m, w, wb, fac=0; char *pData; \r
BITMAPINFOHEADER bih; int color[16], nrColors=0;\r
+ HBITMAP src = bufferBitmap, obmp; HDC tmp = CreateCompatibleDC(hdc);\r
\r
+ bufferBitmap = CreateCompatibleBitmap(hdc, boardRect.right-boardRect.left, Rect.bottom-Rect.top-2*OUTER_MARGIN);\r
+ obmp = SelectObject(tmp, bufferBitmap);\r
+ BitBlt(tmp, 0, 0, boardRect.right - boardRect.left, Rect.bottom - Rect.top - 2*OUTER_MARGIN,\r
+ tmphdc, boardRect.left, OUTER_MARGIN, SRCCOPY);\r
GetObject(bufferBitmap, sizeof(b), &b);\r
if(pData = malloc(b.bmWidthBytes*b.bmHeight + 10000)) {\r
bih.biSize = sizeof(BITMAPINFOHEADER);\r
fputc(pData[i], diagFile);\r
free(pData);\r
}\r
+ DeleteObject(bufferBitmap); bufferBitmap = src;\r
+ SelectObject(tmp, obmp);\r
+ DeleteDC(tmp);\r
}\r
\r
SelectObject(tmphdc, oldBitmap);\r
fprintf(debugFP, "%s: %s\n", label, str);\r
}\r
if (appData.popupExitMessage) {\r
+ if(appData.icsActive) SendToICS("logout\n"); // [HGM] make sure no new games will be started!\r
(void) MessageBox(hwndMain, str, label, MB_OK|\r
(exitStatus ? MB_ICONSTOP : MB_ICONINFORMATION));\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.piece = piece;\r
for (n = 0; n < nFrames; n++) {\r
animInfo.pos = frames[n];\r
- DrawPosition(FALSE, NULL);\r
+ DrawPosition(FALSE, board);\r
animInfo.lastpos = animInfo.pos;\r
Sleep(appData.animSpeed);\r
}\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
+ DrawPosition(FALSE, board);\r
+\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