X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwinboard.c;h=96bebcb4ad22a6c529d0f90f650dd6b1a592c7d4;hb=43ca8ade023eaa6b6fd2fac6b2aeb1a6ea69287f;hp=c6a443ed2fd2e25bf9719500d62748be4d5167fc;hpb=cd09c1f0a427cdce02abb65d05dc7279a1557c99;p=xboard.git diff --git a/winboard/winboard.c b/winboard/winboard.c index c6a443e..96bebcb 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -2727,6 +2727,15 @@ InitDrawingSizes(BoardSize boardSize, int flags) pieceBitmap[0][WhiteZebra] = DoLoadBitmap(hInst, "zebra", squareSize, "s"); pieceBitmap[1][WhiteZebra] = DoLoadBitmap(hInst, "zebra", squareSize, "o"); pieceBitmap[2][WhiteZebra] = DoLoadBitmap(hInst, "n", squareSize, "w"); + pieceBitmap[0][WhiteTower] = DoLoadBitmap(hInst, "tower", squareSize, "s"); + pieceBitmap[1][WhiteTower] = DoLoadBitmap(hInst, "tower", squareSize, "o"); + pieceBitmap[2][WhiteTower] = DoLoadBitmap(hInst, "tower", squareSize, "w"); + pieceBitmap[0][WhiteSword] = DoLoadBitmap(hInst, "sword", squareSize, "s"); + pieceBitmap[1][WhiteSword] = DoLoadBitmap(hInst, "sword", squareSize, "o"); + pieceBitmap[2][WhiteSword] = DoLoadBitmap(hInst, "sword", squareSize, "w"); + pieceBitmap[0][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "s"); + pieceBitmap[1][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "o"); + pieceBitmap[2][WhiteGnu] = DoLoadBitmap(hInst, "gnu", squareSize, "w"); if(gameInfo.variant == VariantShogi && BOARD_HEIGHT != 7) { /* promoted Gold representations (but not in Tori!)*/ pieceBitmap[0][WhiteCannon] = DoLoadBitmap(hInst, "wp", squareSize, "s"); @@ -3754,6 +3763,9 @@ void DrawSeekClose() } + + + VOID HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) { @@ -3974,6 +3986,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) 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[0][animInfo.to.y][animInfo.to.x] = animInfo.piece; } } @@ -4176,6 +4189,7 @@ HDCDrawPosition(HDC hdc, BOOLEAN repaint, Board board) if(fac) for(i=0; i<16; i++) fputDW(diagFile, color[i]); // write bitmap data + for(i=0; i= EmptySquare) return; - if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square + if(x2 >= 0) toX = kill2X, toY = kill2Y, victim = board[killY][killX], victim2 = board[kill2Y][kill2X]; else + if(killX >= 0) toX = killX, toY = killY, victim = board[killY][killX]; // [HGM] lion: first to kill square + + animInfo.from.x = fromX; + animInfo.from.y = fromY; again: @@ -10089,22 +10115,30 @@ again: else Tween(&start, &mid, &finish, kFactor, frames, &nFrames); - animInfo.from.x = fromX; - animInfo.from.y = fromY; animInfo.to.x = toX; animInfo.to.y = toY; animInfo.lastpos = start; animInfo.piece = piece; for (n = 0; n < nFrames; n++) { animInfo.pos = frames[n]; - DrawPosition(FALSE, NULL); + DrawPosition(FALSE, board); animInfo.lastpos = animInfo.pos; Sleep(appData.animSpeed); } animInfo.pos = finish; - DrawPosition(FALSE, NULL); - - if(toX != x || toY != y) { fromX = toX; fromY = toY; toX = x; toY = y; goto again; } // second leg + DrawPosition(FALSE, board); + + if(toX == x2 && toY == kill2Y) { + fromX = toX; fromY = toY; toX = killX; toY = killY; x2 = -1; + board[kill2Y][kill2X] = EmptySquare; goto again; + } // second leg + if(toX != x || toY != y) { + fromX = toX; fromY = toY; toX = x; toY = y; + board[killY][killX] = EmptySquare; goto again; + } // second leg + +if(victim2 != EmptySquare) board[kill2Y][kill2X] = victim2; +if(victim != EmptySquare) board[killY][killX] = victim; animInfo.piece = EmptySquare; Explode(board, fromX, fromY, toX, toY);