mirror of
https://github.com/open-goal/jak-project
synced 2026-08-12 20:03:14 -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:
+9
-19
@@ -256,12 +256,7 @@
|
||||
(init-vf0-vector)
|
||||
(cond
|
||||
((= (-> arg1 position) #t)
|
||||
(let* ((s3-0 (handle->process (-> arg1 handle)))
|
||||
(v1-4 (if (type? s3-0 process-drawable)
|
||||
(the-as process-drawable s3-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-4 (as-type (handle->process (-> arg1 handle)) process-drawable)))
|
||||
(if (and v1-4 (nonzero? (-> v1-4 root)))
|
||||
(vector-copy! (-> arg1 last-world-pos) (-> v1-4 root trans))
|
||||
)
|
||||
@@ -271,13 +266,12 @@
|
||||
(= (-> (the-as entity-actor (-> arg1 position)) type) entity-actor)
|
||||
)
|
||||
(let* ((v1-14 (the-as entity-actor (-> arg1 position)))
|
||||
(s3-1 (if v1-14
|
||||
(-> v1-14 extra process)
|
||||
)
|
||||
)
|
||||
(a0-13 (if (type? s3-1 process-drawable)
|
||||
(the-as process-drawable s3-1)
|
||||
)
|
||||
(a0-13 (as-type
|
||||
(if v1-14
|
||||
(-> v1-14 extra process)
|
||||
)
|
||||
process-drawable
|
||||
)
|
||||
)
|
||||
)
|
||||
(if a0-13
|
||||
@@ -667,12 +661,8 @@
|
||||
)
|
||||
)
|
||||
(let ((f30-2 (* 0.0024038462 (the float (- arg3 arg1)))))
|
||||
(let ((v1-138 s3-1))
|
||||
(set! (-> v1-138 scale) f30-2)
|
||||
)
|
||||
(let ((v1-139 s3-1))
|
||||
(set! (-> v1-139 width) (the float (the int (* 400.0 f30-2))))
|
||||
)
|
||||
(set-scale! s3-1 f30-2)
|
||||
(set-width! s3-1 (the int (* 400.0 f30-2)))
|
||||
(let ((a0-100 s3-1))
|
||||
(set! (-> a0-100 flags) (font-flags kerning middle large))
|
||||
)
|
||||
|
||||
+18
-50
@@ -1701,12 +1701,7 @@
|
||||
)
|
||||
(set! s3-0 (cond
|
||||
((= (the-as vector s2-0) #t)
|
||||
(let* ((s2-1 (handle->process (-> v1-9 handle)))
|
||||
(v1-13 (if (type? s2-1 process-drawable)
|
||||
s2-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-13 (as-type (handle->process (-> v1-9 handle)) process-drawable)))
|
||||
(if v1-13
|
||||
(set! s3-0 (-> (the-as process-drawable v1-13) root trans))
|
||||
)
|
||||
@@ -1715,13 +1710,12 @@
|
||||
)
|
||||
((and (= (logand (the-as int s2-0) 7) 4) (= (-> (the-as basic s2-0) type) entity-actor))
|
||||
(let* ((v1-19 (the-as structure s2-0))
|
||||
(s3-1 (if (the-as vector v1-19)
|
||||
(-> (the-as entity-actor v1-19) extra process)
|
||||
)
|
||||
)
|
||||
(v1-21 (if (type? s3-1 process-drawable)
|
||||
s3-1
|
||||
)
|
||||
(v1-21 (as-type
|
||||
(if (the-as vector v1-19)
|
||||
(-> (the-as entity-actor v1-19) extra process)
|
||||
)
|
||||
process-drawable
|
||||
)
|
||||
)
|
||||
)
|
||||
(if v1-21
|
||||
@@ -2363,12 +2357,7 @@
|
||||
(sv-224 matrix)
|
||||
(sv-228 matrix)
|
||||
)
|
||||
(let ((s3-0 (handle->process (-> arg1 handle))))
|
||||
(set! sv-16 (if (type? s3-0 process-drawable)
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-16 (as-type (handle->process (-> arg1 handle)) process-drawable))
|
||||
(set! sv-20 (-> arg0 buf))
|
||||
(when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root)))
|
||||
(set! sv-208 (-> sv-20 base))
|
||||
@@ -2503,12 +2492,7 @@
|
||||
(sv-136 vector)
|
||||
(sv-140 matrix)
|
||||
)
|
||||
(let ((s0-0 (handle->process (-> arg1 handle))))
|
||||
(set! sv-16 (if (type? s0-0 process-drawable)
|
||||
s0-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-16 (as-type (handle->process (-> arg1 handle)) process-drawable))
|
||||
(set! sv-20 (-> *video-params* relative-x-scale))
|
||||
(set! sv-24 (-> arg0 buf))
|
||||
(when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root)))
|
||||
@@ -2651,12 +2635,7 @@
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
)
|
||||
(let ((s3-0 (handle->process (-> arg1 handle))))
|
||||
(set! sv-16 (if (type? s3-0 process-drawable)
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-16 (as-type (handle->process (-> arg1 handle)) process-drawable))
|
||||
(set! sv-20 (-> arg0 buf))
|
||||
(when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root)))
|
||||
(set! sv-208 (-> sv-20 base))
|
||||
@@ -2823,12 +2802,7 @@
|
||||
(vf5 :class vf)
|
||||
(vf6 :class vf)
|
||||
)
|
||||
(let ((s3-0 (handle->process (-> arg1 handle))))
|
||||
(set! sv-16 (if (type? s3-0 process-drawable)
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-16 (as-type (handle->process (-> arg1 handle)) process-drawable))
|
||||
(set! sv-20 (-> arg0 buf))
|
||||
(when (and sv-16 (nonzero? (-> (the-as process-drawable sv-16) root)))
|
||||
(set! sv-208 (-> sv-20 base))
|
||||
@@ -3346,12 +3320,7 @@
|
||||
(let ((s1-0 (target-pos 0)))
|
||||
(cond
|
||||
((= (-> arg1 position) #t)
|
||||
(let* ((s3-0 (handle->process (-> arg1 handle)))
|
||||
(v1-4 (if (type? s3-0 process-drawable)
|
||||
s3-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-4 (as-type (handle->process (-> arg1 handle)) process-drawable)))
|
||||
(when (and v1-4 (nonzero? (-> (the-as process-drawable v1-4) root)))
|
||||
(vector-copy! (-> arg1 last-world-pos) (-> (the-as process-drawable v1-4) root trans))
|
||||
(vector-! (-> arg1 last-relative-pos) s1-0 (-> arg1 last-world-pos))
|
||||
@@ -3362,13 +3331,12 @@
|
||||
(= (-> (the-as entity-actor (-> arg1 position)) type) entity-actor)
|
||||
)
|
||||
(let* ((v1-15 (the-as structure (-> arg1 position)))
|
||||
(s3-1 (if (the-as vector v1-15)
|
||||
(-> (the-as entity-actor v1-15) extra process)
|
||||
)
|
||||
)
|
||||
(a0-16 (if (type? s3-1 process-drawable)
|
||||
s3-1
|
||||
)
|
||||
(a0-16 (as-type
|
||||
(if (the-as vector v1-15)
|
||||
(-> (the-as entity-actor v1-15) extra process)
|
||||
)
|
||||
process-drawable
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
|
||||
+126
-378
File diff suppressed because it is too large
Load Diff
+3
-9
@@ -1517,17 +1517,11 @@
|
||||
)
|
||||
(dotimes (s5-1 (length gp-0))
|
||||
(set! (-> self current-index) s5-1)
|
||||
(let ((v1-43 sv-208))
|
||||
(set! (-> v1-43 scale) 0.5)
|
||||
)
|
||||
(set-scale! sv-208 0.5)
|
||||
(set! (-> sv-208 origin x) 70.0)
|
||||
(set! (-> sv-208 origin y) (the float sv-212))
|
||||
(let ((v1-48 sv-208))
|
||||
(set! (-> v1-48 width) (the float 375))
|
||||
)
|
||||
(let ((v1-49 sv-208))
|
||||
(set! (-> v1-49 height) (the float 30))
|
||||
)
|
||||
(set-width! sv-208 375)
|
||||
(set-height! sv-208 30)
|
||||
(set! (-> sv-208 flags) (font-flags kerning middle middle-vert large))
|
||||
(let ((v1-51 sv-208))
|
||||
(set! (-> v1-51 color) (if (and (= s5-1 (-> self option-index)) (= (-> self menu-transition) 0.0))
|
||||
|
||||
+1
-3
@@ -399,9 +399,7 @@
|
||||
(if (logtest? (-> arg2 flags) (font-flags middle-vert))
|
||||
(+! (-> arg2 origin y) (* 0.5 (- f30-0 f1-2)))
|
||||
)
|
||||
(let ((v1-10 arg2))
|
||||
(set! (-> v1-10 scale) (* f28-0 arg1))
|
||||
)
|
||||
(set-scale! arg2 (* f28-0 arg1))
|
||||
(set! (-> arg2 width) f0-1)
|
||||
(set! (-> arg2 height) f1-2)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user