mirror of
https://github.com/ppy/osu
synced 2024-12-14 10:57:41 +00:00
Merge branch 'even-less-gameplay-clock' into even-nicer-frame-stability-clock
This commit is contained in:
commit
43442dbf65
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
@ -21,22 +19,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
[Test]
|
||||
public void TestAllSamplesStopDuringSeek()
|
||||
{
|
||||
DrawableSlider slider = null;
|
||||
PoolableSkinnableSample[] samples = null;
|
||||
ISamplePlaybackDisabler sampleDisabler = null;
|
||||
DrawableSlider? slider = null;
|
||||
PoolableSkinnableSample[] samples = null!;
|
||||
ISamplePlaybackDisabler sampleDisabler = null!;
|
||||
|
||||
AddUntilStep("get variables", () =>
|
||||
{
|
||||
sampleDisabler = Player;
|
||||
slider = Player.ChildrenOfType<DrawableSlider>().MinBy(s => s.HitObject.StartTime);
|
||||
samples = slider?.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
||||
samples = slider.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
||||
|
||||
return slider != null;
|
||||
});
|
||||
|
||||
AddUntilStep("wait for slider sliding then seek", () =>
|
||||
{
|
||||
if (!slider.Tracking.Value)
|
||||
if (slider?.Tracking.Value != true)
|
||||
return false;
|
||||
|
||||
if (!samples.Any(s => s.Playing))
|
||||
|
@ -157,7 +157,7 @@ namespace osu.Game.Rulesets.UI
|
||||
if (state == PlaybackState.Valid && proposedTime != manualClock.CurrentTime)
|
||||
direction = proposedTime >= manualClock.CurrentTime ? 1 : -1;
|
||||
|
||||
double timeBehind = Math.Abs(proposedTime - CurrentTime);
|
||||
double timeBehind = Math.Abs(proposedTime - referenceClock.CurrentTime);
|
||||
|
||||
isCatchingUp.Value = timeBehind > 200;
|
||||
waitingOnFrames.Value = state == PlaybackState.NotValid;
|
||||
|
Loading…
Reference in New Issue
Block a user