split out ScreenGameplay::LoadLights

This commit is contained in:
Glenn Maynard
2005-05-04 06:48:34 +00:00
parent 3ba7b814c7
commit 87af9cf1f1
2 changed files with 27 additions and 21 deletions
+26 -21
View File
@@ -1081,27 +1081,7 @@ void ScreenGameplay::LoadNextSong()
//
// Load cabinet lights data
//
if( LIGHTSMAN->IsEnabled() )
{
m_CabinetLightsNoteData.Init();
ASSERT( GAMESTATE->m_pCurSong );
Steps *pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( STEPS_TYPE_LIGHTS_CABINET, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) );
if( pSteps != NULL )
{
pSteps->GetNoteData( m_CabinetLightsNoteData );
}
else
{
pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( GAMESTATE->GetCurrentStyle()->m_StepsType, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) );
if( pSteps )
{
NoteData TapNoteData;
pSteps->GetNoteData( TapNoteData );
NoteDataUtil::LoadTransformedLights( TapNoteData, m_CabinetLightsNoteData, GameManager::StepsTypeToNumTracks(STEPS_TYPE_LIGHTS_CABINET) );
}
}
}
LoadLights();
/* Load the music last, since it may start streaming and we don't want the music
* to compete with other loading. */
@@ -1109,6 +1089,31 @@ void ScreenGameplay::LoadNextSong()
m_pSoundMusic = m_AutoKeysounds.GetSound();
}
void ScreenGameplay::LoadLights()
{
if( !LIGHTSMAN->IsEnabled() )
return;
m_CabinetLightsNoteData.Init();
ASSERT( GAMESTATE->m_pCurSong );
Steps *pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( STEPS_TYPE_LIGHTS_CABINET, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) );
if( pSteps != NULL )
{
pSteps->GetNoteData( m_CabinetLightsNoteData );
}
else
{
pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( GAMESTATE->GetCurrentStyle()->m_StepsType, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) );
if( pSteps )
{
NoteData TapNoteData;
pSteps->GetNoteData( TapNoteData );
NoteDataUtil::LoadTransformedLights( TapNoteData, m_CabinetLightsNoteData, GameManager::StepsTypeToNumTracks(STEPS_TYPE_LIGHTS_CABINET) );
}
}
}
float ScreenGameplay::StartPlayingSong(float MinTimeToNotes, float MinTimeToMusic)
{
ASSERT(MinTimeToNotes >= 0);