1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 21:32:57 +08:00

Use alternative solution for timing offset woes on export

This commit is contained in:
Bartłomiej Dach 2023-08-23 13:54:11 +02:00
parent 64786aaee8
commit 052bf2a6e0
No known key found for this signature in database

View File

@ -437,7 +437,8 @@ namespace osu.Game.Rulesets.Osu.Tests
}, },
BeatmapInfo = BeatmapInfo =
{ {
Ruleset = new OsuRuleset().RulesetInfo Ruleset = new OsuRuleset().RulesetInfo,
BeatmapVersion = LegacyBeatmapEncoder.FIRST_LAZER_VERSION // for correct offset treatment by score encoder
}, },
ControlPointInfo = cpi ControlPointInfo = cpi
}); });
@ -486,13 +487,8 @@ namespace osu.Game.Rulesets.Osu.Tests
AddStep("export score", () => AddStep("export score", () =>
{ {
var scoreToEncode = score.DeepClone();
scoreToEncode.Replay.Frames = scoreToEncode.Replay.Frames.Cast<OsuReplayFrame>()
.Select(frame => new OsuReplayFrame(frame.Time + LegacyBeatmapDecoder.EARLY_VERSION_TIMING_OFFSET, frame.Position, frame.Actions.ToArray()))
.ToList<ReplayFrame>();
using var stream = File.Open(Path.Combine(exportLocation, $"{testCaseName}.osr"), FileMode.Create); using var stream = File.Open(Path.Combine(exportLocation, $"{testCaseName}.osr"), FileMode.Create);
var encoder = new LegacyScoreEncoder(scoreToEncode, playableBeatmap); var encoder = new LegacyScoreEncoder(score, playableBeatmap);
encoder.Encode(stream); encoder.Encode(stream);
}); });
} }