attempt to fix high fps low ar bug
@@ -28,13 +28,14 @@ def prepare_approach(scale, time_preempt, settings):
"""
img = YImage(approachcircle, settings).img
approach_frames = []
- interval = int(settings.timeframe / settings.fps)
- time_preempt = round(time_preempt)
+ interval = settings.timeframe / settings.fps
s = 3.5
- for time_left in range(time_preempt, 0, -interval):
+ time_left = time_preempt
+ while time_left >= 0:
s -= 2.5 * interval / time_preempt
p = imageproc.change_size(img, s * scale, s * scale)
approach_frames.append(p)
+ time_left -= interval
return approach_frames
@@ -165,7 +166,7 @@ def prepare_circle(diff, scale, settings, hd):
else:
# source: https://github.com/ppy/osu/blob/4cb57f8205edf5ed7b7da076325ba76ec9cc3039/osu.Game.Rulesets.Osu/Mods/OsuModHidden.cs#L23
- interval = int(settings.timeframe / settings.fps)
+ interval = settings.timeframe / settings.fps
fade_in = time_preempt * 0.4
fade_in_interval = 100 * interval/fade_in
@@ -174,8 +175,8 @@ def prepare_circle(diff, scale, settings, hd):
fade_out = time_preempt * 0.3
fade_out_interval = 100 * interval/fade_out
- time_preempt = round(time_preempt)
- for i in range(time_preempt, 0, -interval):
+ time_left = time_preempt
+ while time_left >= 0:
if alpha != 0:
circle_frames[-1].append(newalpha(orig_circle, alpha/100))
slidercircle_frames[-1].append(newalpha(orig_slider, alpha/100))
@@ -189,6 +190,8 @@ def prepare_circle(diff, scale, settings, hd):
alphas.append(alpha)
alpha = max(0, min(100, alpha + ii))
+ time_left -= interval
+
logger.debug("done")
return slidercircle_frames, circle_frames, fadeout, alphas
