X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=draw.c;h=7ec60ae4e205c30d248d7aa52d56726691034d0e;hb=604256ed14dc82406197376be74f9fe4d1d7f9da;hp=9368227ca2a5be069eaf678897e60b1d1779790e;hpb=997b54f179fb1834d738042a9b6c4ec1cefe8c6b;p=xboard.git diff --git a/draw.c b/draw.c index 9368227..7ec60ae 100644 --- a/draw.c +++ b/draw.c @@ -287,8 +287,13 @@ ScaleOnePiece (int color, int piece) } if(!pngPieceImages[color][piece]) { // we still did not manage to acquire a piece bitmap - if(!(svgPieces[color][piece] = LoadSVG(SVGDIR, color, piece))) // try to fall back on installed svg - DisplayError(_("No default pieces installed\nSelect your own -pieceImageDirectory"), 0); // give up + static int warned = 0; + if(!(svgPieces[color][piece] = LoadSVG(SVGDIR, color, piece)) && !warned) { // try to fall back on installed svg + char *msg = _("No default pieces installed\nSelect your own -pieceImageDirectory"); + printf("%s\n", msg); // give up + DisplayError(msg, 0); + warned = 1; // prevent error message being repeated for each piece type + } } img = pngPieceImages[color][piece]; @@ -298,6 +303,8 @@ ScaleOnePiece (int color, int piece) pngPieceBitmaps2[color][piece] = cs = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, squareSize, squareSize); if(piece <= WhiteKing) pngPieceBitmaps[color][piece] = cs; + if(!img) return; + // scaled copying of the raw png image cr = cairo_create(cs); w = cairo_image_surface_get_width (img);