1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Don't merge adjacent legacy Catmull segments

This commit is contained in:
Dan Balasescu 2022-05-18 17:11:08 +09:00
parent fe49a7e678
commit 731f0960ec
2 changed files with 7 additions and 3 deletions

View File

@ -22,7 +22,7 @@ namespace osu.Game.Beatmaps.Formats
{
public class LegacyBeatmapEncoder
{
public const int LATEST_VERSION = 128;
public const int FIRST_LAZER_VERSION = 128;
/// <summary>
/// osu! is generally slower than taiko, so a factor is added to increase
@ -55,7 +55,7 @@ namespace osu.Game.Beatmaps.Formats
public void Encode(TextWriter writer)
{
writer.WriteLine($"osu file format v{LATEST_VERSION}");
writer.WriteLine($"osu file format v{FIRST_LAZER_VERSION}");
writer.WriteLine();
handleGeneral(writer);

View File

@ -336,10 +336,14 @@ namespace osu.Game.Rulesets.Objects.Legacy
while (++endIndex < vertices.Length - endPointLength)
{
// Keep incrementing while an implicit segment doesn't need to be started
// Keep incrementing while an implicit segment doesn't need to be started.
if (vertices[endIndex].Position != vertices[endIndex - 1].Position)
continue;
// Adjacent legacy Catmull segments should be treated as a single segment.
if (FormatVersion < LegacyBeatmapEncoder.FIRST_LAZER_VERSION && type == PathType.Catmull)
continue;
// The last control point of each segment is not allowed to start a new implicit segment.
if (endIndex == vertices.Length - endPointLength - 1)
continue;