1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Disable decoupling for OsuGameBase's beatmap implementation

This avoids it ever mutating the underlying track (aka attempting to start
it). Resolves the one caveat mentioned in
aeef92fa710648d4a00edc523e13c17ac6104125.
This commit is contained in:
Dean Herbert 2023-09-21 18:49:44 +09:00
parent 5f634f2812
commit df08c4e1ad
4 changed files with 7 additions and 7 deletions

View File

@ -56,14 +56,14 @@ namespace osu.Game.Beatmaps
public bool IsRewinding { get; private set; }
public FramedBeatmapClock(bool applyOffsets = false)
public FramedBeatmapClock(bool applyOffsets, bool requireDecoupling)
{
this.applyOffsets = applyOffsets;
// A decoupled clock is used to ensure precise time values even when the host audio subsystem is not reporting
// high precision times (on windows there's generally only 5-10ms reporting intervals, as an example).
decoupledTrack = new DecouplingClock();
decoupledTrack = new DecouplingClock { AllowDecoupling = requireDecoupling };
// An interpolating clock is used to ensure precise time values even when the host audio subsystem is not reporting
// high precision times (on windows there's generally only 5-10ms reporting intervals, as an example).
var interpolatedTrack = new InterpolatingFramedClock(decoupledTrack);
if (applyOffsets)

View File

@ -215,7 +215,7 @@ namespace osu.Game
/// For now, this is used as a source specifically for beat synced components.
/// Going forward, it could potentially be used as the single source-of-truth for beatmap timing.
/// </summary>
private readonly FramedBeatmapClock beatmapClock = new FramedBeatmapClock(true);
private readonly FramedBeatmapClock beatmapClock = new FramedBeatmapClock(applyOffsets: true, requireDecoupling: false);
protected override Container<Drawable> Content => content;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Screens.Edit
this.beatDivisor = beatDivisor ?? new BindableBeatDivisor();
underlyingClock = new FramedBeatmapClock(applyOffsets: true);
underlyingClock = new FramedBeatmapClock(applyOffsets: true, requireDecoupling: true);
AddInternal(underlyingClock);
}

View File

@ -68,7 +68,7 @@ namespace osu.Game.Screens.Play
InternalChildren = new Drawable[]
{
GameplayClock = new FramedBeatmapClock(applyOffsets),
GameplayClock = new FramedBeatmapClock(applyOffsets, requireDecoupling: true),
Content
};
}