mirror of
https://github.com/open-goal/jak-project
synced 2026-05-31 01:16:12 -04:00
324def1303
Moves PC-specific entity and debug menu things to `entity-debug.gc` and `default-menu-pc.gc` respectively and makes `(declare-file (debug))` work as it should (no need to wrap the entire file in `(when *debug-segment*` now!). Also changes the DGO descriptor format so that it's less verbose. It might break custom levels, but the format change is very simple so it should not be difficult for anyone to update to the new format. Sadly, you lose the completely useless ability to use DGO object names that don't match the source file name. The horror! I've also gone ahead and expanded the force envmap option to also force the ripple effect to be active. I did not notice any performance or visual drawbacks from this. Gets rid of some distracting LOD and some water pools appearing super flat (and pitch back for dark eco). Fixes #1424
310 lines
12 KiB
Common Lisp
Vendored
Generated
310 lines
12 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; this file is debug only
|
|
(declare-file (debug))
|
|
|
|
;; definition for method 9 of type collide-cache
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw collide-cache ((obj collide-cache))
|
|
(let ((gp-0 (the-as object (-> obj tris))))
|
|
(countdown (s4-0 (-> obj num-tris))
|
|
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64)))
|
|
(add-debug-flat-triangle
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> (the-as collide-cache-tri gp-0) vertex))
|
|
(-> (the-as collide-cache-tri gp-0) vertex 1)
|
|
(-> (the-as collide-cache-tri gp-0) vertex 2)
|
|
t1-0
|
|
)
|
|
)
|
|
(set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64))
|
|
)
|
|
)
|
|
(let ((gp-1 (the-as object (-> obj prims))))
|
|
(countdown (s5-1 (-> obj num-prims))
|
|
(when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) (prim-type sphere))
|
|
(let ((t0-1
|
|
(copy-and-set-field
|
|
(-> *pat-mode-info*
|
|
(-> (the-as collide-shape-prim-sphere (-> (the-as collide-shape-prim gp-1) prim-core action)) pat mode)
|
|
color
|
|
)
|
|
a
|
|
64
|
|
)
|
|
)
|
|
)
|
|
(add-debug-sphere
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> (the-as collide-cache-prim gp-1) prim-core))
|
|
(-> (the-as collide-cache-prim gp-1) prim-core world-sphere w)
|
|
t0-1
|
|
)
|
|
)
|
|
)
|
|
(set! gp-1 (&+ (the-as collide-cache-prim gp-1) 48))
|
|
)
|
|
)
|
|
(print-collide-cache-tri-count)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition of type col-rend-filter
|
|
(deftype col-rend-filter (structure)
|
|
((show-pat-set pat-surface :offset-assert 0)
|
|
(show-pat-clear pat-surface :offset-assert 4)
|
|
(event-mask uint32 :offset-assert 8)
|
|
)
|
|
:method-count-assert 9
|
|
:size-assert #xc
|
|
:flag-assert #x90000000c
|
|
)
|
|
|
|
;; definition for method 3 of type col-rend-filter
|
|
(defmethod inspect col-rend-filter ((obj col-rend-filter))
|
|
(when (not obj)
|
|
(set! obj obj)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" obj 'col-rend-filter)
|
|
(format #t "~1Tshow-pat-set: ~D~%" (-> obj show-pat-set))
|
|
(format #t "~1Tshow-pat-clear: ~D~%" (-> obj show-pat-clear))
|
|
(format #t "~1Tevent-mask: ~D~%" (-> obj event-mask))
|
|
(label cfg-4)
|
|
obj
|
|
)
|
|
|
|
;; definition for function col-rend-draw
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch symbol vs none.
|
|
(defun col-rend-draw ((arg0 col-rend) (arg1 col-rend-filter))
|
|
(let ((s4-0 (new 'stack-no-clear 'matrix)))
|
|
(set! (-> s4-0 vector 0 quad) (-> (math-camera-matrix) vector 2 quad))
|
|
(vector-normalize! (the-as vector (-> s4-0 vector)) 1.0)
|
|
(let ((s3-1 (the-as collide-cache-tri (-> *collide-cache* tris))))
|
|
(countdown (s2-0 (-> *collide-cache* num-tris))
|
|
(vector-3pt-cross! (-> s4-0 vector 1) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1) (-> s3-1 vertex 2))
|
|
(vector-normalize! (-> s4-0 vector 1) 1.0)
|
|
(when (or (-> arg0 show-back-faces?) (>= 0.0 (vector-dot (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1))))
|
|
(let ((v1-9 (-> s3-1 pat)))
|
|
(cond
|
|
((and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-9 (-> arg1 show-pat-set)))
|
|
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-9 (-> arg1 show-pat-clear))))
|
|
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-9 event))))
|
|
)
|
|
(let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-9 mode) color) a 64)))
|
|
(add-debug-flat-triangle
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> s3-1 vertex))
|
|
(-> s3-1 vertex 1)
|
|
(-> s3-1 vertex 2)
|
|
t1-0
|
|
)
|
|
)
|
|
(if (-> arg0 outline?)
|
|
(add-debug-outline-triangle
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> s3-1 vertex))
|
|
(-> s3-1 vertex 1)
|
|
(-> s3-1 vertex 2)
|
|
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x80)
|
|
)
|
|
)
|
|
(when (-> arg0 show-normals?)
|
|
(vector+! (-> s4-0 vector 2) (the-as vector (-> s3-1 vertex)) (-> s3-1 vertex 1))
|
|
(vector+! (-> s4-0 vector 2) (-> s4-0 vector 2) (-> s3-1 vertex 2))
|
|
(vector-float/! (-> s4-0 vector 2) (-> s4-0 vector 2) 3.0)
|
|
(add-debug-vector
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(-> s4-0 vector 2)
|
|
(-> s4-0 vector 1)
|
|
(meters 0.75)
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
|
)
|
|
)
|
|
)
|
|
((-> arg0 ghost-hidden?)
|
|
(add-debug-flat-triangle
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> s3-1 vertex))
|
|
(-> s3-1 vertex 1)
|
|
(-> s3-1 vertex 2)
|
|
(new 'static 'rgba :r #x20 :g #x20 :b #x20 :a #x20)
|
|
)
|
|
(if (-> arg0 outline?)
|
|
(add-debug-outline-triangle
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> s3-1 vertex))
|
|
(-> s3-1 vertex 1)
|
|
(-> s3-1 vertex 2)
|
|
(new 'static 'rgba :r #x10 :g #x10 :b #x10 :a #x10)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(&+! s3-1 64)
|
|
)
|
|
)
|
|
)
|
|
(let ((s5-1 (the-as object (-> *collide-cache* prims))))
|
|
(countdown (s4-1 (-> *collide-cache* num-prims))
|
|
(when (= (-> (the-as collide-cache-prim s5-1) prim-core prim-type) (prim-type sphere))
|
|
(let ((v1-37 (-> (the-as collide-shape-prim-sphere (-> (the-as collide-cache-prim s5-1) prim)) pat)))
|
|
(when (and (or (zero? (-> arg1 show-pat-set)) (logtest? v1-37 (-> arg1 show-pat-set)))
|
|
(or (zero? (-> arg1 show-pat-clear)) (zero? (logand v1-37 (-> arg1 show-pat-clear))))
|
|
(or (zero? (-> arg1 event-mask)) (logtest? (-> arg1 event-mask) (ash 1 (-> v1-37 event))))
|
|
)
|
|
(let ((t0-5 (copy-and-set-field (-> *pat-mode-info* (-> v1-37 mode) color) a 64)))
|
|
(add-debug-sphere
|
|
#t
|
|
(bucket-id debug-no-zbuf1)
|
|
(the-as vector (-> (the-as collide-cache-prim s5-1) prim-core))
|
|
(-> (the-as collide-cache-prim s5-1) prim-core world-sphere w)
|
|
t0-5
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(set! s5-1 (&+ (the-as collide-cache-prim s5-1) 48))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type col-rend
|
|
;; INFO: Used lq/sq
|
|
(defmethod col-rend-method-9 col-rend ((obj col-rend))
|
|
(with-pp
|
|
(let ((s5-0 (new 'stack-no-clear 'collide-query)))
|
|
(let ((f30-0 (-> obj bbox-radius)))
|
|
(let ((v1-0 (-> obj track)))
|
|
(cond
|
|
((zero? v1-0)
|
|
(set! (-> obj bbox-center quad) (-> (target-pos 0) quad))
|
|
(+! (-> obj bbox-center y) (* 0.7 f30-0))
|
|
)
|
|
((= v1-0 1)
|
|
(position-in-front-of-camera! (-> obj bbox-center) (+ (-> obj camera-to-bbox-dist) (-> obj bbox-radius)) 0.0)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> s5-0 bbox min quad) (-> obj bbox-center quad))
|
|
(set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0))
|
|
(set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0))
|
|
(set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0))
|
|
(set! (-> s5-0 bbox max quad) (-> obj bbox-center quad))
|
|
(+! (-> s5-0 bbox max x) f30-0)
|
|
(+! (-> s5-0 bbox max y) f30-0)
|
|
(+! (-> s5-0 bbox max z) f30-0)
|
|
)
|
|
(let ((v1-9 -1))
|
|
(let ((a0-9 (-> obj cspec)))
|
|
(if (not (logtest? a0-9 (collide-spec crate)))
|
|
(set! v1-9 (logxor v1-9 1))
|
|
)
|
|
(if (not (logtest? a0-9 (collide-spec civilian)))
|
|
(set! v1-9 (logxor v1-9 64))
|
|
)
|
|
(if (not (logtest? a0-9 (collide-spec enemy)))
|
|
(set! v1-9 (logxor #x80000 v1-9))
|
|
)
|
|
(if (not (logtest? a0-9 (collide-spec obstacle)))
|
|
(set! v1-9 (logxor v1-9 2))
|
|
)
|
|
(if (not (logtest? a0-9 (collide-spec vehicle-sphere)))
|
|
(set! v1-9 (logand #x80743 v1-9))
|
|
)
|
|
)
|
|
(set! (-> s5-0 collide-with) (the-as collide-spec v1-9))
|
|
)
|
|
(set! (-> s5-0 ignore-pat) (new 'static 'pat-surface))
|
|
(set! (-> s5-0 ignore-process0) #f)
|
|
(set! (-> s5-0 ignore-process1) #f)
|
|
(add-debug-box
|
|
#t
|
|
(bucket-id debug2)
|
|
(the-as vector (-> s5-0 bbox))
|
|
(-> s5-0 bbox max)
|
|
(if (logtest? (-> pp clock frame-counter) 128)
|
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x20)
|
|
(new 'static 'rgba :a #x20)
|
|
)
|
|
)
|
|
(fill-using-bounding-box *collide-cache* s5-0)
|
|
)
|
|
(let ((s5-1 (-> obj show-only))
|
|
(a1-17 (new 'stack 'col-rend-filter))
|
|
)
|
|
(when (nonzero? s5-1)
|
|
(cond
|
|
((logtest? s5-1 8)
|
|
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :noboard #x1))
|
|
)
|
|
((logtest? s5-1 16)
|
|
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
|
|
)
|
|
((logtest? s5-1 32)
|
|
(set! (-> a1-17 show-pat-clear) (new 'static 'pat-surface :nogrind #x1))
|
|
(set! (-> a1-17 show-pat-set) (new 'static 'pat-surface :nojak #x1))
|
|
)
|
|
(else
|
|
(if (logtest? s5-1 8192)
|
|
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nolineofsight #x1) (-> a1-17 show-pat-set)))
|
|
)
|
|
(if (logtest? s5-1 1024)
|
|
(set! (-> a1-17 show-pat-set noentity) 1)
|
|
)
|
|
(if (logtest? s5-1 64)
|
|
(set! (-> a1-17 show-pat-set noboard) 1)
|
|
)
|
|
(if (logtest? s5-1 2048)
|
|
(set! (-> a1-17 show-pat-set nogrind) 1)
|
|
)
|
|
(if (logtest? s5-1 128)
|
|
(set! (-> a1-17 show-pat-set nocamera) 1)
|
|
)
|
|
(if (logtest? s5-1 4096)
|
|
(set! (-> a1-17 show-pat-set nojak) 1)
|
|
)
|
|
(if (logtest? s5-1 256)
|
|
(set! (-> a1-17 show-pat-set noedge) 1)
|
|
)
|
|
(if (logtest? s5-1 #x8000)
|
|
(set! (-> a1-17 show-pat-set nopilot) 1)
|
|
)
|
|
(if (logtest? s5-1 512)
|
|
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> a1-17 show-pat-set)))
|
|
)
|
|
(if (logtest? s5-1 #x4000)
|
|
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :nomech #x1) (-> a1-17 show-pat-set)))
|
|
)
|
|
(if (logtest? #x10000 s5-1)
|
|
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :noproj #x1) (-> a1-17 show-pat-set)))
|
|
)
|
|
(if (logtest? #x40000 s5-1)
|
|
(set! (-> a1-17 show-pat-set) (logior (new 'static 'pat-surface :probe #x1) (-> a1-17 show-pat-set)))
|
|
)
|
|
(if (logtest? #x20000 s5-1)
|
|
(logior! (-> a1-17 event-mask) 64)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(col-rend-draw obj a1-17)
|
|
)
|
|
(none)
|
|
)
|
|
)
|