Skip to content

Commit

Permalink
don't pull pre-calculated values if using autosync
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Jun 10, 2017
1 parent c0d754e commit c516aaf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/TimingData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ float TimingData::WhereUAtBro(float beat) {
if (beat < 0) return 0;
size_t row = BeatToNoteRow(beat);

if ( ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() )
if ( ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() && GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Off)
return ElapsedTimesAtAllRows[row] - GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate * PREFSMAN->m_fGlobalOffsetSeconds;

return GetElapsedTimeFromBeat(beat);
Expand All @@ -1378,7 +1378,7 @@ float TimingData::WhereUAtBro(float beat) const {
if (beat < 0) return 0;
size_t row = BeatToNoteRow(beat);

if ( ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() )
if ( ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() && GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Off)
return ElapsedTimesAtAllRows[row] - GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate * PREFSMAN->m_fGlobalOffsetSeconds;

return GetElapsedTimeFromBeat(beat);
Expand All @@ -1387,7 +1387,7 @@ float TimingData::WhereUAtBro(float beat) const {
float TimingData::WhereUAtBro(int row) {
if (row < 0) return 0;

if ( ValidSequentialAssumption && static_cast<size_t>(row) < ElapsedTimesAtAllRows.size() )
if ( ValidSequentialAssumption && static_cast<size_t>(row) < ElapsedTimesAtAllRows.size() && GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Off)
return ElapsedTimesAtAllRows[row] - GAMESTATE->m_SongOptions.GetCurrent().m_fMusicRate * PREFSMAN->m_fGlobalOffsetSeconds;

return GetElapsedTimeFromBeat(NoteRowToBeat(row));
Expand All @@ -1397,7 +1397,7 @@ float TimingData::WhereUAtBroNoOffset(float beat) {
if (beat < 0) return 0;
size_t row = BeatToNoteRow(beat);

if (ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size())
if (ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() && GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Off)
return ElapsedTimesAtAllRows[row];

return GetElapsedTimeFromBeatNoOffset(beat);
Expand All @@ -1407,7 +1407,7 @@ float TimingData::WhereUAtBroNoOffset(float beat) const {
if (beat < 0) return 0;
size_t row = BeatToNoteRow(beat);

if (ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size())
if (ValidSequentialAssumption && row < ElapsedTimesAtAllRows.size() && GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType == AutosyncType_Off)
return ElapsedTimesAtAllRows[row];

return GetElapsedTimeFromBeatNoOffset(beat);
Expand Down

0 comments on commit c516aaf

Please sign in to comment.