mirror of
https://github.com/open-goal/jak-project
synced 2026-08-17 05:31:46 -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:
+7
-38
@@ -223,12 +223,7 @@
|
||||
(set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w)))
|
||||
)
|
||||
(when (and arg2 (nonzero? (-> this draw)))
|
||||
(let* ((s5-0 (-> arg2 process))
|
||||
(v1-56 (if (type? s5-0 process-drawable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-56 (as-type (-> arg2 process) process-drawable)))
|
||||
(if v1-56
|
||||
(set! (-> this draw light-index) (-> (the-as process-drawable v1-56) draw light-index))
|
||||
)
|
||||
@@ -545,11 +540,7 @@
|
||||
:callback (lambda ((arg0 part-tracker))
|
||||
(let ((v1-1 (handle->process (-> arg0 userdata))))
|
||||
(when (the-as process v1-1)
|
||||
(let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle)))
|
||||
(a0-9 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
(let* ((a0-9 (as-type (handle->process (-> (the-as collectable v1-1) pickup-handle)) process-focusable))
|
||||
(a2-0 (if (not a0-9)
|
||||
(-> arg0 root trans)
|
||||
(get-trans (the-as process-focusable a0-9) 3)
|
||||
@@ -578,11 +569,7 @@
|
||||
:callback (lambda ((arg0 part-tracker))
|
||||
(let ((v1-1 (handle->process (-> arg0 userdata))))
|
||||
(when (the-as process v1-1)
|
||||
(let* ((s5-0 (handle->process (-> (the-as collectable v1-1) pickup-handle)))
|
||||
(a0-9 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
(let* ((a0-9 (as-type (handle->process (-> (the-as collectable v1-1) pickup-handle)) process-focusable))
|
||||
(a2-0 (if (not a0-9)
|
||||
(-> arg0 root trans)
|
||||
(get-trans (the-as process-focusable a0-9) 3)
|
||||
@@ -625,18 +612,9 @@
|
||||
|
||||
;; definition for function check-blue-suck
|
||||
(defbehavior check-blue-suck eco ((arg0 process-drawable))
|
||||
(let ((v1-0 (if (type? arg0 process-drawable)
|
||||
arg0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-0 (as-type arg0 process-drawable)))
|
||||
(when v1-0
|
||||
(let* ((gp-1 (-> v1-0 root))
|
||||
(v1-1 (if (type? gp-1 collide-shape)
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-1 (as-type (-> v1-0 root) collide-shape)))
|
||||
(when v1-1
|
||||
(let ((a0-5 (-> self root root-prim prim-core))
|
||||
(a1-2 (-> (the-as collide-shape v1-1) root-prim prim-core))
|
||||
@@ -654,18 +632,9 @@
|
||||
|
||||
;; definition for function add-blue-motion
|
||||
(defbehavior add-blue-motion eco ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 symbol))
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(s1-0 (if (type? gp-0 process-drawable)
|
||||
(the-as process-focusable gp-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s1-0 (the-as process-focusable (as-type (handle->process (-> self target)) process-drawable))))
|
||||
(when s1-0
|
||||
(let ((s4-0 (if (type? s1-0 process-focusable)
|
||||
s1-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s4-0 (as-type s1-0 process-focusable)))
|
||||
(when s4-0
|
||||
(let ((s1-1 (-> self root root-prim prim-core))
|
||||
(gp-1 (get-trans s4-0 3))
|
||||
|
||||
+2
-12
@@ -889,19 +889,9 @@
|
||||
:code (behavior ((arg0 handle))
|
||||
(set! (-> self target) arg0)
|
||||
(until #f
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-3 (if (type? gp-0 process-drawable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-3 (as-type (handle->process (-> self target)) process-drawable)))
|
||||
(when v1-3
|
||||
(let* ((gp-1 (-> (the-as process-drawable v1-3) root))
|
||||
(v1-4 (if (type? gp-1 collide-shape)
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-4 (as-type (-> (the-as process-drawable v1-3) root) collide-shape)))
|
||||
(when v1-4
|
||||
(let* ((gp-2 (-> self root root-prim prim-core))
|
||||
(a1-3 (-> (the-as collide-shape v1-4) root-prim prim-core))
|
||||
|
||||
+4
-26
@@ -306,13 +306,7 @@
|
||||
(set! (-> self move-pos 0) (-> self move-pos 1))
|
||||
(cond
|
||||
((not (logtest? (-> arg3 param 0) 7))
|
||||
(let ((gp-0 (-> arg3 param 0)))
|
||||
(set! (-> self move-pos 1) (the-as float (if (type? gp-0 float)
|
||||
(the-as float gp-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self move-pos 1) (the-as float (as-type (-> arg3 param 0) float)))
|
||||
)
|
||||
(else
|
||||
(case (-> arg3 param 0)
|
||||
@@ -331,13 +325,7 @@
|
||||
(('jump-to)
|
||||
(cond
|
||||
((not (logtest? (-> arg3 param 0) 7))
|
||||
(let ((gp-1 (-> arg3 param 0)))
|
||||
(set! (-> self move-pos 1) (the-as float (if (type? gp-1 float)
|
||||
(the-as float gp-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self move-pos 1) (the-as float (as-type (-> arg3 param 0) float)))
|
||||
)
|
||||
(else
|
||||
(case (-> arg3 param 0)
|
||||
@@ -464,12 +452,7 @@
|
||||
|
||||
;; definition for method 46 of type elevator
|
||||
(defmethod elevator-method-46 ((this elevator))
|
||||
(let* ((s5-0 *target*)
|
||||
(a0-2 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-2 (the-as target (as-type *target* process-focusable))))
|
||||
(and a0-2 (point-inside-shaft? this (get-trans a0-2 0) (-> this move-pos 0) (-> this move-pos 1)))
|
||||
)
|
||||
)
|
||||
@@ -1001,12 +984,7 @@
|
||||
)
|
||||
(set! sv-32 (the-as float 0.0))
|
||||
(set! sv-36 (-> this path))
|
||||
(let ((s5-2 *target*))
|
||||
(set! sv-40 (if (type? s5-2 process-focusable)
|
||||
s5-2
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! sv-40 (the-as target (as-type *target* process-focusable)))
|
||||
(if (not (and sv-40
|
||||
(logtest? (-> this params flags) (elevator-flags teleport))
|
||||
(find-closest-point-in-path! this (get-trans sv-40 0) (& sv-32) #f #t)
|
||||
|
||||
+8
-19
@@ -943,11 +943,12 @@
|
||||
(let* ((a0-11
|
||||
(vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint)))
|
||||
)
|
||||
(s4-0 (ppointer->process (birth-pickup-at-point a0-11 (pickup-type gem) 1.0 #t *entity-pool* (-> this fact))))
|
||||
(s5-0 (if (type? s4-0 gem)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
(s5-0
|
||||
(as-type
|
||||
(ppointer->process (birth-pickup-at-point a0-11 (pickup-type gem) 1.0 #t *entity-pool* (-> this fact)))
|
||||
gem
|
||||
)
|
||||
)
|
||||
)
|
||||
(if s5-0
|
||||
(set! (-> (the-as gem s5-0) gem-pool) (the-as uint (get-gem-pool-idx this)))
|
||||
@@ -1537,24 +1538,12 @@
|
||||
)
|
||||
(vector-copy! s5-1 (-> v1-31 normal))
|
||||
(vector-copy! s4-0 (-> v1-31 intersect))
|
||||
(let ((v1-32 (and (-> v1-31 collide-ptr) (let ((s2-0 (-> v1-31 collide-ptr)))
|
||||
(if (type? s2-0 collide-shape-prim-sphere)
|
||||
s2-0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-32 (and (-> v1-31 collide-ptr) (as-type (-> v1-31 collide-ptr) collide-shape-prim-sphere))))
|
||||
(when v1-32
|
||||
(let ((s2-1 (-> (the-as collide-shape-prim-sphere v1-32) cshape process)))
|
||||
(let ((s1-0 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s1-0 (-> self root transv))
|
||||
(let* ((s0-0 s2-1)
|
||||
(v1-37 (if (type? s0-0 process-focusable)
|
||||
s0-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-37 (as-type s2-1 process-focusable)))
|
||||
(when v1-37
|
||||
(when (focus-test? (the-as process-focusable v1-37) no-gravity)
|
||||
(vector-float*! s1-0 s1-0 0.5)
|
||||
|
||||
+24
-147
@@ -69,12 +69,7 @@
|
||||
)
|
||||
)
|
||||
(when arg1
|
||||
(let* ((s5-1 (-> self root))
|
||||
(a0-7 (if (type? s5-1 collide-shape)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-7 (as-type (-> self root) collide-shape)))
|
||||
(if a0-7
|
||||
(move-to-point! (the-as collide-shape a0-7) (-> (the-as process-drawable gp-0) root trans))
|
||||
(vector-copy! (-> self root trans) (-> (the-as process-drawable gp-0) root trans))
|
||||
@@ -89,12 +84,7 @@
|
||||
(if (or (zero? (-> self skel active-channels)) (not (-> self skel root-channel 0 frame-group)))
|
||||
(logior! (-> self draw status) (draw-control-status no-draw-temp))
|
||||
)
|
||||
(let* ((gp-1 self)
|
||||
(v1-38 (if (type? gp-1 manipy)
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-38 (as-type self manipy)))
|
||||
(if (and v1-38 (not (-> (the-as manipy v1-38) draw?)))
|
||||
(logior! (-> self draw status) (draw-control-status no-draw-temp))
|
||||
)
|
||||
@@ -223,12 +213,7 @@
|
||||
:code (behavior ((arg0 handle))
|
||||
(swingpole-method-22 self)
|
||||
(suspend)
|
||||
(while (let* ((s5-0 (handle->process arg0))
|
||||
(a0-7 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(while (let ((a0-7 (as-type (handle->process arg0) process-focusable)))
|
||||
(and a0-7 (focus-test? (the-as process-focusable a0-7) pole))
|
||||
)
|
||||
(swingpole-method-22 self)
|
||||
@@ -1522,25 +1507,8 @@
|
||||
;; definition for method 17 of type part-tracker
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod notify-parent-of-death ((this part-tracker))
|
||||
(with-pp
|
||||
(let ((gp-0 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> gp-0 from) (process->ppointer pp))
|
||||
(set! (-> gp-0 num-params) 1)
|
||||
(set! (-> gp-0 message) 'notify)
|
||||
(set! (-> gp-0 param 0) (the-as uint 'die))
|
||||
(let ((s5-0 send-event-function)
|
||||
(s4-0 (ppointer->process (-> this parent)))
|
||||
)
|
||||
(s5-0
|
||||
(if (type? s4-0 process)
|
||||
s4-0
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(send-event (as-type (ppointer->process (-> this parent)) process) 'notify 'die)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 7 of type part-tracker-subsampler
|
||||
@@ -1595,12 +1563,7 @@
|
||||
(if (-> self callback)
|
||||
((-> self callback) self)
|
||||
)
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-15 (if (type? gp-0 process-drawable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-15 (as-type (handle->process (-> self target)) process-drawable)))
|
||||
(cond
|
||||
((and v1-15
|
||||
(nonzero? (-> (the-as process-drawable v1-15) root))
|
||||
@@ -1634,12 +1597,7 @@
|
||||
(if (time-elapsed? (-> self state-time) (-> self linger-duration))
|
||||
(go-virtual die)
|
||||
)
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-13 (if (type? gp-0 process-drawable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-13 (as-type (handle->process (-> self target)) process-drawable)))
|
||||
(if (and v1-13
|
||||
(nonzero? (-> (the-as process-drawable v1-13) root))
|
||||
(nonzero? (-> (the-as process-drawable v1-13) node-list))
|
||||
@@ -1676,12 +1634,7 @@
|
||||
(if (-> self callback)
|
||||
((-> self callback) self)
|
||||
)
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(v1-15 (if (type? gp-0 process-drawable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-15 (as-type (handle->process (-> self target)) process-drawable)))
|
||||
(cond
|
||||
((and v1-15
|
||||
(nonzero? (-> (the-as process-drawable v1-15) root))
|
||||
@@ -1891,25 +1844,8 @@
|
||||
;; definition for method 15 of type lightning-tracker
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod notify-parent-of-death ((this lightning-tracker))
|
||||
(with-pp
|
||||
(let ((gp-0 (new 'stack-no-clear 'event-message-block)))
|
||||
(set! (-> gp-0 from) (process->ppointer pp))
|
||||
(set! (-> gp-0 num-params) 1)
|
||||
(set! (-> gp-0 message) 'notify)
|
||||
(set! (-> gp-0 param 0) (the-as uint 'die))
|
||||
(let ((s5-0 send-event-function)
|
||||
(s4-0 (ppointer->process (-> this parent)))
|
||||
)
|
||||
(s5-0
|
||||
(if (type? s4-0 process)
|
||||
s4-0
|
||||
)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
(send-event (as-type (ppointer->process (-> this parent)) process) 'notify 'die)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type lightning-tracker
|
||||
@@ -1919,18 +1855,10 @@
|
||||
(if (-> this callback)
|
||||
((-> this callback) this)
|
||||
)
|
||||
(let ((a0-6 (cond
|
||||
((>= (-> this target-joint0) 0)
|
||||
(let ((s5-0 (handle->process (-> this target0))))
|
||||
(if (type? s5-0 process-drawable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a0-6 (if (>= (-> this target-joint0) 0)
|
||||
(as-type (handle->process (-> this target0)) process-drawable)
|
||||
(the-as process #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
@@ -1966,18 +1894,10 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-22 (cond
|
||||
((>= (-> this target-joint1) 0)
|
||||
(let ((s5-3 (handle->process (-> this target1))))
|
||||
(if (type? s5-3 process-drawable)
|
||||
(the-as process-focusable s5-3)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a0-22 (if (>= (-> this target-joint1) 0)
|
||||
(the-as process-focusable (as-type (handle->process (-> this target1)) process-drawable))
|
||||
(the-as process-focusable #f)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
@@ -2057,12 +1977,7 @@
|
||||
(let ((s5-1 (new 'stack-no-clear 'vector)))
|
||||
(vector-copy! s5-1 (-> self offset1))
|
||||
(when (and (>= (-> self target-joint1) 0) (< (-> self target-joint1) 256))
|
||||
(let* ((s4-0 (handle->process (-> self target1)))
|
||||
(v1-28 (if (type? s4-0 process-drawable)
|
||||
(the-as process-drawable s4-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-28 (as-type (handle->process (-> self target1)) process-drawable)))
|
||||
(if (and v1-28 (nonzero? (-> v1-28 root)))
|
||||
(vector-copy!
|
||||
s5-1
|
||||
@@ -2154,14 +2069,9 @@
|
||||
(defbehavior lightning-tracker-init lightning-tracker ((arg0 lightning-spec) (arg1 time-frame) (arg2 symbol) (arg3 process-drawable) (arg4 vector) (arg5 vector))
|
||||
(stack-size-set! (-> self main-thread) 128)
|
||||
(set! (-> self target0) (process->handle arg3))
|
||||
(let ((s1-1 (ppointer->process (-> self parent))))
|
||||
(set! (-> self target1) (process->handle (the-as process (if (type? s1-1 process-drawable)
|
||||
s1-1
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self target1)
|
||||
(process->handle (the-as process (as-type (ppointer->process (-> self parent)) process-drawable)))
|
||||
)
|
||||
(cond
|
||||
((>= 256 (the-as int arg4))
|
||||
(set! (-> self target-joint0) (the-as int arg4))
|
||||
@@ -2250,12 +2160,7 @@
|
||||
;; definition for function process-release?
|
||||
;; WARN: Return type mismatch object vs symbol.
|
||||
(defbehavior process-release? process ((arg0 process))
|
||||
(let* ((gp-0 (command-get-process arg0 *target*))
|
||||
(a0-2 (if (type? gp-0 process-focusable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-2 (as-type (command-get-process arg0 *target*) process-focusable)))
|
||||
(the-as symbol (if (and a0-2 (focus-test? (the-as process-focusable a0-2) grabbed))
|
||||
(send-event a0-2 'end-mode 'grab)
|
||||
#t
|
||||
@@ -3358,19 +3263,9 @@
|
||||
:code (behavior ()
|
||||
(set-time! (-> self state-time))
|
||||
(while ((-> self run-function))
|
||||
(let* ((gp-0 (handle->process (-> self target)))
|
||||
(a0-4 (if (type? gp-0 process-drawable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-4 (as-type (handle->process (-> self target)) process-drawable)))
|
||||
(when a0-4
|
||||
(let* ((gp-1 (-> (the-as process-drawable a0-4) root))
|
||||
(a0-6 (if (type? gp-1 collide-shape)
|
||||
gp-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-6 (as-type (-> (the-as process-drawable a0-4) root) collide-shape)))
|
||||
(if a0-6
|
||||
(vector-copy!
|
||||
(-> (the-as collide-shape (-> self root)) trans)
|
||||
@@ -3602,12 +3497,7 @@
|
||||
(-> s4-0 explosion-trans)
|
||||
(-> (the-as collide-shape (-> self root)) root-prim prim-core world-sphere)
|
||||
)
|
||||
(let* ((s2-0 proc)
|
||||
(s3-0 (if (type? s2-0 process-drawable)
|
||||
s2-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s3-0 (as-type proc process-drawable)))
|
||||
(when (and s3-0 (!= s3-0 (handle->process (-> self params ignore-proc))))
|
||||
(let ((v1-6 (find-closest-solid-sphere-prim
|
||||
(the-as collide-shape (-> (the-as process-drawable s3-0) root))
|
||||
@@ -3620,24 +3510,11 @@
|
||||
(v1-6
|
||||
(vector-copy! (-> s4-0 proc-trans) (-> v1-6 prim-core world-sphere))
|
||||
)
|
||||
((begin
|
||||
(let ((s2-2 proc))
|
||||
(set! a0-13 (if (type? s2-2 process-focusable)
|
||||
s2-2
|
||||
)
|
||||
)
|
||||
)
|
||||
a0-13
|
||||
)
|
||||
((begin (set! a0-13 (as-type proc process-focusable)) a0-13)
|
||||
(vector-copy! (-> s4-0 proc-trans) (get-trans (the-as process-focusable a0-13) 3))
|
||||
)
|
||||
(else
|
||||
(let* ((s2-4 (-> (the-as process-focusable s3-0) root))
|
||||
(v1-12 (if (type? s2-4 collide-shape)
|
||||
s2-4
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-12 (as-type (-> (the-as process-focusable s3-0) root) collide-shape)))
|
||||
(if v1-12
|
||||
(vector-copy! (-> s4-0 proc-trans) (-> v1-12 root-prim prim-core world-sphere))
|
||||
(vector-copy! (-> s4-0 proc-trans) (-> (the-as process-focusable s3-0) root trans))
|
||||
|
||||
+1
-6
@@ -752,12 +752,7 @@
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(case message
|
||||
(('touched)
|
||||
(let* ((s4-0 proc)
|
||||
(v1-1 (if (type? s4-0 process-drawable)
|
||||
(the-as process-focusable s4-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-1 (the-as process-focusable (as-type proc process-drawable))))
|
||||
(when v1-1
|
||||
(let ((s4-1 (-> v1-1 root))
|
||||
(a1-3 (new 'stack 'collide-query))
|
||||
|
||||
+2
-11
@@ -262,12 +262,7 @@
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(case message
|
||||
(('touch 'attack 'bonk)
|
||||
(let* ((s5-0 proc)
|
||||
(a0-5 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-5 (as-type proc process-focusable)))
|
||||
(cond
|
||||
((and a0-5 (focus-test? (the-as process-focusable a0-5) edge-grab))
|
||||
(set! (-> self safe-time) (+ (current-time) (seconds 0.2)))
|
||||
@@ -279,11 +274,7 @@
|
||||
)
|
||||
)
|
||||
(vector-copy! (-> self hit-point) (-> self root trans))
|
||||
(let ((a0-13 (if (type? proc process-focusable)
|
||||
proc
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-13 (as-type proc process-focusable)))
|
||||
(vector-copy! (-> self hit-point) (get-trans (the-as process-focusable a0-13) 0))
|
||||
)
|
||||
(if (zero? (-> self bounce-time))
|
||||
|
||||
+1
-10
@@ -175,12 +175,7 @@
|
||||
"Check for inactive processes and add them to the unused list."
|
||||
(local-vars (v1-10 symbol))
|
||||
(dotimes (i (-> this records length))
|
||||
(let* ((proc (handle->process (-> this records data i proc)))
|
||||
(pfoc (if (type? proc process-focusable)
|
||||
proc
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((pfoc (as-type (handle->process (-> this records data i proc)) process-focusable)))
|
||||
(when (or (not pfoc) (focus-test? (the-as process-focusable pfoc) inactive))
|
||||
(dotimes (ii (-> this unused-list length))
|
||||
(when (= (-> this unused-list ii) i)
|
||||
@@ -213,7 +208,3 @@
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+2
-12
@@ -306,12 +306,7 @@
|
||||
(('ridden)
|
||||
(let ((v1-7 (the-as object (-> arg3 param 0))))
|
||||
(when (the-as uint v1-7)
|
||||
(let* ((s5-1 (handle->process (-> (the-as collide-rider v1-7) rider-handle)))
|
||||
(v1-11 (if (type? s5-1 process-focusable)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-11 (as-type (handle->process (-> (the-as collide-rider v1-7) rider-handle)) process-focusable)))
|
||||
(when (and v1-11
|
||||
(logtest? (-> v1-11 mask) (process-mask target))
|
||||
(not (logtest? (-> (the-as process-focusable v1-11) focus-status) (focus-status on-water under-water)))
|
||||
@@ -339,12 +334,7 @@
|
||||
(('bonk)
|
||||
(when (time-elapsed? (-> this player-bonk-timeout) (-> this info player-force-timeout))
|
||||
(set-time! (-> this player-bonk-timeout))
|
||||
(let* ((s4-0 arg0)
|
||||
(v1-31 (if (type? s4-0 process-drawable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-31 (as-type arg0 process-drawable)))
|
||||
(when v1-31
|
||||
(logior! (-> this flags) (rigid-body-object-flag player-impulse-force))
|
||||
(vector-copy! (-> this player-force-position) (-> (the-as process-focusable v1-31) root trans))
|
||||
|
||||
+5
-19
@@ -301,12 +301,7 @@
|
||||
(if (= (-> this shield-type) (shield-type shield-type-0))
|
||||
(seek! (-> this heat-info current-heat-value) 0.0 (* 0.2 (seconds-per-frame)))
|
||||
)
|
||||
(let* ((s4-0 (handle->process (-> this owner)))
|
||||
(s5-0 (if (type? s4-0 process-focusable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-0 (as-type (handle->process (-> this owner)) process-focusable)))
|
||||
(cond
|
||||
(s5-0
|
||||
(if (!= (-> this track-joint) -1)
|
||||
@@ -345,12 +340,7 @@
|
||||
0
|
||||
)
|
||||
)
|
||||
(let* ((s4-0 (handle->process (-> this owner)))
|
||||
(a0-9 (if (type? s4-0 process-focusable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-9 (as-type (handle->process (-> this owner)) process-focusable)))
|
||||
(cond
|
||||
(arg0
|
||||
(logior! (-> this draw status) (draw-control-status no-draw))
|
||||
@@ -642,13 +632,9 @@
|
||||
|
||||
;; definition for method 40 of type shield-sphere
|
||||
(defmethod shield-touch-handler ((this shield-sphere) (arg0 process-focusable) (arg1 event-message-block))
|
||||
(let* ((s5-0 (-> arg1 param 0))
|
||||
(s2-0 arg0)
|
||||
(s3-0 (if (type? s2-0 process-focusable)
|
||||
s2-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-0 (-> arg1 param 0))
|
||||
(s3-0 (as-type arg0 process-focusable))
|
||||
)
|
||||
(when (and s5-0 s3-0)
|
||||
(cond
|
||||
((and (and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status disable dead ignore grabbed))))
|
||||
|
||||
+2
-12
@@ -218,19 +218,9 @@
|
||||
(when (-> self show-particles)
|
||||
(when (nonzero? (-> self collect-effect))
|
||||
(when (time-elapsed? (-> self collect-effect-time) (seconds 1))
|
||||
(let* ((s5-0 (handle->process arg0))
|
||||
(gp-0 (if (type? s5-0 process-drawable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-0 (as-type (handle->process arg0) process-drawable)))
|
||||
(when gp-0
|
||||
(let* ((s5-1 (-> (the-as process-focusable gp-0) root))
|
||||
(v1-9 (if (type? s5-1 collide-shape)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-9 (as-type (-> (the-as process-focusable gp-0) root) collide-shape)))
|
||||
(when v1-9
|
||||
(cond
|
||||
((logtest? (-> self collect-effect flags) (sp-group-flag sp13))
|
||||
|
||||
+3
-16
@@ -260,12 +260,7 @@
|
||||
)
|
||||
:enter (behavior ()
|
||||
(set! (-> self start-time) (-> *display* game-clock frame-counter))
|
||||
(let* ((gp-0 (ppointer->process (-> self parent 0 parent)))
|
||||
(a1-1 (if (type? gp-0 process-focusable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a1-1 (as-type (ppointer->process (-> self parent 0 parent)) process-focusable)))
|
||||
(if a1-1
|
||||
(focus-on! (-> self focus) (the-as process-focusable a1-1))
|
||||
)
|
||||
@@ -280,12 +275,7 @@
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
(let* ((gp-0 (ppointer->process (-> self parent 0 parent)))
|
||||
(a0-1 (if (type? gp-0 process-focusable)
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-1 (as-type (ppointer->process (-> self parent 0 parent)) process-focusable)))
|
||||
(if (and a0-1 (focus-test? (the-as process-focusable a0-1) pilot))
|
||||
(send-event
|
||||
(ppointer->process (-> self parent))
|
||||
@@ -547,10 +537,7 @@
|
||||
:to proc
|
||||
)
|
||||
)
|
||||
(s5-2 (if (type? proc process-focusable)
|
||||
proc
|
||||
)
|
||||
)
|
||||
(s5-2 (as-type proc process-focusable))
|
||||
)
|
||||
(when s4-0
|
||||
(change-parent self (ppointer->process s4-0))
|
||||
|
||||
+2
-6
@@ -605,12 +605,8 @@
|
||||
(new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning))
|
||||
)
|
||||
)
|
||||
(let ((v1-58 gp-0))
|
||||
(set! (-> v1-58 width) (the float 340))
|
||||
)
|
||||
(let ((v1-59 gp-0))
|
||||
(set! (-> v1-59 height) (the float 80))
|
||||
)
|
||||
(set-width! gp-0 340)
|
||||
(set-height! gp-0 80)
|
||||
(let ((v1-60 gp-0)
|
||||
(a0-25 (-> *setting-control* user-default language))
|
||||
)
|
||||
|
||||
+3
-7
@@ -191,13 +191,9 @@
|
||||
v0-1
|
||||
)
|
||||
(('water)
|
||||
(let* ((s5-0 (the-as object (-> arg3 param 0)))
|
||||
(s4-0 (-> arg3 param 1))
|
||||
(gp-0 (if (type? s4-0 process-focusable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s5-0 (the-as object (-> arg3 param 0)))
|
||||
(gp-0 (as-type (-> arg3 param 1) process-focusable))
|
||||
)
|
||||
(when (and (logtest? (-> self flags) (water-flag deadly))
|
||||
(logtest? (water-flag touch-water) (-> (the-as water-info s5-0) flags))
|
||||
(the-as uint gp-0)
|
||||
|
||||
+7
-19
@@ -468,11 +468,7 @@
|
||||
(.mov a0-10 vf3)
|
||||
(let ((s4-0 (-> v1-23 process)))
|
||||
(b! (< f0-2 a0-10) cfg-30)
|
||||
(let ((a1-29 (if (type? s4-0 process-focusable)
|
||||
s4-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a1-29 (as-type s4-0 process-focusable)))
|
||||
(if (and a1-29 (not (logtest? (focus-status board) (-> (the-as process-focusable a1-29) focus-status))))
|
||||
(push-process this (the-as process-focusable a1-29))
|
||||
)
|
||||
@@ -646,13 +642,9 @@
|
||||
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
||||
(case message
|
||||
(('water-info)
|
||||
(let* ((gp-0 (-> block param 0))
|
||||
(s5-0 proc)
|
||||
(a0-2 (if (type? s5-0 process-focusable)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-0 (-> block param 0))
|
||||
(a0-2 (as-type proc process-focusable))
|
||||
)
|
||||
(if (and a0-2 (focus-test? (the-as process-focusable a0-2) board))
|
||||
#f
|
||||
(flow-control-method-13 (-> self flow) (the-as water-info gp-0) (the-as vector (+ gp-0 0)))
|
||||
@@ -660,13 +652,9 @@
|
||||
)
|
||||
)
|
||||
(('touch-water)
|
||||
(let* ((gp-1 (-> self flow))
|
||||
(s5-1 proc)
|
||||
(a1-8 (if (type? s5-1 process-focusable)
|
||||
s5-1
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((gp-1 (-> self flow))
|
||||
(a1-8 (as-type proc process-focusable))
|
||||
)
|
||||
(if (and (nonzero? gp-1) (and a1-8 (!= (-> a1-8 type) target) (< 0.0 (-> gp-1 speed))))
|
||||
(push-process gp-1 (the-as process-focusable a1-8))
|
||||
)
|
||||
|
||||
+2
-11
@@ -450,11 +450,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((s3-2 (-> this process control))
|
||||
(v1-167 (if (type? s3-2 control-info)
|
||||
s3-2
|
||||
)
|
||||
)
|
||||
(let* ((v1-167 (as-type (-> this process control) control-info))
|
||||
(v1-168 (and v1-167 (not (time-elapsed? (-> v1-167 last-time-on-surface) (seconds 0.5)))))
|
||||
)
|
||||
(if (and (logtest? (-> this flags) (water-flag swim-ground))
|
||||
@@ -1015,12 +1011,7 @@
|
||||
(logior! (-> arg0 flags) (water-flag mud))
|
||||
)
|
||||
((= v1-56 'mech)
|
||||
(let* ((s0-2 arg4)
|
||||
(a0-50 (if (type? s0-2 process-focusable)
|
||||
s0-2
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-50 (as-type arg4 process-focusable)))
|
||||
(when (and a0-50 (not (logtest? (focus-status mech) (-> (the-as process-focusable a0-50) focus-status))))
|
||||
(set! (-> arg0 flags) (water-flag))
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user