From 093b507d25ce04e8e41992f73ebb25d7d07b7a8a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 17 Jul 2004 20:17:25 +0000 Subject: [PATCH] simplify, fix fallback, fix lights transform not being run --- stepmania/src/ScreenGameplay.cpp | 40 ++++++++++++-------------------- stepmania/src/Song.cpp | 3 +++ 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index bccba4ae9a..6a7a7c5090 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -1026,35 +1026,25 @@ void ScreenGameplay::LoadNextSong() // Load cabinet lights data // { - vector vSteps; m_CabinetLightsNoteData.Init(); ASSERT( GAMESTATE->m_pCurSong ); - - // From what I understood, if there is no pre-defined step set for lights, then we fall-back - // onto the specified difficulty's stepchart, flashing all cabinet lights on each tap note. - // -- Miryokuteki - // Steps *pSteps = GAMESTATE->m_pCurSong->GetClosestNotes( STEPS_TYPE_LIGHTS_CABINET, StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) ); - vSteps = GAMESTATE->m_pCurSong->GetAllSteps( STEPS_TYPE_LIGHTS_CABINET); + 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) ); + } + } - //If there are no light steps do this (to get current style's steps - if (vSteps.empty()) - GAMESTATE->m_pCurSong->GetSteps(vSteps, - GAMESTATE->GetCurrentStyle()->m_StepsType); - - //Obtain the default steps (just in case the desired difficulty does not exist) - if(!vSteps.empty()) - vSteps[0]->GetNoteData(&m_CabinetLightsNoteData); - - //Scan through all available steps, to see if any match our desired difficulty - for (unsigned i = 0; i < vSteps.size(); ++i) - if (StringToDifficulty(PREFSMAN->m_sLightsStepsDifficulty) == - vSteps[i]->GetDifficulty()) - vSteps[i]->GetNoteData( &m_CabinetLightsNoteData ); - - //if( pSteps != NULL ) - // pSteps->GetNoteData( &m_CabinetLightsNoteData ); - // Convert to 4s so that we can check if we're inside a hold with just // GetTapNote(). m_CabinetLightsNoteData.ConvertHoldNotesTo4s(); diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 4e727389c9..55d22757cf 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -1093,6 +1093,9 @@ void Song::AddAutoGenNotes() /* If m_bAutogenSteps is disabled, only autogen lights. */ if( !PREFSMAN->m_bAutogenSteps && stMissing != STEPS_TYPE_LIGHTS_CABINET ) continue; + /* XXX: disable lights autogen for now */ + if( stMissing == STEPS_TYPE_LIGHTS_CABINET ) + continue; // missing Steps of this type int iNumTracksOfMissing = GAMEMAN->StepsTypeToNumTracks(stMissing);