diff --git a/src/NoteDataUtil.cpp b/src/NoteDataUtil.cpp index 7836f7033e..b5f67e2f63 100644 --- a/src/NoteDataUtil.cpp +++ b/src/NoteDataUtil.cpp @@ -1252,28 +1252,45 @@ void NoteDataUtil::RemoveQuads( NoteData &inout, int iStartIndex, int iEndIndex RemoveSimultaneousNotes( inout, 3, iStartIndex, iEndIndex ); } -void NoteDataUtil::RemoveSpecificTapNotes( NoteData &inout, TapNoteType tn, int iStartIndex, int iEndIndex ) +void NoteDataUtil::RemoveSpecificTapNotes(NoteData &inout, TapNoteType tn, int iStartIndex, int iEndIndex) { - for( int t=0; t(), false); } -void NoteDataUtil::RemoveMines( NoteData &inout, int iStartIndex, int iEndIndex ) +void NoteDataUtil::RemoveMines(NoteData &inout, int iStartIndex, int iEndIndex) { - RemoveSpecificTapNotes( inout, TapNoteType_Mine, iStartIndex, iEndIndex ); + RemoveSpecificTapNotes(inout, TapNoteType_Mine, iStartIndex, iEndIndex); } -void NoteDataUtil::RemoveLifts( NoteData &inout, int iStartIndex, int iEndIndex ) +void NoteDataUtil::RemoveLifts(NoteData &inout, int iStartIndex, int iEndIndex) { - RemoveSpecificTapNotes( inout, TapNoteType_Lift, iStartIndex, iEndIndex ); + RemoveSpecificTapNotes(inout, TapNoteType_Lift, iStartIndex, iEndIndex); } -void NoteDataUtil::RemoveFakes( NoteData &inout, int iStartIndex, int iEndIndex ) +void NoteDataUtil::RemoveFakes(NoteData &inout, TimingData const& timing_data, int iStartIndex, int iEndIndex) { - RemoveSpecificTapNotes( inout, TapNoteType_Fake, iStartIndex, iEndIndex ); + RemoveSpecificTapNotes(inout, TapNoteType_Fake, iStartIndex, iEndIndex); + for(int t=0; t(), false); } void NoteDataUtil::RemoveAllButOneTap( NoteData &inout, int row ) @@ -2692,7 +2709,7 @@ void NoteDataUtil::ConvertAdditionsToRegular( NoteData &inout ) inout.RevalidateATIs(vector(), false); } -void NoteDataUtil::TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong ) +void NoteDataUtil::TransformNoteData(NoteData &nd, TimingData const& timing_data, const AttackArray &aa, StepsType st, Song* pSong) { FOREACH_CONST( Attack, aa, a ) { @@ -2703,12 +2720,12 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const AttackArray &aa, Steps float fStartBeat, fEndBeat; a->GetAttackBeats( pSong, fStartBeat, fEndBeat ); - NoteDataUtil::TransformNoteData( nd, po, st, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); + NoteDataUtil::TransformNoteData(nd, timing_data, po, st, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); } } } -void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, int iStartIndex, int iEndIndex ) +void NoteDataUtil::TransformNoteData( NoteData &nd, TimingData const& timing_data, const PlayerOptions &po, StepsType st, int iStartIndex, int iEndIndex ) { // Apply remove transforms before others so that we don't go removing // notes we just inserted. Apply TRANSFORM_NOROLLS before TRANSFORM_NOHOLDS, @@ -2719,7 +2736,7 @@ void NoteDataUtil::TransformNoteData( NoteData &nd, const PlayerOptions &po, Ste if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOMINES] ) NoteDataUtil::RemoveMines( nd, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOJUMPS] ) NoteDataUtil::RemoveJumps( nd, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOLIFTS] ) NoteDataUtil::RemoveLifts( nd, iStartIndex, iEndIndex ); - if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOFAKES] ) NoteDataUtil::RemoveFakes( nd, iStartIndex, iEndIndex ); + if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOFAKES] ) NoteDataUtil::RemoveFakes( nd, timing_data, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOHANDS] ) NoteDataUtil::RemoveHands( nd, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOQUADS] ) NoteDataUtil::RemoveQuads( nd, iStartIndex, iEndIndex ); if( po.m_bTransforms[PlayerOptions::TRANSFORM_NOSTRETCH] ) NoteDataUtil::RemoveStretch( nd, st, iStartIndex, iEndIndex ); diff --git a/src/NoteDataUtil.h b/src/NoteDataUtil.h index 45995ad8ad..a855ddd2a6 100644 --- a/src/NoteDataUtil.h +++ b/src/NoteDataUtil.h @@ -74,25 +74,25 @@ namespace NoteDataUtil * @param tn the TapNote Type to remove. * @param iStartIndex the starting point for transforming. * @param iEndIndex the ending point for transforming. */ - void RemoveSpecificTapNotes( NoteData &inout, TapNoteType tn, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); + void RemoveSpecificTapNotes(NoteData &inout, TapNoteType tn, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW); /** * @brief Remove all of the mines from the chart. * @param inout the Notedata to be transformed. * @param iStartIndex the starting point for transforming. * @param iEndIndex the ending point for transforming. */ - void RemoveMines( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); + void RemoveMines(NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW); /** * @brief Remove all of the lifts from the chart. * @param inout the Notedata to be transformed. * @param iStartIndex the starting point for transforming. * @param iEndIndex the ending point for transforming. */ - void RemoveLifts( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); + void RemoveLifts(NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW); /** * @brief Remove all of the fakes from the chart. * @param inout the Notedata to be transformed. * @param iStartIndex the starting point for transforming. * @param iEndIndex the ending point for transforming. */ - void RemoveFakes( NoteData &inout, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); + void RemoveFakes(NoteData &inout, TimingData const& timing_data, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW); void RemoveStretch( NoteData &inout, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void RemoveAllButOneTap( NoteData &inout, int row ); void RemoveAllButPlayer( NoteData &inout, PlayerNumber pn ); @@ -163,8 +163,10 @@ namespace NoteDataUtil // True if no notes in row that aren't true in the mask bool RowPassesValidMask( NoteData &inout, int row, const bool bValidMask[] ); - void TransformNoteData( NoteData &nd, const AttackArray &aa, StepsType st, Song* pSong ); - void TransformNoteData( NoteData &nd, const PlayerOptions &po, StepsType st, + void TransformNoteData(NoteData &nd, TimingData const& timing_data, + const AttackArray &aa, StepsType st, Song* pSong); + void TransformNoteData(NoteData &nd, TimingData const& timing_data, + const PlayerOptions &po, StepsType st, int iStartIndex = 0, int iEndIndex = MAX_NOTE_ROW ); void AddTapAttacks( NoteData &nd, Song* pSong ); diff --git a/src/Player.cpp b/src/Player.cpp index d1143f0aae..ce05ba414c 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -670,13 +670,13 @@ void Player::Load() // if( m_pScore ) // m_pScore->Init( pn ); + m_Timing = GAMESTATE->m_pCurSteps[pn]->GetTimingData(); + /* Apply transforms. */ - NoteDataUtil::TransformNoteData( m_NoteData, m_pPlayerState->m_PlayerOptions.GetStage(), GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType ); + NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, m_pPlayerState->m_PlayerOptions.GetStage(), GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType); const Song* pSong = GAMESTATE->m_pCurSong; - m_Timing = GAMESTATE->m_pCurSteps[pn]->GetTimingData(); - // Generate some cache data structure. GenerateCacheDataStructure(m_pPlayerState, m_NoteData); @@ -691,7 +691,7 @@ void Player::Load() // workaround, but since only DDR has ever really implemented those // modes, it's stayed like this. -aj StepsType st = GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType; - NoteDataUtil::TransformNoteData( m_NoteData, m_pPlayerState->m_PlayerOptions.GetStage(), st ); + NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, m_pPlayerState->m_PlayerOptions.GetStage(), st); if (BATTLE_RAVE_MIRROR) { @@ -1504,7 +1504,7 @@ void Player::ApplyWaitingTransforms() // if re-adding noteskin changes, this is one place to edit -aj - NoteDataUtil::TransformNoteData( m_NoteData, po, GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat) ); + NoteDataUtil::TransformNoteData(m_NoteData, *m_Timing, po, GAMESTATE->GetCurrentStyle(GetPlayerState()->m_PlayerNumber)->m_StepsType, BeatToNoteRow(fStartBeat), BeatToNoteRow(fEndBeat)); } m_pPlayerState->m_ModsToApply.clear(); } diff --git a/src/ScoreKeeperNormal.cpp b/src/ScoreKeeperNormal.cpp index 98131d1e1b..a58fe9a435 100644 --- a/src/ScoreKeeperNormal.cpp +++ b/src/ScoreKeeperNormal.cpp @@ -79,7 +79,7 @@ void ScoreKeeperNormal::Load( /* Compute RadarValues before applying any user-selected mods. Apply * Course mods and count them in the "pre" RadarValues because they're * forced and not chosen by the user. */ - NoteDataUtil::TransformNoteData( ndPre, aa, pSteps->m_StepsType, pSong ); + NoteDataUtil::TransformNoteData(ndPre, *(pSteps->GetTimingData()), aa, pSteps->m_StepsType, pSong ); /* Apply user transforms to find out how the notes will really look. * @@ -89,7 +89,7 @@ void ScoreKeeperNormal::Load( * the last call to StoreSelectedOptions and the modifiers list, but that'd * mean moving the queues in ScreenGameplay to GameState ... */ NoteData ndPost = ndPre; - NoteDataUtil::TransformNoteData( ndPost, m_pPlayerState->m_PlayerOptions.GetStage(), pSteps->m_StepsType ); + NoteDataUtil::TransformNoteData(ndPost, *(pSteps->GetTimingData()), m_pPlayerState->m_PlayerOptions.GetStage(), pSteps->m_StepsType); GAMESTATE->SetProcessedTimingData(pSteps->GetTimingData()); // XXX: Not sure why but NoteDataUtil::CalculateRadarValues segfaults without this iTotalPossibleDancePoints += this->GetPossibleDancePoints( &ndPre, &ndPost, pSteps->GetTimingData(), pSong->m_fMusicLengthSeconds ); diff --git a/src/Trail.cpp b/src/Trail.cpp index d2c9d8febe..2e33d60185 100644 --- a/src/Trail.cpp +++ b/src/Trail.cpp @@ -120,8 +120,10 @@ const RadarValues &Trail::GetRadarValues() const PlayerOptions po; po.FromString( e->Modifiers ); if( po.ContainsTransformOrTurn() ) - NoteDataUtil::TransformNoteData( nd, po, pSteps->m_StepsType ); - NoteDataUtil::TransformNoteData( nd, e->Attacks, pSteps->m_StepsType, e->pSong ); + { + NoteDataUtil::TransformNoteData(nd, *(pSteps->GetTimingData()), po, pSteps->m_StepsType); + } + NoteDataUtil::TransformNoteData(nd, *(pSteps->GetTimingData()), e->Attacks, pSteps->m_StepsType, e->pSong); RadarValues transformed_rv; NoteDataUtil::CalculateRadarValues( nd, e->pSong->m_fMusicLengthSeconds, transformed_rv ); GAMESTATE->SetProcessedTimingData(NULL);