Do not call ReInitAllWindows from within LoadStringWidthTable

This commit is contained in:
Jonathan G Rennison
2023-01-29 10:31:28 +00:00
parent 98d7ba8b9d
commit 7a7c688b11
4 changed files with 6 additions and 2 deletions

View File

@@ -1495,8 +1495,6 @@ void LoadStringWidthTable(bool monospace)
_stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32); _stringwidth_table[fs][i] = GetGlyphWidth(fs, i + 32);
} }
} }
ReInitAllWindows(false);
} }
/** /**
@@ -2397,6 +2395,7 @@ bool AdjustGUIZoom(AdjustGUIZoomMode mode)
ClearFontCache(); ClearFontCache();
UpdateFontHeightCache(); UpdateFontHeightCache();
LoadStringWidthTable(); LoadStringWidthTable();
ReInitAllWindows(false);
UpdateAllVirtCoords(); UpdateAllVirtCoords();
if (mode != AGZM_STARTUP) FixTitleGameZoom(); if (mode != AGZM_STARTUP) FixTitleGameZoom();

View File

@@ -881,6 +881,7 @@ bool AfterLoadGame()
/* Load the sprites */ /* Load the sprites */
GfxLoadSprites(); GfxLoadSprites();
LoadStringWidthTable(); LoadStringWidthTable();
ReInitAllWindows(false);
/* Copy temporary data to Engine pool */ /* Copy temporary data to Engine pool */
CopyTempEngineData(); CopyTempEngineData();
@@ -4265,6 +4266,8 @@ void ReloadNewGRFData()
UpdateExtraAspectsVariable(); UpdateExtraAspectsVariable();
ReInitAllWindows(false);
/* Update company statistics. */ /* Update company statistics. */
AfterLoadCompanyStats(); AfterLoadCompanyStats();
/* Check and update house and town values */ /* Check and update house and town values */

View File

@@ -1285,6 +1285,7 @@ static void ZoomMinMaxChanged(int32 new_value)
UpdateRouteStepSpriteSize(); UpdateRouteStepSpriteSize();
UpdateFontHeightCache(); UpdateFontHeightCache();
LoadStringWidthTable(); LoadStringWidthTable();
ReInitAllWindows(false);
} }
} }

View File

@@ -2577,6 +2577,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
/* Reset the font width */ /* Reset the font width */
LoadStringWidthTable(searcher->Monospace()); LoadStringWidthTable(searcher->Monospace());
ReInitAllWindows(false);
return; return;
} }