mirror of
https://github.com/open-goal/jak-project
synced 2026-08-04 01:04:11 -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>
203 lines
6.9 KiB
Common Lisp
Vendored
Generated
203 lines
6.9 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-hide-door-b hide-door-b hide-door-b-lod0-jg hide-door-b-idle-ja
|
|
((hide-door-b-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 2 0 5)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
;; definition of type hide-door-b
|
|
(deftype hide-door-b (com-airlock)
|
|
()
|
|
)
|
|
|
|
;; definition for method 3 of type hide-door-b
|
|
(defmethod inspect ((this hide-door-b))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type com-airlock inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 11 of type hide-door-b
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this hide-door-b) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
|
(set! (-> s5-0 penetrated-by) (penetrate))
|
|
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
|
|
(set! (-> s5-0 total-prims) (the-as uint 3))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> s4-0 prim-core action) (collide-action solid))
|
|
(set! (-> s4-0 transform-index) 3)
|
|
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 32768.0)
|
|
(set! (-> s5-0 root-prim) s4-0)
|
|
)
|
|
(let ((v1-9 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
|
|
(set! (-> v1-9 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-9 prim-core action) (collide-action solid))
|
|
(set! (-> v1-9 transform-index) 4)
|
|
(set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 16384.0)
|
|
)
|
|
(let ((v1-11 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0))))
|
|
(set! (-> v1-11 prim-core collide-as) (collide-spec obstacle))
|
|
(set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list))
|
|
(set! (-> v1-11 prim-core action) (collide-action solid))
|
|
(set! (-> v1-11 transform-index) 5)
|
|
(set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 16384.0)
|
|
)
|
|
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
|
|
(let ((v1-14 (-> s5-0 root-prim)))
|
|
(set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as))
|
|
(set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with))
|
|
)
|
|
(set! (-> this root) s5-0)
|
|
)
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-b" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(init-airlock! this)
|
|
(set! (-> this sound-open-loop) (static-sound-spec "hide-door-open"))
|
|
(set! (-> this sound-open-stop) (static-sound-spec "hide-door-hit"))
|
|
(set! (-> this sound-close-loop) (static-sound-spec "hide-door-close"))
|
|
(set! (-> this sound-close-stop) (static-sound-spec "hide-door-hit"))
|
|
(set! (-> this door-radius) 12288.0)
|
|
(go (method-of-object this close) #t)
|
|
(none)
|
|
)
|
|
|
|
;; definition of type hide-light
|
|
(deftype hide-light (process-drawable)
|
|
()
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type hide-light
|
|
(defmethod inspect ((this hide-light))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-hide-light hide-light hide-light-lod0-jg hide-light-idle-ja
|
|
((hide-light-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -2.3 0 4.5)
|
|
:shadow hide-light-shadow-mg
|
|
:origin-joint-index 3
|
|
:shadow-joint-index 3
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup skel-hide-light-fog hide-light hide-light-fog-lod0-jg hide-light-fog-idle-ja
|
|
((hide-light-fog-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 -2.5 0 3)
|
|
:origin-joint-index 3
|
|
)
|
|
|
|
;; definition for function hide-light-spawn
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun hide-light-spawn ((arg0 hide-light) (arg1 vector) (arg2 cspace))
|
|
(let ((v1-1
|
|
(process-spawn
|
|
manipy
|
|
:init manipy-init
|
|
(-> arg0 root trans)
|
|
(-> arg0 entity)
|
|
(art-group-get-by-name *level* "skel-hide-light-fog" (the-as (pointer uint32) #f))
|
|
#f
|
|
0
|
|
:to arg0
|
|
)
|
|
)
|
|
)
|
|
(send-event
|
|
(ppointer->process v1-1)
|
|
'eval
|
|
(lambda :behavior hide-light
|
|
()
|
|
(let ((v0-0 (-> self node-list data)))
|
|
(set! (-> v0-0 0 param0) (the-as (function cspace transformq none) cspace<-parent-joint!))
|
|
(set! (-> v0-0 0 param1) (the-as basic (-> self parent)))
|
|
(set! (-> v0-0 0 param2) (the-as basic 12))
|
|
v0-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (hide-light)
|
|
:virtual #t
|
|
:code (behavior ()
|
|
(until #f
|
|
(ja-no-eval :group! hide-light-idle-ja :num! (seek!) :frame-num 0.0)
|
|
(until (ja-done? 0)
|
|
(suspend)
|
|
(ja :num! (seek!))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
:post ja-post
|
|
)
|
|
|
|
;; definition for method 11 of type hide-light
|
|
;; WARN: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this hide-light) (arg0 entity-actor))
|
|
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
|
This commonly includes things such as:
|
|
- stack size
|
|
- collision information
|
|
- loading the skeleton group / bones
|
|
- sounds"
|
|
(logior! (-> this mask) (process-mask ambient))
|
|
(set! (-> this root) (new 'process 'trsqv))
|
|
(process-drawable-from-entity! this arg0)
|
|
(logclear! (-> this mask) (process-mask actor-pause))
|
|
(initialize-skeleton
|
|
this
|
|
(the-as skeleton-group (art-group-get-by-name *level* "skel-hide-light" (the-as (pointer uint32) #f)))
|
|
(the-as pair 0)
|
|
)
|
|
(let ((v1-9 (new 'process 'shadow-control -25088.0 0.0 -40960.0 (shadow-flags shdf03 shdf04) 163840.0)))
|
|
(set-vector! (-> v1-9 settings shadow-dir) 0.0 -1.0 0.0 13926.4)
|
|
(set-vector! (-> v1-9 settings bot-plane) 0.0 -1.0 0.0 58982.4)
|
|
(set-vector! (-> v1-9 settings top-plane) 0.0 -1.0 0.0 0.0)
|
|
(set! (-> v1-9 settings shadow-type) 1)
|
|
(set! (-> this draw shadow-ctrl) v1-9)
|
|
)
|
|
(hide-light-spawn this *zero-vector* (-> this node-list data 12))
|
|
(set-setting! 'spotlight-color #f 0.0 (the-as uint #x80c0c0c0))
|
|
(ja-post)
|
|
(go (method-of-object this idle))
|
|
(none)
|
|
)
|