Make SVGDIR a variable
[xboard.git] / draw.c
diff --git a/draw.c b/draw.c
index 080fd82..930b02c 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -117,6 +117,8 @@ int useTexture, textureW[2], textureH[2];
 
 #define White(piece) ((int)(piece) < (int)BlackPawn)
 
+char svgDir[MSG_SIZ] = SVGDIR;
+
 char *crWhite = "#FFFFB0";
 char *crBlack = "#AD5D3D";
 
@@ -316,7 +318,7 @@ ScaleOnePiece (int color, int piece)
 
   if(!pngPieceImages[color][piece]) { // we still did not manage to acquire a piece bitmap
     static int warned = 0;
-    if(!(svgPieces[color][piece] = LoadSVG(SVGDIR, color, piece, 0)) && !warned) { // try to fall back on installed svg 
+    if(!(svgPieces[color][piece] = LoadSVG(svgDir, color, piece, 0)) && !warned) { // try to fall back on installed svg 
       char *msg = _("No default pieces installed!\nSelect your own using '-pieceImageDirectory'.");
       printf("%s\n", msg); // give up
       DisplayError(msg, 0);
@@ -727,6 +729,7 @@ DrawText (char *string, int x, int y, int align)
        }
 
        cairo_move_to (cr, xx-1, yy);
+       if(align == -2) cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); else
        if(align < 3) cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
        else          cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
        cairo_show_text (cr, string);
@@ -755,7 +758,7 @@ InscribeKanji (ChessSquare piece, int x, int y)
     strncpy(buf, p, 10);
     for(q=buf; (*++q & 0xC0) == 0x80;);
     *q = NULLCHAR;
-    DrawText(buf, x, y, -1);
+    DrawText(buf, x, y, n > WhiteLion ? -2 : -1);
 }
 
 void
@@ -767,7 +770,7 @@ DrawOneSquare (int x, int y, ChessSquare piece, int square_color, int marker, ch
        BlankSquare(csBoardWindow, x, y, square_color, piece, 1);
     } else {
        pngDrawPiece(csBoardWindow, piece, square_color, x, y);
-        InscribeKanji(piece, x, y);
+        if(appData.inscriptions[0]) InscribeKanji(piece, x, y);
     }
 
     if(align) { // square carries inscription (coord or piece count)