X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=5eb6baab77ebafad374700366d32d82c9688323f;hb=6341a1e8f282d099affed789a69bad4660fe9cdc;hp=bbe4a79a5b293a77818736ddc7479610e6643e15;hpb=56fd0c5021f5074a510ae8f170338656ee243ec7;p=xboard.git diff --git a/draw.c b/draw.c index bbe4a79..5eb6baa 100644 --- a/draw.c +++ b/draw.c @@ -759,13 +759,7 @@ BlankSquare (cairo_surface_t *dest, int x, int y, int color, ChessSquare piece, cr = cairo_create (dest); - if ((useTexture & color+1) && CutOutSquare(x, y, &x0, &y0, color)) { - cairo_set_source_surface (cr, pngBoardBitmap[color], x*fac - x0, y*fac - y0); - cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); - cairo_rectangle (cr, x*fac, y*fac, squareSize, squareSize); - cairo_fill (cr); - cairo_destroy (cr); - } else { // evenly colored squares + { // evenly colored squares char *col = NULL; switch (color) { case 0: col = appData.darkSquareColor; break; @@ -777,8 +771,14 @@ BlankSquare (cairo_surface_t *dest, int x, int y, int color, ChessSquare piece, cairo_rectangle (cr, fac*x, fac*y, squareSize, squareSize); cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); cairo_fill (cr); - cairo_destroy (cr); } + if ((useTexture & color+1) && CutOutSquare(x, y, &x0, &y0, color)) { + cairo_set_source_surface (cr, pngBoardBitmap[color], x*fac - x0, y*fac - y0); + cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); + cairo_rectangle (cr, x*fac, y*fac, squareSize, squareSize); + cairo_fill (cr); + } + cairo_destroy (cr); } static void @@ -793,6 +793,7 @@ pngDrawPiece (cairo_surface_t *dest, ChessSquare piece, int square_color, int x, kind = 1; piece -= BlackPawn; } + if(piece == WhiteKing && kind == appData.jewelled) piece = WhiteZebra; 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); @@ -902,6 +903,7 @@ InscribeKanji (cairo_surface_t *canvas, ChessSquare piece, int x, int y) p = appData.inscriptions; n = piece; while(piece > WhitePawn) { + if(*p == '/') p++, piece = n - WhitePBishop; // secondary series if(*p++ == NULLCHAR) { if(n != WhiteKing) return; p = q;