X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=384ccfb5b1933fda83f538e5550b7a7f0e43c44d;hb=49254d2c6abc5586805adb5186172fabefcad7d9;hp=53156f0a0c629e51e0bf9ab7f8c90f49531cc3b7;hpb=dd67211f46050409861a109a9778af6594279569;p=xboard.git diff --git a/draw.c b/draw.c index 53156f0..384ccfb 100644 --- a/draw.c +++ b/draw.c @@ -124,13 +124,10 @@ struct { int x1, x2, y1, y2; } gridSegments[BOARD_RANKS + BOARD_FILES + 2]; -static int dual = 0; - void -SwitchWindow () +SwitchWindow (int main) { - dual = !dual; - currBoard = (dual ? &mainOptions[W_BOARD] : &dualOptions[3]); + currBoard = (main ? &mainOptions[W_BOARD] : &dualOptions[3]); csBoardWindow = DRAWABLE(currBoard); } @@ -627,7 +624,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 +633,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);