From c587f12d65c728655a10821af36890cfce896adc Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 23 Jun 2005 00:30:02 +0000 Subject: [PATCH] Don't construct overlay screens in ScreenManager ctor. We havn't reset GAMESTATE by then, so much of it is uninitialized, and we should not load screens until that's done. (fixes valgrind warning due to IsEventMode() being called from SSystemLayer) --- stepmania/src/ScreenManager.cpp | 7 ------- stepmania/src/StepMania.cpp | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/stepmania/src/ScreenManager.cpp b/stepmania/src/ScreenManager.cpp index 95c83c4052..7c0e58e48f 100644 --- a/stepmania/src/ScreenManager.cpp +++ b/stepmania/src/ScreenManager.cpp @@ -56,13 +56,6 @@ ScreenManager::ScreenManager() m_pSharedBGA = new Actor; m_bZeroNextUpdate = false; - - /* By the time this is constructed, THEME has already been set up and set to - * the current theme. Call ThemeChanged(), to handle the starting theme - * and set up m_SystemLayer. */ - ASSERT( THEME ); - ASSERT( !THEME->GetCurThemeName().empty() ); - this->ThemeChanged(); } diff --git a/stepmania/src/StepMania.cpp b/stepmania/src/StepMania.cpp index 1066f938ff..915c264084 100644 --- a/stepmania/src/StepMania.cpp +++ b/stepmania/src/StepMania.cpp @@ -1149,6 +1149,10 @@ int main(int argc, char* argv[]) HOOKS->BoostPriority(); ResetGame(); + + /* Now that GAMESTATE is reset, tell SCREENMAN to update the theme (load + * overlay screens and global sounds), and load the initial screen. */ + SCREENMAN->ThemeChanged(); SCREENMAN->SetNewScreen( INITIAL_SCREEN ); CodeDetector::RefreshCacheItems();