mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 08:12:56 +08:00
Delay backwards instead of using a millisecond tolerance.
This commit is contained in:
parent
fc90cfa604
commit
95c4704a9e
@ -11,11 +11,6 @@ namespace osu.Game.Graphics.Containers
|
|||||||
{
|
{
|
||||||
public class BeatSyncedContainer : Container
|
public class BeatSyncedContainer : Container
|
||||||
{
|
{
|
||||||
/// <summary>
|
|
||||||
/// A new beat will not be sent if the time since the beat is larger than this tolerance.
|
|
||||||
/// </summary>
|
|
||||||
private const int seek_tolerance = 20;
|
|
||||||
|
|
||||||
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
|
||||||
|
|
||||||
private int lastBeat;
|
private int lastBeat;
|
||||||
@ -40,10 +35,10 @@ namespace osu.Game.Graphics.Containers
|
|||||||
if (controlPoint == lastControlPoint && beat == lastBeat)
|
if (controlPoint == lastControlPoint && beat == lastBeat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((currentTrackTime - controlPoint.Time) % controlPoint.BeatLength > seek_tolerance)
|
double offsetFromBeat = (controlPoint.Time - currentTrackTime) % controlPoint.BeatLength;
|
||||||
return;
|
|
||||||
|
|
||||||
OnNewBeat(beat, controlPoint.BeatLength, controlPoint.TimeSignature, kiai);
|
using (BeginDelayedSequence(offsetFromBeat, true))
|
||||||
|
OnNewBeat(beat, controlPoint.BeatLength, controlPoint.TimeSignature, kiai);
|
||||||
|
|
||||||
lastBeat = beat;
|
lastBeat = beat;
|
||||||
lastControlPoint = controlPoint;
|
lastControlPoint = controlPoint;
|
||||||
|
Loading…
Reference in New Issue
Block a user