Implement variant-dependent png piece symbols
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 5 Oct 2012 16:54:01 +0000 (18:54 +0200)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sun, 21 Oct 2012 09:28:14 +0000 (11:28 +0200)
xboard.c

index 5dc557c..4d12241 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -1057,6 +1057,20 @@ InitDrawingSizes (BoardSize boardSize, int flags)
        int p;
        for(p=0; p<=(int)WhiteKing; p++)
           pngPieceBitmaps[i][p] = pngPieceBitmaps2[i][p]; // defaults
+       if(gameInfo.variant == VariantShogi) {
+          pngPieceBitmaps[i][(int)WhiteCannon] = pngPieceBitmaps2[i][(int)WhiteKing+1];
+          pngPieceBitmaps[i][(int)WhiteNightrider] = pngPieceBitmaps2[i][(int)WhiteKing+2];
+          pngPieceBitmaps[i][(int)WhiteSilver] = pngPieceBitmaps2[i][(int)WhiteKing+3];
+          pngPieceBitmaps[i][(int)WhiteGrasshopper] = pngPieceBitmaps2[i][(int)WhiteKing+4];
+          pngPieceBitmaps[i][(int)WhiteQueen] = pngPieceBitmaps2[i][(int)WhiteLance];
+       }
+       if(gameInfo.variant == VariantGothic) {
+          pngPieceBitmaps[i][(int)WhiteMarshall] = pngPieceBitmaps2[i][(int)WhiteSilver];
+       }
+       if(gameInfo.variant == VariantSChess) {
+          pngPieceBitmaps[i][(int)WhiteAngel]    = pngPieceBitmaps2[i][(int)WhiteFalcon];
+          pngPieceBitmaps[i][(int)WhiteMarshall] = pngPieceBitmaps2[i][(int)WhiteAlfil];
+       }
     }
     oldMono = -10; // kludge to force recreation of animation masks
     oldVariant = gameInfo.variant;