[decompiler] as-type and font method support (#3855)

Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2025-02-01 21:23:11 -05:00
committed by GitHub
parent d5590ab638
commit 48cb9bb787
645 changed files with 5391 additions and 16694 deletions
+1 -6
View File
@@ -310,12 +310,7 @@
(set! (-> v1-2 action-mask) (collide-action solid))
)
(when (>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
(let* ((s4-0 (-> s5-0 best-other-tri collide-ptr))
(s5-1 (if (type? s4-0 collide-shape-prim-sphere)
s4-0
)
)
)
(let ((s5-1 (the-as basic (as-type (-> s5-0 best-other-tri collide-ptr) collide-shape-prim-sphere))))
(when s5-1
(let ((s4-1 (new 'stack-no-clear 'vector)))
(vector-rotate-around-y! s4-1 (-> this slave-trans-offset) (if (logtest? (-> this info options) 1)
+1 -6
View File
@@ -1660,12 +1660,7 @@
;; definition for method 45 of type under-lift
(defmethod commited-to-ride? ((this under-lift))
"@returns if the target is considered within the elevator area enough to begin descending/ascending"
(let* ((gp-0 *target*)
(a0-2 (if (type? gp-0 process-focusable)
gp-0
)
)
)
(let ((a0-2 (the-as target (as-type *target* process-focusable))))
(when a0-2
(let* ((v1-1 (get-trans a0-2 0))
(gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans)))
+3 -18
View File
@@ -196,19 +196,9 @@
(let ((s5-0 (the-as object (-> block param 1))))
(when (!= (-> (the-as attack-info s5-0) id) (-> self incoming-attack-id))
(set! (-> self incoming-attack-id) (-> (the-as attack-info s5-0) id))
(let* ((gp-0 proc)
(s4-0 (if (type? gp-0 process-drawable)
gp-0
)
)
)
(let ((s4-0 (the-as process (as-type proc process-drawable))))
(when s4-0
(let* ((s3-0 (-> (the-as process-drawable s4-0) root))
(gp-1 (if (type? (the-as collide-shape s3-0) collide-shape)
s3-0
)
)
)
(let ((gp-1 (the-as trsqv (as-type (-> (the-as process-drawable s4-0) root) collide-shape))))
(when gp-1
(when (logtest? (-> (the-as collide-shape gp-1) root-prim prim-core collide-as) (collide-spec projectile))
(when (zero? (-> self state-flip))
@@ -270,12 +260,7 @@
)
)
(vector-reset! (-> self root transv))
(let* ((gp-2 proc)
(a0-11 (if (type? (the-as process-focusable gp-2) process-focusable)
gp-2
)
)
)
(let ((a0-11 (the-as process (as-type proc process-focusable))))
(when a0-11
(vector-! (-> self root transv) (-> self root trans) (get-trans (the-as process-focusable a0-11) 0))
(set! (-> self root transv y) 0.0)