mirror of
https://github.com/open-goal/jak-project
synced 2026-05-25 23:35:33 -04:00
3f686854e6
- `visvol-edit` - `editable` - `editable-player` - `mysql-nav-graph` - `nav-graph-editor` - `nav-mesh-editor-h` - `nav-mesh-editor` The SQL data is not filled in yet.
509 lines
18 KiB
Common Lisp
Vendored
Generated
509 lines
18 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; this file is debug only
|
|
(declare-file (debug))
|
|
|
|
;; definition of type visvol-edit-info
|
|
(deftype visvol-edit-info (structure)
|
|
((editing symbol)
|
|
(current-func visvol-edit-func)
|
|
(analog-func visvol-edit-func)
|
|
)
|
|
(:methods
|
|
(handle-pad-input (_type_) object)
|
|
(draw-menu (_type_ process-drawable) object)
|
|
(set-origin-joint-idx! (_type_ process-drawable) none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type visvol-edit-info
|
|
(defmethod inspect ((this visvol-edit-info))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(format #t "[~8x] ~A~%" this 'visvol-edit-info)
|
|
(format #t "~1Tediting: ~A~%" (-> this editing))
|
|
(format #t "~1Tcurrent-func: ~D~%" (-> this current-func))
|
|
(format #t "~1Tanalog-func: ~D~%" (-> this analog-func))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition of type visvol-editor
|
|
(deftype visvol-editor (process)
|
|
((proc handle)
|
|
)
|
|
(:state-methods
|
|
idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type visvol-editor
|
|
(defmethod inspect ((this visvol-editor))
|
|
(when (not this)
|
|
(set! this this)
|
|
(goto cfg-4)
|
|
)
|
|
(let ((t9-0 (method-of-type process inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~2Tproc: ~D~%" (-> this proc))
|
|
(label cfg-4)
|
|
this
|
|
)
|
|
|
|
;; definition for method 9 of type visvol-edit-info
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defmethod handle-pad-input ((this visvol-edit-info))
|
|
(if (cpad-pressed? 0 up)
|
|
(+! (-> this current-func) -1)
|
|
)
|
|
(if (cpad-pressed? 0 left)
|
|
(+! (-> this current-func) -4)
|
|
)
|
|
(if (cpad-pressed? 0 down)
|
|
(+! (-> this current-func) 1)
|
|
)
|
|
(if (cpad-pressed? 0 right)
|
|
(+! (-> this current-func) 4)
|
|
)
|
|
(cond
|
|
((< (the-as int (-> this current-func)) 0)
|
|
(let ((v0-0 2))
|
|
(set! (-> this current-func) (the-as visvol-edit-func v0-0))
|
|
v0-0
|
|
)
|
|
)
|
|
((>= (the-as int (-> this current-func)) 3)
|
|
(set! (-> this current-func) (visvol-edit-func visvol-positive))
|
|
0
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 11 of type visvol-edit-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
;; WARN: Function (method 11 visvol-edit-info) has a return type of none, but the expression builder found a return statement.
|
|
(defmethod set-origin-joint-idx! ((this visvol-edit-info) (arg0 process-drawable))
|
|
(if (or (not arg0) (!= (-> this analog-func) 2))
|
|
(return #f)
|
|
)
|
|
(let ((v0-1 (the-as int (-> arg0 draw origin-joint-index))))
|
|
(let ((v1-7 (+ (-> arg0 node-list length) -1)))
|
|
(when (cpad-pressed? 0 r1)
|
|
(set! v0-1 (the-as int (+ (the-as uint v0-1) 1)))
|
|
(if (cpad-hold? 0 l1)
|
|
(set! v0-1 (the-as int (+ (the-as uint v0-1) 4)))
|
|
)
|
|
(case v0-1
|
|
((1 2)
|
|
(set! v0-1 3)
|
|
)
|
|
)
|
|
)
|
|
(when (cpad-pressed? 0 l1)
|
|
(+! v0-1 -1)
|
|
(if (cpad-hold? 0 r1)
|
|
(+! v0-1 -4)
|
|
)
|
|
(case v0-1
|
|
((1 2)
|
|
(set! v0-1 0)
|
|
)
|
|
)
|
|
)
|
|
(if (< v0-1 0)
|
|
(set! v0-1 v1-7)
|
|
)
|
|
(if (< v1-7 v0-1)
|
|
(set! v0-1 0)
|
|
)
|
|
)
|
|
(set! (-> arg0 draw origin-joint-index) (the-as uint v0-1))
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type visvol-edit-info
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defmethod draw-menu ((this visvol-edit-info) (arg0 process-drawable))
|
|
(when (cpad-pressed? 0 l2)
|
|
(set! (-> this editing) (not (-> this editing)))
|
|
(cond
|
|
((-> this editing)
|
|
(set! *external-cam-mode* 'locked)
|
|
)
|
|
(*target*
|
|
(set! *external-cam-mode* #f)
|
|
)
|
|
(else
|
|
(set! *external-cam-mode* 'pad-0)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((or (not (-> this editing)) (cpad-hold? 0 r2))
|
|
(if (not (-> this editing))
|
|
(format *stdcon* "press l2 to edit visvol~%")
|
|
(format *stdcon* "release r2 to continue editing visvol~%")
|
|
)
|
|
(if (or (cpad-hold? 0 r2) (not *target*))
|
|
(set! *external-cam-mode* 'pad-0)
|
|
)
|
|
)
|
|
(else
|
|
(set! *external-cam-mode* 'locked)
|
|
(handle-pad-input this)
|
|
(set-origin-joint-idx! this arg0)
|
|
(let ((s3-0 ">")
|
|
(s4-0 " ")
|
|
)
|
|
(if (not (logtest? (-> *display* real-frame-clock integral-frame-counter) 8))
|
|
(set! s3-0 " ")
|
|
)
|
|
(format *stdcon* " r2/l2: move camera~%")
|
|
(format
|
|
*stdcon*
|
|
" r1/l1: select joint ~D ~S~%"
|
|
(if arg0
|
|
(the-as int (-> arg0 draw origin-joint-index))
|
|
-1
|
|
)
|
|
(if (and arg0 (-> arg0 node-list data (-> arg0 draw origin-joint-index) joint))
|
|
(-> arg0 node-list data (-> arg0 draw origin-joint-index) joint name)
|
|
"?"
|
|
)
|
|
)
|
|
(format *stdcon* " dpad: select function~%")
|
|
(format *stdcon* " x, tri: toggle/call~%")
|
|
(format *stdcon* "------------------------~%")
|
|
(let ((t9-9 format)
|
|
(a0-14 *stdcon*)
|
|
(a1-9 " ~S analog: ~S~%")
|
|
(a2-1 (if (= (-> this current-func) (visvol-edit-func visvol-positive))
|
|
s3-0
|
|
s4-0
|
|
)
|
|
)
|
|
(v1-45 (-> this analog-func))
|
|
)
|
|
(t9-9 a0-14 a1-9 a2-1 (cond
|
|
((= v1-45 (visvol-edit-func visvol-positive))
|
|
(set! *display-xyz-axes* #t)
|
|
"visvol positive"
|
|
)
|
|
((= v1-45 (visvol-edit-func visvol-negative))
|
|
(set! *display-xyz-axes* #t)
|
|
"visvol negative"
|
|
)
|
|
((= v1-45 (visvol-edit-func adjust-sphere))
|
|
(set! *display-xyz-axes* #f)
|
|
"adjust sphere"
|
|
)
|
|
((= v1-45 (visvol-edit-func adjust-vis-distance))
|
|
(set! *display-xyz-axes* #f)
|
|
"adjust vis distance"
|
|
)
|
|
(else
|
|
"???"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(format *stdcon* " ~S print to listener~%" (if (= (-> this current-func) (visvol-edit-func visvol-negative))
|
|
s3-0
|
|
s4-0
|
|
)
|
|
)
|
|
(format *stdcon* " ~S quit~%" (cond
|
|
((= (-> this current-func) (visvol-edit-func adjust-sphere))
|
|
(empty)
|
|
s3-0
|
|
)
|
|
(else
|
|
s4-0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(let ((v1-51 0))
|
|
(if (cpad-pressed? 0 x)
|
|
(+! v1-51 1)
|
|
)
|
|
(if (cpad-pressed? 0 triangle)
|
|
(+! v1-51 -1)
|
|
)
|
|
(when (nonzero? v1-51)
|
|
(case (-> this current-func)
|
|
(((visvol-edit-func visvol-positive))
|
|
(+! (-> this analog-func) v1-51)
|
|
)
|
|
(((visvol-edit-func visvol-negative))
|
|
(when arg0
|
|
(let ((s4-1 (entity-by-name (-> arg0 name))))
|
|
(when s4-1
|
|
(let ((f30-0 (res-lump-float s4-1 'vis-dist :default 200.0))
|
|
(s4-2 (res-lump-data s4-1 'visvol (pointer float)))
|
|
)
|
|
(when s4-2
|
|
(format #t "~%actor-vis ~S ~M " (-> arg0 name) f30-0)
|
|
(format #t "~M ~M ~M ~M ~M ~M~%~%" (-> s4-2 0) (-> s4-2 1) (-> s4-2 2) (-> s4-2 4) (-> s4-2 5) (-> s4-2 6))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(format
|
|
#t
|
|
"~%:bounds (static-spherem ~M ~M ~M ~M)~%"
|
|
(-> arg0 draw bounds x)
|
|
(-> arg0 draw bounds y)
|
|
(-> arg0 draw bounds z)
|
|
(-> arg0 draw bounds w)
|
|
)
|
|
(let ((v1-63 (-> arg0 draw origin-joint-index)))
|
|
(format
|
|
#t
|
|
":origin-joint ~s~%~%"
|
|
(if (and (>= v1-63 0) (< v1-63 (the-as uint (-> arg0 node-list length))) (-> arg0 node-list data v1-63 joint))
|
|
(-> arg0 node-list data v1-63 joint name)
|
|
"?"
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(((visvol-edit-func adjust-sphere))
|
|
(kill-by-type visvol-editor *active-pool*)
|
|
)
|
|
(else
|
|
(format 0 "~%ERROR<GMJ>: bad visvol-edit-func~%")
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((< (the-as int (-> this analog-func)) 0)
|
|
(set! (-> this analog-func) (visvol-edit-func adjust-vis-distance))
|
|
)
|
|
((>= (the-as int (-> this analog-func)) 4)
|
|
(set! (-> this analog-func) (visvol-edit-func visvol-positive))
|
|
0
|
|
)
|
|
)
|
|
(when arg0
|
|
(let ((f28-0 (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 48.0 110.0 1.0))
|
|
(f30-1 (analog-input (the-as int (-> *cpad-list* cpads 0 righty)) 128.0 48.0 110.0 1.0))
|
|
(f26-0 (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 1.0))
|
|
(f0-10 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 1.0))
|
|
)
|
|
(when (or (!= f28-0 0.0) (!= f30-1 0.0) (!= f26-0 0.0) (!= f0-10 0.0))
|
|
(case (-> this analog-func)
|
|
(((visvol-edit-func visvol-positive) (visvol-edit-func visvol-negative))
|
|
(set! f28-0 (* 1228.8 f28-0))
|
|
(set! f30-1 (* -1228.8 f30-1))
|
|
(set! f26-0 (* 1228.8 f26-0))
|
|
(let ((f0-11 (/ f0-10 -100)))
|
|
(set! f0-10 (+ 1.0 f0-11))
|
|
)
|
|
)
|
|
(((visvol-edit-func adjust-sphere))
|
|
(set! f28-0 (* -409.6 f28-0))
|
|
(set! f30-1 (* -409.6 f30-1))
|
|
(set! f26-0 (* -409.6 f26-0))
|
|
(let ((f0-12 (/ f0-10 100)))
|
|
(set! f0-10 (+ 1.0 f0-12))
|
|
)
|
|
)
|
|
(((visvol-edit-func adjust-vis-distance))
|
|
(let ((f1-15 (/ f28-0 100)))
|
|
(set! f28-0 (+ 1.0 f1-15))
|
|
)
|
|
(let ((f1-17 (/ f30-1 -100)))
|
|
(set! f30-1 (+ 1.0 f1-17))
|
|
)
|
|
(let ((f1-19 (/ f26-0 100)))
|
|
(set! f26-0 (+ 1.0 f1-19))
|
|
)
|
|
)
|
|
)
|
|
(case (-> this analog-func)
|
|
(((visvol-edit-func visvol-positive))
|
|
(let ((a0-57 (entity-by-name (-> arg0 name))))
|
|
(when a0-57
|
|
(let ((v1-110 (res-lump-data a0-57 'visvol (pointer float))))
|
|
(when v1-110
|
|
(let ((a2-23 (&-> v1-110 4))
|
|
(a0-58 (&-> v1-110 4))
|
|
(a1-29 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> a1-29 x) f28-0)
|
|
(set! (-> a1-29 y) f30-1)
|
|
(set! (-> a1-29 z) f26-0)
|
|
(set! (-> a1-29 w) 1.0)
|
|
(vector+! (the-as vector a2-23) (the-as vector a0-58) a1-29)
|
|
)
|
|
(set! (-> v1-110 4) (fmax (-> v1-110 4) (+ 4096.0 (-> v1-110 0))))
|
|
(set! (-> v1-110 5) (fmax (-> v1-110 5) (+ 4096.0 (-> v1-110 1))))
|
|
(set! (-> v1-110 6) (fmax (-> v1-110 6) (+ 4096.0 (-> v1-110 2))))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(((visvol-edit-func visvol-negative))
|
|
(let ((a0-65 (entity-by-name (-> arg0 name))))
|
|
(when a0-65
|
|
(let ((v1-112 (res-lump-data a0-65 'visvol (pointer float))))
|
|
(when v1-112
|
|
(let ((a2-26 (&-> v1-112 0))
|
|
(a0-66 (&-> v1-112 0))
|
|
(a1-34 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> a1-34 x) f28-0)
|
|
(set! (-> a1-34 y) f30-1)
|
|
(set! (-> a1-34 z) f26-0)
|
|
(set! (-> a1-34 w) 1.0)
|
|
(vector+! (the-as vector a2-26) (the-as vector a0-66) a1-34)
|
|
)
|
|
(set! (-> v1-112 0) (fmin (-> v1-112 0) (+ -4096.0 (-> v1-112 4))))
|
|
(set! (-> v1-112 1) (fmin (-> v1-112 1) (+ -4096.0 (-> v1-112 5))))
|
|
(set! (-> v1-112 2) (fmin (-> v1-112 2) (+ -4096.0 (-> v1-112 6))))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(((visvol-edit-func adjust-sphere))
|
|
(set! (-> arg0 draw bounds w) (* (-> arg0 draw bounds w) f0-10))
|
|
(let ((s4-3 (matrix-copy! (new 'stack-no-clear 'matrix) (matrix-local->world #f #f)))
|
|
(s2-0 (matrix-copy!
|
|
(new 'stack-no-clear 'matrix)
|
|
(-> arg0 node-list data (-> arg0 draw origin-joint-index) bone transform)
|
|
)
|
|
)
|
|
(s3-1 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> s3-1 x) f28-0)
|
|
(set! (-> s3-1 y) f30-1)
|
|
(set! (-> s3-1 z) f26-0)
|
|
(set! (-> s3-1 w) 1.0)
|
|
(vector-reset! (-> s4-3 trans))
|
|
(vector-matrix*! s3-1 s3-1 s4-3)
|
|
(vector-reset! (-> s2-0 trans))
|
|
(matrix-transpose! s2-0 s2-0)
|
|
(vector-matrix*! s3-1 s3-1 s2-0)
|
|
(+! (-> arg0 draw bounds x) (-> s3-1 x))
|
|
(+! (-> arg0 draw bounds y) (-> s3-1 y))
|
|
(+! (-> arg0 draw bounds z) (-> s3-1 z))
|
|
)
|
|
)
|
|
(((visvol-edit-func adjust-vis-distance))
|
|
(let ((s4-4 (entity-by-name (-> arg0 name))))
|
|
(when s4-4
|
|
(let ((f0-36 (* (res-lump-float s4-4 'vis-dist :default 200.0) f30-1)))
|
|
(add-32bit-data!
|
|
s4-4
|
|
(new 'static 'res-tag :name 'vis-dist :key-frame -1000000000.0 :elt-count #x1 :elt-type float)
|
|
f0-36
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(case (-> this analog-func)
|
|
(((visvol-edit-func adjust-vis-distance))
|
|
(let ((a0-93 (entity-by-name (-> arg0 name))))
|
|
(when a0-93
|
|
(let ((f0-37 (res-lump-float a0-93 'vis-dist :default 200.0)))
|
|
(format *stdcon* "~%vis distance: ~M" f0-37)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(case (-> this analog-func)
|
|
(((visvol-edit-func adjust-sphere))
|
|
(when arg0
|
|
(let ((a1-53 (-> arg0 draw origin-joint-index)))
|
|
(show-maya-skeleton arg0 (the-as int a1-53) #x46400000)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
;; definition for symbol *visvol-edit-info*, type visvol-edit-info
|
|
(define *visvol-edit-info* (the-as visvol-edit-info 0))
|
|
|
|
;; definition for symbol *visvol-edit-info*, type visvol-edit-info
|
|
(define *visvol-edit-info* (new 'static 'visvol-edit-info :editing #t))
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate idle (visvol-editor)
|
|
:virtual #t
|
|
:enter (behavior ()
|
|
(set! *display-actor-vis* #t)
|
|
)
|
|
:exit (behavior ()
|
|
(set! *display-xyz-axes* #f)
|
|
(set! *display-actor-vis* #f)
|
|
(set! *external-cam-mode* #f)
|
|
)
|
|
:trans (behavior ()
|
|
(draw-menu
|
|
*visvol-edit-info*
|
|
(the-as process-drawable (as-type (handle->process (-> self proc)) process-drawable))
|
|
)
|
|
)
|
|
:code sleep-code
|
|
)
|
|
|
|
;; definition for function visvol-editor-init-by-other
|
|
(defbehavior visvol-editor-init-by-other visvol-editor ((arg0 handle))
|
|
(set! (-> self proc) arg0)
|
|
(go-virtual idle)
|
|
)
|
|
|
|
;; definition for function stop-visvol-edit
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defun stop-visvol-edit ()
|
|
(kill-by-type visvol-editor *active-pool*)
|
|
0
|
|
)
|
|
|
|
;; definition for function visvol-edit
|
|
;; WARN: Return type mismatch int vs object.
|
|
(defun visvol-edit ((arg0 string))
|
|
(stop-visvol-edit)
|
|
(let* ((v1-0 (process->ppointer (process-by-name arg0 *active-pool*)))
|
|
(gp-0 (logior (if v1-0
|
|
(new 'static 'handle :pid (-> v1-0 0 pid))
|
|
(new 'static 'handle)
|
|
)
|
|
(new 'static 'handle :process v1-0)
|
|
)
|
|
)
|
|
)
|
|
(if (not (handle->process gp-0))
|
|
(set! gp-0 (process->handle *debug-actor*))
|
|
(debug-actor arg0)
|
|
)
|
|
(process-spawn visvol-editor gp-0 :name "visvol-editor")
|
|
)
|
|
0
|
|
)
|
|
|
|
|
|
|
|
|