1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 13:37:25 +08:00

Move out requireMoreUpdateLoops for better consistency

This commit is contained in:
Dean Herbert 2019-10-04 13:42:06 +08:00
parent ddef7fa3ba
commit aeb62825cd

View File

@ -115,17 +115,16 @@ namespace osu.Game.Rulesets.UI
setClock(); // LoadComplete may not be run yet, but we still want the clock.
validState = true;
requireMoreUpdateLoops = false;
var newProposedTime = parentGameplayClock.CurrentTime;
try
{
if (!FrameStablePlayback)
{
requireMoreUpdateLoops = false;
return;
}
else if (firstConsumption)
if (firstConsumption)
{
// On the first update, frame-stability seeking would result in unexpected/unwanted behaviour.
// Instead we perform an initial seek to the proposed time.
@ -159,8 +158,6 @@ namespace osu.Game.Rulesets.UI
newProposedTime = newTime.Value;
}
requireMoreUpdateLoops = manualClock.CurrentTime != parentGameplayClock.CurrentTime;
}
finally
{
@ -171,6 +168,8 @@ namespace osu.Game.Rulesets.UI
manualClock.Rate = Math.Abs(parentGameplayClock.Rate) * direction;
manualClock.IsRunning = parentGameplayClock.IsRunning;
requireMoreUpdateLoops |= manualClock.CurrentTime != parentGameplayClock.CurrentTime;
// The manual clock time has changed in the above code. The framed clock now needs to be updated
// to ensure that the its time is valid for our children before input is processed
framedClock.ProcessFrame();