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

Delay backwards instead of using a millisecond tolerance.

This commit is contained in:
smoogipooo 2017-05-22 20:01:28 +09:00
parent fc90cfa604
commit 95c4704a9e

View File

@ -11,11 +11,6 @@ namespace osu.Game.Graphics.Containers
{
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 int lastBeat;
@ -40,10 +35,10 @@ namespace osu.Game.Graphics.Containers
if (controlPoint == lastControlPoint && beat == lastBeat)
return;
if ((currentTrackTime - controlPoint.Time) % controlPoint.BeatLength > seek_tolerance)
return;
double offsetFromBeat = (controlPoint.Time - currentTrackTime) % controlPoint.BeatLength;
OnNewBeat(beat, controlPoint.BeatLength, controlPoint.TimeSignature, kiai);
using (BeginDelayedSequence(offsetFromBeat, true))
OnNewBeat(beat, controlPoint.BeatLength, controlPoint.TimeSignature, kiai);
lastBeat = beat;
lastControlPoint = controlPoint;