mirror of
https://github.com/ppy/osu
synced 2025-01-01 20:02:14 +00:00
Move initial state set inside updateClock
This commit is contained in:
parent
1bd461f229
commit
b4e5311014
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user