From c6cf9d8d64aded07d2dc0281699990775199870f Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 13 Nov 2010 18:42:27 +0100 Subject: [PATCH] Add -variant seirawan to menu --- backend.c | 1 + common.h | 2 ++ winboard/resource.h | 1 + winboard/winboard.c | 2 +- winboard/winboard.rc | 4 +++- winboard/woptions.c | 6 +++++- xoptions.c | 1 + 7 files changed, 14 insertions(+), 3 deletions(-) diff --git a/backend.c b/backend.c index 0026207..ba658ea 100644 --- a/backend.c +++ b/backend.c @@ -957,6 +957,7 @@ InitBackEnd1() case VariantJanus: /* should work */ case VariantSuper: /* experimental */ case VariantGreat: /* experimental, requires legality testing to be off */ + case VariantSChess: /* S-Chess, should work */ break; } } diff --git a/common.h b/common.h index 63cee7d..322bd66 100644 --- a/common.h +++ b/common.h @@ -319,6 +319,7 @@ typedef enum { VariantGreat, VariantTwilight, VariantMakruk, + VariantSChess, VariantUnknown /* Catchall for other unknown variants */ } VariantClass; @@ -362,6 +363,7 @@ typedef enum { "great",\ "twilight",\ "makruk",\ + "seirawan",\ "unknown" \ } diff --git a/winboard/resource.h b/winboard/resource.h index 9dc8528..15835f5 100644 --- a/winboard/resource.h +++ b/winboard/resource.h @@ -491,6 +491,7 @@ #define OPT_VariantGreat 1527 #define OPT_VariantTwilight 1528 #define OPT_VariantMakruk 1529 +#define OPT_VariantSChess 1530 #define IDC_Files 1550 #define IDC_Ranks 1551 #define IDC_Holdings 1552 diff --git a/winboard/winboard.c b/winboard/winboard.c index 620cad5..e98e516 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -306,7 +306,7 @@ int dialogItems[][40] = { OPT_VariantBughouse, OPT_VariantTwilight, OPT_VariantShogi, OPT_VariantSuper, OPT_VariantKnightmate, OPT_VariantBerolina, OPT_VariantCylinder, OPT_VariantFairy, OPT_VariantMakruk, OPT_VariantGothic, OPT_VariantCapablanca, OPT_VariantJanus, - OPT_VariantCRC, OPT_VariantFalcon, OPT_VariantCourier, OPT_VariantGreat, + OPT_VariantCRC, OPT_VariantFalcon, OPT_VariantCourier, OPT_VariantGreat, OPT_VariantSChess, OPT_VariantShatranj, OPT_VariantXiangqi, GPB_Variant, GPB_Board, IDC_Height, IDC_Width, IDC_Hand, IDC_Pieces, IDC_Def }, { DLG_Fonts, IDOK, IDCANCEL, OPT_ChooseClockFont, OPT_ChooseMessageFont, diff --git a/winboard/winboard.rc b/winboard/winboard.rc index bb8cd3f..25658ba 100644 --- a/winboard/winboard.rc +++ b/winboard/winboard.rc @@ -712,7 +712,9 @@ BEGIN 50,10 CONTROL "&Shatranj",OPT_VariantShatranj,"Button",BS_AUTORADIOBUTTON,134, 84,50,10 - CONTROL "&xiangqi",OPT_VariantXiangqi,"Button",BS_AUTORADIOBUTTON,134,94,50, + CONTROL "Seira&wan",OPT_VariantSChess,"Button",BS_AUTORADIOBUTTON,134,94,50, + 10 + CONTROL "&xiangqi",OPT_VariantXiangqi,"Button",BS_AUTORADIOBUTTON,134,104,50, 10 GROUPBOX "Variant",GPB_Variant,4,4,185,115 LTEXT "Board size:",GPB_Board,10,135,40,8 diff --git a/winboard/woptions.c b/winboard/woptions.c index 4d071ce..2c5b24f 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -786,7 +786,8 @@ VariantWhichRadio(HWND hDlg) (IsDlgButtonChecked(hDlg, OPT_VariantGiveaway) ? VariantGiveaway : (IsDlgButtonChecked(hDlg, OPT_VariantTwilight) ? VariantTwilight : (IsDlgButtonChecked(hDlg, OPT_VariantMakruk) ? VariantMakruk : - VariantNormal ))))))))))))))))))))))))))))); + (IsDlgButtonChecked(hDlg, OPT_VariantSChess) ? VariantSChess : + VariantNormal )))))))))))))))))))))))))))))); } LRESULT CALLBACK @@ -889,6 +890,9 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) case VariantMakruk: CheckDlgButton(hDlg, OPT_VariantMakruk, TRUE); break; + case VariantSChess: + CheckDlgButton(hDlg, OPT_VariantSChess, TRUE); + break; default: ; } diff --git a/xoptions.c b/xoptions.c index b30719d..af309a1 100644 --- a/xoptions.c +++ b/xoptions.c @@ -966,6 +966,7 @@ struct NewVarButton buttonDesc[] = { {N_("give-away"), "#FFFFBF", 0, VariantGiveaway}, {N_("losers"), "#FFFFBF", 0, VariantLosers}, {N_("fairy"), "#BFBFBF", 0, VariantFairy}, + {N_("Seirawan"), "#FFBFBF", 0, VariantSChess}, {N_("Superchess"), "#FFBFBF", 0, VariantSuper}, {N_("crazyhouse"), "#FFBFBF", 0, VariantCrazyhouse}, {N_("bughouse"), "#FFBFBF", 0, VariantBughouse}, -- 1.7.0.4