X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=45aaf01fa3ff52b3a71fe567b3834e51d81063f1;hb=b7d7c902b3f869f85816a2da3872b03119affd3a;hp=53156f0a0c629e51e0bf9ab7f8c90f49531cc3b7;hpb=b26b0121f5fae16ac114604a488a4b7afe89e5c9;p=xboard.git 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);