From: H.G.Muller Date: Sat, 6 Jul 2019 14:03:43 +0000 (+0200) Subject: Make square-size rounding dependent on fairy pieces (WB) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=24364104200c448f2ca2d5f4f09cfd3c04216f6a;p=xboard.git Make square-size rounding dependent on fairy pieces (WB) WinBoard 'rounds' the square size to one of the three values for which images of fairy pieces are built in, in variants that normally would contain such pieces. But when used as parent of an engine-defined variant they might actually not contain any fairy pieces at all. This situation is now recognized for parent variant fairy, and would suppress the rounding when it occurs. --- diff --git a/winboard/winboard.c b/winboard/winboard.c index ac5fc03..1302c8c 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -2068,6 +2068,7 @@ static int TranslatePieceToFontPiece( int piece ) case WhiteSilver: return PM_WSG; case WhiteLance: + return PM_WL; case WhiteFalcon: return PM_WV; @@ -2370,12 +2371,15 @@ InitDrawingSizes(BoardSize boardSize, int flags) if(boardSize != SizeMiddling && boardSize != SizePetite && boardSize != SizeBulky && !appData.useFont) { // correct board size to one where built-in pieces exist + int fairies = 0; + for(i=WhiteQueen+1; i SizeBulky) // Archbishop and Chancellor available in entire middle range || (v == VariantShogi && boardSize != SizeModerate) // Japanese-style Shogi || v == VariantKnightmate || v == VariantSChess || v == VariantXiangqi || v == VariantSpartan - || v == VariantShatranj || v == VariantMakruk || v == VariantGreat || v == VariantFairy || v == VariantLion ) { + || v == VariantShatranj || v == VariantMakruk || v == VariantGreat|| v == VariantLion || + v == VariantFairy && fairies ) { if(boardSize < SizeMediocre) boardSize = SizePetite; else if(boardSize > SizeModerate) boardSize = SizeBulky; else boardSize = SizeMiddling; @@ -5353,6 +5357,7 @@ WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; + case IDM_ToStart: ToStartEvent(); SetFocus(hwndMain); @@ -8764,6 +8769,7 @@ GLT_GetFromList( int index, char *name ) if( SendDlgItemMessage( gameListOptionsDialog, IDC_GameListTags, LB_GETTEXT, index, (LPARAM) name ) != LB_ERR ) return TRUE; } + return FALSE; }