fix seagulls at high fps (#1607)

This commit is contained in:
ManDude
2022-07-05 17:11:05 +01:00
committed by GitHub
parent 8caa5bfa70
commit 7084742a3d
3 changed files with 28 additions and 23 deletions
+1 -1
View File
@@ -25039,7 +25039,7 @@
:heap-base #x180
:flag-assert #x11018001f0
(:methods
(create-the-flock! (_type_ vector) (pointer process) 14)
(spawn-bird (_type_ vector) (pointer process) 14)
(play-hint (_type_ int) none 15)
(dummy-16 (_type_ seagull) float 16)
)
+3
View File
@@ -74,6 +74,9 @@
(-> obj time-ratio)
)
;; new constant for use in high FPS scenarios
(defconstant DISPLAY_FPS_RATIO (/ (-> *display* time-factor) 5.0))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DISPLAY ENV and DRAW ENV
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+24 -22
View File
@@ -8,6 +8,8 @@
(declare-type seagullflock process)
(defconstant SEAGULLFLOCK_MAX 64)
;; DECOMP BEGINS
(import "goal_src/jak1/import/seagull-ag.gc")
@@ -79,7 +81,7 @@
((self-override seagullflock :offset 28)
(path path-control :offset-assert 112)
(trans vector :inline :offset-assert 128)
(bird (pointer seagull) 64 :offset-assert 144)
(bird (pointer seagull) SEAGULLFLOCK_MAX :offset-assert 144)
(birds int32 :offset-assert 400)
(link actor-link-info :offset-assert 404)
(bird-at-waterfall uint64 :offset-assert 408)
@@ -98,7 +100,7 @@
:size-assert #x1f0
:flag-assert #x11018001f0
(:methods
(create-the-flock! (_type_ vector) (pointer process) 14)
(spawn-bird (_type_ vector) (pointer process) 14)
(play-hint (_type_ int) none 15)
(dummy-16 (_type_ seagull) float 16)
)
@@ -307,7 +309,7 @@
)
(let ((f0-28 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))
(set! (-> obj angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28)))
(set! (-> obj target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps
(set! (-> obj target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps
)
)
0
@@ -470,7 +472,7 @@
)
)
)
(set! (-> obj root-override transv y) (* (-> *display* time-adjust-ratio) f0-0)) ;; changed for high fps
(set! (-> obj root-override transv y) (* DISPLAY_FPS_RATIO f0-0)) ;; changed for high fps
)
0
(none)
@@ -505,8 +507,8 @@
(let ((f30-1 (* arg0 (sin (-> obj heading))))
(f0-4 (* arg0 (cos (-> obj heading))))
)
(set! (-> obj root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1)))) ;; changed for high fps
(set! (-> obj root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4)))) ;; changed for high fps
(set! (-> obj root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1)))) ;; changed for high fps
(set! (-> obj root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4)))) ;; changed for high fps
)
0
(none)
@@ -516,8 +518,8 @@
(let ((f30-1 (* arg0 (sin (-> obj heading))))
(f0-4 (* arg0 (cos (-> obj heading))))
)
(set! (-> obj root-override transv x) (* (-> *display* time-adjust-ratio) f30-1)) ;; changed for high fps
(set! (-> obj root-override transv z) (* (-> *display* time-adjust-ratio) f0-4)) ;; changed for high fps
(set! (-> obj root-override transv x) (* DISPLAY_FPS_RATIO f30-1)) ;; changed for high fps
(set! (-> obj root-override transv z) (* DISPLAY_FPS_RATIO f0-4)) ;; changed for high fps
)
0
(none)
@@ -590,7 +592,7 @@
)
)
)
(set! (-> v1-13 root-override transv y) (* (-> *display* time-adjust-ratio) f0-5)) ;; changed for high fps
(set! (-> v1-13 root-override transv y) (* DISPLAY_FPS_RATIO f0-5)) ;; changed for high fps
)
0
(let* ((gp-1 self)
@@ -598,8 +600,8 @@
(f30-2 (* f28-0 (sin (-> gp-1 heading))))
(f0-10 (* f28-0 (cos (-> gp-1 heading))))
)
(set! (-> gp-1 root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) ;; changed for high fps
(set! (-> gp-1 root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) ;; changed for high fps
(set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) ;; changed for high fps
(set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) ;; changed for high fps
)
0
)
@@ -719,7 +721,7 @@
)
(let ((f0-33 (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z)))))
(set! (-> s5-0 angletan) (/ (- (-> s4-0 y)) (sqrtf f0-33)))
(set! (-> s5-0 target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y)))))) ;; changed for high fps
(set! (-> s5-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y)))))) ;; changed for high fps
)
)
0
@@ -742,7 +744,7 @@
)
)
)
(set! (-> v1-44 root-override transv y) (* (-> *display* time-adjust-ratio) f0-38)) ;; changed for high fps
(set! (-> v1-44 root-override transv y) (* DISPLAY_FPS_RATIO f0-38)) ;; changed for high fps
)
0
)
@@ -763,7 +765,7 @@
)
)
)
(set! (-> v1-48 root-override transv y) (* (-> *display* time-adjust-ratio) f0-39)) ;; changed for high fps
(set! (-> v1-48 root-override transv y) (* DISPLAY_FPS_RATIO f0-39)) ;; changed for high fps
)
0
)
@@ -911,7 +913,7 @@
)
(let ((f0-33 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))
(set! (-> gp-0 angletan) (/ (- (-> s5-0 y)) (sqrtf f0-33)))
(set! (-> gp-0 target-dist) (* (-> *display* time-adjust-ratio) (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps
(set! (-> gp-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y)))))) ;; changed for high fps
)
)
0
@@ -924,8 +926,8 @@
(f30-0 (* f28-0 (sin (-> gp-1 heading))))
(f0-41 (* f28-0 (cos (-> gp-1 heading))))
)
(set! (-> gp-1 root-override transv x) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) ;; changed for high fps
(set! (-> gp-1 root-override transv z) (* (-> *display* time-adjust-ratio) (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) ;; changed for high fps
(set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) ;; changed for high fps
(set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) ;; changed for high fps
)
0
(dummy-27 self)
@@ -1355,10 +1357,10 @@
(set! (-> obj target quad) (-> obj trans quad))
(set! (-> obj max-lift) 20480.0)
(set! (-> obj birds) 0)
(dotimes (v1-16 64)
(dotimes (v1-16 SEAGULLFLOCK_MAX)
(set! (-> obj bird v1-16) (the-as (pointer seagull) #f))
)
(create-the-flock! obj (-> obj trans))
(spawn-bird obj (-> obj trans))
(dotimes (s5-1 20)
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let* ((f30-0 (-> obj trans x))
@@ -1379,7 +1381,7 @@
)
(set! (-> s4-0 y) (-> obj trans y))
(set! (-> s4-0 w) 1.0)
(create-the-flock! obj s4-0)
(spawn-bird obj s4-0)
)
)
(set! (-> obj squall) (new 'process 'ambient-sound sound-seagull-squall (-> obj trans)))
@@ -1389,8 +1391,8 @@
(none)
)
(defmethod create-the-flock! seagullflock ((obj seagullflock) (arg0 vector))
(if (= (-> obj birds) 64)
(defmethod spawn-bird seagullflock ((obj seagullflock) (arg0 vector))
(if (= (-> obj birds) SEAGULLFLOCK_MAX)
(return (the-as (pointer process) #f))
)
(let ((v0-0 (process-spawn seagull arg0 (-> obj birds) obj :to obj)))