Make GameManager a namespace rather than a singleton since it doesn't contain any data.

This commit is contained in:
Steve Checkoway
2008-03-24 12:49:31 +00:00
parent 2e009a4072
commit 551d9bfc23
3 changed files with 49 additions and 80 deletions
+6 -9
View File
@@ -268,7 +268,6 @@ void ShutdownGame()
SAFE_DELETE( SOUND ); /* uses GAMESTATE, PREFSMAN */
SAFE_DELETE( PREFSMAN );
SAFE_DELETE( GAMESTATE );
SAFE_DELETE( GAMEMAN );
SAFE_DELETE( NOTESKIN );
SAFE_DELETE( THEME );
SAFE_DELETE( ANNOUNCER );
@@ -752,21 +751,20 @@ RageDisplay *CreateDisplay()
static void SwitchToLastPlayedGame()
{
ASSERT( GAMEMAN );
const Game *pGame = GAMEMAN->StringToGameType( PREFSMAN->GetCurrentGame() );
const Game *pGame = GameManager::StringToGameType( PREFSMAN->GetCurrentGame() );
/* If the active game type isn't actually available, revert to the default. */
if( pGame == NULL )
pGame = GAMEMAN->GetDefaultGame();
pGame = GameManager::GetDefaultGame();
if( !GAMEMAN->IsGameEnabled( pGame ) && pGame != GAMEMAN->GetDefaultGame() )
if( !GameManager::IsGameEnabled( pGame ) && pGame != GameManager::GetDefaultGame() )
{
pGame = GAMEMAN->GetDefaultGame();
pGame = GameManager::GetDefaultGame();
LOG->Warn( "Default NoteSkin for \"%s\" missing, reverting to \"%s\"",
pGame->m_szName, GAMEMAN->GetDefaultGame()->m_szName );
pGame->m_szName, GameManager::GetDefaultGame()->m_szName );
}
ASSERT( GAMEMAN->IsGameEnabled(pGame) );
ASSERT( GameManager::IsGameEnabled(pGame) );
StepMania::ChangeCurrentGame( pGame );
}
@@ -992,7 +990,6 @@ int main(int argc, char* argv[])
CheckSettings();
GAMEMAN = new GameManager;
THEME = new ThemeManager;
ANNOUNCER = new AnnouncerManager;
NOTESKIN = new NoteSkinManager;