From: H.G. Muller Date: Fri, 8 Feb 2013 14:14:43 +0000 (+0100) Subject: Revive -flipBlack option X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=b7d7c902b3f869f85816a2da3872b03119affd3a;p=xboard.git Revive -flipBlack option The -flipBlack option in the cairo version is now implemented the same way as it was in XBoard, swapping white and black pieces in filpView mode. This requires a set black piece images that are the upside-down versions of the white ones. --- diff --git a/draw.c b/draw.c index 53156f0..45aaf01 100644 --- a/draw.c +++ b/draw.c @@ -627,7 +627,7 @@ BlankSquare (cairo_surface_t *dest, int x, int y, int color, ChessSquare piece, static void pngDrawPiece (cairo_surface_t *dest, ChessSquare piece, int square_color, int x, int y) { - int kind, p = piece; + int kind; cairo_t *cr; if ((int)piece < (int) BlackPawn) { @@ -636,7 +636,7 @@ pngDrawPiece (cairo_surface_t *dest, ChessSquare piece, int square_color, int x, kind = 1; piece -= BlackPawn; } - if(appData.upsideDown && flipView) { p += p < BlackPawn ? BlackPawn : -BlackPawn; }// swap white and black pieces + if(appData.upsideDown && flipView) kind = 1 - kind; // swap white and black pieces BlankSquare(dest, x, y, square_color, piece, 1); // erase previous contents with background cr = cairo_create (dest); cairo_set_source_surface (cr, pngPieceBitmaps[kind][piece], x, y);