diff --git a/goal_src/jak2/engine/ui/hud-classes.gc b/goal_src/jak2/engine/ui/hud-classes.gc index bc37eb2e7e..e0b19b8d01 100644 --- a/goal_src/jak2/engine/ui/hud-classes.gc +++ b/goal_src/jak2/engine/ui/hud-classes.gc @@ -187,7 +187,8 @@ (set-as-offset-from! (-> this sprites 7) (-> this sprites 8 pos) 40 40) (set-as-offset-from! (-> this sprites 21) (-> this sprites 8 pos) 25 25) (let ((v1-12 - (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) + ;; og:preserve-this mod by 360 to avoid sine breaking at high float values (fix flash effect breaking after X hours) + (+ (the int (* 127.0 (sin (degrees (mod (* (-> *display* game-clock frame-counter) 2) 360))))) 127) ) ) (set! (-> this sprites 1 color x) v1-12) @@ -366,7 +367,8 @@ (set! (-> this sprites 0 scale-x) 1.5) (set! (-> this sprites 0 scale-y) 1.5) (let ((v1-31 - (+ (the int (* 15.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 4)))))) 160) + ;; og:preserve-this mod by 360 to avoid sine breaking at high float values (fix flash effect breaking after X hours) + (+ (the int (* 15.0 (sin (degrees (mod (* (-> *display* game-clock frame-counter) 4) 360))))) 160) ) ) (set! (-> this sprites 0 color x) v1-31) diff --git a/goal_src/jak3/engine/ui/hud-classes.gc b/goal_src/jak3/engine/ui/hud-classes.gc index e3227cb42b..37e34f0760 100644 --- a/goal_src/jak3/engine/ui/hud-classes.gc +++ b/goal_src/jak3/engine/ui/hud-classes.gc @@ -137,7 +137,8 @@ ((nonzero? (-> this values 5 current)) (let ((f30-1 (the float - (+ (the int (* 127.0 (sin (* 182.04445 (the float (-> *display* game-clock frame-counter)))))) 127) + ;; og:preserve-this mod by 360 to avoid sine breaking at high float values (fix flash effect breaking after X hours) + (+ (the int (* 127.0 (sin (degrees (mod (-> *display* game-clock frame-counter) 360))))) 127) ) ) ) @@ -160,13 +161,15 @@ (+ 0.5 (* 0.5 (sin - (* 182.04445 (the float (* (if (>= (-> this values 2 current) (the int (-> *FACT-bank* darkjak-bomb-min))) + ;; og:preserve-this mod by 360 to avoid sine breaking at high float values (fix flash effect breaking after X hours) + (degrees (mod (* (if (>= (-> this values 2 current) (the int (-> *FACT-bank* darkjak-bomb-min))) 2 1 ) (-> *display* game-clock frame-counter) ) - ) + 360 + ) ) ) )