mirror of
https://github.com/ppy/osu
synced 2025-02-21 04:57:11 +00:00
Round object coordinates to nearest integers rather than truncating
Addresses https://github.com/ppy/osu/issues/31256.
This commit is contained in:
parent
0d16ed028b
commit
e9762422b3
@ -42,7 +42,10 @@ namespace osu.Game.Database
|
||||
return null;
|
||||
|
||||
using var contentStreamReader = new LineBufferedReader(contentStream);
|
||||
var beatmapContent = new LegacyBeatmapDecoder().Decode(contentStreamReader);
|
||||
|
||||
// FIRST_LAZER_VERSION is specified here to avoid flooring object coordinates on decode via `(int)` casts.
|
||||
// we will be making integers out of them lower down, but in a slightly different manner (rounding rather than truncating)
|
||||
var beatmapContent = new LegacyBeatmapDecoder(LegacyBeatmapEncoder.FIRST_LAZER_VERSION).Decode(contentStreamReader);
|
||||
|
||||
var workingBeatmap = new FlatWorkingBeatmap(beatmapContent);
|
||||
var playableBeatmap = workingBeatmap.GetPlayableBeatmap(beatmapInfo.Ruleset);
|
||||
@ -93,6 +96,12 @@ namespace osu.Game.Database
|
||||
|
||||
hitObject.StartTime = Math.Floor(hitObject.StartTime);
|
||||
|
||||
if (hitObject is IHasXPosition hasXPosition)
|
||||
hasXPosition.X = MathF.Round(hasXPosition.X);
|
||||
|
||||
if (hitObject is IHasYPosition hasYPosition)
|
||||
hasYPosition.Y = MathF.Round(hasYPosition.Y);
|
||||
|
||||
if (hitObject is not IHasPath hasPath) continue;
|
||||
|
||||
// stable's hit object parsing expects the entire slider to use only one type of curve,
|
||||
|
Loading…
Reference in New Issue
Block a user