mirror of
https://github.com/open-goal/jak-project
synced 2026-07-31 00:14:38 -04:00
[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.  --------- Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
+1
-6
@@ -789,12 +789,7 @@
|
||||
(set! (-> this surf) *gravel-surface*)
|
||||
)
|
||||
(((pat-event rail))
|
||||
(let* ((s4-0 (-> this process))
|
||||
(a0-14 (if (type? s4-0 process-focusable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-14 (the-as process-drawable (as-type (-> this process) process-focusable))))
|
||||
(if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status))))
|
||||
(set! (-> this surf) *rail-surface*)
|
||||
)
|
||||
|
||||
+6
-24
@@ -207,20 +207,11 @@
|
||||
(when (and (logtest? (process-mask crate enemy collectable guard) (-> arg0 mask))
|
||||
(not (logtest? (process-mask no-track) (-> arg0 mask)))
|
||||
)
|
||||
(let* ((gp-0 *search-info*)
|
||||
(s4-0 arg0)
|
||||
(s5-0 (if (type? s4-0 process-drawable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-0 *search-info*)
|
||||
(s5-0 (as-type arg0 process-drawable))
|
||||
)
|
||||
(when s5-0
|
||||
(let* ((s4-1 (-> s5-0 root))
|
||||
(s3-0 (if (type? s4-1 collide-shape)
|
||||
s4-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s3-0 (the-as trsqv (as-type (-> s5-0 root) collide-shape))))
|
||||
(when s3-0
|
||||
(let* ((s4-2 (the-as structure (-> (the-as collide-shape s3-0) root-prim prim-core)))
|
||||
(f30-0 (- (vector-vector-distance (-> gp-0 point) (-> (the-as collide-prim-core s4-2) world-sphere))
|
||||
@@ -228,12 +219,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((s1-0 s5-0)
|
||||
(s2-0 (if (type? s1-0 process-focusable)
|
||||
s1-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s2-0 (the-as process-drawable (as-type s5-0 process-focusable))))
|
||||
(if (and (type? s2-0 process-focusable)
|
||||
s2-0
|
||||
s2-0
|
||||
@@ -407,11 +393,7 @@
|
||||
(while (begin (label cfg-89) (nonzero? s4-0))
|
||||
(+! s4-0 -1)
|
||||
(let* ((s1-0 (-> arg0 s4-0))
|
||||
(s2-0 (-> s1-0 process))
|
||||
(s3-0 (if (type? s2-0 process-focusable)
|
||||
s2-0
|
||||
)
|
||||
)
|
||||
(s3-0 (the-as process-drawable (as-type (-> s1-0 process) process-focusable)))
|
||||
)
|
||||
(when (and (and s3-0 (not (logtest? (-> (the-as process-focusable s3-0) focus-status) (focus-status disable dead))))
|
||||
(and (logtest? (process-mask crate enemy collectable guard) (-> s3-0 mask))
|
||||
|
||||
+3
-13
@@ -12,21 +12,11 @@
|
||||
(-> this src-proc)
|
||||
(or process (-> this dst-proc))
|
||||
)
|
||||
(let* ((process-source (handle->process (-> this src-proc)))
|
||||
(process-focus (if (type? process-source process-focusable)
|
||||
(the-as process-focusable process-source)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((process-focus (as-type (handle->process (-> this src-proc)) process-focusable)))
|
||||
(when process-focus
|
||||
(when (not process)
|
||||
(let ((process-dest (handle->process (-> this dst-proc))))
|
||||
(set! process (if (type? process-dest process-focusable)
|
||||
(the-as process-focusable process-dest)
|
||||
)
|
||||
)
|
||||
(if (not process)
|
||||
(set! process (as-type (handle->process (-> this dst-proc)) process-focusable))
|
||||
)
|
||||
)
|
||||
(when process
|
||||
(let ((start-pos (new 'stack-no-clear 'vector)))
|
||||
(set! (-> start-pos quad) (-> (get-trans process-focus 3) quad))
|
||||
|
||||
Reference in New Issue
Block a user