mirror of https://github.com/ppy/osu
Fix FrameStabilityContainer performing frame-stable seeks
This commit is contained in:
parent
65f5318298
commit
80e1568e97
|
@ -68,6 +68,8 @@ protected override void LoadComplete()
|
|||
|
||||
private const double sixty_frame_time = 1000.0 / 60;
|
||||
|
||||
private bool firstConsumption = true;
|
||||
|
||||
public override bool UpdateSubTree()
|
||||
{
|
||||
requireMoreUpdateLoops = true;
|
||||
|
@ -103,7 +105,14 @@ private void updateClock()
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue