Improve performance of name sorting in town and station list windows

This commit is contained in:
Jonathan G Rennison
2019-05-12 18:03:57 +01:00
parent 748d73079a
commit f6b9395c6a
10 changed files with 81 additions and 38 deletions

View File

@@ -232,6 +232,12 @@ void UpdateAllVirtCoords()
RebuildViewportKdtree();
}
void ClearAllCachedNames()
{
ClearAllStationCachedNames();
ClearAllTownCachedNames();
}
/**
* Initialization of the windows and several kinds of caches.
* This is not done directly in AfterLoadGame because these
@@ -248,6 +254,7 @@ static void InitializeWindowsAndCaches()
SetupColoursAndInitialWindow();
/* Update coordinates of the signs. */
ClearAllCachedNames();
UpdateAllVirtCoords();
ResetViewportAfterLoadGame();