From: H.G. Muller Date: Sat, 26 Feb 2011 20:12:08 +0000 (+0100) Subject: Fix flipBlack option XBoard with board texture X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=554e83e0e983b4146d5424be557eaaf6e09ad1b5;p=xboard.git Fix flipBlack option XBoard with board texture In XBoard -flipBlack is implemented by swapping white and black pieces, because the Shogi bitmaps from XShogi are made that way. But the mask used to cut out the whole in the board texture to fit the piece was not swapped, both when drawing static pieces, as well as during animation. --- diff --git a/xboard.c b/xboard.c index 2d3a155..73bd41c 100644 --- a/xboard.c +++ b/xboard.c @@ -4263,7 +4263,7 @@ static void colorDrawPieceImage(piece, square_color, x, y, dest) } break; } - if(appData.upsideDown && flipView) kind ^= 2; // swap white and black pieces + if(appData.upsideDown && flipView) { kind ^= 2; p += p < BlackPawn ? BlackPawn : -BlackPawn; }// swap white and black pieces if(useTexture & square_color+1) { BlankSquare(x, y, square_color, piece, dest, 1); // erase previous contents with background XSetClipMask(xDisplay, wlPieceGC, xpmMask[p]); @@ -8769,6 +8769,7 @@ BeginAnimation(anim, piece, startColor, start) { Pixmap mask; + if(appData.upsideDown && flipView) piece += piece < BlackPawn ? BlackPawn : -BlackPawn; /* The old buffer is initialised with the start square (empty) */ BlankSquare(start->x, start->y, startColor, EmptySquare, anim->saveBuf, 0); anim->prevFrame = *start;