From 1a5a23875201f033f922cd7b8f770032c93ed0cd Mon Sep 17 00:00:00 2001 From: ekrctb Date: Sat, 26 Jan 2019 16:14:37 +0900 Subject: [PATCH] Use integer count for tiny droplet generation --- osu.Game.Rulesets.Catch/Objects/JuiceStream.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs index 61beaf7154..8cbd824805 100644 --- a/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs +++ b/osu.Game.Rulesets.Catch/Objects/JuiceStream.cs @@ -90,13 +90,17 @@ private void createTicks() 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