1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Update comments to better explain what LastTick is doing

This commit is contained in:
Dean Herbert 2023-09-29 14:40:44 +09:00
parent 81485c548c
commit d7119674e8
4 changed files with 11 additions and 8 deletions

View File

@ -104,8 +104,8 @@ namespace osu.Game.Rulesets.Catch.Objects
}
}
// this also includes LegacyLastTick and this is used for TinyDroplet generation above.
// this means that the final segment of TinyDroplets are increasingly mistimed where LegacyLastTickOffset is being applied.
// this also includes LastTick and this is used for TinyDroplet generation above.
// this means that the final segment of TinyDroplets are increasingly mistimed where LastTick is being applied.
lastEvent = e;
switch (e.Type)

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Mods
d.HitObjectApplied += _ =>
{
// slider tails are a painful edge case, as their start time is offset 36ms back (see `LegacyLastTick`).
// slider tails are a painful edge case, as their start time is offset 36ms back (see `LastTick`).
// to work around this, look up the slider tail's parenting slider's end time instead to ensure proper snap.
double snapTime = d is DrawableSliderTail tail
? tail.Slider.GetEndTime()

View File

@ -288,7 +288,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override void PlaySamples()
{
// rather than doing it this way, we should probably attach the sample to the tail circle.
// this can only be done after we stop using LegacyLastTick.
// this can only be done if we stop using LastTick.
if (!TailCircle.SamplePlaysOnlyOnHit || TailCircle.IsHit)
base.PlaySamples();
}

View File

@ -205,9 +205,10 @@ namespace osu.Game.Rulesets.Osu.Objects
break;
case SliderEventType.LastTick:
// we need to use the LegacyLastTick here for compatibility reasons (difficulty).
// it is *okay* to use this because the TailCircle is not used for any meaningful purpose in gameplay.
// if this is to change, we should revisit this.
// Of note, we are directly mapping LastTick (instead of `SliderEventType.Tail`) to SliderTailCircle.
// It is required as difficulty calculation and gameplay relies on reading this value.
// (although it is displayed in classic skins, which may be a concern).
// If this is to change, we should revisit this.
AddNested(TailCircle = new SliderTailCircle(this)
{
RepeatIndex = e.SpanIndex,
@ -262,7 +263,9 @@ namespace osu.Game.Rulesets.Osu.Objects
if (HeadCircle != null)
HeadCircle.Samples = this.GetNodeSamples(0);
// The samples should be attached to the slider tail, however this can only be done after LegacyLastTick is removed otherwise they would play earlier than they're intended to.
// The samples should be attached to the slider tail, however this can only be done if LastTick is removed otherwise they would play earlier than they're intended to.
// (see mapping logic in `CreateNestedHitObjects` above)
//
// For now, the samples are played by the slider itself at the correct end time.
TailSamples = this.GetNodeSamples(repeatCount + 1);
}