mirror of
https://github.com/open-goal/jak-project
synced 2026-08-03 00:47:12 -04:00
7edfc8bcec
* blocked: `part-tester` - `code` handler thinks it returns nothing * blocked: `crates` finished but `go` is returning none causing issues * blocked: `(event ram-boss-idle)::snow-ram-boss` expression building fails due to delay slot issue * decomp: finish `snow-ram` | `seagull` blocked, new static data issue * decomp: finish `snow-bumper` * stuck: `snow-ball` close, can't figure out a type made on the stack * decomp: finish `spider-egg` * decomp: finish `puffer` * decomp: finish `driller-lurker` * decomp: finish `dark-crystal` * stuck: `kermit` - mostly done but stuck on a joint related callback arg * decomp: finish `gnawer` * decomp: finish `mother-spider-egg` * decomp: finish `swamp-blimp` * stuck: `mistycannon` prebind function signature * decomp: finish `citb-plat` * decomp: finish `darkvine` * blocked: `jungle-mirrors` - issues with `link` macro * decomp: finish `launcherdoor` * decomp: finish `quicksandlurker` except for 1 unused function * stuck: `balloonlurker` - `(code balloonlurker-mine-explode)` has some weird joint related code * stuck: need to decompile an asm func in `orbit-plat` * decomp: finish `voicebox` * blocked: `mother-spider` has issues where `go` returns none * decomp: finish `bully` * decomp: finish `seagull` * fixed up after merge conflicts * decomp: finish `jungle-mirrors` * update gsrc * double checked files, fixed issues * decomp: revert change to projectile methods * decomp: some more fixes * address feedback * fix up remaining method calls in `cam-states` * fix jungle-mirrors
162 lines
4.9 KiB
Common Lisp
162 lines
4.9 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: part-tester.gc
|
|
;; name in dgo: part-tester
|
|
;; dgos: GAME, ENGINE
|
|
|
|
(declare-type part-tester basic)
|
|
|
|
(define-extern *part-tester* part-tester)
|
|
|
|
(when *debug-segment*
|
|
;; failed to figure out what this is:
|
|
(set!
|
|
(-> *part-group-id-table* 105)
|
|
(new 'static 'sparticle-launch-group
|
|
:length 2
|
|
:duration #xbb8
|
|
:linger-duration #x5dc
|
|
:name "group-part-tester"
|
|
:launcher
|
|
(new 'static 'inline-array sparticle-group-item 2 (sp-item 56) (sp-item 57))
|
|
:bounds (new 'static 'sphere :w 4096.0)
|
|
)
|
|
)
|
|
|
|
(deftype part-tester (process)
|
|
((root trsqv :offset-assert 112)
|
|
(part sparticle-launch-control :offset-assert 116)
|
|
(old-group sparticle-launch-group :offset-assert 120)
|
|
)
|
|
:heap-base #x100
|
|
:method-count-assert 14
|
|
:size-assert #x7c
|
|
:flag-assert #xe0100007c
|
|
)
|
|
|
|
(define *part-tester-name* (the-as string #f))
|
|
|
|
(defmethod deactivate part-tester ((obj part-tester))
|
|
(if (nonzero? (-> obj part))
|
|
(kill-and-free-particles (-> obj part))
|
|
)
|
|
((method-of-type process deactivate) obj)
|
|
(none)
|
|
)
|
|
|
|
(defstate part-tester-idle (part-tester)
|
|
:code
|
|
(behavior ()
|
|
(while #t
|
|
(let ((gp-0 (entity-by-name *part-tester-name*)))
|
|
(when gp-0
|
|
(let ((s5-0 (-> gp-0 extra process)))
|
|
(if
|
|
(and
|
|
s5-0
|
|
(type-type? (-> s5-0 type) process-drawable)
|
|
(nonzero? (-> (the-as process-drawable s5-0) root))
|
|
)
|
|
(set!
|
|
(-> self root trans quad)
|
|
(-> (the-as process-drawable s5-0) root trans quad)
|
|
)
|
|
(set! (-> self root trans quad) (-> gp-0 extra trans quad))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(add-debug-x
|
|
#t
|
|
(bucket-id debug-draw1)
|
|
(-> self root trans)
|
|
(the-as rgba (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80))
|
|
)
|
|
|
|
;; change this line to change the particle group to test
|
|
;; notes:
|
|
;; - 3d particles won't work
|
|
;; - particles that use aux list won't work
|
|
;; - some particles may have callbacks that won't work yet
|
|
;; - you need to load the level with the particle defs first
|
|
;; - there is an issue with blending. check the "always" box as a temporary workaround
|
|
;; - the visibilty check also doesn't work. comment it out in defmethod spawn.
|
|
(let ((gp-1 (-> *part-group-id-table* 105)))
|
|
(let ((s5-1 (-> self root trans)))
|
|
|
|
(when (!= gp-1 (-> self old-group))
|
|
(when (nonzero? (-> self part))
|
|
(kill-and-free-particles (-> self part))
|
|
(set! (-> self heap-cur) (&-> (-> self part) type))
|
|
)
|
|
(set! (-> self part) (create-launch-control gp-1 self))
|
|
)
|
|
|
|
|
|
(when (nonzero? (-> self part))
|
|
(spawn (-> self part) (cond
|
|
((logtest?
|
|
(-> gp-1 flags)
|
|
(sp-group-flag screen-space)
|
|
)
|
|
*zero-vector*
|
|
)
|
|
(else
|
|
(empty)
|
|
s5-1
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> self old-group) gp-1)
|
|
)
|
|
(suspend)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
(defbehavior part-tester-init-by-other process-drawable ((arg0 vector))
|
|
(set! (-> self root) (new 'process 'trsqv))
|
|
(set! (-> self root trans quad) (-> arg0 quad))
|
|
(set! *part-tester* (the-as part-tester (process->ppointer self)))
|
|
(go part-tester-idle)
|
|
(none)
|
|
)
|
|
|
|
(define-perm *debug-part-dead-pool* dead-pool
|
|
(new 'debug 'dead-pool 1 #x10000 '*debug-part-dead-pool*)
|
|
)
|
|
|
|
(defun start-part ()
|
|
(kill-by-type part-tester *active-pool*)
|
|
(let ((gp-0 (get-process *debug-part-dead-pool* part-tester #x4000)))
|
|
(when gp-0
|
|
(let ((t9-2 (method-of-type part-tester activate)))
|
|
(t9-2
|
|
(the-as part-tester gp-0)
|
|
*default-pool*
|
|
'part-tester
|
|
(the-as pointer #x70004000)
|
|
)
|
|
)
|
|
(run-now-in-process gp-0 part-tester-init-by-other (if *anim-tester*
|
|
(->
|
|
*anim-tester*
|
|
0
|
|
root
|
|
trans
|
|
)
|
|
(target-pos 0)
|
|
)
|
|
)
|
|
(-> gp-0 ppointer)
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
)
|