RECT crect, wrect, oldRect;\r
int offby;\r
LOGBRUSH logbrush;\r
+ VariantClass v = gameInfo.variant;\r
\r
int suppressVisibleEffects = 0; // [HGM] kludge to request updating sizeInfo only\r
if((int)boardSize >= 1000 ) { boardSize -= 1000; suppressVisibleEffects = 1; }\r
\r
/* [HGM] call with -2 uses old size (for if nr of files, ranks changes) */\r
if(boardSize == (BoardSize)(-2) ) boardSize = oldBoardSize;\r
+ oldBoardSize = boardSize;\r
+\r
+ if(boardSize != SizeMiddling && boardSize != SizePetite && boardSize != SizeBulky && !appData.useFont)\r
+ { // correct board size to one where built-in pieces exist\r
+ if((v == VariantCapablanca || v == VariantGothic || v == VariantGrand || v == VariantCapaRandom || v == VariantJanus || v == VariantSuper)\r
+ && (boardSize < SizePetite || boardSize > SizeBulky) // Archbishop and Chancellor available in entire middle range\r
+ || (v == VariantShogi && boardSize != SizeModerate) // Japanese-style Shogi\r
+ || v == VariantKnightmate || v == VariantSChess || v == VariantXiangqi || v == VariantSpartan\r
+ || v == VariantShatranj || v == VariantMakruk || v == VariantGreat || v == VariantFairy ) {\r
+ if(boardSize < SizeMediocre) boardSize = SizePetite; else\r
+ if(boardSize > SizeModerate) boardSize = SizeBulky; else\r
+ boardSize = SizeMiddling;\r
+ }\r
+ }\r
+ if(!appData.useFont && boardSize == SizePetite && (v == VariantShogi || v == VariantKnightmate)) boardSize = SizeMiddling; // no Unicorn in Petite\r
\r
oldRect.left = wpMain.x; //[HGM] placement: remember previous window params\r
oldRect.top = wpMain.y;\r
\r
sizeInfo[boardSize].cliWidth = boardRect.right + OUTER_MARGIN;\r
sizeInfo[boardSize].cliHeight = boardRect.bottom + OUTER_MARGIN;\r
- oldBoardSize = boardSize;\r
oldTinyLayout = tinyLayout;\r
winW = 2 * GetSystemMetrics(SM_CXFRAME) + boardRect.right + OUTER_MARGIN;\r
winH = 2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYMENU) +\r