mirror of
https://github.com/ppy/osu
synced 2025-01-04 13:22:08 +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()
|
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;
|
int loops = MaxCatchUpFrames;
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -121,14 +105,27 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
private void updateClock()
|
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)
|
if (parentGameplayClock == null)
|
||||||
setClock(); // LoadComplete may not be run yet, but we still want the clock.
|
setClock(); // LoadComplete may not be run yet, but we still want the clock.
|
||||||
|
|
||||||
double proposedTime = parentGameplayClock.CurrentTime;
|
double proposedTime = parentGameplayClock.CurrentTime;
|
||||||
|
|
||||||
// each update start with considering things in valid state.
|
|
||||||
state = PlaybackState.Valid;
|
|
||||||
|
|
||||||
if (FrameStablePlayback)
|
if (FrameStablePlayback)
|
||||||
// if we require frame stability, the proposed time will be adjusted to move at most one known
|
// if we require frame stability, the proposed time will be adjusted to move at most one known
|
||||||
// frame interval in the current direction.
|
// frame interval in the current direction.
|
||||||
|
Loading…
Reference in New Issue
Block a user