From: H.G. Muller Date: Fri, 5 Oct 2012 17:25:58 +0000 (+0200) Subject: Cleanup CairoOverlayPiece X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=85c4c1dd51c5f07caf7437ddb427cd7389cf5e3e;p=xboard.git Cleanup CairoOverlayPiece --- diff --git a/backend.h b/backend.h index 074ab98..d5cba54 100644 --- a/backend.h +++ b/backend.h @@ -289,6 +289,7 @@ typedef struct XB_ListGame { GameInfo gameInfo; /* Note that some entries may be NULL. */ } ListGame; +extern int doubleClick; extern int storedGames; extern int opponentKibitzes; extern ChessSquare gatingPiece; diff --git a/xboard.c b/xboard.c index 3153450..3d05f69 100644 --- a/xboard.c +++ b/xboard.c @@ -4148,16 +4148,7 @@ OverlayPiece (ChessSquare piece, GC clip, GC outline, Drawable dest) static void CairoOverlayPiece (ChessSquare piece, cairo_surface_t *dest) { - static ChessSquare oldPiece = -1; - static int oldSize; static cairo_t *pieceSource; - extern int doubleClick; // in backend.c -// if(piece != oldPiece || squareSize != oldSize) { // try make it faster by only changing cr if we need other piece -// if(pieceSource) cairo_destroy (pieceSource); -// pieceSource = cairo_create (dest); -// cairo_set_source_surface (pieceSource, pngPieceBitmaps[!White(piece)][piece % BlackPawn], 0, 0); -// oldPiece = piece; oldSize = squareSize; -// } pieceSource = cairo_create (dest); cairo_set_source_surface (pieceSource, pngPieceBitmaps[!White(piece)][piece % BlackPawn], 0, 0); if(doubleClick) cairo_paint_with_alpha (pieceSource, 0.6);