Make Claws glyph available in non-Chu variants
authorH.G.Muller <hgm@hgm-xboard.(none)>
Fri, 13 Mar 2015 21:58:15 +0000 (22:58 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 7 May 2015 18:53:34 +0000 (20:53 +0200)
The variant-dependent replacement glyphs for promotable pieces in Chu
are now assigned to pieces that reuse the replaced glyphs to represent
promoted pieces, rather than to unused promoted pieces. This means that
in Chu they now must be replaced by swapping, which avoids occurrence
of duplicats both in Chu and other variants. And thus frees piece types
that now can be used for new glyphs. As a result the Nightrider remains
available in Chu, and the Claw glyph in other variants. Other freed
pieces are for now used for the promotion Golds of variant shogi.

common.h
draw.c

index 6239e13..fa06beb 100644 (file)
--- a/common.h
+++ b/common.h
@@ -293,7 +293,7 @@ typedef enum {
     WhiteFerz, WhiteAlfil, WhiteAngel, WhiteMarshall, WhiteWazir, WhiteMan,
     WhiteCannon, WhiteNightrider, WhiteCardinal, WhiteDragon, WhiteGrasshopper,
     WhiteSilver, WhiteFalcon, WhiteLance, WhiteCobra, WhiteUnicorn, WhiteLion,
-    WhiteTokin, WhiteDagger, WhitePCardinal, WhitePDragon, WhiteCat,
+    WhiteTokin, WhiteClaw, WhitePCardinal, WhitePDragon, WhiteCat,
     WhitePSword, WhiteMonarch, WhiteMother, WhiteNothing, WhitePRook, WhitePDagger,
     WhiteDolphin, WhiteStag, WhiteHorned, WhiteEagle, WhiteSword,
     WhiteCrown, WhiteHCrown, WhiteHorse, WhiteDrunk, WhitePBishop, WhiteKing,
@@ -301,7 +301,7 @@ typedef enum {
     BlackFerz, BlackAlfil, BlackAngel, BlackMarshall, BlackWazir, BlackMan,
     BlackCannon, BlackNightrider, BlackCardinal, BlackDragon, BlackGrasshopper,
     BlackSilver, BlackFalcon, BlackLance, BlackCobra, BlackUnicorn, BlackLion,
-    BlackTokin, BlackDagger, BlackPCardinal, BlackPDragon, BlackCat,
+    BlackTokin, BlackClaw, BlackPCardinal, BlackPDragon, BlackCat,
     BlackPSword, BlackMonarch, BlackMother, BlackNothing, BlackPRook, BlackPDagger,
     BlackDolphin, BlackStag, BlackHorned, BlackEagle, BlackSword,
     BlackCrown, BlackHCrown, BlackHorse, BlackDrunk, BlackPBishop, BlackKing,
diff --git a/draw.c b/draw.c
index 848fa61..3cb5727 100644 (file)
--- a/draw.c
+++ b/draw.c
@@ -162,10 +162,14 @@ SelectPieces(VariantClass v)
           pngPieceBitmaps[i][(int)WhiteNightrider] = pngPieceBitmaps2[i][(int)WhiteLion];
        }
        if(v == VariantChu) {
-          pngPieceBitmaps[i][(int)WhiteNightrider] = pngPieceBitmaps2[i][(int)WhiteKing+1];
-          pngPieceBitmaps[i][(int)WhiteUnicorn] = pngPieceBitmaps2[i][(int)WhiteCat];
-          pngPieceBitmaps[i][(int)WhiteSilver]  = pngPieceBitmaps2[i][(int)WhiteSword];
-          pngPieceBitmaps[i][(int)WhiteFalcon]  = pngPieceBitmaps2[i][(int)WhiteDagger];
+          pngPieceBitmaps[i][(int)WhiteNightrider] = pngPieceBitmaps2[i][(int)WhiteClaw];
+          pngPieceBitmaps[i][(int)WhiteClaw]    = pngPieceBitmaps2[i][(int)WhiteNightrider];
+          pngPieceBitmaps[i][(int)WhiteUnicorn] = pngPieceBitmaps2[i][(int)WhiteHorned];
+          pngPieceBitmaps[i][(int)WhiteSilver]  = pngPieceBitmaps2[i][(int)WhiteStag];
+          pngPieceBitmaps[i][(int)WhiteFalcon]  = pngPieceBitmaps2[i][(int)WhiteEagle];
+          pngPieceBitmaps[i][(int)WhiteHorned]  = pngPieceBitmaps2[i][(int)WhiteUnicorn];
+          pngPieceBitmaps[i][(int)WhiteStag]    = pngPieceBitmaps2[i][(int)WhiteSilver];
+          pngPieceBitmaps[i][(int)WhiteEagle]   = pngPieceBitmaps2[i][(int)WhiteFalcon];
        }
     }
 }
@@ -282,9 +286,9 @@ CreatePNGBoard (char *s, int kind)
 
 char *pngPieceNames[] = // must be in same order as internal piece encoding
 { "Pawn", "Knight", "Bishop", "Rook", "Queen", "Advisor", "Elephant", "Archbishop", "Marshall", "Gold", "Commoner",
-  "Canon", "Nightrider", "CrownedBishop", "CrownedRook", "Princess", "Chancellor", "Hawk", "Lance", "Cobra", "Unicorn", "Lion",
-  "GoldPawn", "HSword", "PromoHorse", "PromoDragon", "Leopard", "PromoSword", "Prince", "Phoenix", "Kylin", "PromoRook", "PromoHSword",
-  "Dolphin", "Chancellor", "Unicorn", "Hawk", "Sword", "Crown", "HCrown", "Knight", "Elephant", "PromoBishop", "King",
+  "Canon", "Nightrider", "CrownedBishop", "CrownedRook", "Crown", "Chancellor", "Hawk", "Lance", "Cobra", "Unicorn", "Lion",
+  "GoldPawn", "Claw", "PromoHorse", "PromoDragon", "GoldLance", "PromoSword", "Prince", "Phoenix", "Kylin", "PromoRook", "PromoHSword",
+  "Dolphin", "Sword", "Leopard", "HSword", "GoldSilver", "Princess", "HCrown", "Knight", "Elephant", "PromoBishop", "King",
   "Claw", "GoldKnight", "GoldLance", "GoldSilver", NULL
 };