mirror of
https://github.com/ppy/osu.git
synced 2025-02-10 08:52:54 +08: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.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
@ -21,22 +19,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[Test]
|
[Test]
|
||||||
public void TestAllSamplesStopDuringSeek()
|
public void TestAllSamplesStopDuringSeek()
|
||||||
{
|
{
|
||||||
DrawableSlider slider = null;
|
DrawableSlider? slider = null;
|
||||||
PoolableSkinnableSample[] samples = null;
|
PoolableSkinnableSample[] samples = null!;
|
||||||
ISamplePlaybackDisabler sampleDisabler = null;
|
ISamplePlaybackDisabler sampleDisabler = null!;
|
||||||
|
|
||||||
AddUntilStep("get variables", () =>
|
AddUntilStep("get variables", () =>
|
||||||
{
|
{
|
||||||
sampleDisabler = Player;
|
sampleDisabler = Player;
|
||||||
slider = Player.ChildrenOfType<DrawableSlider>().MinBy(s => s.HitObject.StartTime);
|
slider = Player.ChildrenOfType<DrawableSlider>().MinBy(s => s.HitObject.StartTime);
|
||||||
samples = slider?.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
samples = slider.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
||||||
|
|
||||||
return slider != null;
|
return slider != null;
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for slider sliding then seek", () =>
|
AddUntilStep("wait for slider sliding then seek", () =>
|
||||||
{
|
{
|
||||||
if (!slider.Tracking.Value)
|
if (slider?.Tracking.Value != true)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!samples.Any(s => s.Playing))
|
if (!samples.Any(s => s.Playing))
|
||||||
|
@ -157,7 +157,7 @@ namespace osu.Game.Rulesets.UI
|
|||||||
if (state == PlaybackState.Valid && proposedTime != manualClock.CurrentTime)
|
if (state == PlaybackState.Valid && proposedTime != manualClock.CurrentTime)
|
||||||
direction = proposedTime >= manualClock.CurrentTime ? 1 : -1;
|
direction = proposedTime >= manualClock.CurrentTime ? 1 : -1;
|
||||||
|
|
||||||
double timeBehind = Math.Abs(proposedTime - CurrentTime);
|
double timeBehind = Math.Abs(proposedTime - referenceClock.CurrentTime);
|
||||||
|
|
||||||
isCatchingUp.Value = timeBehind > 200;
|
isCatchingUp.Value = timeBehind > 200;
|
||||||
waitingOnFrames.Value = state == PlaybackState.NotValid;
|
waitingOnFrames.Value = state == PlaybackState.NotValid;
|
||||||
|
Loading…
Reference in New Issue
Block a user