From: H.G. Muller Date: Mon, 7 Oct 2013 15:00:42 +0000 (+0200) Subject: Animate both legs of Lion move X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7be221b22bc0e10fa8c2b71b6506398d1f42cb0f;p=xboard.git Animate both legs of Lion move --- diff --git a/backend.c b/backend.c index 71e7099..11ce0e6 100644 --- a/backend.c +++ b/backend.c @@ -10069,8 +10069,6 @@ MakeMove (int fromX, int fromY, int toX, int toY, int promoChar) strcat(parseList[forwardMostMove - 1], "#"); break; } - - killX = killY = -1; // [HGM] lion: used up } /* Updates currentMove if not pausing */ @@ -10090,6 +10088,8 @@ ShowMove (int fromX, int fromY, int toX, int toY) currentMove = forwardMostMove; } + killX = killY = -1; // [HGM] lion: used up + if (instant) return; DisplayMove(currentMove - 1); @@ -11765,6 +11765,7 @@ LoadGameOneMove (ChessMove readAhead) thinkOutput[0] = NULLCHAR; MakeMove(fromX, fromY, toX, toY, promoChar); + killX = killY = -1; // [HGM] lion: used up currentMove = forwardMostMove; return TRUE; } diff --git a/board.c b/board.c index 48f075d..8df780b 100644 --- a/board.c +++ b/board.c @@ -599,7 +599,7 @@ void AnimateMove (Board board, int fromX, int fromY, int toX, int toY) { ChessSquare piece; - int hop; + int hop, x = toX, y = toY; Pnt start, finish, mid; Pnt frames[kFactor * 2 + 1]; int nFrames, startColor, endColor; @@ -616,6 +616,10 @@ AnimateMove (Board board, int fromX, int fromY, int toX, int toY) piece = board[fromY][fromX]; if (piece >= EmptySquare) return; + if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square + +again: + #if DONT_HOP hop = FALSE; #else @@ -653,6 +657,8 @@ AnimateMove (Board board, int fromX, int fromY, int toX, int toY) /* Be sure end square is redrawn */ damage[0][toY][toX] |= True; + + if(toX != x || toY != y) { fromX = toX; fromY = toY; toX = x; toY = y; goto again; } // second leg } void