From: H.G. Muller Date: Mon, 4 Apr 2011 17:26:53 +0000 (+0200) Subject: Fix animation masks on changing piece pixmaps X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=8a03ebeed96f122200d439a856083f09e393a2fe;p=xboard.git Fix animation masks on changing piece pixmaps The animation masks were not remade when new pieces were loaded interactively through the board-options dialog. --- diff --git a/xboard.c b/xboard.c index bd9ff8f..3771130 100644 --- a/xboard.c +++ b/xboard.c @@ -3441,6 +3441,8 @@ void CreateXIMPieces() XSynchronize(xDisplay, False); /* Work-around for xlib/xt buffering bug */ } +static VariantClass oldVariant = (VariantClass) -1; // [HGM] pieces: redo every time variant changes + #if HAVE_LIBXPM void CreateXPMBoard(char *s, int kind) { @@ -3599,6 +3601,7 @@ void CreateXPMPieces() xpmJailSquare = xpmLightSquare; fprintf(stderr, _("Done.\n")); } + oldVariant = -1; // kludge to force re-makig of animation masks XSynchronize(xDisplay, False); /* Work-around for xlib/xt buffering bug */ } @@ -8271,11 +8274,10 @@ InitAnimState (anim, info) static void CreateAnimVars () { - static VariantClass old = (VariantClass) -1; // [HGM] pieces: redo every time variant changes XWindowAttributes info; - if (xpmDone && gameInfo.variant == old) return; - if(xpmDone) old = gameInfo.variant; // first time pieces might not be created yet + if (xpmDone && gameInfo.variant == oldVariant) return; + if(xpmDone) oldVariant = gameInfo.variant; // first time pieces might not be created yet XGetWindowAttributes(xDisplay, xBoardWindow, &info); InitAnimState(&game, &info);