Files
jak-project/test/decompiler/reference/levels/common/blocking-plane_REF.gc
T
Tyler Wilding 7c25b721f1 decomp: easy batch number 2 (#824)
* decomp: finish `jungle-elevator`

* decomp: finish `bouncer`

* decomp: finish `hopper`

* decomp: finish `junglefish`

* decomp: finish `blocking-plane`

* decomp: finish `sidekick-human`

* decomp: finish `assistant-firecanyon`

* decomp: finish `sage-bluehut`

* decomp: finish `flutflut-bluehut`

* fix arg type
2021-09-06 14:29:06 -04:00

186 lines
4.5 KiB
Common Lisp
Vendored

;;-*-Lisp-*-
(in-package goal)
;; definition of type blocking-plane
(deftype blocking-plane (process-drawable)
()
:heap-base #x40
:method-count-assert 20
:size-assert #xb0
:flag-assert #x14004000b0
)
;; definition for method 3 of type blocking-plane
(defmethod inspect blocking-plane ((obj blocking-plane))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
:art-group-name "ef-plane"
:bounds (new 'static 'vector :w 122880.0)
:version #x6
)
)
)
(set! (-> v1-1 jgeo) 0)
(set! (-> v1-1 janim) 2)
(set! (-> v1-1 mgeo 0) (the-as uint 1))
(set! (-> v1-1 lod-dist 0) 4095996000.0)
(set! *ef-plane-sg* v1-1)
)
;; failed to figure out what this is:
(defstate blocking-plane-idle (blocking-plane)
:code
(behavior ()
(transform-post)
(while #t
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
;; definition for function blocking-plane-init-by-other
;; Used lq/sq
(defbehavior
blocking-plane-init-by-other blocking-plane
((arg0 curve-control) (arg1 int))
(if (or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found)))
(deactivate self)
)
(let ((s5-0 (new 'static 'vector))
(gp-0 (new 'static 'vector))
)
0.0
(eval-path-curve-div! arg0 s5-0 (the float arg1) 'exact)
(eval-path-curve-div! arg0 gp-0 (+ 1.0 (the float arg1)) 'exact)
(let ((f30-1 (* 0.5 (vector-vector-distance s5-0 gp-0)))
(s4-1
(new
'process
'collide-shape
self
(collide-list-enum usually-hit-by-player)
)
)
)
(let
((s3-1
(new
'process
'collide-shape-prim-mesh
s4-1
(the-as uint 0)
(the-as uint 0)
)
)
)
(set! (-> s3-1 prim-core collide-as) (the-as uint 512))
(set! (-> s3-1 collide-with) (the-as uint 16))
(set! (-> s3-1 prim-core action) (the-as uint 1))
(set! (-> s3-1 prim-core offense) 4)
(set! (-> s3-1 transform-index) 3)
(set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 (fmax 122880.0 f30-1))
)
(dummy-46 s4-1)
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
(dummy-50 s4-1)
(set! (-> self root) s4-1)
)
(let ((s4-2 (new-stack-matrix0)))
(vector+! (-> self root trans) s5-0 gp-0)
(vector-float*! (-> self root trans) (-> self root trans) 0.5)
(set! (-> self root trans y) (+ 61440.0 (-> self root trans y)))
(vector-! (the-as vector (-> s4-2 vector)) gp-0 s5-0)
(set!
(-> self root scale x)
(*
0.00024414062
(vector-normalize-ret-len! (the-as vector (-> s4-2 vector)) 1.0)
)
)
(set! (-> self root scale y) 30.0)
(set! (-> self root scale z) 0.0)
(set! (-> s4-2 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad))
(vector-cross!
(-> s4-2 vector 2)
(the-as vector (-> s4-2 vector))
(-> s4-2 vector 1)
)
(vector-normalize! (-> s4-2 vector 2) 1.0)
(matrix->quaternion (-> self root quat) s4-2)
)
)
(dummy-14 self *ef-plane-sg* '())
(logior! (-> self draw status) 32)
(go blocking-plane-idle)
(none)
)
;; definition for function blocking-plane-spawn
;; INFO: Return type mismatch int vs none.
(defun blocking-plane-spawn ((arg0 curve-control))
(with-pp
(cond
((or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found)))
)
(else
(let ((s5-0 (the int (the float (+ (-> arg0 curve num-cverts) -1))))
(s4-0 0)
)
(while (< s4-0 s5-0)
(let ((s3-0 (get-process *default-dead-pool* blocking-plane #x4000)))
(when s3-0
(let ((t9-1 (method-of-type blocking-plane activate)))
(t9-1
(the-as blocking-plane s3-0)
pp
'blocking-plane
(the-as pointer #x70004000)
)
)
(run-now-in-process s3-0 blocking-plane-init-by-other arg0 s4-0)
(-> s3-0 ppointer)
)
)
(+! s4-0 2)
)
)
)
)
0
(none)
)
)
;; definition for function blocking-plane-destroy
;; INFO: Return type mismatch int vs none.
(defun blocking-plane-destroy ()
(with-pp
(let ((gp-0 (-> pp child)))
(while gp-0
(let ((s5-0 (ppointer->process gp-0)))
(set! gp-0 (-> gp-0 0 brother))
(if (type-type? (-> s5-0 type) blocking-plane)
(deactivate s5-0)
)
)
)
)
0
(none)
)
)