X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=16c4b0d7e03eada36d022318e395169142cf162b;hb=eca734a86610900053cd02af3e78d7983fe3bb40;hp=afb639396e11b134dc8feab9a000f2d9caa4bec7;hpb=6bead4fda35db0cb9ec61309ee7cd9c99bb53475;p=xboard.git diff --git a/draw.c b/draw.c index afb6393..16c4b0d 100644 --- a/draw.c +++ b/draw.c @@ -5,7 +5,8 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -54,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -109,7 +109,7 @@ cairo_surface_t *csBoardWindow; static cairo_surface_t *pngPieceImages[2][(int)BlackPawn]; // png 256 x 256 images static cairo_surface_t *pngPieceBitmaps[2][(int)BlackPawn]; // scaled pieces as used static cairo_surface_t *pngPieceBitmaps2[2][(int)BlackPawn]; // scaled pieces in store -static RsvgHandle *svgPieces[2][(int)BlackPawn+4]; // vector pieces in store +static RsvgHandle *svgPieces[2][(int)BlackPawn]; // vector pieces in store static cairo_surface_t *pngBoardBitmap[2], *pngOriginalBoardBitmap[2]; int useTexture, textureW[2], textureH[2]; @@ -253,7 +253,7 @@ CreatePNGBoard (char *s, int kind) textureW[kind] = 0; // prevents bitmap from being used if not succesfully loaded if(strstr(s, ".png")) { cairo_surface_t *img = cairo_image_surface_create_from_png (s); - if(img) { + if(cairo_surface_status(img) == CAIRO_STATUS_SUCCESS) { char c, *p = s, *q; int r, f; if(pngOriginalBoardBitmap[kind]) cairo_surface_destroy(pngOriginalBoardBitmap[kind]); @@ -451,7 +451,7 @@ InitDrawingParams (int reloadPieces) { int i, p; if(reloadPieces) - for(i=0; i<2; i++) for(p=0; p