mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:03:08 +08:00
Fix control points being flushed too late
This commit is contained in:
parent
45af796943
commit
cf2d885099
@ -262,6 +262,21 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestTimingPointResetsSpeedMultiplier()
|
||||||
|
{
|
||||||
|
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||||
|
|
||||||
|
using (var resStream = TestResources.OpenResource("timingpoint-speedmultiplier-reset.osu"))
|
||||||
|
using (var stream = new LineBufferedReader(resStream))
|
||||||
|
{
|
||||||
|
var controlPoints = decoder.Decode(stream).ControlPointInfo;
|
||||||
|
|
||||||
|
Assert.That(controlPoints.DifficultyPointAt(0).SpeedMultiplier, Is.EqualTo(0.5).Within(0.1));
|
||||||
|
Assert.That(controlPoints.DifficultyPointAt(2000).SpeedMultiplier, Is.EqualTo(1).Within(0.1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDecodeBeatmapColours()
|
public void TestDecodeBeatmapColours()
|
||||||
{
|
{
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
osu file format v14
|
||||||
|
|
||||||
|
[TimingPoints]
|
||||||
|
0,-200,4,1,0,100,0,0
|
||||||
|
2000,100,1,1,0,100,1,0
|
@ -411,15 +411,15 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
private void addControlPoint(double time, ControlPoint point, bool timingChange)
|
private void addControlPoint(double time, ControlPoint point, bool timingChange)
|
||||||
{
|
{
|
||||||
|
if (time != pendingControlPointsTime)
|
||||||
|
flushPendingPoints();
|
||||||
|
|
||||||
if (timingChange)
|
if (timingChange)
|
||||||
{
|
{
|
||||||
beatmap.ControlPointInfo.Add(time, point);
|
beatmap.ControlPointInfo.Add(time, point);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time != pendingControlPointsTime)
|
|
||||||
flushPendingPoints();
|
|
||||||
|
|
||||||
pendingControlPoints.Add(point);
|
pendingControlPoints.Add(point);
|
||||||
pendingControlPointsTime = time;
|
pendingControlPointsTime = time;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user