mirror of
https://github.com/open-goal/jak-project
synced 2026-06-05 19:28:31 -04:00
cd68cb671e
Major change to how `deftype` shows up in our code: - the decompiler will no longer emit the `offset-assert`, `method-count-assert`, `size-assert` and `flag-assert` parameters. There are extremely few cases where having this in the decompiled code is helpful, as the types there come from `all-types` which already has those parameters. This also doesn't break type consistency because: - the asserts aren't compared. - the first step of the test uses `all-types`, which has the asserts, which will throw an error if they're bad. - the decompiler won't emit the `heap-base` parameter unless necessary now. - the decompiler will try its hardest to turn a fixed-offset field into an `overlay-at` field. It falls back to the old offset if all else fails. - `overlay-at` now supports field "dereferencing" to specify the offset that's within a field that's a structure, e.g.: ```lisp (deftype foobar (structure) ((vec vector :inline) (flags int32 :overlay-at (-> vec w)) ) ) ``` in this structure, the offset of `flags` will be 12 because that is the final offset of `vec`'s `w` field within this structure. - **removed ID from all method declarations.** IDs are only ever automatically assigned now. Fixes #3068. - added an `:overlay` parameter to method declarations, in order to declare a new method that goes on top of a previously-defined method. Syntax is `:overlay <method-name>`. Please do not ever use this. - added `state-methods` list parameter. This lets you quickly specify a list of states to be put in the method table. Same syntax as the `states` list parameter. The decompiler will try to put as many states in this as it can without messing with the method ID order. Also changes `defmethod` to make the first type definition (before the arguments) optional. The type can now be inferred from the first argument. Fixes #3093. --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
127 lines
4.0 KiB
Common Lisp
Vendored
Generated
127 lines
4.0 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type blocking-plane
|
|
(deftype blocking-plane (process-drawable)
|
|
()
|
|
(:states
|
|
blocking-plane-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type blocking-plane
|
|
(defmethod inspect ((this blocking-plane))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *ef-plane-sg* ef-plane ef-plane-lod0-jg ef-plane-idle-ja
|
|
((ef-plane-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 30)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate blocking-plane-idle (blocking-plane)
|
|
:code (behavior ()
|
|
(transform-post)
|
|
(loop
|
|
(logior! (-> self mask) (process-mask sleep))
|
|
(suspend)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function blocking-plane-init-by-other
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(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) (collide-kind wall-object))
|
|
(set! (-> s3-1 collide-with) (collide-kind target))
|
|
(set! (-> s3-1 prim-core action) (collide-action solid))
|
|
(set! (-> s3-1 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-1 transform-index) 3)
|
|
(set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 (fmax 122880.0 f30-1))
|
|
(set-root-prim! s4-1 s3-1)
|
|
)
|
|
(set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w)))
|
|
(backup-collide-with-as 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)
|
|
(+! (-> self root trans y) 61440.0)
|
|
(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)
|
|
)
|
|
)
|
|
(initialize-skeleton self *ef-plane-sg* '())
|
|
(logior! (-> self draw status) (draw-status skip-bones))
|
|
(go blocking-plane-idle)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function blocking-plane-spawn
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defbehavior blocking-plane-spawn process ((arg0 curve-control))
|
|
(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)
|
|
(process-spawn blocking-plane arg0 s4-0 :to self)
|
|
(+! 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)
|
|
)
|
|
)
|