From 53ebb7d35c575bb7dea8a1817f631571923cbd18 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 24 Oct 2002 03:47:37 +0000 Subject: [PATCH] bugfix for when not all notetypes are available remove lots of unused includes --- stepmania/src/ScreenSelectGame.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/stepmania/src/ScreenSelectGame.cpp b/stepmania/src/ScreenSelectGame.cpp index 69e3ce6286..e9ff824d4c 100644 --- a/stepmania/src/ScreenSelectGame.cpp +++ b/stepmania/src/ScreenSelectGame.cpp @@ -10,20 +10,11 @@ */ #include "ScreenSelectGame.h" -#include -#include "RageTextureManager.h" -#include "RageUtil.h" #include "RageMusic.h" #include "ScreenManager.h" #include "PrefsManager.h" -#include "ScreenOptions.h" -#include "ScreenTitleMenu.h" -#include "GameConstantsAndTypes.h" -#include "StepMania.h" -#include "PrefsManager.h" #include "RageLog.h" #include "GameManager.h" -#include #include "GameState.h" #include "InputMapper.h" @@ -49,12 +40,7 @@ ScreenSelectGame::ScreenSelectGame() : { LOG->Trace( "ScreenSelectGame::ScreenSelectGame()" ); - - // - // populate g_SelectGameLines - // -// CStringArray arrayGameNames; -// GAMEMAN->GetGameNames( arrayGameNames ); + /* populate g_SelectGameLines */ CArray aGames; GAMEMAN->GetEnabledGames( aGames ); for( int i=0; im_CurGame; + /* Search the list of games for the currently active game. If it's + * not there, we might have set a game and then the user removed its + * note skins; reset it to the first available. */ + CArray aGames; + GAMEMAN->GetEnabledGames( aGames ); + ASSERT(aGames.GetSize()); + + m_iSelectedOption[0][SG_GAME] = 0; + for(int sel = 0; sel < aGames.GetSize(); ++sel) + if(aGames[sel] == GAMESTATE->m_CurGame) m_iSelectedOption[0][SG_GAME] = sel; } void ScreenSelectGame::ExportOptions()