1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Fix FrameStabilityContainer performing frame-stable seeks

This commit is contained in:
Dean Herbert 2019-04-24 13:44:21 +09:00
parent 65f5318298
commit 80e1568e97

View File

@ -68,6 +68,8 @@ namespace osu.Game.Rulesets.UI
private const double sixty_frame_time = 1000.0 / 60;
private bool firstConsumption = true;
public override bool UpdateSubTree()
{
requireMoreUpdateLoops = true;
@ -103,7 +105,14 @@ namespace osu.Game.Rulesets.UI
try
{
if (Math.Abs(manualClock.CurrentTime - newProposedTime) > sixty_frame_time * 1.2f)
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.
manualClock.CurrentTime = newProposedTime;
firstConsumption = false;
}
else if (Math.Abs(manualClock.CurrentTime - newProposedTime) > sixty_frame_time * 1.2f)
{
newProposedTime = newProposedTime > manualClock.CurrentTime
? Math.Min(newProposedTime, manualClock.CurrentTime + sixty_frame_time)