1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-22 23:23:28 +08:00

Merge pull request #28609 from smoogipoo/fix-legacy-break-time-export

Truncate break times for legacy beatmap export
This commit is contained in:
Bartłomiej Dach 2024-06-26 12:11:33 +02:00 committed by GitHub
commit 00aa196c6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,7 @@ using System.Text;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Formats; using osu.Game.Beatmaps.Formats;
using osu.Game.Beatmaps.Timing;
using osu.Game.IO; using osu.Game.IO;
using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Objects.Types;
@ -59,9 +60,13 @@ namespace osu.Game.Database
// Convert beatmap elements to be compatible with legacy format // Convert beatmap elements to be compatible with legacy format
// So we truncate time and position values to integers, and convert paths with multiple segments to bezier curves // So we truncate time and position values to integers, and convert paths with multiple segments to bezier curves
foreach (var controlPoint in playableBeatmap.ControlPointInfo.AllControlPoints) foreach (var controlPoint in playableBeatmap.ControlPointInfo.AllControlPoints)
controlPoint.Time = Math.Floor(controlPoint.Time); controlPoint.Time = Math.Floor(controlPoint.Time);
for (int i = 0; i < playableBeatmap.Breaks.Count; i++)
playableBeatmap.Breaks[i] = new BreakPeriod(Math.Floor(playableBeatmap.Breaks[i].StartTime), Math.Floor(playableBeatmap.Breaks[i].EndTime));
foreach (var hitObject in playableBeatmap.HitObjects) foreach (var hitObject in playableBeatmap.HitObjects)
{ {
// Truncate end time before truncating start time because end time is dependent on start time // Truncate end time before truncating start time because end time is dependent on start time