Files
water111 3ee2b4423c [decompiler] Cleanup for Jak 3 (#3845)
This PR does a few cleanups:
- improve method names/comments/flags for `enemy.gc` and a few other
files
- fix `new-stack-matrix0` not working for jak 3
- add `matrix-copy!` detection for jak 3
- add `vector-copy!` detection

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
2025-01-20 10:31:29 -05:00

70 lines
1.7 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type simple-focus
(deftype simple-focus (process-focusable)
((first-time? symbol)
)
(:state-methods
idle
)
)
;; definition for method 3 of type simple-focus
(defmethod inspect ((this simple-focus))
(when (not this)
(set! this this)
(goto cfg-4)
)
(let ((t9-0 (method-of-type process-focusable inspect)))
(t9-0 this)
)
(format #t "~2Tfirst-time?: ~A~%" (-> this first-time?))
(label cfg-4)
this
)
;; definition for method 21 of type simple-focus
(defmethod get-trans ((this simple-focus) (arg0 int))
"Get the `trans` for this process."
(-> this root trans)
)
;; definition for method 12 of type simple-focus
(defmethod run-logic? ((this simple-focus))
"Should this process be run? Checked by execute-process-tree."
(when (-> this first-time?)
(set! (-> this first-time?) #f)
#t
)
)
;; failed to figure out what this is:
(defstate idle (simple-focus)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('move-trans)
(let ((v0-0 (-> self root trans)))
(vector-copy! v0-0 (the-as vector (-> block param 0)))
v0-0
)
)
)
)
:code sleep-code
)
;; definition for function simple-focus-init-by-other
(defbehavior simple-focus-init-by-other simple-focus ()
(let ((gp-0 (new 'process 'trsqv)))
(set! (-> self root) (the-as collide-shape gp-0))
(vector-identity! (-> gp-0 scale))
(quaternion-identity! (-> gp-0 quat))
)
(logclear! (-> self mask) (process-mask enemy))
(set! (-> self first-time?) #t)
(set! (-> self event-hook) (-> (method-of-object self idle) event))
(go-virtual idle)
)