From 79c98b8d1014bedb16535fb1e798ccecb12e52e4 Mon Sep 17 00:00:00 2001 From: pongo1231 Date: Sat, 9 Sep 2023 21:45:02 +0000 Subject: [PATCH] ChaosMod: Make "Bouncy Radar" fps-independent --- ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp b/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp index 32fef6575..64a86eb14 100644 --- a/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp +++ b/ChaosMod/Effects/db/Screen/ScreenBouncyRadar.cpp @@ -2,6 +2,8 @@ #include "Memory/UI.h" +#define BOUNCE_SPEED_MULT 100.f + static float xOffset, yOffset, xVelocity, yVelocity, xMin, xMax, yMin, yMax; static void OnStart() @@ -43,8 +45,10 @@ static void OnTick() yVelocity *= -1; } - xOffset += xVelocity; - yOffset += yVelocity; + auto mult = GET_FRAME_TIME() * BOUNCE_SPEED_MULT; + + xOffset += xVelocity * mult; + yOffset += yVelocity * mult; Memory::SetRadarOffset(xOffset, yOffset); }