1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Use integer count for tiny droplet generation

This commit is contained in:
ekrctb 2019-01-26 16:14:37 +09:00
parent aaba377e11
commit 1a5a238752

View File

@ -90,13 +90,17 @@ namespace osu.Game.Rulesets.Catch.Objects
time = Math.Max(StartTime + Duration / 2, time - LegacyLastTickOffset.Value);
}
int tinyTickCount = 1;
double tinyTickInterval = time - lastTickTime;
while (tinyTickInterval > 100)
tinyTickInterval /= 2;
// we don't want to generate at (t == time - epsilon) due to floating point accuracy. time - 1 seems working.
for (double t = lastTickTime + tinyTickInterval; t < time - 1; t += tinyTickInterval)
while (tinyTickInterval > 100 && tinyTickCount < 10000)
{
tinyTickInterval /= 2;
tinyTickCount *= 2;
}
for (int tinyTickIndex = 0; tinyTickIndex < tinyTickCount - 1; tinyTickIndex++)
{
var t = lastTickTime + (tinyTickIndex + 1) * tinyTickInterval;
double progress = reversed ? 1 - (t - spanStartTime) / spanDuration : (t - spanStartTime) / spanDuration;
AddNested(new TinyDroplet