From b7d7c902b3f869f85816a2da3872b03119affd3a Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 8 Feb 2013 15:14:43 +0100 Subject: [PATCH] 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. --- draw.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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); -- 1.7.0.4