From 7d99a4a8766a9399180bfa6c5292e16fac70d4e4 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 8 Mar 2016 17:20:21 +0100 Subject: [PATCH] Improve triple-leg-move animation When both locust squares (kill and kill2) are set, animation now takes place in three stages. As kill2 is not retreived when stepping through the game history, this works only for moves just entered or played by the engine. Replayed moves are still animated in 2 stages, though, which does look pretty good on 2-out-1-in moves. --- board.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/board.c b/board.c index f0cb1c6..9bce22f 100644 --- a/board.c +++ b/board.c @@ -600,7 +600,7 @@ void AnimateMove (Board board, int fromX, int fromY, int toX, int toY) { ChessSquare piece; - int hop, x = toX, y = toY; + int hop, x = toX, y = toY, x2 = kill2X; Pnt start, finish, mid; Pnt frames[kFactor * 2 + 1]; int nFrames, startColor, endColor; @@ -621,6 +621,7 @@ AnimateMove (Board board, int fromX, int fromY, int toX, int toY) piece = board[fromY][fromX]; if (piece >= EmptySquare) return; + if(x2 >= 0) toX = kill2X, toY = kill2Y; else if(killX >= 0) toX = killX, toY = killY; // [HGM] lion: first to kill square again: @@ -663,6 +664,7 @@ again: /* Be sure end square is redrawn */ damage[0][toY][toX] |= True; + if(toX == x2 && toY == kill2Y) { fromX = toX; fromY = toY; toX = killX; toY = killY; x2 = -1; goto again; } // second leg if(toX != x || toY != y) { fromX = toX; fromY = toY; toX = x; toY = y; goto again; } // second leg } -- 1.7.0.4