Skip to content

Commit

Permalink
Merge pull request #556 from 123jimin/202201-practice-playback-fix
Browse files Browse the repository at this point in the history
Fixed CMOD not rendering properly (fixes #549)
  • Loading branch information
Drewol authored Jan 23, 2022
2 parents 5250afb + 55cab49 commit 28716ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Beatmap/include/Beatmap/BeatmapPlayback.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BeatmapPlayback
return GetViewDistanceIgnoringScrollSpeed(startTime, startTime + duration);
}

/// Get # of (4th) beats between `startTime` and `endTime`, taking scroll speed changes into account.
/// Get # of (4th) beats between `startTime` and `endTime`, taking scroll speed changes into account (if CMOD is not used).
float GetViewDistance(MapTime startTime, MapTime endTime) const;

/// Get # of (4th) beats between `startTime` and `endTime`, ignoring any scroll speed changes.
Expand Down
4 changes: 2 additions & 2 deletions Beatmap/src/BeatmapPlayback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,14 @@ void BeatmapPlayback::GetObjectsInViewRange(float numBeats, Vector<ObjectState*>

if (!IsEndTiming(tp_next) && tp_next->time <= objTime)
{
currBeats += m_beatmap->GetBeatCountWithScrollSpeedApplied(currRefTime, tp_next->time, tp);
currBeats += GetViewDistance(currRefTime, tp_next->time);

tp = tp_next;
tp_next = std::next(tp_next);
currRefTime = tp->time;
}

const float objBeats = currBeats + m_beatmap->GetBeatCountWithScrollSpeedApplied(currRefTime, objTime, tp);
const float objBeats = currBeats + GetViewDistance(currRefTime, objTime);
if (objBeats >= numBeats)
{
break;
Expand Down
2 changes: 1 addition & 1 deletion Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ class Game_Impl : public Game
// Camera and rendering info
{
const float viewRange = m_track ? m_track->GetViewRange() : -1.0f;
textPos.y += RenderText(Utility::Sprintf("SpeedMod: hi=%.3f mod=%.3f | ViewRange: %.4f", m_hispeed, m_modSpeed, viewRange), textPos).y;
textPos.y += RenderText(Utility::Sprintf("SpeedMod: %s hi=%.3f mod=%.3f | ViewRange: %.4f", Enum_SpeedMods::ToString(m_speedMod), m_hispeed, m_modSpeed, viewRange), textPos).y;

if (m_track)
{
Expand Down

0 comments on commit 28716ae

Please sign in to comment.