Files
jak-project/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc
T
Hat Kid 459d83f755 decomp: tomb-* files, target-indax, grunt-mech, breakable-wall, pillar-collapse, mechtest-obs, ruins-obs (#2114)
Manual patches in:

- `tomb-boulder`: a few `ppointer->handle`s (I think) were not being
decompiled properly (all used in combination with `clone-anim-once`)
- `ruins-obs`, `pillar-collapse`: `art-joint-anim` casts
- `tomb-beetle`: commented out a call to `shadow-control-method-14` that
was crashing the game when spawning the beetles
- `grunt-mech`: commented out `(.mula.s)` instruction

Notes:
- `enemy-info`'s `idle-anim-script` is most likely a `(pointer
idle-control-frame)`, however, some `nav-enemy-info` labels set it to
`#f` (first encountered in `tomb-beetle`, but also present in `hal`,
`roboguard` and `metalkor-setup`), which crashes the decompiler. This
may become a problem in the future when we eventually get to these
files. For this PR, I made `tomb-beetle` decompile with
`idle-anim-script` set to `#f` and have not noticed any issues/crashes
with that.
- `tomb-boulder` compiles and doesn't crash, but when trying to play the
Daxter chase sequence, the boulder sometimes either spawns at the origin
or spawns in the correct place, but doesn't move.

Co-authored-by: water <awaterford111445@gmail.com>
2023-01-14 13:53:31 -05:00

78 lines
2.7 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: shadow-cpu.gc
;; name in dgo: shadow-cpu
;; dgos: ENGINE, GAME
;; temp
(defmethod shadow-control-method-13 shadow-control ((obj shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float))
(with-pp
(let ((s4-0 (new 'stack-no-clear 'collide-query)))
(let ((v1-0 pp))
(set! (-> s4-0 start-pos quad) (-> arg0 quad))
(set! (-> s4-0 start-pos y) (+ 4096.0 (-> s4-0 start-pos y)))
(set-vector! (-> s4-0 move-dist) 0.0 (- arg3) 0.0 1.0)
(let ((a0-4 s4-0))
(set! (-> a0-4 radius) 8192.0)
(set! (-> a0-4 collide-with) (collide-spec backgnd))
(set! (-> a0-4 ignore-process0) v1-0)
(set! (-> a0-4 ignore-process1) #f)
(set! (-> a0-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> a0-4 action-mask) (collide-action solid))
)
)
(cond
((>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0)
(let ((v1-5 obj))
(logclear! (-> v1-5 settings flags) (shadow-flags disable-draw))
)
0
(let ((v1-7 obj))
(set! (-> v1-7 settings bot-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg1)))
)
0
(set! (-> obj settings top-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg2)))
0
)
(else
(let ((v1-10 obj))
(logior! (-> v1-10 settings flags) (shadow-flags disable-draw))
)
0
)
)
)
0
(none)
)
)
(defmethod shadow-control-method-14 shadow-control ((obj shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float))
(let ((gp-0 (-> obj settings)))
(let ((s4-0 (-> gp-0 shadow-dir)))
(vector-normalize-copy! s4-0 arg1 1.0)
(set! (-> gp-0 shadow-dir w) (- arg2))
(when *shadow-debug*
(add-debug-x #t (bucket-id debug-no-zbuf1) arg0 *color-red*)
(add-debug-vector #t (bucket-id debug-no-zbuf1) arg0 s4-0 (meters 3) *color-red*)
)
(let ((s1-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s4-0 arg3))
(s5-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s4-0 arg4))
)
(vector-negate! (-> gp-0 top-plane) s4-0)
(vector-negate! (-> gp-0 bot-plane) s4-0)
(set! (-> gp-0 top-plane w) (- (vector-dot s1-2 (the-as vector (-> gp-0 top-plane)))))
(set! (-> gp-0 bot-plane w) (- (vector-dot s5-2 (the-as vector (-> gp-0 bot-plane)))))
)
)
(logior! (-> gp-0 flags) (shadow-flags shdf02 shdf03 shdf04 shdf07))
)
0
(none)
)
;; DECOMP BEGINS