Skip to content

Commit

Permalink
Add inline comment explaining LifetimeEnd set for future visitors
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed May 15, 2024
1 parent d52dffe commit a3960bf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ private void setComputedLifetime(HitObjectLifetimeEntry entry)

// always load the hitobject before its first judgement offset
entry.LifetimeStart = Math.Min(entry.HitObject.StartTime - entry.HitObject.MaximumJudgementOffset, computedStartTime);

// This is likely not entirely correct, but sets a sane expectation of the ending lifetime.
// A more correct lifetime will be overwritten after a DrawableHitObject is assigned via DrawableHitObject.updateState.
//
// It is required that we set a lifetime end here to ensure that in scenarios like loading a Player instance to a seeked
// location in a beatmap doesn't churn every hit object into a DrawableHitObject. Even in a pooled scenario, the overhead
// of this can be quite crippling.
entry.LifetimeEnd = entry.HitObject.GetEndTime() + timeRange.Value;
}

Expand Down

0 comments on commit a3960bf

Please sign in to comment.