use empty TimingData in Steps to signify fallback on Song timing.
This required using the new Steps::GetTimingData function and the allowEmpty parameter to TimingData::TidyUpData when appropriate, as well as clearing the TimingData to remove step timing rather than coping the song timing over it. Fixes some odd editor behavior when changing song timing, and is overall a slightly less hacky way of doing things.
This commit is contained in:
@@ -216,6 +216,10 @@ void AdjustSync::AutosyncOffset()
|
||||
const vector<Steps *>& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps();
|
||||
FOREACH( Steps*, const_cast<vector<Steps *>&>(vpSteps), s )
|
||||
{
|
||||
// Empty TimingData means it's inherited
|
||||
// from the song and is already changed.
|
||||
if( (*s)->m_Timing.empty() )
|
||||
continue;
|
||||
(*s)->m_Timing.m_fBeat0OffsetInSeconds += mean;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -262,7 +262,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
||||
fBeatsUntilStep = GetDisplayedBeat(pPlayerState, fNoteBeat) - GetDisplayedBeat(pPlayerState, fSongBeat);
|
||||
float fYOffsetBeatSpacing = fBeatsUntilStep;
|
||||
float fSpeedMultiplier = bShowEffects ?
|
||||
pCurSteps->m_Timing.GetDisplayedSpeedPercent(
|
||||
pCurSteps->GetTimingData()->GetDisplayedSpeedPercent(
|
||||
position.m_fSongBeatVisible,
|
||||
position.m_fMusicSecondsVisible ) : 1.0f;
|
||||
fYOffset += fSpeedMultiplier * fYOffsetBeatSpacing * (1-pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing);
|
||||
@@ -271,7 +271,7 @@ float ArrowEffects::GetYOffset( const PlayerState* pPlayerState, int iCol, float
|
||||
if( pPlayerState->m_PlayerOptions.GetCurrent().m_fTimeSpacing != 0.0f )
|
||||
{
|
||||
float fSongSeconds = GAMESTATE->m_Position.m_fMusicSecondsVisible;
|
||||
float fNoteSeconds = pCurSteps->m_Timing.GetElapsedTimeFromBeat(fNoteBeat);
|
||||
float fNoteSeconds = pCurSteps->GetTimingData()->GetElapsedTimeFromBeat(fNoteBeat);
|
||||
float fSecondsUntilStep = fNoteSeconds - fSongSeconds;
|
||||
float fBPM = pPlayerState->m_PlayerOptions.GetCurrent().m_fScrollBPM;
|
||||
float fBPS = fBPM/60.f;
|
||||
|
||||
@@ -103,7 +103,7 @@ void AutoKeysounds::LoadAutoplaySoundsInto( RageSoundReader_Chain *pChain )
|
||||
if( tn[pn].iKeysoundIndex >= 0 )
|
||||
{
|
||||
RString sKeysoundFilePath = sSongDir + pSong->m_vsKeysoundFile[tn[pn].iKeysoundIndex];
|
||||
float fSeconds = GAMESTATE->m_pCurSteps[pn]->m_Timing.GetElapsedTimeFromBeatNoOffset( NoteRowToBeat(iRow) ) + SOUNDMAN->GetPlayLatency();
|
||||
float fSeconds = GAMESTATE->m_pCurSteps[pn]->GetTimingData()->GetElapsedTimeFromBeatNoOffset( NoteRowToBeat(iRow) ) + SOUNDMAN->GetPlayLatency();
|
||||
|
||||
float fPan = 0;
|
||||
if( !bSoundIsGlobal )
|
||||
|
||||
+1
-1
@@ -204,7 +204,7 @@ void BPMDisplay::SetBpmFromSteps( const Steps* pSteps )
|
||||
ASSERT( pSteps != NULL );
|
||||
DisplayBpms bpms;
|
||||
float fMinBPM, fMaxBPM;
|
||||
pSteps->m_Timing.GetActualBPM( fMinBPM, fMaxBPM );
|
||||
pSteps->GetTimingData()->GetActualBPM( fMinBPM, fMaxBPM );
|
||||
bpms.Add( fMinBPM );
|
||||
bpms.Add( fMaxBPM );
|
||||
m_fCycleTime = 1.0f;
|
||||
|
||||
+1
-1
@@ -985,7 +985,7 @@ void GameState::UpdateSongPosition( float fPositionSeconds, const TimingData &ti
|
||||
{
|
||||
if( m_pCurSteps[pn] )
|
||||
{
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, m_pCurSteps[pn]->m_Timing, timestamp );
|
||||
m_pPlayerState[pn]->m_Position.UpdateSongPosition( fPositionSeconds, *m_pCurSteps[pn]->GetTimingData(), timestamp );
|
||||
Actor::SetPlayerBGMBeat( pn, m_pPlayerState[pn]->m_Position.m_fSongBeatVisible, m_pPlayerState[pn]->m_Position.m_fSongBeatNoOffset );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void GameplayAssist::PlayTicks( const NoteData &nd, const PlayerState *ps )
|
||||
|
||||
//float fPositionSeconds = GAMESTATE->m_Position.m_fMusicSeconds;
|
||||
fPositionSeconds += SOUNDMAN->GetPlayLatency() + (float)CommonMetrics::TICK_EARLY_SECONDS + 0.250f;
|
||||
const TimingData &timing = GAMESTATE->m_pCurSteps[ps->m_PlayerNumber]->m_Timing;
|
||||
const TimingData &timing = *GAMESTATE->m_pCurSteps[ps->m_PlayerNumber]->GetTimingData();
|
||||
const float fSongBeat = timing.GetBeatFromElapsedTimeNoOffset( fPositionSeconds );
|
||||
|
||||
const int iSongRow = max( 0, BeatToNoteRowNotRounded( fSongBeat ) );
|
||||
|
||||
@@ -369,8 +369,9 @@ static RString GetSSCNoteData( const Song &song, const Steps &in, bool bSavingCa
|
||||
|
||||
lines.push_back( ssprintf( "#CREDIT:%s;", SmEscape(in.GetCredit()).c_str() ) );
|
||||
|
||||
// XXX: Is there a better way to write this?
|
||||
if (const_cast<TimingData &>(song.m_SongTiming) != in.m_Timing)
|
||||
// If the Steps TimingData is not empty, then they have their own
|
||||
// timing. Write out the corresponding tags.
|
||||
if( !in.m_Timing.empty() )
|
||||
{
|
||||
lines.push_back( ssprintf( "#OFFSET:%.f;", in.m_Timing.m_fBeat0OffsetInSeconds ) );
|
||||
GetTimingTags( lines, in.m_Timing );
|
||||
|
||||
+1
-1
@@ -659,7 +659,7 @@ void Player::Load()
|
||||
|
||||
const Song* pSong = GAMESTATE->m_pCurSong;
|
||||
|
||||
m_Timing = &GAMESTATE->m_pCurSteps[pn]->m_Timing;
|
||||
m_Timing = GAMESTATE->m_pCurSteps[pn]->GetTimingData();
|
||||
|
||||
// Generate some cache data structure.
|
||||
GenerateCacheDataStructure(m_pPlayerState, m_NoteData);
|
||||
|
||||
+4
-3
@@ -199,9 +199,10 @@ const SongPosition &PlayerState::GetDisplayedPosition() const
|
||||
|
||||
const TimingData &PlayerState::GetDisplayedTiming() const
|
||||
{
|
||||
if( GAMESTATE->m_bIsUsingStepTiming && GAMESTATE->m_pCurSteps[m_PlayerNumber] != NULL )
|
||||
return GAMESTATE->m_pCurSteps[m_PlayerNumber]->m_Timing;
|
||||
return GAMESTATE->m_pCurSong->m_SongTiming;
|
||||
Steps *steps = GAMESTATE->m_pCurSteps[m_PlayerNumber];
|
||||
if( steps == NULL )
|
||||
return GAMESTATE->m_pCurSong->m_SongTiming;
|
||||
return *steps->GetTimingData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ void ScoreKeeperNormal::Load(
|
||||
* forced and not chosen by the user. */
|
||||
NoteDataUtil::TransformNoteData( nd, aa, pSteps->m_StepsType, pSong );
|
||||
RadarValues rvPre;
|
||||
GAMESTATE->SetProcessedTimingData(&pSteps->m_Timing);
|
||||
GAMESTATE->SetProcessedTimingData(pSteps->GetTimingData());
|
||||
NoteDataUtil::CalculateRadarValues( nd, pSong->m_fMusicLengthSeconds, rvPre );
|
||||
|
||||
/* Apply user transforms to find out how the notes will really look.
|
||||
@@ -283,7 +283,7 @@ void ScoreKeeperNormal::HandleTapNoteScoreInternal( TapNoteScore tns, TapNoteSco
|
||||
m_pPlayerStageStats->m_iActualDancePoints += TapNoteScoreToDancePoints( tns );
|
||||
|
||||
// update judged row totals. Respect Combo segments here.
|
||||
TimingData &td = GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->m_Timing;
|
||||
TimingData &td = *GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->GetTimingData();
|
||||
ComboSegment *cs = td.GetComboSegmentAtRow(row);
|
||||
if (tns == TNS_CheckpointHit || tns >= m_MinScoreToContinueCombo)
|
||||
{
|
||||
@@ -316,7 +316,7 @@ void ScoreKeeperNormal::HandleComboInternal( int iNumHitContinueCombo, int iNumH
|
||||
{
|
||||
m_pPlayerStageStats->m_iCurMissCombo = 0;
|
||||
}
|
||||
TimingData &td = GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->m_Timing;
|
||||
TimingData &td = *GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->GetTimingData();
|
||||
if( iNumBreakCombo == 0 )
|
||||
{
|
||||
int multiplier = ( iRow == -1 ? 1 : td.GetComboSegmentAtRow( iRow )->GetCombo() );
|
||||
@@ -336,7 +336,7 @@ void ScoreKeeperNormal::HandleRowComboInternal( TapNoteScore tns, int iNumTapsIn
|
||||
{
|
||||
iNumTapsInRow = min( iNumTapsInRow, 1);
|
||||
}
|
||||
TimingData &td = GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->m_Timing;
|
||||
TimingData &td = *GAMESTATE->m_pCurSteps[m_pPlayerState->m_PlayerNumber]->GetTimingData();
|
||||
if ( tns >= m_MinScoreToContinueCombo )
|
||||
{
|
||||
m_pPlayerStageStats->m_iCurMissCombo = 0;
|
||||
|
||||
+18
-15
@@ -1375,7 +1375,7 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
continue;
|
||||
|
||||
float fStartedHoldingSeconds = m_pSoundMusic->GetPositionSeconds() - fSecsHeld;
|
||||
float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->m_Timing.GetBeatFromElapsedTime(fStartedHoldingSeconds) );
|
||||
float fStartBeat = max( fStartPlayingAtBeat, m_pSteps->GetTimingData()->GetBeatFromElapsedTime(fStartedHoldingSeconds) );
|
||||
float fEndBeat = max( fStartBeat, GetBeat() );
|
||||
fEndBeat = min( fEndBeat, fStopPlayingAtBeat );
|
||||
|
||||
@@ -1420,11 +1420,11 @@ void ScreenEdit::Update( float fDeltaTime )
|
||||
float fLastBeat = NoteRowToBeat(m_iStopPlayingAt);
|
||||
if( bButtonIsBeingPressed && m_EditState == STATE_RECORDING )
|
||||
{
|
||||
float fSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( fLastBeat );
|
||||
fLastBeat = m_pSteps->m_Timing.GetBeatFromElapsedTime( fSeconds + 0.5f );
|
||||
float fSeconds = m_pSteps->GetTimingData()->GetElapsedTimeFromBeat( fLastBeat );
|
||||
fLastBeat = m_pSteps->GetTimingData()->GetBeatFromElapsedTime( fSeconds + 0.5f );
|
||||
}
|
||||
|
||||
float fStopAtSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_iStopPlayingAt) ) + 1;
|
||||
float fStopAtSeconds = m_pSteps->GetTimingData()->GetElapsedTimeFromBeat( NoteRowToBeat(m_iStopPlayingAt) ) + 1;
|
||||
if( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fMusicSeconds > fStopAtSeconds )
|
||||
{
|
||||
TransitionEditState( ( LOOP_ON_CHART_END ? STATE_PLAYING : STATE_EDITING ) );
|
||||
@@ -1601,7 +1601,7 @@ void ScreenEdit::UpdateTextInfo()
|
||||
sText += ssprintf("Attack here?: %s\n", FindAttackAtTime(attacks, beat) > -1 ? "YES" : "NO");
|
||||
}
|
||||
|
||||
GAMESTATE->SetProcessedTimingData(&m_pSteps->m_Timing);
|
||||
GAMESTATE->SetProcessedTimingData(m_pSteps->GetTimingData());
|
||||
const StepsTypeCategory &cat = GAMEMAN->GetStepsTypeInfo(m_pSteps->m_StepsType).m_StepsTypeCategory;
|
||||
if (cat == StepsTypeCategory_Couple || cat == StepsTypeCategory_Routine)
|
||||
{
|
||||
@@ -2512,7 +2512,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( pCourse == NULL )
|
||||
return false;
|
||||
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
|
||||
float fStartTime = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat );
|
||||
float fStartTime = m_pSteps->GetTimingData()->GetElapsedTimeFromBeat( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat );
|
||||
int iAttack = FindAttackAtTime( ce.attacks, fStartTime );
|
||||
|
||||
if( iAttack >= 0 )
|
||||
@@ -2594,7 +2594,8 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
else
|
||||
{
|
||||
// TODO: Give Song/Step Timing switches/functions here?
|
||||
fStart = m_pSteps->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker) );
|
||||
TimingData *timing = m_pSteps->GetTimingData();
|
||||
fStart = timing->GetElapsedTimeFromBeat( NoteRowToBeat(m_NoteFieldEdit.m_iBeginMarker) );
|
||||
int iAttack = FindAttackAtTime( ce.attacks, fStart );
|
||||
|
||||
if( iAttack >= 0 )
|
||||
@@ -2603,7 +2604,7 @@ bool ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
|
||||
if( m_NoteFieldEdit.m_iEndMarker == -1 )
|
||||
fEnd = m_pSong->m_fMusicLengthSeconds;
|
||||
else
|
||||
fEnd = m_pSteps->m_Timing.GetElapsedTimeFromBeat( NoteRowToBeat(m_NoteFieldEdit.m_iEndMarker) );
|
||||
fEnd = timing->GetElapsedTimeFromBeat( NoteRowToBeat(m_NoteFieldEdit.m_iEndMarker) );
|
||||
}
|
||||
g_fLastInsertAttackPositionSeconds = fStart;
|
||||
g_fLastInsertAttackDurationSeconds = fEnd - fStart;
|
||||
@@ -3049,8 +3050,10 @@ void ScreenEdit::TransitionEditState( EditState em )
|
||||
|
||||
if (!GAMESTATE->m_bIsUsingStepTiming)
|
||||
{
|
||||
// Substitute the song timing for the step timing during
|
||||
// previuw if we're in song mode
|
||||
backupStepTiming = GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing;
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing = GAMESTATE->m_pCurSong->m_SongTiming;
|
||||
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Timing.Clear();
|
||||
}
|
||||
|
||||
/* Reset the note skin, in case preferences have changed. */
|
||||
@@ -3839,7 +3842,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
|
||||
// TODO: Handle Song/Step Timing functions/switches here?
|
||||
|
||||
g_fLastInsertAttackPositionSeconds = m_pSteps->m_Timing.GetElapsedTimeFromBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||
g_fLastInsertAttackPositionSeconds = m_pSteps->GetTimingData()->GetElapsedTimeFromBeat( GAMESTATE->m_Position.m_fSongBeat );
|
||||
g_fLastInsertAttackDurationSeconds = StringToFloat( g_InsertCourseAttack.rows[0].choices[iDurationChoice] );
|
||||
iAttack = FindAttackAtTime( ce.attacks, g_fLastInsertAttackPositionSeconds );
|
||||
|
||||
@@ -3935,7 +3938,7 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
|
||||
if( ScreenPrompt::s_LastAnswer == ANSWER_YES )
|
||||
{
|
||||
SaveUndo();
|
||||
m_pSteps->m_Timing = m_pSong->m_SongTiming;
|
||||
m_pSteps->m_Timing.Clear();
|
||||
SetDirty( true );
|
||||
}
|
||||
}
|
||||
@@ -4180,7 +4183,7 @@ const TimingData & ScreenEdit::GetAppropriateTiming() const
|
||||
{
|
||||
if( GAMESTATE->m_bIsUsingStepTiming )
|
||||
{
|
||||
return m_pSteps->m_Timing;
|
||||
return *m_pSteps->GetTimingData();
|
||||
}
|
||||
return m_pSong->m_SongTiming;
|
||||
}
|
||||
@@ -4211,12 +4214,12 @@ inline void ScreenEdit::SetBeat(float fBeat)
|
||||
if( !GAMESTATE->m_bIsUsingStepTiming )
|
||||
{
|
||||
GAMESTATE->m_Position.m_fSongBeat = fBeat;
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = m_pSteps->m_Timing.GetBeatFromElapsedTime(m_pSong->m_SongTiming.GetElapsedTimeFromBeat(fBeat));
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = m_pSteps->GetTimingData()->GetBeatFromElapsedTime(m_pSong->m_SongTiming.GetElapsedTimeFromBeat(fBeat));
|
||||
}
|
||||
else
|
||||
{
|
||||
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = fBeat;
|
||||
GAMESTATE->m_Position.m_fSongBeat = m_pSong->m_SongTiming.GetBeatFromElapsedTime(m_pSteps->m_Timing.GetElapsedTimeFromBeat(fBeat));
|
||||
GAMESTATE->m_Position.m_fSongBeat = m_pSong->m_SongTiming.GetBeatFromElapsedTime(m_pSteps->GetTimingData()->GetElapsedTimeFromBeat(fBeat));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4285,7 +4288,7 @@ static LocalizedString SAVE_CHANGES_BEFORE_EXITING ( "ScreenEdit", "Do you want
|
||||
|
||||
void ScreenEdit::HandleMainMenuChoice( MainMenuChoice c, const vector<int> &iAnswers )
|
||||
{
|
||||
GAMESTATE->SetProcessedTimingData(&m_pSteps->m_Timing);
|
||||
GAMESTATE->SetProcessedTimingData(m_pSteps->GetTimingData());
|
||||
switch( c )
|
||||
{
|
||||
DEFAULT_FAIL( c );
|
||||
|
||||
@@ -2340,7 +2340,7 @@ void ScreenGameplay::SaveStats()
|
||||
const NoteData &nd = pi->m_pPlayer->GetNoteData();
|
||||
PlayerNumber pn = pi->m_pn;
|
||||
|
||||
GAMESTATE->SetProcessedTimingData(&GAMESTATE->m_pCurSteps[pn]->m_Timing);
|
||||
GAMESTATE->SetProcessedTimingData(GAMESTATE->m_pCurSteps[pn]->GetTimingData());
|
||||
NoteDataUtil::CalculateRadarValues( nd, fMusicLen, rv );
|
||||
pss.m_radarPossible += rv;
|
||||
NoteDataWithScoring::GetActualRadarValues( nd, pss, fMusicLen, rv );
|
||||
|
||||
@@ -151,7 +151,8 @@ void ScreenHowToPlay::Init()
|
||||
Steps *pSteps = SongUtil::GetClosestNotes( &m_Song, pStyle->m_StepsType, Difficulty_Beginner );
|
||||
ASSERT_M( pSteps != NULL, ssprintf("No playable steps of StepsType '%s' for ScreenHowToPlay", StringConversion::ToString(pStyle->m_StepsType).c_str()) );
|
||||
|
||||
pSteps->m_Timing.TidyUpData( false );
|
||||
m_Song.m_SongTiming.TidyUpData( false );
|
||||
pSteps->m_Timing.TidyUpData( true );
|
||||
NoteData tempNoteData;
|
||||
pSteps->GetNoteData( tempNoteData );
|
||||
pStyle->GetTransformedNoteDataForStyle( PLAYER_1, tempNoteData, m_NoteData );
|
||||
|
||||
@@ -1779,7 +1779,7 @@ void ScreenSelectMusic::AfterMusicChange()
|
||||
if(SAMPLE_MUSIC_PREVIEW_MODE == SampleMusicPreviewMode_LastSong)
|
||||
{
|
||||
m_sSampleMusicToPlay = pSong->GetMusicPath();
|
||||
m_pSampleMusicTimingData = &pSong->m_Timing;
|
||||
m_pSampleMusicTimingData = &pSong->m_SongTiming;
|
||||
m_fSampleStartSeconds = pSong->m_fMusicSampleStartSeconds;
|
||||
m_fSampleLengthSeconds = pSong->m_fMusicSampleLengthSeconds;
|
||||
}
|
||||
|
||||
@@ -233,6 +233,10 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input )
|
||||
FOREACH( Steps*, const_cast<vector<Steps *>&>(vpSteps), s )
|
||||
{
|
||||
TimingData &pTiming = (*s)->m_Timing;
|
||||
// Empty means it inherits song timing,
|
||||
// which has already been updated.
|
||||
if( pTiming.empty() )
|
||||
continue;
|
||||
float second = sTiming.GetElapsedTimeFromBeat(GAMESTATE->m_Position.m_fSongBeat);
|
||||
seg = pTiming.GetBPMSegmentAtBeat(pTiming.GetBeatFromElapsedTime(second));
|
||||
seg->SetBPS( seg->GetBPS() + fDelta );
|
||||
@@ -278,6 +282,10 @@ bool ScreenSyncOverlay::Input( const InputEventPlus &input )
|
||||
const vector<Steps *>& vpSteps = GAMESTATE->m_pCurSong->GetAllSteps();
|
||||
FOREACH( Steps*, const_cast<vector<Steps *>&>(vpSteps), s )
|
||||
{
|
||||
// Empty means it inherits song timing,
|
||||
// which has already been updated.
|
||||
if( (*s)->m_Timing.empty() )
|
||||
continue;
|
||||
(*s)->m_Timing.m_fBeat0OffsetInSeconds += fDelta;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -198,7 +198,7 @@ Steps *Song::CreateSteps()
|
||||
|
||||
void Song::InitSteps(Steps *pSteps)
|
||||
{
|
||||
pSteps->m_Timing = this->m_SongTiming;
|
||||
// TimingData is initially empty (i.e. defaults to song timing)
|
||||
pSteps->m_sAttackString = this->m_sAttackString;
|
||||
pSteps->m_Attacks = this->m_Attacks;
|
||||
pSteps->SetDisplayBPM(this->m_DisplayBPMType);
|
||||
@@ -541,7 +541,7 @@ void Song::TidyUpData( bool fromCache, bool /* duringCache */ )
|
||||
|
||||
FOREACH( Steps *, m_vpSteps, s )
|
||||
{
|
||||
(*s)->m_Timing.TidyUpData( false );
|
||||
(*s)->m_Timing.TidyUpData( true );
|
||||
}
|
||||
|
||||
/* Generate these before we autogen notes, so the new notes can inherit
|
||||
@@ -889,9 +889,9 @@ void Song::ReCalculateRadarValuesAndLastSecond(bool fromCache, bool duringCache)
|
||||
if( tempNoteData.GetLastRow() != 0 )
|
||||
{
|
||||
localFirst = min(localFirst,
|
||||
pSteps->m_Timing.GetElapsedTimeFromBeat(tempNoteData.GetFirstBeat()));
|
||||
pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetFirstBeat()));
|
||||
localLast = max(localLast,
|
||||
pSteps->m_Timing.GetElapsedTimeFromBeat(tempNoteData.GetLastBeat()));
|
||||
pSteps->GetTimingData()->GetElapsedTimeFromBeat(tempNoteData.GetLastBeat()));
|
||||
}
|
||||
wipe_notedata:
|
||||
if (duringCache)
|
||||
@@ -1587,7 +1587,8 @@ bool Song::IsEditAlreadyLoaded( Steps* pSteps ) const
|
||||
|
||||
bool Song::IsStepsUsingDifferentTiming(Steps *pSteps) const
|
||||
{
|
||||
return pSteps->m_Timing != this->m_SongTiming;
|
||||
// XXX This no longer depends on Song at all
|
||||
return !pSteps->m_Timing.empty();
|
||||
}
|
||||
|
||||
bool Song::HasSignificantBpmChangesOrStops() const
|
||||
|
||||
+7
-6
@@ -66,7 +66,7 @@ void Steps::GetDisplayBpms( DisplayBpms &AddTo ) const
|
||||
else
|
||||
{
|
||||
float fMinBPM, fMaxBPM;
|
||||
this->m_Timing.GetActualBPM( fMinBPM, fMaxBPM );
|
||||
this->GetTimingData()->GetActualBPM( fMinBPM, fMaxBPM );
|
||||
AddTo.Add( fMinBPM );
|
||||
AddTo.Add( fMaxBPM );
|
||||
}
|
||||
@@ -291,7 +291,7 @@ void Steps::CalculateRadarValues( float fMusicLengthSeconds )
|
||||
FOREACH_PlayerNumber( pn )
|
||||
m_CachedRadarValues[pn].Zero();
|
||||
|
||||
GAMESTATE->SetProcessedTimingData(&this->m_Timing);
|
||||
GAMESTATE->SetProcessedTimingData(this->GetTimingData());
|
||||
if( tempNoteData.IsComposite() )
|
||||
{
|
||||
vector<NoteData> vParts;
|
||||
@@ -527,11 +527,12 @@ const TimingData *Steps::GetTimingData() const
|
||||
|
||||
bool Steps::HasSignificantTimingChanges() const
|
||||
{
|
||||
if( m_Timing.HasStops() || m_Timing.HasDelays() || m_Timing.HasWarps() ||
|
||||
m_Timing.HasSpeedChanges() || m_Timing.HasScrollChanges() )
|
||||
const TimingData *timing = GetTimingData();
|
||||
if( timing->HasStops() || timing->HasDelays() || timing->HasWarps() ||
|
||||
timing->HasSpeedChanges() || timing->HasScrollChanges() )
|
||||
return true;
|
||||
|
||||
if( m_Timing.HasBpmChanges() )
|
||||
if( timing->HasBpmChanges() )
|
||||
{
|
||||
// check to see if these changes are significant.
|
||||
if( (GetMaxBPM() - GetMinBPM()) > 3.000f )
|
||||
@@ -584,7 +585,7 @@ public:
|
||||
}
|
||||
static int GetTimingData( T* p, lua_State *L )
|
||||
{
|
||||
p->m_Timing.PushSelf(L);
|
||||
p->GetTimingData()->PushSelf(L);
|
||||
return 1;
|
||||
}
|
||||
static int GetHash( T* p, lua_State *L ) { lua_pushnumber( L, p->GetHash() ); return 1; }
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ const RadarValues &Trail::GetRadarValues() const
|
||||
NoteData nd;
|
||||
pSteps->GetNoteData( nd );
|
||||
RadarValues rv_orig;
|
||||
GAMESTATE->SetProcessedTimingData(const_cast<TimingData *>(&pSteps->m_Timing));
|
||||
GAMESTATE->SetProcessedTimingData(const_cast<TimingData *>(pSteps->GetTimingData()));
|
||||
NoteDataUtil::CalculateRadarValues( nd, e->pSong->m_fMusicLengthSeconds, rv_orig );
|
||||
PlayerOptions po;
|
||||
po.FromString( e->Modifiers );
|
||||
|
||||
Reference in New Issue
Block a user