[splittiming]

- calculate m_fFirstBeat and m_fLastBeat correctly
- fix a crash caused by calculating by tidying the timing first.
- make editor go back to right place after playing (the editor should be fairly working now!)
This commit is contained in:
Thai Pangsakulyanont
2011-05-12 19:07:41 +07:00
parent 6847ef9087
commit a09e3d51c2
2 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -2372,11 +2372,11 @@ void ScreenEdit::TransitionEditState( EditState em )
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = m_fBeatToReturnTo;
// Make sure we're snapped.
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = Quantize( GAMESTATE->m_Position.m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = Quantize( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat, NoteTypeToBeat(m_SnapDisplay.GetNoteType()) );
/* Playing and recording have lead-ins, which may start before beat 0;
* make sure we don't stay there if we escaped out early. */
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = max( GAMESTATE->m_Position.m_fSongBeat, 0 );
GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat = max( GAMESTATE->m_pPlayerState[PLAYER_1]->m_Position.m_fSongBeat, 0 );
break;
+9 -9
View File
@@ -472,6 +472,13 @@ void Song::TidyUpData()
m_fMusicLengthSeconds = 0;
}
m_SongTiming.TidyUpData();
FOREACH( Steps *, m_vpSteps, s )
{
(*s)->m_Timing.TidyUpData();
}
/* Generate these before we autogen notes, so the new notes can inherit
* their source's values. */
ReCalculateRadarValuesAndLastBeat();
@@ -488,13 +495,6 @@ void Song::TidyUpData()
m_sArtist = "Unknown artist";
TranslateTitles();
m_SongTiming.TidyUpData();
FOREACH( Steps *, m_vpSteps, s )
{
(*s)->m_Timing.TidyUpData();
}
if( m_fMusicSampleStartSeconds == -1 ||
m_fMusicSampleStartSeconds == 0 ||
m_fMusicSampleStartSeconds+m_fMusicSampleLengthSeconds > this->m_fMusicLengthSeconds )
@@ -833,8 +833,8 @@ void Song::ReCalculateRadarValuesAndLastBeat()
if( tempNoteData.GetLastRow() == 0 )
continue;
fFirstBeat = min( fFirstBeat, tempNoteData.GetFirstBeat() );
fLastBeat = max( fLastBeat, tempNoteData.GetLastBeat() );
fFirstBeat = min( fFirstBeat, m_SongTiming.GetBeatFromElapsedTime(pSteps->m_Timing.GetElapsedTimeFromBeat(tempNoteData.GetFirstBeat())) );
fLastBeat = max( fLastBeat, m_SongTiming.GetBeatFromElapsedTime(pSteps->m_Timing.GetElapsedTimeFromBeat(tempNoteData.GetLastBeat())) );
}
m_fFirstBeat = fFirstBeat;