From b4e53110146b4f7d651cd588d794be0d075e4db1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 30 Oct 2020 20:37:07 +0900 Subject: [PATCH] Move initial state set inside updateClock --- .../Rulesets/UI/FrameStabilityContainer.cs | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/osu.Game/Rulesets/UI/FrameStabilityContainer.cs b/osu.Game/Rulesets/UI/FrameStabilityContainer.cs index c8f37d75a0..e9865f6c8b 100644 --- a/osu.Game/Rulesets/UI/FrameStabilityContainer.cs +++ b/osu.Game/Rulesets/UI/FrameStabilityContainer.cs @@ -85,22 +85,6 @@ namespace osu.Game.Rulesets.UI public override bool UpdateSubTree() { - if (frameStableClock.WaitingOnFrames.Value) - { - // waiting on frames is a special case where we want to avoid doing any update propagation, unless new frame data has arrived. - state = PlaybackState.Valid; - } - else if (!frameStableClock.IsPaused.Value) - { - state = PlaybackState.Valid; - } - else - { - // time should not advance while paused, nor should anything run. - state = PlaybackState.NotValid; - return true; - } - int loops = MaxCatchUpFrames; do @@ -121,14 +105,27 @@ namespace osu.Game.Rulesets.UI private void updateClock() { + if (frameStableClock.WaitingOnFrames.Value) + { + // if waiting on frames, run one update loop to determine if frames have arrived. + state = PlaybackState.Valid; + } + else if (frameStableClock.IsPaused.Value) + { + // time should not advance while paused, nor should anything run. + state = PlaybackState.NotValid; + return; + } + else + { + state = PlaybackState.Valid; + } + if (parentGameplayClock == null) setClock(); // LoadComplete may not be run yet, but we still want the clock. double proposedTime = parentGameplayClock.CurrentTime; - // each update start with considering things in valid state. - state = PlaybackState.Valid; - if (FrameStablePlayback) // if we require frame stability, the proposed time will be adjusted to move at most one known // frame interval in the current direction.