From 8a03ebeed96f122200d439a856083f09e393a2fe Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 4 Apr 2011 19:26:53 +0200 Subject: [PATCH] Fix animation masks on changing piece pixmaps The animation masks were not remade when new pieces were loaded interactively through the board-options dialog. --- xboard.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) 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); -- 1.7.0.4