mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:42:56 +08:00
Merge pull request #20203 from peppy/fix-beat-sync-stop
Fix beat sync stopping after returning to menu from a failed play
This commit is contained in:
commit
2bd23d7499
@ -121,6 +121,17 @@ namespace osu.Game.Beatmaps
|
|||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
|
if (Source != null && Source is not IAdjustableClock && Source.CurrentTime < decoupledClock.CurrentTime)
|
||||||
|
{
|
||||||
|
// InterpolatingFramedClock won't interpolate backwards unless its source has an ElapsedFrameTime.
|
||||||
|
// See https://github.com/ppy/osu-framework/blob/ba1385330cc501f34937e08257e586c84e35d772/osu.Framework/Timing/InterpolatingFramedClock.cs#L91-L93
|
||||||
|
// This is not always the case here when doing large seeks.
|
||||||
|
// (Of note, this is not an issue if the source is adjustable, as the source is seeked to be in time by DecoupleableInterpolatingFramedClock).
|
||||||
|
// Rather than trying to get around this by fixing the framework clock stack, let's work around it for now.
|
||||||
|
Seek(Source.CurrentTime);
|
||||||
|
}
|
||||||
|
else
|
||||||
finalClockSource.ProcessFrame();
|
finalClockSource.ProcessFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,11 +390,6 @@ namespace osu.Game
|
|||||||
var framedClock = new FramedClock(beatmap.Track);
|
var framedClock = new FramedClock(beatmap.Track);
|
||||||
|
|
||||||
beatmapClock.ChangeSource(framedClock);
|
beatmapClock.ChangeSource(framedClock);
|
||||||
|
|
||||||
// Normally the internal decoupled clock will seek the *track* to the decoupled time, but we blocked this.
|
|
||||||
// It won't behave nicely unless we also set it to the track's time.
|
|
||||||
// Probably another thing which should be fixed in the decoupled mess (or just replaced).
|
|
||||||
beatmapClock.Seek(beatmap.Track.CurrentTime);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void InitialiseFonts()
|
protected virtual void InitialiseFonts()
|
||||||
|
Loading…
Reference in New Issue
Block a user