From: H.G. Muller Date: Wed, 5 Jan 2011 16:31:37 +0000 (+0100) Subject: Fix WB font-based piece rendering on variant switch X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=040cf1c2a55625ab41f0b3b930f56beb8d9fed3f;p=xboard.git 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. --- 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]); }