X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=5eb6baab77ebafad374700366d32d82c9688323f;hb=077968e4416346f9e4e8576d72ccc98d84c598d8;hp=1604a23a4bd2fe8ceadca00538fa428587019563;hpb=2f0884e0846edf141d42ea2d5e3fcbc6949f50f6;p=xboard.git diff --git a/draw.c b/draw.c index 1604a23..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 @@ -903,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;