Skip to content

Commit

Permalink
[high fps] fix blinking in all games
Browse files Browse the repository at this point in the history
Fixes both interval and animation speed. (jak1 previously only had a fix for the former.)
  • Loading branch information
SuperSamus committed Nov 13, 2024
1 parent 2a41bc6 commit 174acb2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
11 changes: 6 additions & 5 deletions goal_src/jak1/engine/gfx/foreground/eye.gc
Original file line number Diff line number Diff line change
Expand Up @@ -688,17 +688,18 @@
(cond
((and (>= (-> s5-3 left lid) 0.0) (>= (-> s5-3 right lid) 0.0))
(set! (-> s5-3 random-time)
(the int
(* (/ 1.0 (-> *display* time-adjust-ratio)) ;; og:preserve-this changed for high fps
(the-as uint 60))))
(the int (* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(the-as uint 60))))
(set! (-> s5-3 blink) 0.0))
(else
(+! (-> s5-3 random-time) -1)
(let ((v1-54 (-> s5-3 random-time)))
(let ((v1-54 (the int (* DISPLAY_FPS_RATIO (-> s5-3 random-time))))) ;; og:preserve-this changed for high fps
(when (< v1-54 (the-as uint 10))
(set! (-> s5-3 blink) (-> *eye-work* blink-table v1-54))
(if (zero? v1-54)
(set! (-> s5-3 random-time) (the-as uint (the int (* (1/ DISPLAY_FPS_RATIO) (rand-vu-float-range 60.0 240.0)))))))))))
(set! (-> s5-3 random-time) (the-as uint (the int
(* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(rand-vu-float-range 60.0 240.0)))))))))))
;; pick between level and common eyes
(cond
((>= (the-as uint 1) (-> s5-3 level))
Expand Down
12 changes: 9 additions & 3 deletions goal_src/jak2/engine/gfx/foreground/eye.gc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
;; name in dgo: eye
;; dgos: ENGINE, GAME

;; note: changed for high fps

;; DECOMP BEGINS

(define *eye-work* (new 'static 'eye-work
Expand Down Expand Up @@ -1029,16 +1031,20 @@
(when (not (paused?))
(cond
((and (>= (-> s4-0 left lid) 0.0) (>= (-> s4-0 right lid) 0.0))
(set! (-> s4-0 random-time) (the-as uint 60))
(set! (-> s4-0 random-time)
(the int (* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(the-as uint 60))))
(set! (-> s4-0 blink) 0.0)
)
(else
(+! (-> s4-0 random-time) -1)
(let ((v1-22 (-> s4-0 random-time)))
(let ((v1-22 (the int (* DISPLAY_FPS_RATIO (-> s4-0 random-time))))) ;; og:preserve-this changed for high fps
(when (< v1-22 (the-as uint 10))
(set! (-> s4-0 blink) (-> *eye-work* blink-table v1-22))
(if (zero? v1-22)
(set! (-> s4-0 random-time) (the-as uint (the int (rand-vu-float-range 60.0 240.0))))
(set! (-> s4-0 random-time) (the-as uint (the int
(* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(rand-vu-float-range 60.0 240.0)))))
)
)
)
Expand Down
12 changes: 9 additions & 3 deletions goal_src/jak3/engine/gfx/foreground/eye.gc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
;; name in dgo: eye
;; dgos: GAME

;; note: changed for high fps

;; DECOMP BEGINS

;; og:preserve-this
Expand Down Expand Up @@ -717,16 +719,20 @@
(when (not (paused?))
(cond
((and (>= (-> s5-0 left lid) 0.0) (>= (-> s5-0 right lid) 0.0))
(set! (-> s5-0 random-time) (the-as uint 60))
(set! (-> s5-0 random-time)
(the int (* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(the-as uint 60))))
(set! (-> s5-0 blink) 0.0)
)
(else
(+! (-> s5-0 random-time) -1)
(let ((v1-19 (-> s5-0 random-time)))
(let ((v1-19 (the int (* DISPLAY_FPS_RATIO (-> s5-0 random-time))))) ;; og:preserve-this changed for high fps
(when (< v1-19 (the-as uint 10))
(set! (-> s5-0 blink) (-> *eye-work* blink-table v1-19))
(if (zero? v1-19)
(set! (-> s5-0 random-time) (the-as uint (the int (rand-vu-float-range 60.0 240.0))))
(set! (-> s5-0 random-time) (the-as uint (the int
(* (1/ DISPLAY_FPS_RATIO) ;; og:preserve-this changed for high fps
(rand-vu-float-range 60.0 240.0)))))
)
)
)
Expand Down

0 comments on commit 174acb2

Please sign in to comment.