mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 20:22:55 +08:00
Set source directly in FramedBeatmapClock
ctor
This isn't required, but avoids creating a temporary `StopwatchClock` and generally just makes debug easier with less state changes.
This commit is contained in:
parent
586311d508
commit
bf08fbe196
@ -55,11 +55,11 @@ namespace osu.Game.Beatmaps
|
|||||||
|
|
||||||
public bool IsRewinding { get; private set; }
|
public bool IsRewinding { get; private set; }
|
||||||
|
|
||||||
public FramedBeatmapClock(bool applyOffsets, bool requireDecoupling)
|
public FramedBeatmapClock(bool applyOffsets, bool requireDecoupling, IClock? source = null)
|
||||||
{
|
{
|
||||||
this.applyOffsets = applyOffsets;
|
this.applyOffsets = applyOffsets;
|
||||||
|
|
||||||
decoupledTrack = new DecouplingClock { AllowDecoupling = requireDecoupling };
|
decoupledTrack = new DecouplingClock(source) { AllowDecoupling = requireDecoupling };
|
||||||
|
|
||||||
// An interpolating clock is used to ensure precise time values even when the host audio subsystem is not reporting
|
// 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).
|
// high precision times (on windows there's generally only 5-10ms reporting intervals, as an example).
|
||||||
|
@ -61,11 +61,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
GameplayClock = new FramedBeatmapClock(applyOffsets, requireDecoupling: true),
|
GameplayClock = new FramedBeatmapClock(applyOffsets, requireDecoupling: true, sourceClock),
|
||||||
Content
|
Content
|
||||||
};
|
};
|
||||||
|
|
||||||
GameplayClock.ChangeSource(sourceClock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user