1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:17:27 +08:00

Merge pull request #25702 from smoogipoo/re-fix-mania-conversion

Re-fix mania conversion following new discoveries
This commit is contained in:
Bartłomiej Dach 2023-12-08 14:37:12 +01:00 committed by GitHub
commit 5991c49541
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 186 additions and 150 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,132 +1,168 @@
{
"Mappings": [{
"Mappings": [
{
"RandomW": 2659373485,
"RandomX": 3579807591,
"RandomY": 273326509,
"RandomZ": 272969173,
"StartTime": 500.0,
"Objects": [{
"Objects": [
{
"StartTime": 500.0,
"EndTime": 2500.0,
"Column": 0
}, {
},
{
"StartTime": 1500.0,
"EndTime": 2500.0,
"Column": 1
}]
}, {
}
]
},
{
"RandomW": 3083803045,
"RandomX": 273326509,
"RandomY": 272969173,
"RandomZ": 2659373485,
"StartTime": 3000.0,
"Objects": [{
"Objects": [
{
"StartTime": 3000.0,
"EndTime": 4000.0,
"Column": 2
}]
}, {
}
]
},
{
"RandomW": 4073554232,
"RandomX": 272969173,
"RandomY": 2659373485,
"RandomZ": 3083803045,
"StartTime": 4500.0,
"Objects": [{
"Objects": [
{
"StartTime": 4500.0,
"EndTime": 5500.0,
"Column": 4
}]
}, {
}
]
},
{
"RandomW": 3420401969,
"RandomX": 2659373485,
"RandomY": 3083803045,
"RandomZ": 4073554232,
"StartTime": 6000.0,
"Objects": [{
"Objects": [
{
"StartTime": 6000.0,
"EndTime": 6500.0,
"Column": 2
}]
}, {
}
]
},
{
"RandomW": 1129881182,
"RandomX": 3083803045,
"RandomY": 4073554232,
"RandomZ": 3420401969,
"StartTime": 7000.0,
"Objects": [{
"Objects": [
{
"StartTime": 7000.0,
"EndTime": 8000.0,
"Column": 2
}]
}, {
}
]
},
{
"RandomW": 315568458,
"RandomX": 3420401969,
"RandomY": 1129881182,
"RandomZ": 2358617505,
"StartTime": 8500.0,
"Objects": [{
"Objects": [
{
"StartTime": 8500.0,
"EndTime": 11000.0,
"Column": 0
}]
}, {
}
]
},
{
"RandomW": 548134043,
"RandomX": 1129881182,
"RandomY": 2358617505,
"RandomZ": 315568458,
"StartTime": 11500.0,
"Objects": [{
"Objects": [
{
"StartTime": 11500.0,
"EndTime": 12000.0,
"Column": 1
}]
}, {
}
]
},
{
"RandomW": 3979422122,
"RandomX": 548134043,
"RandomY": 2810584254,
"RandomZ": 2250186050,
"StartTime": 12500.0,
"Objects": [{
"Objects": [
{
"StartTime": 12500.0,
"EndTime": 16500.0,
"Column": 4
}]
}, {
}
]
},
{
"RandomW": 2466283411,
"RandomX": 2810584254,
"RandomY": 2250186050,
"RandomZ": 3979422122,
"StartTime": 17000.0,
"Objects": [{
"Objects": [
{
"StartTime": 17000.0,
"EndTime": 18000.0,
"Column": 2
}]
}, {
}
]
},
{
"RandomW": 83157665,
"RandomX": 2250186050,
"RandomY": 3979422122,
"RandomZ": 2466283411,
"StartTime": 18500.0,
"Objects": [{
"Objects": [
{
"StartTime": 18500.0,
"EndTime": 19450.0,
"Column": 0
}]
}, {
}
]
},
{
"RandomW": 2383087700,
"RandomX": 83157665,
"RandomY": 2055150192,
"RandomZ": 510071020,
"StartTime": 19875.0,
"Objects": [{
"Objects": [
{
"StartTime": 19875.0,
"EndTime": 23875.0,
"Column": 1
}, {
},
{
"StartTime": 19875.0,
"EndTime": 23875.0,
"Column": 0
}]
}]
}
]
}
]
}

View File

@ -1,14 +1,18 @@
{
"Mappings": [{
"Mappings": [
{
"RandomW": 3083084786,
"RandomX": 273326509,
"RandomY": 273553282,
"RandomZ": 2659838971,
"StartTime": 4836,
"Objects": [{
"StartTime": 4836,
"EndTime": 4836,
"StartTime": 4836.0,
"Objects": [
{
"StartTime": 4836.0,
"EndTime": 4836.0,
"Column": 0
}]
}]
}
]
}
]
}

View File

@ -52,18 +52,14 @@ namespace osu.Game.Rulesets.Mania.Beatmaps.Patterns.Legacy
/// <returns>The column.</returns>
protected int GetColumn(float position, bool allowSpecial = false)
{
// Casts to doubles are present here because, although code is originally written as float division,
// the division actually appears to occur on doubles in osu!stable. This is likely a result of
// differences in optimisations between .NET versions due to the presence of the double parameter type of Math.Floor().
if (allowSpecial && TotalColumns == 8)
{
const float local_x_divisor = 512f / 7;
return Math.Clamp((int)Math.Floor((double)position / local_x_divisor), 0, 6) + 1;
return Math.Clamp((int)MathF.Floor(position / local_x_divisor), 0, 6) + 1;
}
float localXDivisor = 512f / TotalColumns;
return Math.Clamp((int)Math.Floor((double)position / localXDivisor), 0, TotalColumns - 1);
return Math.Clamp((int)MathF.Floor(position / localXDivisor), 0, TotalColumns - 1);
}
/// <summary>