slight optimization.

(if we aren't loading a player, we don't need to do anything other than load up the game/style info and the
name of the settings, so don't bother trying. when a player is loaded up, it is loaded from scratch from the ini
file anyway.)
This commit is contained in:
Thad Ward
2003-09-18 19:07:04 +00:00
parent c203f4c09d
commit 896dc0f8da
+25 -21
View File
@@ -86,6 +86,31 @@ void NoteFieldMode::Load(IniFile &ini, CString id, int pn)
/* Required: */
ASSERT( ini.GetValue ( id, "Name", m_Name ) );
/* Grab this directly; don't try to set game specs per-player. */
CString sGames;
if(ini.GetValue( id, "Games", sGames ))
{
vector<CString> games;
split(sGames, ",", games);
for(unsigned n = 0; n < games.size(); ++n)
{
vector<CString> bits;
split(games[n], "-", bits);
ASSERT(bits.size() == 2);
const Game game = GAMEMAN->StringToGameType( bits[0] );
ASSERT(game != GAME_INVALID);
const Style style = GAMEMAN->GameAndStringToStyle( game, bits[1] );
ASSERT(style != STYLE_INVALID);
Styles.insert(style);
}
}
// if we aren't loading a player, we can bail here.
if(pn == -1)
return;
GetValue( ini, pn, id, "Backdrop", m_Backdrop );
GetValue( ini, pn, id, "FOV", m_fFov );
GetValue( ini, pn, id, "NearClipDistance", m_fNear );
@@ -117,27 +142,6 @@ void NoteFieldMode::Load(IniFile &ini, CString id, int pn)
GetValue( ini, pn, id, ssprintf("HoldJudgment", t+1), m_HoldJudgmentCmd[t] );
GetValue( ini, pn, id, ssprintf("HoldJudgment%i", t+1), m_HoldJudgmentCmd[t] );
}
/* Grab this directly; don't try to set game specs per-player. */
CString sGames;
if(ini.GetValue( id, "Games", sGames ))
{
vector<CString> games;
split(sGames, ",", games);
for(unsigned n = 0; n < games.size(); ++n)
{
vector<CString> bits;
split(games[n], "-", bits);
ASSERT(bits.size() == 2);
const Game game = GAMEMAN->StringToGameType( bits[0] );
ASSERT(game != GAME_INVALID);
const Style style = GAMEMAN->GameAndStringToStyle( game, bits[1] );
ASSERT(style != STYLE_INVALID);
Styles.insert(style);
}
}
}
NoteFieldPositioning::NoteFieldPositioning(CString fn)