Fix WinBoard front-end for Janggi
authorH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 7 Oct 2020 08:25:34 +0000 (10:25 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Wed, 7 Oct 2020 08:25:34 +0000 (10:25 +0200)
The board checkering for Janggi should be the same as for Xiangqi,
but in WinBoard such decisions are taken in the front-end. Also
whether a certain board size is available with built-in piece images.

winboard/winboard.c

index cdfca8e..474534a 100644 (file)
@@ -322,7 +322,7 @@ int dialogItems[][42] = {
   OPT_VariantKnightmate, OPT_VariantBerolina, OPT_VariantCylinder, OPT_VariantFairy,\r
   OPT_VariantMakruk, OPT_VariantGothic, OPT_VariantCapablanca, OPT_VariantJanus,\r
   OPT_VariantCRC, OPT_VariantFalcon, OPT_VariantCourier, OPT_VariantGreat, OPT_VariantSChess,\r
-  OPT_VariantShatranj, OPT_VariantXiangqi, GPB_Variant, GPB_Board, IDC_Height,\r
+  OPT_VariantShatranj, OPT_VariantXiangqi, OPT_VariantJanggi, GPB_Variant, GPB_Board, IDC_Height,\r
   IDC_Width, IDC_Hand, IDC_Pieces, IDC_Def }, \r
 { DLG_Fonts, IDOK, IDCANCEL, OPT_ChooseClockFont, OPT_ChooseMessageFont,\r
   OPT_ChooseCoordFont, OPT_ChooseTagFont, OPT_ChooseCommentsFont,  OPT_ChooseConsoleFont, OPT_ChooseMoveHistoryFont, OPT_DefaultFonts,\r
@@ -2072,6 +2072,7 @@ static int TranslatePieceToFontPiece( int piece )
 \r
 \r
 \r
+\r
         return PM_WL;\r
     case WhiteFalcon:\r
         return PM_WV;\r
@@ -2382,7 +2383,7 @@ InitDrawingSizes(BoardSize boardSize, int flags)
       || (v == VariantShogi && boardSize != SizeModerate)   // Japanese-style Shogi\r
       ||  v == VariantKnightmate || v == VariantSChess || v == VariantXiangqi || v == VariantSpartan\r
       ||  v == VariantShatranj || v == VariantMakruk || v == VariantGreat|| v == VariantLion ||\r
-          v == VariantFairy && fairies ) {\r
+          v == VariantJanggi || v == VariantFairy && fairies ) {\r
       if(boardSize < SizeMediocre) boardSize = SizePetite; else\r
       if(boardSize > SizeModerate) boardSize = SizeBulky;  else\r
                                    boardSize = SizeMiddling;\r
@@ -3580,7 +3581,7 @@ DrawBoardOnDC(HDC hdc, Board board, HDC tmphdc)
       piece = board[row][column];\r
 \r
       square_color = ((column + row) % 2) == 1;\r
-      if( gameInfo.variant == VariantXiangqi ) {\r
+      if( gameInfo.variant == VariantXiangqi|| gameInfo.variant == VariantJanggi ) {\r
           square_color = !InPalace(row, column);\r
           if(BOARD_HEIGHT&1) { if(row==BOARD_HEIGHT/2) square_color ^= 1; }\r
           else if(row < BOARD_HEIGHT/2) square_color ^= 1;\r