mirror of
https://github.com/open-goal/jak-project
synced 2026-08-18 21:57:54 -04:00
[decompiler] Detect vector*! (#3846)
Detect use of `vector*!`, which is inlined in jak 2 and jak 3. --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
@@ -541,7 +541,7 @@
|
||||
((-> jcontrol postbind-function) this joints jcontrol)
|
||||
)
|
||||
(let ((a1-5 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> a1-5 quad) (-> this bounds quad))
|
||||
(vector-copy! a1-5 (-> this bounds))
|
||||
(set! (-> a1-5 w) 1.0)
|
||||
(vector-norm-matrix*!
|
||||
(-> this origin)
|
||||
@@ -819,7 +819,7 @@
|
||||
(set! (-> v1-35 origin-joint-index) (the-as uint (-> skelgroup origin-joint-index)))
|
||||
(set! (-> v1-35 shadow-joint-index) (the-as uint (-> skelgroup shadow-joint-index)))
|
||||
)
|
||||
(set! (-> s2-0 bounds quad) (-> skelgroup bounds quad))
|
||||
(vector-copy! (-> s2-0 bounds) (-> skelgroup bounds))
|
||||
(let ((v1-37 (-> skelgroup shadow)))
|
||||
(when (and (> v1-37 0) (< v1-37 sv-20))
|
||||
(let ((s0-0 (-> s1-0 data v1-37)))
|
||||
@@ -923,19 +923,17 @@
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! (-> s3-0 skeleton bones 0 transform trans quad) (-> (the-as vector (get-property-struct
|
||||
(-> s3-0 jgeo extra)
|
||||
'trans-offset
|
||||
'interp
|
||||
-1000000000.0
|
||||
*null-vector*
|
||||
(the-as (pointer res-tag) #f)
|
||||
*res-static-buf*
|
||||
)
|
||||
)
|
||||
quad
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> s3-0 skeleton bones 0 transform trans) (the-as vector (get-property-struct
|
||||
(-> s3-0 jgeo extra)
|
||||
'trans-offset
|
||||
'interp
|
||||
-1000000000.0
|
||||
*null-vector*
|
||||
(the-as (pointer res-tag) #f)
|
||||
*res-static-buf*
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1118,53 +1116,36 @@
|
||||
|
||||
(defbehavior ja-linear-vel process-drawable ((chan int))
|
||||
(local-vars (s4-1 vector) (sv-16 res-tag))
|
||||
(rlet ((vf0 :class vf)
|
||||
(vf4 :class vf)
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
(let* ((s4-0 (-> self skel root-channel chan))
|
||||
(v1-2 (-> s4-0 frame-group))
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(let* ((s4-0 (-> self skel root-channel chan))
|
||||
(v1-2 (-> s4-0 frame-group))
|
||||
)
|
||||
(cond
|
||||
((-> v1-2 extra)
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((gp-0 (res-lump-data (-> v1-2 extra) 'linear-vel pointer :tag-ptr (& sv-16))))
|
||||
(cond
|
||||
(gp-0
|
||||
(let* ((s5-0 (the int (the float (the int (-> s4-0 frame-num)))))
|
||||
(f0-5 (-> s4-0 frame-num))
|
||||
(f28-0 (- f0-5 (the float (the int f0-5))))
|
||||
)
|
||||
(set! s4-1 (new 'static 'vector))
|
||||
(let ((f30-0 (ja-rate 0)))
|
||||
(vector-lerp! s4-1 (the-as vector (&+ gp-0 (* s5-0 16))) (the-as vector (&+ gp-0 (* (+ s5-0 1) 16))) f28-0)
|
||||
(let ((a0-7 s4-1))
|
||||
(let ((v1-9 s4-1)
|
||||
(a1-3 (-> self root scale))
|
||||
)
|
||||
(.lvf vf4 (&-> v1-9 quad))
|
||||
(.lvf vf5 (&-> a1-3 quad))
|
||||
)
|
||||
(.add.x.vf.w vf6 vf0 vf0)
|
||||
(.mul.vf.xyz vf6 vf4 vf5)
|
||||
(.svf (&-> a0-7 quad) vf6)
|
||||
)
|
||||
(vector-float*! s4-1 s4-1 f30-0)
|
||||
)
|
||||
(cond
|
||||
((-> v1-2 extra)
|
||||
(set! sv-16 (new 'static 'res-tag))
|
||||
(let ((gp-0 (res-lump-data (-> v1-2 extra) 'linear-vel pointer :tag-ptr (& sv-16))))
|
||||
(cond
|
||||
(gp-0
|
||||
(let* ((s5-0 (the int (the float (the int (-> s4-0 frame-num)))))
|
||||
(f0-5 (-> s4-0 frame-num))
|
||||
(f28-0 (- f0-5 (the float (the int f0-5))))
|
||||
)
|
||||
(set! s4-1 (new 'static 'vector))
|
||||
(let ((f30-0 (ja-rate 0)))
|
||||
(vector-lerp! s4-1 (the-as vector (&+ gp-0 (* s5-0 16))) (the-as vector (&+ gp-0 (* (+ s5-0 1) 16))) f28-0)
|
||||
(vector*! s4-1 s4-1 (-> self root scale))
|
||||
(vector-float*! s4-1 s4-1 f30-0)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! s4-1 *null-vector*)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! s4-1 *null-vector*)
|
||||
)
|
||||
)
|
||||
s4-1
|
||||
)
|
||||
(else
|
||||
*null-vector*
|
||||
)
|
||||
s4-1
|
||||
)
|
||||
(else
|
||||
*null-vector*
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2079,8 +2060,8 @@
|
||||
(set! v1-0 (-> self entity))
|
||||
)
|
||||
(if arg1
|
||||
(set! (-> gp-0 quad) (-> arg1 quad))
|
||||
(set! (-> gp-0 quad) (-> v1-0 extra trans quad))
|
||||
(vector-copy! gp-0 arg1)
|
||||
(vector-copy! gp-0 (-> v1-0 extra trans))
|
||||
)
|
||||
(let ((s5-0 (-> v1-0 extra perm task))
|
||||
(s4-0 (new 'static 'fact-info))
|
||||
|
||||
Reference in New Issue
Block a user