mirror of
https://github.com/open-goal/jak-project
synced 2026-09-01 01:52:03 -04:00
deftype and defmethod syntax major changes (#3094)
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>
This commit is contained in:
+11
-14
@@ -3,22 +3,19 @@
|
||||
|
||||
;; definition of type focus
|
||||
(deftype focus (structure)
|
||||
((handle handle :offset-assert 0)
|
||||
(collide-with collide-spec :offset-assert 8)
|
||||
((handle handle)
|
||||
(collide-with collide-spec)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #xc
|
||||
:flag-assert #xd0000000c
|
||||
(:methods
|
||||
(clear-focused (_type_) none 9)
|
||||
(collide-check? (_type_ process-focusable) object 10)
|
||||
(reset-to-collide-spec (_type_ collide-spec) none 11)
|
||||
(try-update-focus (_type_ process-focusable) symbol 12)
|
||||
(clear-focused (_type_) none)
|
||||
(collide-check? (_type_ process-focusable) object)
|
||||
(reset-to-collide-spec (_type_ collide-spec) none)
|
||||
(try-update-focus (_type_ process-focusable) symbol)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type focus
|
||||
(defmethod inspect focus ((this focus))
|
||||
(defmethod inspect ((this focus))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
@@ -32,7 +29,7 @@
|
||||
|
||||
;; definition for method 11 of type focus
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod reset-to-collide-spec focus ((this focus) (arg0 collide-spec))
|
||||
(defmethod reset-to-collide-spec ((this focus) (arg0 collide-spec))
|
||||
(set! (-> this collide-with) arg0)
|
||||
(set! (-> this handle) (the-as handle #f))
|
||||
0
|
||||
@@ -40,7 +37,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 10 of type focus
|
||||
(defmethod collide-check? focus ((this focus) (arg0 process-focusable))
|
||||
(defmethod collide-check? ((this focus) (arg0 process-focusable))
|
||||
(when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead))))
|
||||
(let* ((s5-0 (-> arg0 root))
|
||||
(v1-2 (if (type? s5-0 collide-shape)
|
||||
@@ -54,7 +51,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 12 of type focus
|
||||
(defmethod try-update-focus focus ((this focus) (arg0 process-focusable))
|
||||
(defmethod try-update-focus ((this focus) (arg0 process-focusable))
|
||||
(when (!= (handle->process (-> this handle)) arg0)
|
||||
(set! (-> this handle) (process->handle arg0))
|
||||
#t
|
||||
@@ -63,7 +60,7 @@
|
||||
|
||||
;; definition for method 9 of type focus
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod clear-focused focus ((this focus))
|
||||
(defmethod clear-focused ((this focus))
|
||||
(set! (-> this handle) (the-as handle #f))
|
||||
0
|
||||
(none)
|
||||
|
||||
+28
-28
@@ -2,7 +2,7 @@
|
||||
(in-package goal)
|
||||
|
||||
;; definition for method 15 of type skeleton-group
|
||||
(defmethod add-to-loading-level skeleton-group ((this skeleton-group))
|
||||
(defmethod add-to-loading-level ((this skeleton-group))
|
||||
(let ((v1-1 (-> *level* loading-level)))
|
||||
(if v1-1
|
||||
(set-loaded-art (-> v1-1 art-group) this)
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
;; definition for method 10 of type draw-control
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod lod-set! draw-control ((this draw-control) (arg0 int))
|
||||
(defmethod lod-set! ((this draw-control) (arg0 int))
|
||||
(let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod)))))
|
||||
(set! (-> this desired-lod) v1-1)
|
||||
(when (!= (-> this cur-lod) v1-1)
|
||||
@@ -212,7 +212,7 @@
|
||||
|
||||
;; definition for method 11 of type draw-control
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set))
|
||||
(defmethod lods-assign! ((this draw-control) (arg0 lod-set))
|
||||
(mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 49)
|
||||
(let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod))))
|
||||
(set! (-> this cur-lod) -1)
|
||||
@@ -224,7 +224,7 @@
|
||||
|
||||
;; definition for method 12 of type draw-control
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod setup-masks draw-control ((this draw-control) (arg0 int) (arg1 int))
|
||||
(defmethod setup-masks ((this draw-control) (arg0 int) (arg1 int))
|
||||
"TODO - use the enum types"
|
||||
(local-vars (v1-4 int) (a2-1 (array uint64)))
|
||||
(let ((a1-2 (logior (logclear (-> this seg-mask) arg0) arg1)))
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
;; definition for method 9 of type lod-set
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity))
|
||||
(defmethod setup-lods! ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity))
|
||||
(local-vars (sv-16 res-tag))
|
||||
(let ((v1-0 (-> arg1 length))
|
||||
(s3-0 (-> arg0 max-lod))
|
||||
@@ -293,7 +293,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 13 of type draw-control
|
||||
(defmethod setup-cspace-and-add draw-control ((this draw-control) (arg0 art-joint-geo) (arg1 symbol))
|
||||
(defmethod setup-cspace-and-add ((this draw-control) (arg0 art-joint-geo) (arg1 symbol))
|
||||
(let ((s5-0 ((method-of-type cspace-array new) arg1 cspace-array (+ (-> arg0 length) 1))))
|
||||
(let ((v0-1 ((method-of-type skeleton new) arg1 skeleton (+ (-> arg0 length) 1))))
|
||||
(set! (-> this skeleton) v0-1)
|
||||
@@ -368,7 +368,7 @@
|
||||
;; definition for method 14 of type draw-control
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod do-joint-math draw-control ((this draw-control) (arg0 cspace-array) (arg1 joint-control))
|
||||
(defmethod do-joint-math ((this draw-control) (arg0 cspace-array) (arg1 joint-control))
|
||||
(with-pp
|
||||
(cond
|
||||
((logtest? (-> this status) (draw-control-status no-draw no-draw-temp))
|
||||
@@ -448,7 +448,7 @@
|
||||
|
||||
;; definition for method 17 of type process-drawable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod cleanup-for-death process-drawable ((this process-drawable))
|
||||
(defmethod cleanup-for-death ((this process-drawable))
|
||||
(when (type? (-> this root) collide-shape)
|
||||
(let ((v1-2 (-> (the-as collide-shape (-> this root)) root-prim)))
|
||||
(set! (-> v1-2 prim-core collide-as) (collide-spec))
|
||||
@@ -466,7 +466,7 @@
|
||||
|
||||
;; definition for method 18 of type process-drawable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod relocate-nav process-drawable ((this process-drawable) (arg0 int))
|
||||
(defmethod relocate-nav ((this process-drawable) (arg0 int))
|
||||
(set! (-> this nav) (the-as nav-control (&+ (the-as pointer (-> this nav)) arg0)))
|
||||
0
|
||||
(none)
|
||||
@@ -525,7 +525,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 10 of type process-drawable
|
||||
(defmethod deactivate process-drawable ((this process-drawable))
|
||||
(defmethod deactivate ((this process-drawable))
|
||||
(if (nonzero? (-> this part))
|
||||
(kill-and-free-particles (-> this part))
|
||||
)
|
||||
@@ -733,7 +733,7 @@
|
||||
|
||||
;; definition for method 14 of type process-drawable
|
||||
;; INFO: Used lq/sq
|
||||
(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair))
|
||||
(defmethod initialize-skeleton ((this process-drawable) (arg0 skeleton-group) (arg1 pair))
|
||||
(local-vars (v1-14 art-element))
|
||||
(if (not arg0)
|
||||
(go process-drawable-art-error "skel-group")
|
||||
@@ -805,7 +805,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 15 of type process-drawable
|
||||
(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string))
|
||||
(defmethod initialize-skeleton-by-name ((this process-drawable) (arg0 string))
|
||||
(let* ((s4-0 *level*)
|
||||
(s3-0 (method-of-object s4-0 art-group-get-by-name))
|
||||
)
|
||||
@@ -821,7 +821,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 16 of type process-drawable
|
||||
(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector))
|
||||
(defmethod apply-alignment ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector))
|
||||
(with-pp
|
||||
(when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel))
|
||||
(let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))
|
||||
@@ -1194,7 +1194,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
|
||||
(defmethod update-anim-data joint-control ((this joint-control))
|
||||
(defmethod update-anim-data ((this joint-control))
|
||||
(local-vars (s7-0 none) (ra-0 int))
|
||||
(let ((s5-0 (+ (-> this active-channels) (-> this float-channels))))
|
||||
(dotimes (s4-0 (the-as int s5-0))
|
||||
@@ -1238,7 +1238,7 @@
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
|
||||
(defmethod evaluate-joint-control process-drawable ((this process-drawable))
|
||||
(defmethod evaluate-joint-control ((this process-drawable))
|
||||
(local-vars (s1-0 joint-control-channel) (s2-0 int) (s4-0 uint) (s7-0 none) (ra-0 int))
|
||||
(let ((gp-0 (-> this skel)))
|
||||
(let ((a0-1 (-> gp-0 top-anim)))
|
||||
@@ -1354,7 +1354,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 9 of type joint-control
|
||||
(defmethod current-cycle-distance joint-control ((this joint-control))
|
||||
(defmethod current-cycle-distance ((this joint-control))
|
||||
(cond
|
||||
((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels))))
|
||||
(let ((s4-0 (-> this root-channel (-> this root-channel 0 group-size)))
|
||||
@@ -1402,7 +1402,7 @@
|
||||
|
||||
;; definition for method 9 of type top-anim-joint-control
|
||||
;; WARN: Return type mismatch top-anim-joint-control vs none.
|
||||
(defmethod reset top-anim-joint-control ((this top-anim-joint-control))
|
||||
(defmethod reset ((this top-anim-joint-control))
|
||||
(let ((v0-0 this))
|
||||
(set! (-> v0-0 interp) 0.0)
|
||||
(set! (-> v0-0 frame-targ) #f)
|
||||
@@ -1421,7 +1421,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 11 of type top-anim-joint-control
|
||||
(defmethod get-channel top-anim-joint-control ((this top-anim-joint-control) (arg0 int))
|
||||
(defmethod get-channel ((this top-anim-joint-control) (arg0 int))
|
||||
(case arg0
|
||||
((1)
|
||||
(case (-> this process 0 skel float-channels)
|
||||
@@ -1451,15 +1451,15 @@
|
||||
|
||||
;; definition for method 12 of type top-anim-joint-control
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod push-anim-to-targ top-anim-joint-control ((this top-anim-joint-control)
|
||||
(arg0 art-joint-anim)
|
||||
(arg1 float)
|
||||
(arg2 int)
|
||||
(arg3 int)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
(arg6 symbol)
|
||||
)
|
||||
(defmethod push-anim-to-targ ((this top-anim-joint-control)
|
||||
(arg0 art-joint-anim)
|
||||
(arg1 float)
|
||||
(arg2 int)
|
||||
(arg3 int)
|
||||
(arg4 float)
|
||||
(arg5 float)
|
||||
(arg6 symbol)
|
||||
)
|
||||
(when (!= (-> this interp) 0.0)
|
||||
(let ((v1-1 this))
|
||||
(set! (-> v1-1 frame-targ) arg0)
|
||||
@@ -1489,7 +1489,7 @@
|
||||
|
||||
;; definition for method 10 of type top-anim-joint-control
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update top-anim-joint-control ((this top-anim-joint-control))
|
||||
(defmethod update ((this top-anim-joint-control))
|
||||
(with-pp
|
||||
(let* ((v1-0 (-> this process))
|
||||
(pp (if v1-0
|
||||
|
||||
+17
-21
@@ -3,26 +3,22 @@
|
||||
|
||||
;; definition of type process-focusable
|
||||
(deftype process-focusable (process-drawable)
|
||||
((root collide-shape :override)
|
||||
(focus-status focus-status :offset-assert 200)
|
||||
((root collide-shape :override)
|
||||
(focus-status focus-status)
|
||||
)
|
||||
:heap-base #x50
|
||||
:method-count-assert 27
|
||||
:size-assert #xcc
|
||||
:flag-assert #x1b005000cc
|
||||
(:methods
|
||||
(get-trans (_type_ int) vector 20)
|
||||
(get-quat (_type_ int) quaternion 21)
|
||||
(get-transv (_type_) vector 22)
|
||||
(time-to-apex-or-ground (_type_ int) int 23)
|
||||
(get-water-height (_type_) meters 24)
|
||||
(get-notice-time (_type_) time-frame 25)
|
||||
(get-inv-mass (_type_) float 26)
|
||||
(get-trans (_type_ int) vector)
|
||||
(get-quat (_type_ int) quaternion)
|
||||
(get-transv (_type_) vector)
|
||||
(time-to-apex-or-ground (_type_ int) int)
|
||||
(get-water-height (_type_) meters)
|
||||
(get-notice-time (_type_) time-frame)
|
||||
(get-inv-mass (_type_) float)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type process-focusable
|
||||
(defmethod inspect process-focusable ((this process-focusable))
|
||||
(defmethod inspect ((this process-focusable))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
@@ -37,7 +33,7 @@
|
||||
|
||||
;; definition for method 20 of type process-focusable
|
||||
;; WARN: Return type mismatch structure vs vector.
|
||||
(defmethod get-trans process-focusable ((this process-focusable) (arg0 int))
|
||||
(defmethod get-trans ((this process-focusable) (arg0 int))
|
||||
"@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])"
|
||||
(let ((gp-0 (-> this root)))
|
||||
(the-as vector (cond
|
||||
@@ -59,34 +55,34 @@
|
||||
)
|
||||
|
||||
;; definition for method 22 of type process-focusable
|
||||
(defmethod get-transv process-focusable ((this process-focusable))
|
||||
(defmethod get-transv ((this process-focusable))
|
||||
(-> this root transv)
|
||||
)
|
||||
|
||||
;; definition for method 21 of type process-focusable
|
||||
(defmethod get-quat process-focusable ((this process-focusable) (arg0 int))
|
||||
(defmethod get-quat ((this process-focusable) (arg0 int))
|
||||
(-> this root quat)
|
||||
)
|
||||
|
||||
;; definition for method 23 of type process-focusable
|
||||
(defmethod time-to-apex-or-ground process-focusable ((this process-focusable) (arg0 int))
|
||||
(defmethod time-to-apex-or-ground ((this process-focusable) (arg0 int))
|
||||
0
|
||||
)
|
||||
|
||||
;; definition for method 24 of type process-focusable
|
||||
;; WARN: Return type mismatch int vs meters.
|
||||
(defmethod get-water-height process-focusable ((this process-focusable))
|
||||
(defmethod get-water-height ((this process-focusable))
|
||||
(the-as meters 0)
|
||||
)
|
||||
|
||||
;; definition for method 26 of type process-focusable
|
||||
(defmethod get-inv-mass process-focusable ((this process-focusable))
|
||||
(defmethod get-inv-mass ((this process-focusable))
|
||||
0.0
|
||||
)
|
||||
|
||||
;; definition for method 25 of type process-focusable
|
||||
;; WARN: Return type mismatch int vs time-frame.
|
||||
(defmethod get-notice-time process-focusable ((this process-focusable))
|
||||
(defmethod get-notice-time ((this process-focusable))
|
||||
(the-as time-frame 0)
|
||||
)
|
||||
|
||||
|
||||
+28
-30
@@ -3,42 +3,40 @@
|
||||
|
||||
;; definition of type process-taskable
|
||||
(deftype process-taskable (process-focusable)
|
||||
((task game-task-control :offset-assert 204)
|
||||
(ambient ambient-control :inline :offset-assert 208)
|
||||
(neck-joint-index int32 :offset-assert 224)
|
||||
(talk-message text-id :offset-assert 228)
|
||||
(bounce-away symbol :offset-assert 232)
|
||||
(will-talk symbol :offset-assert 236)
|
||||
(look-at-me symbol :offset-assert 240)
|
||||
(hide-during-movie symbol :offset-assert 244)
|
||||
(talk-distance meters :offset-assert 248)
|
||||
(talk-height meters :offset-assert 252)
|
||||
(last-talk time-frame :offset-assert 256)
|
||||
(want-to-say time-frame :offset-assert 264)
|
||||
(birth-time time-frame :offset-assert 272)
|
||||
(slave handle :offset-assert 280)
|
||||
((task game-task-control)
|
||||
(ambient ambient-control :inline)
|
||||
(neck-joint-index int32)
|
||||
(talk-message text-id)
|
||||
(bounce-away symbol)
|
||||
(will-talk symbol)
|
||||
(look-at-me symbol)
|
||||
(hide-during-movie symbol)
|
||||
(talk-distance meters)
|
||||
(talk-height meters)
|
||||
(last-talk time-frame)
|
||||
(want-to-say time-frame)
|
||||
(birth-time time-frame)
|
||||
(slave handle)
|
||||
)
|
||||
:heap-base #xa0
|
||||
:method-count-assert 38
|
||||
:size-assert #x120
|
||||
:flag-assert #x2600a00120
|
||||
(:state-methods
|
||||
hide
|
||||
idle
|
||||
(active game-task-event)
|
||||
(play-game game-task-event)
|
||||
)
|
||||
(:methods
|
||||
(hide () _type_ :state 27)
|
||||
(idle () _type_ :state 28)
|
||||
(active (game-task-event) _type_ :state 29)
|
||||
(play-game (game-task-event) _type_ :state 30)
|
||||
(process-taskable-method-31 (_type_) none 31)
|
||||
(process-taskable-method-32 (_type_) none 32)
|
||||
(init-art! (_type_) none 33)
|
||||
(process-taskable-method-34 (_type_) symbol 34)
|
||||
(get-art-elem (_type_) art-element 35)
|
||||
(process-taskable-method-36 (_type_) none 36)
|
||||
(process-taskable-method-37 (_type_) none 37)
|
||||
(process-taskable-method-31 (_type_) none)
|
||||
(process-taskable-method-32 (_type_) none)
|
||||
(init-art! (_type_) none)
|
||||
(process-taskable-method-34 (_type_) symbol)
|
||||
(get-art-elem (_type_) art-element)
|
||||
(process-taskable-method-36 (_type_) none)
|
||||
(process-taskable-method-37 (_type_) none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type process-taskable
|
||||
(defmethod inspect process-taskable ((this process-taskable))
|
||||
(defmethod inspect ((this process-taskable))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
|
||||
+9
-9
@@ -3,7 +3,7 @@
|
||||
|
||||
;; definition for method 7 of type process-taskable
|
||||
;; WARN: Return type mismatch process-focusable vs process-taskable.
|
||||
(defmethod relocate process-taskable ((this process-taskable) (arg0 int))
|
||||
(defmethod relocate ((this process-taskable) (arg0 int))
|
||||
(if (nonzero? (-> this task))
|
||||
(&+! (-> this task) arg0)
|
||||
)
|
||||
@@ -34,13 +34,13 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
)
|
||||
|
||||
;; definition for method 34 of type process-taskable
|
||||
(defmethod process-taskable-method-34 process-taskable ((this process-taskable))
|
||||
(defmethod process-taskable-method-34 ((this process-taskable))
|
||||
#t
|
||||
)
|
||||
|
||||
;; definition for method 35 of type process-taskable
|
||||
;; WARN: Return type mismatch art-joint-anim vs art-element.
|
||||
(defmethod get-art-elem process-taskable ((this process-taskable))
|
||||
(defmethod get-art-elem ((this process-taskable))
|
||||
"Checks various things such the current actor, task status, etc to determine the right art-group data to use
|
||||
@returns the appropriate [[art-element]] for the given NPC"
|
||||
(the-as art-element (if (> (-> this skel active-channels) 0)
|
||||
@@ -51,14 +51,14 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
|
||||
;; definition for method 36 of type process-taskable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod process-taskable-method-36 process-taskable ((this process-taskable))
|
||||
(defmethod process-taskable-method-36 ((this process-taskable))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 37 of type process-taskable
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod process-taskable-method-37 process-taskable ((this process-taskable))
|
||||
(defmethod process-taskable-method-37 ((this process-taskable))
|
||||
(let ((v1-1 (-> this draw shadow-ctrl)))
|
||||
(cond
|
||||
((and (-> this draw shadow)
|
||||
@@ -346,7 +346,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
|
||||
;; definition for method 31 of type process-taskable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod process-taskable-method-31 process-taskable ((this process-taskable))
|
||||
(defmethod process-taskable-method-31 ((this process-taskable))
|
||||
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0)))
|
||||
(set! (-> s5-0 total-prims) (the-as uint 4))
|
||||
@@ -387,7 +387,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
|
||||
;; definition for method 32 of type process-taskable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod process-taskable-method-32 process-taskable ((this process-taskable))
|
||||
(defmethod process-taskable-method-32 ((this process-taskable))
|
||||
(logior! (-> this skel status) (joint-control-status eye-anim))
|
||||
(set! (-> this talk-message) (text-id press-triangle-to-talk))
|
||||
(set! (-> this bounce-away) #t)
|
||||
@@ -420,7 +420,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
|
||||
;; definition for method 33 of type process-taskable
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod init-art! process-taskable ((this process-taskable))
|
||||
(defmethod init-art! ((this process-taskable))
|
||||
"@see [[initialize-skeleton]]"
|
||||
0
|
||||
(none)
|
||||
@@ -428,7 +428,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
|
||||
|
||||
;; definition for method 11 of type process-taskable
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! process-taskable ((this process-taskable) (arg0 entity-actor))
|
||||
(defmethod init-from-entity! ((this process-taskable) (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
|
||||
|
||||
+6
-10
@@ -3,19 +3,15 @@
|
||||
|
||||
;; definition of type simple-focus
|
||||
(deftype simple-focus (process-focusable)
|
||||
((first-time? symbol :offset-assert 204)
|
||||
((first-time? symbol)
|
||||
)
|
||||
:heap-base #x50
|
||||
:method-count-assert 28
|
||||
:size-assert #xd0
|
||||
:flag-assert #x1c005000d0
|
||||
(:methods
|
||||
(idle () _type_ :state 27)
|
||||
(:state-methods
|
||||
idle
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type simple-focus
|
||||
(defmethod inspect simple-focus ((this simple-focus))
|
||||
(defmethod inspect ((this simple-focus))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
@@ -29,13 +25,13 @@
|
||||
)
|
||||
|
||||
;; definition for method 20 of type simple-focus
|
||||
(defmethod get-trans simple-focus ((this simple-focus) (arg0 int))
|
||||
(defmethod get-trans ((this simple-focus) (arg0 int))
|
||||
"@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])"
|
||||
(-> this root trans)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type simple-focus
|
||||
(defmethod run-logic? simple-focus ((this simple-focus))
|
||||
(defmethod run-logic? ((this simple-focus))
|
||||
(when (-> this first-time?)
|
||||
(set! (-> this first-time?) #f)
|
||||
#t
|
||||
|
||||
+8
-12
@@ -3,22 +3,18 @@
|
||||
|
||||
;; definition of type simple-nav-sphere
|
||||
(deftype simple-nav-sphere (process-drawable)
|
||||
((root collide-shape :override)
|
||||
(first-time? symbol :offset-assert 200)
|
||||
(track-joint int32 :offset-assert 204)
|
||||
((root collide-shape :override)
|
||||
(first-time? symbol)
|
||||
(track-joint int32)
|
||||
)
|
||||
:heap-base #x50
|
||||
:method-count-assert 22
|
||||
:size-assert #xd0
|
||||
:flag-assert #x16005000d0
|
||||
(:methods
|
||||
(idle () _type_ :state 20)
|
||||
(active () _type_ :state 21)
|
||||
(:state-methods
|
||||
idle
|
||||
active
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type simple-nav-sphere
|
||||
(defmethod inspect simple-nav-sphere ((this simple-nav-sphere))
|
||||
(defmethod inspect ((this simple-nav-sphere))
|
||||
(when (not this)
|
||||
(set! this this)
|
||||
(goto cfg-4)
|
||||
@@ -56,7 +52,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 12 of type simple-nav-sphere
|
||||
(defmethod run-logic? simple-nav-sphere ((this simple-nav-sphere))
|
||||
(defmethod run-logic? ((this simple-nav-sphere))
|
||||
(cond
|
||||
(*display-nav-marks*
|
||||
#t
|
||||
|
||||
Reference in New Issue
Block a user