From 040cf1c2a55625ab41f0b3b930f56beb8d9fed3f Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 5 Jan 2011 17:31:37 +0100 Subject: [PATCH] Fix WB font-based piece rendering on variant switch The piece bitmaps were only created from the font characters when the number of ranks or files changed, because it was done in InitDrawingSizes(). This caused missing pieces when changing to a variant on the same board that used other pieces. Now InitDrawingSizes() is called for any variant switch. --- backend.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/backend.c b/backend.c index cd53ac6..b48ea5f 100644 --- a/backend.c +++ b/backend.c @@ -5303,8 +5303,8 @@ InitPosition(redraw) int i, j, pawnRow, overrule, oldx = gameInfo.boardWidth, oldy = gameInfo.boardHeight, - oldh = gameInfo.holdingsWidth, - oldv = gameInfo.variant; + oldh = gameInfo.holdingsWidth; + static int oldv; if(appData.icsActive) shuffleOpenings = FALSE; // [HGM] shuffle: in ICS mode, only shuffle on ICS request @@ -5566,18 +5566,12 @@ InitPosition(redraw) if(oldx != gameInfo.boardWidth || oldy != gameInfo.boardHeight || + oldv != gameInfo.variant || oldh != gameInfo.holdingsWidth -#ifdef GOTHIC - || oldv == VariantGothic || // For licensing popups - gameInfo.variant == VariantGothic -#endif -#ifdef FALCON - || oldv == VariantFalcon || - gameInfo.variant == VariantFalcon -#endif ) InitDrawingSizes(-2 ,0); + oldv = gameInfo.variant; if (redraw) DrawPosition(TRUE, boards[currentMove]); } -- 1.7.0.4