mirror of
https://github.com/ppy/osu
synced 2025-01-31 10:22:02 +00:00
Merge pull request #2155 from smoogipoo/fix-perfectcurve
Fix linear perfect curves not using the linear curve approximator
This commit is contained in:
commit
c8be224b5f
@ -0,0 +1,13 @@
|
||||
{
|
||||
"Mappings": [{
|
||||
"StartTime": 118858,
|
||||
"Objects": [{
|
||||
"StartTime": 118858,
|
||||
"EndTime": 119088,
|
||||
"StartX": 219,
|
||||
"StartY": 215,
|
||||
"EndX": 239.6507,
|
||||
"EndY": 29.1437378
|
||||
}]
|
||||
}]
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
osu file format v14
|
||||
|
||||
[Difficulty]
|
||||
HPDrainRate:6
|
||||
CircleSize:4.2
|
||||
OverallDifficulty:9
|
||||
ApproachRate:9.8
|
||||
SliderMultiplier:1.87
|
||||
SliderTickRate:1
|
||||
|
||||
[TimingPoints]
|
||||
49051,230.769230769231,4,2,1,15,1,0
|
||||
|
||||
[HitObjects]
|
||||
219,215,118858,2,0,P|224:170|244:-10,1,187,8|2,0:0|0:0,0:0:0:0:
|
@ -20,6 +20,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Osu";
|
||||
|
||||
[TestCase("basic")]
|
||||
[TestCase("colinear-perfect-curve")]
|
||||
public new void Test(string name)
|
||||
{
|
||||
base.Test(name);
|
||||
|
@ -176,6 +176,8 @@
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\basic-expected-conversion.json" />
|
||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\basic.osu" />
|
||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\colinear-perfect-curve-expected-conversion.json" />
|
||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\colinear-perfect-curve.osu" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
||||
|
@ -9,6 +9,7 @@ using System.Globalization;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Audio;
|
||||
using System.Linq;
|
||||
using osu.Framework.MathUtils;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
@ -74,6 +75,11 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
points.Add(new Vector2((int)Convert.ToDouble(temp[0], CultureInfo.InvariantCulture), (int)Convert.ToDouble(temp[1], CultureInfo.InvariantCulture)) - pos);
|
||||
}
|
||||
|
||||
// osu-stable special-cased colinear perfect curves to a CurveType.Linear
|
||||
bool isLinear(List<Vector2> p) => Precision.AlmostEquals(0, (p[1].Y - p[0].Y) * (p[2].X - p[0].X) - (p[1].X - p[0].X) * (p[2].Y - p[0].Y));
|
||||
if (points.Count == 3 && curveType == CurveType.PerfectCurve && isLinear(points))
|
||||
curveType = CurveType.Linear;
|
||||
|
||||
int repeatCount = Convert.ToInt32(split[6], CultureInfo.InvariantCulture);
|
||||
|
||||
if (repeatCount > 9000)
|
||||
|
Loading…
Reference in New Issue
Block a user