1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 18:32:56 +08:00

Merge pull request #26698 from EVAST9919/slider-sample-alloc

Reduce sliding sample allocations in `DrawableSlider`
This commit is contained in:
Dean Herbert 2024-01-29 20:37:32 +09:00 committed by GitHub
commit a3199333bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -239,11 +239,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
if (Tracking.Value && Time.Current >= HitObject.StartTime)
{
// keep the sliding sample playing at the current tracking position
if (!slidingSample.IsPlaying)
if (!slidingSample.RequestedPlaying)
slidingSample.Play();
slidingSample.Balance.Value = CalculateSamplePlaybackBalance(CalculateDrawableRelativePosition(Ball));
}
else if (slidingSample.IsPlaying)
else if (slidingSample.IsPlaying || slidingSample.RequestedPlaying)
slidingSample.Stop();
}
}

View File

@ -153,7 +153,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
if (tracking.NewValue)
{
if (!spinningSample.IsPlaying)
if (!spinningSample.RequestedPlaying)
spinningSample.Play();
spinningSample.VolumeTo(1, 300);