jak2 gsrc

This commit is contained in:
Hat Kid
2026-04-15 02:33:12 +02:00
parent 9f66a69859
commit c0b0f35b05
226 changed files with 15133 additions and 19367 deletions
+29 -28
View File
@@ -16,7 +16,6 @@ Do not call these functions unless *debug-segment* is set.
"Fills points with positions that make a wireframe sphere made of the given number of horizontal and vertical lines.
The points array is expected to have a capacity of at least (h-lines * v-lines * 3).
Both h-lines and v-lines should be whole numbers."
(local-vars (next-hz vector) (next-vt vector) (h-line int))
(let ((offset (new-stack-vector0))
(scale 1.0)
(num-points 0)
@@ -26,27 +25,29 @@ Do not call these functions unless *debug-segment* is set.
(let ((f28-0 (* scale (sin (* (the float v-line) (/ 32768.0 v-lines)))))
(f26-0 (* scale (sin (* (the float (+ v-line 1)) (/ 32768.0 v-lines)))))
(current (new-stack-vector0))
(next-hz (new 'stack-no-clear 'vector))
)
(set! next-hz (new 'stack-no-clear 'vector))
(set! (-> next-hz quad) (the-as uint128 0))
(set! next-vt (new 'stack-no-clear 'vector))
(set! (-> next-vt quad) (the-as uint128 0))
(set! (-> current y) (+ (-> offset y) (* (cos (* (the float v-line) (/ 32768.0 v-lines))) scale)))
(set! (-> next-hz y) (-> current y))
(set! (-> next-vt y) (+ (-> offset y) (* (cos (* (the float (+ v-line 1)) (/ 32768.0 v-lines))) scale)))
(set! h-line 0)
(while (< h-line (the int h-lines))
(set! (-> current x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> current z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz x) (+ (-> offset x) (* (cos (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz z) (+ (-> offset z) (* (sin (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-vt x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> next-vt z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> points data num-points quad) (-> current quad))
(set! (-> points data (+ num-points 1) quad) (-> next-hz quad))
(set! (-> points data (+ num-points 2) quad) (-> next-vt quad))
(+! num-points 3)
(set! h-line (+ h-line 1))
(let ((next-vt (new 'stack-no-clear 'vector)))
(set! (-> next-vt quad) (the-as uint128 0))
(set! (-> current y) (+ (-> offset y) (* (cos (* (the float v-line) (/ 32768.0 v-lines))) scale)))
(set! (-> next-hz y) (-> current y))
(set! (-> next-vt y) (+ (-> offset y) (* (cos (* (the float (+ v-line 1)) (/ 32768.0 v-lines))) scale)))
(let ((h-line 0))
(while (< h-line (the int h-lines))
(set! (-> current x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> current z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz x) (+ (-> offset x) (* (cos (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-hz z) (+ (-> offset z) (* (sin (* (the float (+ h-line 1)) (/ 65536.0 h-lines))) f28-0)))
(set! (-> next-vt x) (+ (-> offset x) (* (cos (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> next-vt z) (+ (-> offset z) (* (sin (* (the float h-line) (/ 65536.0 h-lines))) f26-0)))
(set! (-> points data num-points quad) (-> current quad))
(set! (-> points data (+ num-points 1) quad) (-> next-hz quad))
(set! (-> points data (+ num-points 2) quad) (-> next-vt quad))
(+! num-points 3)
(+! h-line 1)
)
)
)
)
)
@@ -68,7 +69,6 @@ Do not call these functions unless *debug-segment* is set.
"Adds a debug sphere to a bucket.
The table-idx specifies the resolution of the sphere and must be >= 0 and <= 9, where 9 would specify
the highest resolution available and 0 would draw nothing."
(local-vars (sphere-points vector-array) (point-3 vector))
(rlet ((vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
@@ -83,12 +83,12 @@ Do not call these functions unless *debug-segment* is set.
)
)
)
(set! sphere-points (-> *debug-sphere-table* table-idx))
(set! point-3 (the-as vector (new-stack-vector0)))
(let ((point-1 (new-stack-vector0))
(point-2 (new-stack-vector0))
(points (-> sphere-points data))
)
(let* ((sphere-points (-> *debug-sphere-table* table-idx))
(point-3 (the-as vector (new-stack-vector0)))
(point-1 (new-stack-vector0))
(point-2 (new-stack-vector0))
(points (-> sphere-points data))
)
(.lvf vf1 (&-> position quad))
(.mov vf2 radius)
(countdown (s4-1 (/ (-> sphere-points length) 3))
@@ -109,6 +109,7 @@ Do not call these functions unless *debug-segment* is set.
(add-debug-line #t bucket point-1 point-3 color #f (the-as rgba -1))
)
)
0
(none)
)
(none)
)
+35 -135
View File
@@ -1145,6 +1145,7 @@
(let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub)))
(dotimes (s2-0 (-> s3-0 length))
(let ((a1-4
;; og:preserve-this allocate on debug heap
(new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func)
)
)
@@ -2666,20 +2667,6 @@
)
(defun debug-menu-make-continue-sub-menu ((arg0 game-info) (arg1 symbol))
(local-vars
(sv-16 (function symbol type object object pair))
(sv-32 symbol)
(sv-48 type)
(sv-64 symbol)
(sv-80 (function symbol type object object pair))
(sv-96 symbol)
(sv-112 type)
(sv-128 string)
(sv-144 (function symbol type object object pair))
(sv-160 symbol)
(sv-176 type)
(sv-192 string)
)
(let ((s4-0 *level-load-list*)
(s5-0 '())
)
@@ -2691,34 +2678,20 @@
(let ((v1-2 (car s3-0))
(a0-5 arg1)
)
(when (if (= a0-5 'test)
(logtest? (continue-flags test) (-> (the-as continue-point v1-2) flags))
#t
)
(let ((s2-0 (method-of-type pair new))
(s1-0 'debug)
(s0-0 pair)
(if (if (= a0-5 'test)
(logtest? (continue-flags test) (-> (the-as continue-point v1-2) flags))
#t
)
(set! sv-16 (method-of-type pair new))
(set! sv-32 'debug)
(set! sv-48 pair)
(set! sv-64 'flag)
(set! sv-80 (method-of-type pair new))
(set! sv-96 'debug)
(set! sv-112 pair)
(set! sv-128 (-> (the-as continue-point v1-2) name))
(set! sv-144 (method-of-type pair new))
(set! sv-160 'debug)
(set! sv-176 pair)
(set! sv-192 (-> (the-as continue-point v1-2) name))
(let* ((a3-1 (dcons 'dm-current-continue '()))
(a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1))
(a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2))
)
(set! s5-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) s5-0))
)
(set! s5-0 (cons
(cons 'flag (cons
(-> (the-as continue-point v1-2) name)
(cons (-> (the-as continue-point v1-2) name) (cons 'dm-current-continue '()))
)
)
s5-0
)
)
)
)
)
(set! s3-0 (cdr s3-0))
)
@@ -2730,72 +2703,41 @@
(let ((a3-5 '()))
(let ((a2-6 (car s5-0)))
(while (not (null? s5-0))
;; og:preserve-this cons -> dcons
(set! a3-5 (dcons a2-6 a3-5))
(set! s5-0 (cdr s5-0))
(set! a2-6 (car s5-0))
)
)
(dcons 'menu (dcons (symbol->string arg1) a3-5))
;; og:preserve-this cons -> dcons
(dcons 'menu (cons (symbol->string arg1) a3-5))
)
)
)
(defun debug-menu-make-task-sub-menu ((arg0 symbol))
"TODO - need to know more about game-info"
(local-vars
(sv-16 (function symbol type object object pair))
(sv-32 symbol)
(sv-48 type)
(sv-64 symbol)
(sv-80 (function symbol type object object pair))
(sv-96 symbol)
(sv-112 type)
(sv-128 string)
(sv-144 (function symbol type object object pair))
(sv-160 symbol)
(sv-176 type)
(sv-192 int)
)
(let ((gp-0 '()))
(let ((s4-0 (-> *game-info* sub-task-list)))
(countdown (s3-0 (-> s4-0 length))
(when (nonzero? s3-0)
(let ((v1-4 (-> s4-0 s3-0)))
(when (= (-> v1-4 level) arg0)
(let ((s2-0 (method-of-type pair new))
(s1-0 'debug)
(s0-0 pair)
)
(set! sv-16 (method-of-type pair new))
(set! sv-32 'debug)
(set! sv-48 pair)
(set! sv-64 'flag)
(set! sv-80 (method-of-type pair new))
(set! sv-96 'debug)
(set! sv-112 pair)
(set! sv-128 (-> v1-4 name))
(set! sv-144 (method-of-type pair new))
(set! sv-160 'debug)
(set! sv-176 pair)
(set! sv-192 (* s3-0 8))
(let* ((a3-1 (dcons 'dm-task-menu-pick-func '()))
(a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1))
(a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2))
)
(set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0))
)
(if (= (-> v1-4 level) arg0)
(set! gp-0
;; og:preserve-this cons -> dcons
(dcons (dcons 'flag (dcons (-> v1-4 name) (dcons (* s3-0 8) (dcons 'dm-task-menu-pick-func '())))) gp-0)
)
)
)
)
)
)
)
;; og:preserve-this cons -> dcons
(dcons 'menu (dcons (symbol->string arg0) gp-0))
)
)
(defun debug-menu-make-task-menu ((arg0 debug-menu-context))
(local-vars (sv-16 debug-menu-context))
(let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu"))
(s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0))
)
@@ -2824,14 +2766,9 @@
(a0-3 (car s3-0))
)
(while (not (null? s3-0))
(let ((s2-0 debug-menu-append-item)
(s1-0 s5-0)
(s0-0 debug-menu-make-from-template)
)
(set! sv-16 arg0)
(let ((a1-2 (debug-menu-make-task-sub-menu (the-as symbol a0-3))))
(s2-0 s1-0 (s0-0 sv-16 a1-2))
)
(debug-menu-append-item
s5-0
(debug-menu-make-from-template arg0 (debug-menu-make-task-sub-menu (the-as symbol a0-3)))
)
(set! s3-0 (cdr s3-0))
(set! a0-3 (car s3-0))
@@ -2936,51 +2873,16 @@
)
(defun debug-menu-make-play-menu ((arg0 debug-menu-context))
(local-vars
(sv-16 symbol)
(sv-32 type)
(sv-48 symbol)
(sv-64 (function symbol type object object pair))
(sv-80 symbol)
(sv-96 type)
(sv-112 string)
(sv-128 (function symbol type object object pair))
(sv-144 symbol)
(sv-160 type)
(sv-176 int)
)
(let ((gp-0 '()))
(countdown (s4-0 (-> *game-info* play-list length))
(let ((v1-4 (-> *game-info* play-list s4-0)))
(when (-> v1-4 play-continue)
(let ((s3-0 (method-of-type pair new))
;; og:preserve-this allocate on debug heap
(s2-0 'debug)
(s1-0 pair)
(s0-0 (method-of-type pair new))
)
(set! sv-16 'debug)
(set! sv-32 pair)
(set! sv-48 'function)
(set! sv-64 (method-of-type pair new))
(set! sv-80 'debug)
(set! sv-96 pair)
(set! sv-112 (-> v1-4 name))
(set! sv-128 (method-of-type pair new))
(set! sv-144 'debug)
(set! sv-160 pair)
(set! sv-176 (* s4-0 8))
(let* ((a3-1 (dcons 'dm-play-task '()))
(a3-2 (sv-128 sv-144 sv-160 sv-176 a3-1))
(a3-3 (sv-64 sv-80 sv-96 sv-112 a3-2))
)
(set! gp-0 (s3-0 s2-0 s1-0 (s0-0 sv-16 sv-32 sv-48 a3-3) gp-0))
)
(if (-> v1-4 play-continue)
;; og:preserve-this cons -> dcons
(set! gp-0 (dcons (dcons 'function (dcons (-> v1-4 name) (dcons (* s4-0 8) (dcons 'dm-play-task '())))) gp-0))
)
)
)
)
;; og:preserve-this
;; og:preserve-this cons -> dcons
(debug-menu-make-from-template arg0 (dcons 'menu (dcons "Play" gp-0)))
)
)
@@ -3055,6 +2957,7 @@
#f
)
;; og:preserve-this added
(defun dm-game-opengoal-cheat-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg))
(if (= arg1 (debug-menu-msg press))
(logxor! (-> *pc-settings* cheats) (the-as uint (/ arg0 8)))
@@ -3542,14 +3445,9 @@
(a1-7 (car s3-2))
)
(while (not (null? s3-2))
(let ((s2-0 debug-menu-append-item)
(s1-0 s4-2)
(s0-0 debug-menu-make-from-template)
)
(set! sv-16 arg0)
(let ((a1-8 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7))))
(s2-0 s1-0 (s0-0 sv-16 a1-8))
)
(debug-menu-append-item
s4-2
(debug-menu-make-from-template arg0 (debug-menu-make-continue-sub-menu *game-info* (the-as symbol a1-7)))
)
(set! s3-2 (cdr s3-2))
(set! a1-7 (car s3-2))
@@ -3569,6 +3467,7 @@
(flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func)
(flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func)
(flag "Perf" *stats-perf* dm-boolean-toggle-pick-func)
;; og:preserve-this
(flag "Joint" *stats-joint* dm-boolean-toggle-pick-func)
(menu
"Memory Stats"
@@ -4092,6 +3991,7 @@
)
(menu
"Gun"
;; og:preserve-this
(flag "yellow" (the binteger (game-feature gun-yellow)) dm-game-feature-toggle-pick-func)
(flag "red" (the binteger (game-feature gun-red)) dm-game-feature-toggle-pick-func)
(flag "blue" (the binteger (game-feature gun-blue)) dm-game-feature-toggle-pick-func)
+232 -238
View File
@@ -154,9 +154,9 @@
(defmethod clear-history-entries! ((this history))
"Iterates through each [[history-elt]] in the `elt` dynamic array
For each entry:
- clear `timestamp`
- clear `record-tag`"
For each entry:
- clear `timestamp`
- clear `record-tag`"
(set! (-> this alloc-index) 0)
(countdown (v1-0 (-> this allocated-length))
(let ((a1-3 (-> this elts v1-0)))
@@ -176,10 +176,10 @@ For each entry:
;; WARN: new jak 2 until loop case, check carefully
(defmethod clear-record-tags! ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint))
"First grab the latest [[history-elt]] at `alloc-index`
1. update it's `channel`, `record-id` and `owner` from the provided args
2. - if it's `record-tag` is zero -- return it
- otherwise, iterate through all `elts` until one is found that does not match it's `timestamp`
- if not `0` out the `record-tag` for that elt and continue iteration"
1. update it's `channel`, `record-id` and `owner` from the provided args
2. - if it's `record-tag` is zero -- return it
- otherwise, iterate through all `elts` until one is found that does not match it's `timestamp`
- if not `0` out the `record-tag` for that elt and continue iteration"
(let* ((t1-0 (-> this alloc-index))
(v1-0 (-> this elts))
(v0-0 (-> v1-0 t1-0))
@@ -228,9 +228,9 @@ For each entry:
(defmethod update-entries! ((this history-iterator))
"Iterate through each [[history-elt]] in [[*history*]]
- If we hit the end set `done?` to true
- If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f
- However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`"
- If we hit the end set `done?` to true
- If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f
- However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`"
(let ((v1-0 *history*)
(a1-2 (-> *display* base-clock frame-counter))
)
@@ -276,150 +276,143 @@ For each entry:
;; WARN: new jak 2 until loop case, check carefully
(defun history-print ((arg0 history-iterator))
(local-vars
(sv-16 object)
(sv-24 int)
(sv-32 int)
(sv-40 history-elt)
(sv-48 time-frame)
(sv-56 uint)
(sv-64 collide-status)
(sv-72 float)
(sv-80 string)
(sv-96 string)
)
(set! sv-16 (-> arg0 out))
(set! sv-24 -1)
(set! sv-32 0)
(until #f
(set! sv-40 (update-entries! arg0))
(if (not sv-40)
(goto cfg-71)
(let ((sv-16 (-> arg0 out))
(sv-24 -1)
(sv-32 0)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> sv-40 channel)))
(set! sv-48 (frame-counter-delta arg0 sv-40))
(set! sv-56 (-> sv-40 record-id))
(cond
((!= sv-24 sv-48)
(set! sv-24 (the-as int sv-48))
(set! sv-32 (the-as int sv-56))
(format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id))
)
((!= sv-32 sv-56)
(set! sv-32 (the-as int sv-56))
(format sv-16 " ~4X " (-> sv-40 record-id))
)
(else
(format sv-16 " ")
)
)
(let ((v1-22 (-> sv-40 channel)))
(cond
((or (= v1-22 (history-channel trans))
(or (= v1-22 (history-channel transv))
(= v1-22 (history-channel transv-in))
(= v1-22 (history-channel transv-out))
(= v1-22 (history-channel intersect))
(until #f
(let ((sv-40 (update-entries! arg0)))
(if (not sv-40)
(goto cfg-71)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> sv-40 channel)))
(let ((sv-48 (frame-counter-delta arg0 sv-40))
(sv-56 (-> sv-40 record-id))
)
(cond
((!= sv-24 sv-48)
(set! sv-24 (the-as int sv-48))
(set! sv-32 (the-as int sv-56))
(format sv-16 "~3D ~4X " sv-48 (-> sv-40 record-id))
)
((!= sv-32 sv-56)
(set! sv-32 (the-as int sv-56))
(format sv-16 " ~4X " (-> sv-40 record-id))
)
(else
(format sv-16 " ")
)
)
)
(let ((v1-22 (-> sv-40 channel)))
(cond
((or (= v1-22 (history-channel trans))
(or (= v1-22 (history-channel transv))
(= v1-22 (history-channel transv-in))
(= v1-22 (history-channel transv-out))
(= v1-22 (history-channel intersect))
)
)
(format
sv-16
"~-15S: ~14Mm ~14Mm ~14Mm~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
(format
sv-16
"~-15S: ~14Mm ~14Mm ~14Mm~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal)))
(format
sv-16
"~-15S: ~14f ~14f ~14f~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
((= v1-22 (history-channel pat))
(let* ((s2-0 (-> sv-40 vector x))
(s5-2 format)
(s4-2 sv-16)
(s3-2 "~-15S: #x~6X mode:~-8S material:~-10S event:~S~%")
(s1-0 (history-channel->string (-> sv-40 channel)))
(s0-0 s2-0)
)
(set! sv-80 (pat-mode->string (the-as pat-surface s2-0)))
(set! sv-96 (pat-material->string (the-as pat-surface s2-0)))
(let ((t2-0 (pat-event->string (the-as pat-surface s2-0))))
(s5-2 s4-2 s3-2 s1-0 s0-0 sv-80 sv-96 t2-0)
((or (= v1-22 (history-channel local-normal)) (= v1-22 (history-channel surface-normal)))
(format
sv-16
"~-15S: ~14f ~14f ~14f~%"
(history-channel->string (-> sv-40 channel))
(-> sv-40 vector x)
(-> sv-40 vector y)
(-> sv-40 vector z)
)
)
)
)
((= v1-22 (history-channel collide-status))
(set! sv-64 (-> sv-40 collide-status))
(set! sv-72 (-> sv-40 vector z))
(format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64)
(let ((s5-4 sv-64))
(if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background))
(format sv-16 "touch-background ")
((= v1-22 (history-channel pat))
(let ((s2-0 (-> sv-40 vector x)))
(format
sv-16
"~-15S: #x~6X mode:~-8S material:~-10S event:~S~%"
(history-channel->string (-> sv-40 channel))
s2-0
(pat-mode->string (the-as pat-surface s2-0))
(pat-material->string (the-as pat-surface s2-0))
(pat-event->string (the-as pat-surface s2-0))
)
)
(if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface))
(format sv-16 "on-special-surface ")
)
((= v1-22 (history-channel collide-status))
(let ((sv-64 (-> sv-40 collide-status))
(sv-72 (-> sv-40 vector z))
)
(format sv-16 "~-15S: #x~6X " (history-channel->string (-> sv-40 channel)) sv-64)
(let ((s5-4 sv-64))
(if (= (logand s5-4 (collide-status touch-background)) (collide-status touch-background))
(format sv-16 "touch-background ")
)
(if (= (logand s5-4 (collide-status on-special-surface)) (collide-status on-special-surface))
(format sv-16 "on-special-surface ")
)
(if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall))
(format sv-16 "touch-wall ")
)
(if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface))
(format sv-16 "on-surface ")
)
(if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface))
(format sv-16 "impact-surface ")
)
(if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling))
(format sv-16 "touch-ceiling ")
)
(if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground))
(format sv-16 "on-ground ")
)
(if (= (logand s5-4 (collide-status glance)) (collide-status glance))
(format sv-16 "glance ")
)
(if (= (logand s5-4 (collide-status blocked)) (collide-status blocked))
(format sv-16 "blocked ")
)
(if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge))
(format sv-16 "touch-edge ")
)
(if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky))
(format sv-16 "touch-ceiling-sticky ")
)
(if (= (logand s5-4 (collide-status on-water)) (collide-status on-water))
(format sv-16 "on-water ")
)
(if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor))
(format sv-16 "touch-actor ")
)
(if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit))
(format sv-16 "probe-hit ")
)
(if (= (logand s5-4 (collide-status stuck)) (collide-status stuck))
(format sv-16 "stuck ")
)
(if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch))
(format sv-16 "no-touch ")
)
(if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface))
(format sv-16 "touch-surface ")
)
)
(format sv-16 " #x~6X~%" sv-72)
)
(if (= (logand s5-4 (collide-status touch-wall)) (collide-status touch-wall))
(format sv-16 "touch-wall ")
)
((= v1-22 (history-channel friction))
(let ((f30-0 (-> sv-40 vector x)))
(format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0)
)
(if (= (logand s5-4 (collide-status on-surface)) (collide-status on-surface))
(format sv-16 "on-surface ")
)
(if (= (logand s5-4 (collide-status impact-surface)) (collide-status impact-surface))
(format sv-16 "impact-surface ")
)
(if (= (logand s5-4 (collide-status touch-ceiling)) (collide-status touch-ceiling))
(format sv-16 "touch-ceiling ")
)
(if (= (logand s5-4 (collide-status on-ground)) (collide-status on-ground))
(format sv-16 "on-ground ")
)
(if (= (logand s5-4 (collide-status glance)) (collide-status glance))
(format sv-16 "glance ")
)
(if (= (logand s5-4 (collide-status blocked)) (collide-status blocked))
(format sv-16 "blocked ")
)
(if (= (logand s5-4 (collide-status touch-edge)) (collide-status touch-edge))
(format sv-16 "touch-edge ")
)
(if (= (logand s5-4 (collide-status touch-ceiling-sticky)) (collide-status touch-ceiling-sticky))
(format sv-16 "touch-ceiling-sticky ")
)
(if (= (logand s5-4 (collide-status on-water)) (collide-status on-water))
(format sv-16 "on-water ")
)
(if (= (logand s5-4 (collide-status touch-actor)) (collide-status touch-actor))
(format sv-16 "touch-actor ")
)
(if (= (logand (collide-status probe-hit) s5-4) (collide-status probe-hit))
(format sv-16 "probe-hit ")
)
(if (= (logand s5-4 (collide-status stuck)) (collide-status stuck))
(format sv-16 "stuck ")
)
(if (= (logand s5-4 (collide-status no-touch)) (collide-status no-touch))
(format sv-16 "no-touch ")
)
(if (= (logand s5-4 (collide-status touch-surface)) (collide-status touch-surface))
(format sv-16 "touch-surface ")
)
)
(format sv-16 " #x~6X~%" sv-72)
)
((= v1-22 (history-channel friction))
(let ((f30-0 (-> sv-40 vector x)))
(format sv-16 "~-15S: ~f~%" (history-channel->string (-> sv-40 channel)) f30-0)
)
)
)
)
)
)
)
)
@@ -432,113 +425,114 @@ For each entry:
;; WARN: new jak 2 until loop case, check carefully
(defun history-draw ((arg0 history-iterator))
(local-vars (sv-16 vector) (sv-20 vector) (sv-24 pat-surface))
(set! sv-16 (the-as vector #f))
(set! sv-20 (the-as vector #f))
(set! sv-24 (new 'static 'pat-surface))
(until #f
(let ((s5-0 (update-entries! arg0)))
(if (not s5-0)
(goto cfg-34)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
(let* ((f0-0 (get-age arg0 s5-0))
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
)
(case (-> s5-0 channel)
(((history-channel trans))
(if sv-16
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-16
(-> s5-0 vector)
(the-as rgba (logior #xffff00 (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
(let ((sv-16 (the-as vector #f))
(sv-20 (the-as vector #f))
(sv-24 (new 'static 'pat-surface))
)
(until #f
(let ((s5-0 (update-entries! arg0)))
(if (not s5-0)
(goto cfg-34)
)
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
(let* ((f0-0 (get-age arg0 s5-0))
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
)
(set! sv-16 (-> s5-0 vector))
)
(((history-channel intersect))
(if sv-20
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-20
(-> s5-0 vector)
(the-as rgba (logior #xffffff (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
)
(set! sv-20 (-> s5-0 vector))
)
(((history-channel transv))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior (shl v1-8 24) #xff00))
)
)
(((history-channel transv-in))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x408040 (shl v1-8 24)))
)
)
(((history-channel transv-out))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x404080 (shl v1-8 24)))
)
)
(((history-channel local-normal) (history-channel surface-normal))
(let ((t1-7
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
(case (-> s5-0 channel)
(((history-channel trans))
(if sv-16
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-16
(-> s5-0 vector)
(the-as rgba (logior #xffff00 (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
)
(set! sv-16 (-> s5-0 vector))
)
(((history-channel intersect))
(if sv-20
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
sv-20
(-> s5-0 vector)
(the-as rgba (logior #xffffff (shl v1-8 24)))
#f
(the-as rgba -1)
)
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
)
(set! sv-20 (-> s5-0 vector))
)
(((history-channel transv))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 1)
(the-as rgba (logior t1-7 (shl v1-8 24)))
(meters 0.000024414063)
(the-as rgba (logior (shl v1-8 24) #xff00))
)
)
)
(((history-channel pat))
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
)
(((history-channel friction))
(let ((f0-3 (-> s5-0 vector x))
(a3-10 (new 'stack-no-clear 'vector))
)
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
(((history-channel transv-in))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
a3-10
(meters 0.00024414062)
(the-as rgba (logior #xffffff (shl v1-8 24)))
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x408040 (shl v1-8 24)))
)
)
)
(((history-channel transv-out))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 0.000024414063)
(the-as rgba (logior #x404080 (shl v1-8 24)))
)
)
(((history-channel local-normal) (history-channel surface-normal))
(let ((t1-7
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
)
)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
(-> s5-0 vector)
(meters 1)
(the-as rgba (logior t1-7 (shl v1-8 24)))
)
)
)
(((history-channel pat))
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
)
(((history-channel friction))
(let ((f0-3 (-> s5-0 vector x))
(a3-10 (new 'stack-no-clear 'vector))
)
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
(-> s5-0 origin)
a3-10
(meters 0.00024414062)
(the-as rgba (logior #xffffff (shl v1-8 24)))
)
)
)
)
)
)
)
+215 -224
View File
@@ -39,7 +39,7 @@
obj
)
(defmethod mem-usage ((this object) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((this object) (usage memory-usage-block) (flags int))
this
)
@@ -66,9 +66,9 @@
(defun mem-size ((data basic) (inspect-usage? symbol) (arg2 int))
"@param data The [[basic]] to call `mem-usage` on
@param inspect-usage? Set to [[#t]] if `inspect` should be called on the resulting [[memory-usage-block]]
@param arg2 TODO - unsure, some sort of bitfield
@returns The total memory footprint of the provided [[basic]]"
@param inspect-usage? Set to [[#t]] if `inspect` should be called on the resulting [[memory-usage-block]]
@param arg2 TODO - unsure, some sort of bitfield
@returns The total memory footprint of the provided [[basic]]"
(let ((block (new 'stack 'memory-usage-block)))
(mem-usage data block arg2)
(if inspect-usage?
@@ -80,11 +80,11 @@
(defmethod compute-memory-usage! ((this level) (force? symbol))
"Calculates the memory usage of the level, returns and stores the [[memory-usage-block]]
in `mem-usage-block` as well as the total size in `mem-usage`
@param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value
@returns The [[memory-usage-block]] representing the footprint of the level
@see [[memory-usage-block::10]]"
in `mem-usage-block` as well as the total size in `mem-usage`
@param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value
@returns The [[memory-usage-block]] representing the footprint of the level
@see [[memory-usage-block::10]]"
(if (zero? (-> this mem-usage-block))
(set! (-> this mem-usage-block) (new 'debug 'memory-usage-block))
)
@@ -97,23 +97,23 @@ in `mem-usage-block` as well as the total size in `mem-usage`
(-> this mem-usage-block)
)
(defmethod mem-usage ((this process-tree) (arg0 memory-usage-block) (arg1 int))
(defmethod mem-usage ((this process-tree) (usage memory-usage-block) (flags int))
(let ((v1-0 90))
(let* ((a0-1 *dead-pool-list*)
(a3-0 (car a0-1))
)
(while (not (null? a0-1))
(set! (-> arg0 data v1-0 name) (symbol->string (the-as symbol a3-0)))
(set! (-> usage data v1-0 name) (symbol->string (the-as symbol a3-0)))
(+! v1-0 1)
(set! a0-1 (cdr a0-1))
(set! a3-0 (car a0-1))
)
)
(set! (-> arg0 length) (max (-> arg0 length) v1-0))
(set! (-> usage length) (max (-> usage length) v1-0))
)
(set! (-> arg0 data 96 name) "*debug-dead-pool*")
(set! *temp-mem-usage* arg0)
(when (logtest? arg1 32)
(set! (-> usage data 96 name) "*debug-dead-pool*")
(set! *temp-mem-usage* usage)
(when (logtest? flags 32)
(let* ((s5-0 90)
(s4-0 *dead-pool-list*)
(v1-4 (car s4-0))
@@ -311,7 +311,6 @@ in `mem-usage-block` as well as the total size in `mem-usage`
(define *max-dma* 0)
(defmethod print-mem-usage ((this memory-usage-block) (level level) (fmt-dest object))
(local-vars (sv-16 object) (sv-32 string) (sv-48 int))
(let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base)))))
(let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total))))
(< #x10000 v1-2)
@@ -348,218 +347,210 @@ in `mem-usage-block` as well as the total size in `mem-usage`
(if (< (the-as int s2-0) s3-0)
(format fmt-dest "~3L")
)
(let ((s0-0 format))
(set! sv-16 fmt-dest)
(set! sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--")
(let ((s4-1 (-> level name))
(s3-1 (sar s3-0 10))
(s2-1 (shr s2-0 10))
)
(set! sv-48 (sar (memory-used *nk-dead-pool*) 10))
(let ((t2-0 (sar (memory-total *nk-dead-pool*) 10))
(t9-4 s0-0)
(a0-22 sv-16)
(a1-8 sv-32)
(a2-1 s4-1)
(a3-0 s3-1)
(t0-0 s2-1)
(t1-0 sv-48)
)
(t9-4 a0-22 a1-8 a2-1 a3-0 t0-0 t1-0 t2-0)
(format fmt-dest "~5,'-DK/~5,'-DK--~%" (shr s1-0 10) (sar *max-dma* 10))
(when *stats-memory-short*
(let ((s3-2 (if (cpad-hold? 1 l3)
#t
fmt-dest
)
(let* ((s0-0 format)
(sv-16 fmt-dest)
(sv-32 "~0K~10,'-S--~5,'-DK-of-~5,'-DK--~5,'-DK-of-~5,'-DK--")
(s4-1 (-> level name))
(s3-1 (sar s3-0 10))
(s2-1 (shr s2-0 10))
(sv-48 (sar (memory-used *nk-dead-pool*) 10))
(t2-0 (sar (memory-total *nk-dead-pool*) 10))
(t0-0 s2-1)
(t1-0 sv-48)
)
(s0-0 sv-16 sv-32 s4-1 s3-1 t0-0 t1-0 t2-0)
(format fmt-dest "~5,'-DK/~5,'-DK--~%" (shr s1-0 10) (sar *max-dma* 10))
(when *stats-memory-short*
(let ((s3-2 (if (cpad-hold? 1 l3)
#t
fmt-dest
)
(s4-2 format)
(s2-2 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%")
(s1-1 (sar (memory-used *nk-dead-pool*) 10))
(s0-1 (sar (memory-total *nk-dead-pool*) 10))
)
(set! t0-0 (the-as int (compact-time *nk-dead-pool*)))
(set! t1-0 (the-as int (-> *nk-dead-pool* compact-count)))
(set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ)))
(s4-2 s3-2 s2-2 s1-1 s0-1 t0-0 (the-as uint t1-0) (the-as uint t2-0))
)
)
(when (not *stats-memory-short*)
(set! (-> *dma-mem-usage* data 87 total)
(* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16)
)
(let ((t9-11 format)
(a0-31 fmt-dest)
(a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%")
(a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10))
(a3-3 (sar (-> *dma-mem-usage* data 87 total) 10))
)
(t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0))
(format
fmt-dest
" bsp-leaf-vis ~192H~5DK~%"
(sar (+ (-> this data 61 total) (-> this data 62 total)) 10)
(the-as none a3-3)
)
(format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3))
)
(format
fmt-dest
" tfrag ~192H~5DK ~280Htfragment~456H~5DK~%"
(sar
(+ (-> this data 1 total)
(-> this data 2 total)
(-> this data 3 total)
(-> this data 4 total)
(-> this data 5 total)
(-> this data 6 total)
(-> this data 7 total)
(-> this data 8 total)
)
10
)
(sar (-> *dma-mem-usage* data 1 total) 10)
)
(format
fmt-dest
" tie-proto ~192H~5DK ~280Hsky~456H~5DK~%"
(sar
(+ (-> this data 9 total)
(-> this data 10 total)
(-> this data 11 total)
(-> this data 12 total)
(-> this data 13 total)
(-> this data 14 total)
(-> this data 16 total)
(-> this data 17 total)
)
10
)
(sar (-> *dma-mem-usage* data 88 total) 10)
)
(format
fmt-dest
" tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%"
(sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10)
(sar (-> *dma-mem-usage* data 9 total) 10)
)
(format
fmt-dest
" shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%"
(sar
(+ (-> this data 25 total)
(-> this data 26 total)
(-> this data 27 total)
(-> this data 28 total)
(-> this data 29 total)
(-> this data 30 total)
(-> this data 31 total)
(-> this data 32 total)
(-> this data 33 total)
)
10
)
(sar (-> *dma-mem-usage* data 15 total) 10)
)
(format
fmt-dest
" shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%"
(sar (-> this data 34 total) 10)
(sar (-> *dma-mem-usage* data 27 total) 10)
)
(format
fmt-dest
" collision ~192H~5DK ~280Htie-generic~456H~5DK~%"
(sar
(+ (-> this data 50 total)
(-> this data 51 total)
(-> this data 52 total)
(-> this data 53 total)
(-> this data 54 total)
(-> this data 55 total)
(-> this data 56 total)
(-> this data 57 total)
)
10
)
(sar (-> *dma-mem-usage* data 17 total) 10)
)
(format
fmt-dest
" pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%"
(sar
(+ (-> this data 35 total)
(-> this data 36 total)
(-> this data 37 total)
(-> this data 38 total)
(-> this data 39 total)
(-> this data 40 total)
(-> this data 41 total)
(-> this data 42 total)
(-> this data 73 total)
(-> this data 74 total)
(-> this data 75 total)
(-> this data 76 total)
(-> this data 78 total)
(-> this data 81 total)
(-> this data 80 total)
(-> this data 111 total)
)
10
)
(sar (-> *dma-mem-usage* data 35 total) 10)
)
(format
fmt-dest
" pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%"
(sar
(+ (-> this data 67 total)
(-> this data 68 total)
(-> this data 69 total)
(-> this data 70 total)
(-> this data 71 total)
(-> this data 77 total)
(-> this data 79 total)
(-> this data 72 total)
)
10
)
(sar (-> *dma-mem-usage* data 89 total) 10)
)
(format
fmt-dest
" textures ~192H~5DK ~280Htextures~456H~5DK~%"
(sar (-> this data 82 total) 10)
(sar (-> *dma-mem-usage* data 82 total) 10)
)
(format fmt-dest " entity ~192H~5DK~%" (sar
(+ (-> this data 66 total)
(-> this data 43 total)
(-> this data 44 total)
(-> this data 45 total)
(-> this data 49 total)
(-> this data 48 total)
(-> this data 46 total)
(-> this data 47 total)
)
10
)
)
(format
fmt-dest
" misc ~192H~5DK ~280Hsprite~456H~5DK~%"
(sar
(+ (-> this data 0 total)
(-> this data 63 total)
(-> this data 64 total)
(-> this data 83 total)
(-> this data 84 total)
)
10
)
(sar (-> *dma-mem-usage* data 85 total) 10)
(s4-2 format)
(s2-2 "heap-~5,'-DK/~5,'-DK----~D---~D/~D~%")
(s1-1 (sar (memory-used *nk-dead-pool*) 10))
(s0-1 (sar (memory-total *nk-dead-pool*) 10))
)
(set! t0-0 (the-as int (compact-time *nk-dead-pool*)))
(set! t1-0 (the-as int (-> *nk-dead-pool* compact-count)))
(set! t2-0 (the-as int (-> *nk-dead-pool* compact-count-targ)))
(s4-2 s3-2 s2-2 s1-1 s0-1 t0-0 (the-as uint t1-0) (the-as uint t2-0))
)
)
(when (not *stats-memory-short*)
(set! (-> *dma-mem-usage* data 87 total)
(* (dma-buffer-length (-> *display* frames (-> *display* last-screen) debug-buf)) 16)
)
(let ((t9-11 format)
(a0-31 fmt-dest)
(a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%")
(a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10))
(a3-3 (sar (-> *dma-mem-usage* data 87 total) 10))
)
(t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0))
(format
fmt-dest
" bsp-leaf-vis ~192H~5DK~%"
(sar (+ (-> this data 61 total) (-> this data 62 total)) 10)
(the-as none a3-3)
)
(format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3))
)
(format
fmt-dest
" tfrag ~192H~5DK ~280Htfragment~456H~5DK~%"
(sar
(+ (-> this data 1 total)
(-> this data 2 total)
(-> this data 3 total)
(-> this data 4 total)
(-> this data 5 total)
(-> this data 6 total)
(-> this data 7 total)
(-> this data 8 total)
)
10
)
(sar (-> *dma-mem-usage* data 1 total) 10)
)
(format
fmt-dest
" tie-proto ~192H~5DK ~280Hsky~456H~5DK~%"
(sar
(+ (-> this data 9 total)
(-> this data 10 total)
(-> this data 11 total)
(-> this data 12 total)
(-> this data 13 total)
(-> this data 14 total)
(-> this data 16 total)
(-> this data 17 total)
)
10
)
(sar (-> *dma-mem-usage* data 88 total) 10)
)
(format
fmt-dest
" tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%"
(sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10)
(sar (-> *dma-mem-usage* data 9 total) 10)
)
(format
fmt-dest
" shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%"
(sar
(+ (-> this data 25 total)
(-> this data 26 total)
(-> this data 27 total)
(-> this data 28 total)
(-> this data 29 total)
(-> this data 30 total)
(-> this data 31 total)
(-> this data 32 total)
(-> this data 33 total)
)
10
)
(sar (-> *dma-mem-usage* data 15 total) 10)
)
(format
fmt-dest
" shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%"
(sar (-> this data 34 total) 10)
(sar (-> *dma-mem-usage* data 27 total) 10)
)
(format
fmt-dest
" collision ~192H~5DK ~280Htie-generic~456H~5DK~%"
(sar
(+ (-> this data 50 total)
(-> this data 51 total)
(-> this data 52 total)
(-> this data 53 total)
(-> this data 54 total)
(-> this data 55 total)
(-> this data 56 total)
(-> this data 57 total)
)
10
)
(sar (-> *dma-mem-usage* data 17 total) 10)
)
(format
fmt-dest
" pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%"
(sar
(+ (-> this data 35 total)
(-> this data 36 total)
(-> this data 37 total)
(-> this data 38 total)
(-> this data 39 total)
(-> this data 40 total)
(-> this data 41 total)
(-> this data 42 total)
(-> this data 73 total)
(-> this data 74 total)
(-> this data 75 total)
(-> this data 76 total)
(-> this data 78 total)
(-> this data 81 total)
(-> this data 80 total)
(-> this data 111 total)
)
10
)
(sar (-> *dma-mem-usage* data 35 total) 10)
)
(format
fmt-dest
" pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%"
(sar
(+ (-> this data 67 total)
(-> this data 68 total)
(-> this data 69 total)
(-> this data 70 total)
(-> this data 71 total)
(-> this data 77 total)
(-> this data 79 total)
(-> this data 72 total)
)
10
)
(sar (-> *dma-mem-usage* data 89 total) 10)
)
(format
fmt-dest
" textures ~192H~5DK ~280Htextures~456H~5DK~%"
(sar (-> this data 82 total) 10)
(sar (-> *dma-mem-usage* data 82 total) 10)
)
(format fmt-dest " entity ~192H~5DK~%" (sar
(+ (-> this data 66 total)
(-> this data 43 total)
(-> this data 44 total)
(-> this data 45 total)
(-> this data 49 total)
(-> this data 48 total)
(-> this data 46 total)
(-> this data 47 total)
)
10
)
)
(format
fmt-dest
" misc ~192H~5DK ~280Hsprite~456H~5DK~%"
(sar
(+ (-> this data 0 total)
(-> this data 63 total)
(-> this data 64 total)
(-> this data 83 total)
(-> this data 84 total)
)
10
)
(sar (-> *dma-mem-usage* data 85 total) 10)
)
)
)
+50 -107
View File
@@ -505,18 +505,7 @@
;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16
;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16
(defun debug-menu-make-from-template ((arg0 debug-menu-context) (arg1 pair))
(local-vars
(s4-0 debug-menu-node)
(sv-16 object)
(sv-32 (function object int int))
(sv-48 int)
(sv-64 (function object int int))
(sv-80 (function object float float))
(sv-96 float)
(sv-112 (function object float float))
(sv-128 float)
(sv-144 (function object int int))
)
(local-vars (s4-0 debug-menu-node))
(when (or (not arg1) (null? arg1))
(set! s4-0 (the-as debug-menu-node #f))
(goto cfg-39)
@@ -591,79 +580,44 @@
)
)
((or (= s5-0 'int-var) (= s5-0 'int-var-gat1) (= s5-0 'hex-var))
(set! s4-0 (new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
)
(let ((s3-4 debug-menu-item-var-make-int)
(s2-3 (the-as debug-menu-item-var s4-0))
(s1-3 (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(s0-2 (command-get-int (ref arg1 5) 0))
)
(set! sv-16 (ref arg1 6))
(set! sv-32 command-get-int)
(let ((a0-24 (ref arg1 7))
(a1-18 0)
(set! s4-0
(new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
(set! sv-48 (sv-32 a0-24 a1-18))
)
(set! sv-64 command-get-int)
(let* ((a0-26 (ref arg1 8))
(a1-20 0)
(t1-0 (sv-64 a0-26 a1-20))
(t2-0 (= s5-0 'hex-var))
)
(s3-4 s2-3 (the-as (function int debug-menu-msg int int int) s1-3) s0-2 (the-as symbol sv-16) sv-48 t1-0 t2-0)
)
)
(debug-menu-item-var-make-int
(the-as debug-menu-item-var s4-0)
(the-as (function int debug-menu-msg int int int) (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(command-get-int (ref arg1 5) 0)
(the-as symbol (ref arg1 6))
(command-get-int (ref arg1 7) 0)
(command-get-int (ref arg1 8) 0)
(= s5-0 'hex-var)
)
s4-0
)
((= s5-0 'float-var)
(set! s4-0 (new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
)
(let ((s5-5 debug-menu-item-var-make-float)
(s3-6 (the-as debug-menu-item-var s4-0))
(s2-5 (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(s1-6 (command-get-float (ref arg1 5) 0.0))
(s0-3 (ref arg1 6))
)
(set! sv-80 command-get-float)
(let ((a0-35 (ref arg1 7))
(a1-28 0.0)
(set! s4-0
(new
'debug
'debug-menu-item-var
(the-as string s4-1)
(the-as int (car (cdr (cdr arg1))))
(the-as int (ref arg1 4))
)
(set! sv-96 (sv-80 a0-35 a1-28))
)
(set! sv-112 command-get-float)
(let ((a0-37 (ref arg1 8))
(a1-30 0.0)
)
(set! sv-128 (sv-112 a0-37 a1-30))
)
(set! sv-144 command-get-int)
(let* ((a0-39 (ref arg1 9))
(a1-32 0)
(t2-1 (sv-144 a0-39 a1-32))
)
(s5-5
s3-6
(the-as (function int debug-menu-msg float float float) s2-5)
s1-6
(the-as symbol s0-3)
sv-96
sv-128
t2-1
)
)
(debug-menu-item-var-make-float
(the-as debug-menu-item-var s4-0)
(the-as (function int debug-menu-msg float float float) (debug-menu-func-decode (car (cdr (cdr (cdr arg1))))))
(command-get-float (ref arg1 5) 0.0)
(the-as symbol (ref arg1 6))
(command-get-float (ref arg1 7) 0.0)
(command-get-float (ref arg1 8) 0.0)
(command-get-int (ref arg1 9) 0)
)
s4-0
)
@@ -845,13 +799,7 @@
(draw-string "..." s1-0 s5-0)
(set! arg4 (and (zero? arg3) arg4))
(when arg4
(let ((v1-14 s5-0)
(a1-5 20)
(a0-8 379)
)
(set! (-> v1-14 origin x) (the float a1-5))
(set! (-> v1-14 origin y) (the float a0-8))
)
(set-origin! s5-0 20 379)
(draw-string-adv (-> arg0 name) s1-0 s5-0)
(draw-string-adv ":" s1-0 s5-0)
(draw-string (-> arg0 display-str) s1-0 s5-0)
@@ -892,7 +840,6 @@
)
(defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int))
(local-vars (sv-16 dma-buffer) (sv-32 pointer))
(let ((v1-0 0))
(let* ((a0-1 (-> arg0 items))
(a1-1 (car a0-1))
@@ -929,28 +876,24 @@
(font-color menu)
)
)
(let ((v1-20 (-> arg0 context font))
(a1-5 s3-1)
(a0-15 s2-1)
(set-origin! (-> arg0 context font) s3-1 s2-1)
(let* ((sv-16 (-> *display* frames (-> *display* on-screen) debug-buf))
(sv-32 (-> sv-16 base))
)
(draw-string ">" sv-16 (-> arg0 context font))
(let ((a3-3 (-> sv-16 base)))
(let ((v1-32 (the-as object (-> sv-16 base))))
(set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag))
(set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id debug3)
sv-32
(the-as (pointer dma-tag) a3-3)
)
(set! (-> v1-20 origin x) (the float a1-5))
(set! (-> v1-20 origin y) (the float a0-15))
)
(set! sv-16 (-> *display* frames (-> *display* on-screen) debug-buf))
(set! sv-32 (-> sv-16 base))
(draw-string ">" sv-16 (-> arg0 context font))
(let ((a3-3 (-> sv-16 base)))
(let ((v1-32 (the-as object (-> sv-16 base))))
(set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag))
(set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(bucket-id debug3)
sv-32
(the-as (pointer dma-tag) a3-3)
)
)
)
+261 -184
View File
@@ -238,7 +238,7 @@
(defmethod alloc-new-node! ((this mysql-nav-graph))
"Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1`
otherwise, return the new size of the array"
otherwise, return the new size of the array"
(cond
((>= (-> this node-array length) 3000)
(format #t "mysql-nav-graph : nodes buffer too small, increase NAV_GRAPH_EDITOR_NODE_COUNT~%")
@@ -262,7 +262,7 @@ otherwise, return the new size of the array"
(defmethod alloc-new-edge! ((this mysql-nav-graph))
"Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1`
otherwise, return the new size of the array"
otherwise, return the new size of the array"
(cond
((>= (-> this edge-array length) 5000)
(format #t "mysql-nav-graph : edges buffer too small, increase NAV_GRAPH_EDITOR_EDGE_COUNT~%")
@@ -286,7 +286,7 @@ otherwise, return the new size of the array"
(defmethod indexof-visnode ((this mysql-nav-graph) (edge-id int) (node-id int))
"Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id`
if none exist, return `-1`"
if none exist, return `-1`"
(dotimes (v1-0 (-> this visnode-array length))
(let ((a3-2 (-> this visnode-array data v1-0)))
(if (and (= (-> a3-2 runtime-edge-id) edge-id) (= (-> a3-2 runtime-node-id) node-id))
@@ -299,9 +299,9 @@ if none exist, return `-1`"
(defmethod alloc-new-visnode! ((this mysql-nav-graph) (edge-id int) (node-id int))
"Potentially allocates a new `[[mysql-nav-visnode]]`:
- if `visnode-array`'s `length` exceeds `3000` return `-1`
- otherwise, if the node already exists, TODO
- if the node does not already exist, create it!"
- if `visnode-array`'s `length` exceeds `3000` return `-1`
- otherwise, if the node already exists, TODO
- if the node does not already exist, create it!"
(cond
((>= (-> this visnode-array length) 3000)
(format #t "mysql-nav-graph : visnodes buffer too small, increase NAV_GRAPH_EDITOR_VISNODE_COUNT~%")
@@ -697,7 +697,7 @@ if none exist, return `-1`"
(defmethod indexof-nav-node ((this mysql-nav-graph) (node-id int))
"Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id
returns `-1` if none is found"
returns `-1` if none is found"
(dotimes (v1-0 (-> this node-array length))
(if (= node-id (-> (the-as mysql-nav-node (-> this node-array data v1-0)) nav_node_id))
(return v1-0)
@@ -708,7 +708,7 @@ returns `-1` if none is found"
(defmethod indexof-nav-edge ((this mysql-nav-graph) (edge-id int))
"Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id
returns `-1` if none is found"
returns `-1` if none is found"
(dotimes (v1-0 (-> this edge-array length))
(if (= edge-id (-> (the-as mysql-nav-edge (-> this edge-array data v1-0)) nav_edge_id))
(return v1-0)
@@ -726,7 +726,6 @@ returns `-1` if none is found"
;; WARN: new jak 2 until loop case, check carefully
(defmethod init-from-sql! ((this mysql-nav-graph) (arg0 string) (arg1 string))
"Query the database and initialize the [[mysql-nav-graph]] and all it's related components"
(local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int))
(set! (-> this node-array length) 0)
(set! (-> this edge-array length) 0)
(set! (-> this visnode-array length) 0)
@@ -774,35 +773,36 @@ returns `-1` if none is found"
(set! (-> nav-node angle) (* 182.04445 (string->float (-> s2-1 data (+ s1-0 5)))))
(set! (-> nav-node radius) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 6)))))
(set! (-> nav-node nav_node_flag) (nav-node-flag))
(set! sv-16 (new 'global 'string 0 (-> s2-1 data (+ s1-0 7))))
(copy-string<-string sv-16 (-> s2-1 data (+ s1-0 7)))
(until #f
(cond
((string-prefix= "visited" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag visited))
)
((string-prefix= "blocked" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag blocked))
)
((string-prefix= "pedestrian" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag pedestrian))
)
((string-prefix= "selected" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag selected))
)
((string-prefix= "hidden" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag hidden))
)
(else
#t
(goto cfg-27)
)
)
(let ((a1-16 (string-skip-to-char (-> sv-16 data) (the-as uint 44))))
(if (= (-> a1-16 0) 44)
(set! a1-16 (&-> a1-16 1))
(let ((sv-16 (new 'global 'string 0 (-> s2-1 data (+ s1-0 7)))))
(copy-string<-string sv-16 (-> s2-1 data (+ s1-0 7)))
(until #f
(cond
((string-prefix= "visited" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag visited))
)
((string-prefix= "blocked" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag blocked))
)
((string-prefix= "pedestrian" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag pedestrian))
)
((string-prefix= "selected" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag selected))
)
((string-prefix= "hidden" sv-16)
(logior! (-> nav-node nav_node_flag) (nav-node-flag hidden))
)
(else
#t
(goto cfg-27)
)
(string-suck-up! sv-16 a1-16)
)
(let ((a1-16 (string-skip-to-char (-> sv-16 data) (the-as uint 44))))
(if (= (-> a1-16 0) 44)
(set! a1-16 (&-> a1-16 1))
)
(string-suck-up! sv-16 a1-16)
)
)
)
#f
@@ -846,155 +846,155 @@ returns `-1` if none is found"
(let ((s2-2 0))
(while (< s2-2 (-> s3-3 len))
(when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> this nav_graph_id))
(let ((s0-2 (string->int (-> s3-3 data (+ s2-2 1)))))
(set! sv-32 (string->int (-> s3-3 data (+ s2-2 2))))
(set! sv-48 (indexof-nav-node this s0-2))
(set! sv-64 (indexof-nav-node this sv-32))
(let ((nav-edge (-> this edge-array data (-> this edge-array length))))
(when (and (!= sv-48 -1) (!= sv-64 -1))
(set! (-> nav-edge nav_graph_id) (-> this nav_graph_id))
(set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2))))
(set! (-> nav-edge nav_node_id_1) (the-as uint s0-2))
(set! (-> nav-edge nav_node_id_2) (the-as uint sv-32))
(set! (-> nav-edge mysql-save-flag) (mysql-save-flag))
(set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length)))
(set! (-> nav-edge runtime-node-id-1) sv-48)
(set! (-> nav-edge runtime-node-id-2) sv-64)
(let ((s0-3 (-> s3-3 data (+ s2-2 3))))
(cond
((string= "default" s0-3)
(set! (-> nav-edge directionality) (nav-directionality default))
0
)
((string= "directed" s0-3)
(set! (-> nav-edge directionality) (nav-directionality directed))
)
((string= "bi_directional" s0-3)
(set! (-> nav-edge directionality) (nav-directionality bi_directional))
)
)
(let* ((s0-2 (string->int (-> s3-3 data (+ s2-2 1))))
(sv-32 (string->int (-> s3-3 data (+ s2-2 2))))
(sv-48 (indexof-nav-node this s0-2))
(sv-64 (indexof-nav-node this sv-32))
(nav-edge (-> this edge-array data (-> this edge-array length)))
)
(when (and (!= sv-48 -1) (!= sv-64 -1))
(set! (-> nav-edge nav_graph_id) (-> this nav_graph_id))
(set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2))))
(set! (-> nav-edge nav_node_id_1) (the-as uint s0-2))
(set! (-> nav-edge nav_node_id_2) (the-as uint sv-32))
(set! (-> nav-edge mysql-save-flag) (mysql-save-flag))
(set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length)))
(set! (-> nav-edge runtime-node-id-1) sv-48)
(set! (-> nav-edge runtime-node-id-2) sv-64)
(let ((s0-3 (-> s3-3 data (+ s2-2 3))))
(cond
((string= "default" s0-3)
(set! (-> nav-edge directionality) (nav-directionality default))
0
)
((string= "directed" s0-3)
(set! (-> nav-edge directionality) (nav-directionality directed))
)
((string= "bi_directional" s0-3)
(set! (-> nav-edge directionality) (nav-directionality bi_directional))
)
)
(set! (-> nav-edge speed_limit) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 4)))))
(set! (-> nav-edge density) (string->float (-> s3-3 data (+ s2-2 5))))
(set! (-> nav-edge traffic_edge_flag) 0)
(let ((s0-4 (new 'global 'string 0 (-> s3-3 data (+ s2-2 6)))))
(copy-string<-string s0-4 (-> s3-3 data (+ s2-2 6)))
(until #f
(cond
((string-prefix= "pedestrian" s0-4)
(logior! (-> nav-edge traffic_edge_flag) 1)
)
(else
#t
(goto cfg-58)
)
)
(let ((a1-30 (string-skip-to-char (-> s0-4 data) (the-as uint 44))))
(if (= (-> a1-30 0) 44)
(set! a1-30 (&-> a1-30 1))
)
(string-suck-up! s0-4 a1-30)
)
)
)
#f
(label cfg-58)
(set! (-> nav-edge nav_clock_mask) (nav-clock-mask))
(let ((s0-5 (new 'global 'string 0 (-> s3-3 data (+ s2-2 7)))))
(copy-string<-string s0-5 (-> s3-3 data (+ s2-2 7)))
(until #f
(cond
((string-prefix= "phase-1a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1a))
)
((string-prefix= "phase-1" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1))
)
((string-prefix= "phase-2a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2a))
)
((string-prefix= "phase-2" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2))
)
((string-prefix= "phase-3a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3a))
)
((string-prefix= "phase-3" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3))
)
((string-prefix= "phase-4a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4a))
)
((string-prefix= "phase-4" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4))
)
(else
#t
(goto cfg-80)
)
)
(let ((a1-42 (string-skip-to-char (-> s0-5 data) (the-as uint 44))))
(if (= (-> a1-42 0) 44)
(set! a1-42 (&-> a1-42 1))
)
(string-suck-up! s0-5 a1-42)
)
)
)
#f
(label cfg-80)
(let ((s0-6 (-> s3-3 data (+ s2-2 8))))
(cond
((string= "no-clock" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type no-clock))
0
)
((string= "clock2" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock2))
)
((string= "clock3" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock3))
)
((string= "clock4" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock4))
)
)
)
(set! (-> nav-edge width) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 9)))))
(set! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag))
(let ((s0-7 (new 'global 'string 0 (-> s3-3 data (+ s2-2 10)))))
(copy-string<-string s0-7 (-> s3-3 data (+ s2-2 10)))
(until #f
(cond
((string-prefix= "pass-red" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-red))
)
((string-prefix= "pass-green" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-green))
)
((string-prefix= "pass-yellow" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-yellow))
)
((string-prefix= "pass-blue" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-blue))
)
(else
#t
(goto cfg-102)
)
)
(let ((a1-54 (string-skip-to-char (-> s0-7 data) (the-as uint 44))))
(if (= (-> a1-54 0) 44)
(set! a1-54 (&-> a1-54 1))
)
(string-suck-up! s0-7 a1-54)
)
)
)
#f
(label cfg-102)
(+! (-> this edge-array length) 1)
)
(set! (-> nav-edge speed_limit) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 4)))))
(set! (-> nav-edge density) (string->float (-> s3-3 data (+ s2-2 5))))
(set! (-> nav-edge traffic_edge_flag) 0)
(let ((s0-4 (new 'global 'string 0 (-> s3-3 data (+ s2-2 6)))))
(copy-string<-string s0-4 (-> s3-3 data (+ s2-2 6)))
(until #f
(cond
((string-prefix= "pedestrian" s0-4)
(logior! (-> nav-edge traffic_edge_flag) 1)
)
(else
#t
(goto cfg-58)
)
)
(let ((a1-30 (string-skip-to-char (-> s0-4 data) (the-as uint 44))))
(if (= (-> a1-30 0) 44)
(set! a1-30 (&-> a1-30 1))
)
(string-suck-up! s0-4 a1-30)
)
)
)
#f
(label cfg-58)
(set! (-> nav-edge nav_clock_mask) (nav-clock-mask))
(let ((s0-5 (new 'global 'string 0 (-> s3-3 data (+ s2-2 7)))))
(copy-string<-string s0-5 (-> s3-3 data (+ s2-2 7)))
(until #f
(cond
((string-prefix= "phase-1a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1a))
)
((string-prefix= "phase-1" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-1))
)
((string-prefix= "phase-2a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2a))
)
((string-prefix= "phase-2" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-2))
)
((string-prefix= "phase-3a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3a))
)
((string-prefix= "phase-3" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-3))
)
((string-prefix= "phase-4a" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4a))
)
((string-prefix= "phase-4" s0-5)
(logior! (-> nav-edge nav_clock_mask) (nav-clock-mask phase-4))
)
(else
#t
(goto cfg-80)
)
)
(let ((a1-42 (string-skip-to-char (-> s0-5 data) (the-as uint 44))))
(if (= (-> a1-42 0) 44)
(set! a1-42 (&-> a1-42 1))
)
(string-suck-up! s0-5 a1-42)
)
)
)
#f
(label cfg-80)
(let ((s0-6 (-> s3-3 data (+ s2-2 8))))
(cond
((string= "no-clock" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type no-clock))
0
)
((string= "clock2" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock2))
)
((string= "clock3" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock3))
)
((string= "clock4" s0-6)
(set! (-> nav-edge nav_clock_type) (nav-clock-type clock4))
)
)
)
(set! (-> nav-edge width) (* 4096.0 (string->float (-> s3-3 data (+ s2-2 9)))))
(set! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag))
(let ((s0-7 (new 'global 'string 0 (-> s3-3 data (+ s2-2 10)))))
(copy-string<-string s0-7 (-> s3-3 data (+ s2-2 10)))
(until #f
(cond
((string-prefix= "pass-red" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-red))
)
((string-prefix= "pass-green" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-green))
)
((string-prefix= "pass-yellow" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-yellow))
)
((string-prefix= "pass-blue" s0-7)
(logior! (-> nav-edge minimap_edge_flag) (nav-minimap-edge-flag pass-blue))
)
(else
#t
(goto cfg-102)
)
)
(let ((a1-54 (string-skip-to-char (-> s0-7 data) (the-as uint 44))))
(if (= (-> a1-54 0) 44)
(set! a1-54 (&-> a1-54 1))
)
(string-suck-up! s0-7 a1-54)
)
)
)
#f
(label cfg-102)
(+! (-> this edge-array length) 1)
)
)
)
@@ -1168,6 +1168,43 @@ returns `-1` if none is found"
)
)
(defmethod mysql-nav-graph-method-19 ((this mysql-nav-graph))
(set! (-> this level-info-array-length) 0)
(set! (-> this level-info-last-lookup) 0)
(dotimes (v1-0 32)
(let ((a0-3 (-> this level-info-array v1-0)))
(set! (-> a0-3 level) #f)
(set! (-> a0-3 level-id) (the-as uint v1-0))
(set! (-> a0-3 node-count) 0)
(set! (-> a0-3 branch-count) 0)
(set! (-> a0-3 to-link-count) 0)
)
0
)
(dotimes (s5-0 (-> this node-array length))
(let ((s4-0 (-> this node-array data s5-0)))
(when (not (logtest? (-> s4-0 mysql-save-flag) (mysql-save-flag delete)))
(let ((v1-10 (lookup-level-info2 this s4-0 #t)))
(set! (-> s4-0 level-node-index) (-> v1-10 node-count))
(+! (-> v1-10 node-count) 1)
(let ((a0-10 (the-as mysql-nav-edge (-> s4-0 temp-edge-list))))
(while a0-10
(when (not (logtest? (-> a0-10 mysql-save-flag) (mysql-save-flag delete)))
(if (!= (-> v1-10 level) (-> this node-array data (-> a0-10 runtime-node-id-2) level_name))
(+! (-> v1-10 to-link-count) 1)
)
(+! (-> v1-10 branch-count) 1)
)
(set! a0-10 (-> a0-10 temp-next-edge))
)
)
)
)
)
)
0
(none)
)
(defmethod mysql-nav-graph-method-20 ((this mysql-nav-graph))
(mysql-nav-graph-method-17 this)
@@ -1175,3 +1212,43 @@ returns `-1` if none is found"
0
(none)
)
(defmethod exec-sql! ((this mysql-nav-graph))
(format #t "Saving nodes ...~%")
(dotimes (s5-0 (-> this node-array length))
(let ((a0-3 (-> this node-array data s5-0)))
(set! (-> a0-3 nav_graph_id) (-> this nav_graph_id))
(if (not (exec-sql! a0-3))
(return #f)
)
)
)
(format #t "Done.~%")
(format #t "Saving edges ...~%")
(dotimes (s5-1 (-> this edge-array length))
(let ((a0-7 (-> this edge-array data s5-1)))
(set! (-> a0-7 nav_graph_id) (-> this nav_graph_id))
(set! (-> a0-7 nav_node_id_1) (-> this node-array data (-> a0-7 runtime-node-id-1) nav_node_id))
(set! (-> a0-7 nav_node_id_2) (-> this node-array data (-> a0-7 runtime-node-id-2) nav_node_id))
(exec-sql! a0-7)
)
)
(format #t "Done.~%")
(format #t "Saving visible nodes ...~%")
(dotimes (s5-2 (-> this visnode-array length))
(let ((a0-11 (-> this visnode-array data s5-2)))
(set! (-> a0-11 nav_graph_id) (-> this nav_graph_id))
(set! (-> a0-11 nav_node_id) (-> this node-array data (-> a0-11 runtime-node-id) nav_node_id))
(set! (-> a0-11 nav_edge_id)
(-> (the-as mysql-nav-edge (+ (the-as uint (-> this edge-array)) (* 80 (-> a0-11 runtime-edge-id))))
nav_node_id_2
)
)
(if (not (exec-sql! a0-11))
(return #f)
)
)
)
(format #t "Done.~%")
#t
)
+131 -157
View File
@@ -191,12 +191,7 @@
(dotimes (s2-0 (-> s3-0 length))
(let ((s1-0 (-> s3-0 s2-0)))
(-> s1-0 aid)
(let* ((s0-0 s1-0)
(v1-14 (if (type? s0-0 entity-nav-mesh)
s0-0
)
)
)
(let ((v1-14 (as-type s1-0 entity-nav-mesh)))
(when v1-14
(let ((a0-7 (-> v1-14 nav-mesh))
(a1-2 (new 'stack-no-clear 'nav-find-poly-parms))
@@ -261,28 +256,25 @@
(let ((v1-23 (-> this nav-graph visnode-array data s3-1)))
(when (and (= (-> v1-23 runtime-edge-id) arg0) (not (logtest? (-> v1-23 mysql-save-flag) (mysql-save-flag delete))))
(vector-!
(the-as vector (-> s4-0 vector))
(-> s4-0 vector 0)
(the-as
vector
(+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> v1-23 runtime-node-id)))
)
(-> s4-0 trans)
)
(vector-normalize!
(the-as vector (-> s4-0 vector))
(fmax 15360.0 (+ -15360.0 (vector-length (the-as vector (-> s4-0 vector)))))
)
(vector-rotate-around-y! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) 24576.0)
(vector-normalize! (-> s4-0 vector 0) (fmax 15360.0 (+ -15360.0 (vector-length (-> s4-0 vector 0)))))
(vector-rotate-around-y! (-> s4-0 vector 1) (-> s4-0 vector 0) 24576.0)
(vector-normalize! (-> s4-0 vector 1) 16384.0)
(vector-rotate-around-y! (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)) -24576.0)
(vector-rotate-around-y! (-> s4-0 vector 2) (-> s4-0 vector 0) -24576.0)
(vector-normalize! (-> s4-0 vector 2) 16384.0)
(vector+! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector)) (-> s4-0 trans))
(vector+! (-> s4-0 vector 2) (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)))
(vector+! (-> s4-0 vector 1) (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)))
(vector+! (-> s4-0 vector 0) (-> s4-0 vector 0) (-> s4-0 trans))
(vector+! (-> s4-0 vector 2) (-> s4-0 vector 2) (-> s4-0 vector 0))
(vector+! (-> s4-0 vector 1) (-> s4-0 vector 1) (-> s4-0 vector 0))
(add-debug-line
#t
(bucket-id debug2)
(the-as vector (-> s4-0 vector))
(-> s4-0 vector 0)
(-> s4-0 vector 1)
*color-light-yellow*
#f
@@ -291,7 +283,7 @@
(add-debug-line
#t
(bucket-id debug2)
(the-as vector (-> s4-0 vector))
(-> s4-0 vector 0)
(-> s4-0 vector 2)
*color-light-yellow*
#f
@@ -306,12 +298,12 @@
#f
(the-as rgba -1)
)
(vector-lerp! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s4-0 vector 2) 0.5)
(vector-lerp! (-> s4-0 vector 0) (-> s4-0 vector 1) (-> s4-0 vector 2) 0.5)
(add-debug-line
#t
(bucket-id debug2)
(-> s4-0 trans)
(the-as vector (-> s4-0 vector))
(-> s4-0 vector 0)
*color-light-yellow*
#f
(the-as rgba -1)
@@ -434,7 +426,6 @@
)
(defmethod nav-graph-editor-method-28 ((this nav-graph-editor))
(local-vars (sv-144 int) (sv-160 (function _varargs_ object)))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -455,11 +446,7 @@
(set! (-> v1-8 w) (-> s2-0 radius))
)
(set! (-> s2-0 cam-dist) (vector-vector-distance-squared s3-0 (camera-pos)))
(let ((f0-6 (-> s2-0 cam-dist))
(f1-0 (-> this clipping-dist))
)
(set! (-> s2-0 visible) (< f0-6 (* f1-0 f1-0)))
)
(set! (-> s2-0 visible) (< (-> s2-0 cam-dist) (square (-> this clipping-dist))))
(if (or (and (-> this vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))
(and (not (-> this vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))))
)
@@ -494,48 +481,46 @@
(add-debug-x #t (bucket-id debug2) s3-0 *color-red*)
(let ((s1-1 add-debug-text-3d)
(s0-1 #t)
(sv-144 324)
)
(set! sv-144 324)
(set! sv-160 format)
(let ((a0-16 (clear *temp-string*))
(a1-8 "~D")
(a2-6 (-> s2-0 nav_mesh_id))
(format (clear *temp-string*) "~D" (-> s2-0 nav_mesh_id))
(let ((a2-7 *temp-string*)
(a3-2 s3-0)
(v1-24 (-> s2-0 level_name))
)
(sv-160 a0-16 a1-8 a2-6)
)
(let* ((a2-7 *temp-string*)
(a3-2 s3-0)
(v1-24 (-> s2-0 level_name))
(t0-1 (cond
((= v1-24 'ctyport)
3
)
((= v1-24 'ctyinda)
4
)
((= v1-24 'ctyindb)
5
)
((= v1-24 'ctypal)
6
)
((= v1-24 'ctysluma)
7
)
((= v1-24 'ctyslumb)
8
)
((= v1-24 'ctyslumc)
9
)
(else
1
)
)
)
(t1-0 #f)
(s1-1
s0-1
(the-as bucket-id sv-144)
a2-7
a3-2
(cond
((= v1-24 'ctyport)
(font-color red)
)
(s1-1 s0-1 (the-as bucket-id sv-144) a2-7 a3-2 (the-as font-color t0-1) (the-as vector2h t1-0))
((= v1-24 'ctyinda)
(font-color orange)
)
((= v1-24 'ctyindb)
(font-color yellow)
)
((= v1-24 'ctypal)
(font-color green)
)
((= v1-24 'ctysluma)
(font-color blue)
)
((= v1-24 'ctyslumb)
(font-color cyan)
)
((= v1-24 'ctyslumc)
(font-color pink)
)
(else
(font-color white)
)
)
(the-as vector2h #f)
)
)
)
(let ((s1-2 (new 'stack-no-clear 'vector)))
@@ -681,10 +666,7 @@
(dotimes (s2-1 (-> s3-3 length))
(let* ((s0-1 (-> s3-3 s2-1))
(s1-1 (-> s0-1 aid))
(v1-28 (if (type? s0-1 entity-nav-mesh)
s0-1
)
)
(v1-28 (as-type s0-1 entity-nav-mesh))
)
(when v1-28
(let ((a0-24 (-> v1-28 nav-mesh))
@@ -755,7 +737,7 @@
)
)
((and (-> this next-state) (= (-> this next-state name) 'move-plane))
(vector-cross! s3-0 *up-vector* (the-as vector (-> (camera-matrix) vector)))
(vector-cross! s3-0 *up-vector* (-> (camera-matrix) vector 0))
(vector-normalize! s3-0 1.0)
(set! (-> s2-0 quad) (-> this mouse-hit quad))
(reverse-transform-point! s5-1 s2-0 s3-0 s1-0)
@@ -832,7 +814,7 @@
(dotimes (a0-64 4)
(set! (-> v1-57 quad a0-64) (the-as uint128 0))
)
(vector+! (the-as vector (-> v1-57 vector)) s5-1 (new 'static 'vector :x 8192.0 :z 8192.0 :w 1.0))
(vector+! (-> v1-57 vector 0) s5-1 (new 'static 'vector :x 8192.0 :z 8192.0 :w 1.0))
(vector+! (-> v1-57 vector 1) s5-1 (new 'static 'vector :x 8192.0 :z -8192.0 :w 1.0))
(vector+! (-> v1-57 vector 2) s5-1 (new 'static 'vector :x -8192.0 :z -8192.0 :w 1.0))
(vector+! (-> v1-57 trans) s5-1 (new 'static 'vector :x -8192.0 :z 8192.0 :w 1.0))
@@ -1005,7 +987,6 @@
;; WARN: Return type mismatch symbol vs none.
(defmethod nav-graph-editor-method-43 ((this nav-graph-editor))
(local-vars (sv-128 vector) (sv-144 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -1039,9 +1020,9 @@
)
(let ((f30-0 0.0)
(s0-1 ray-cylinder-intersect)
(sv-128 (-> this mouse-pos))
(sv-144 (new 'stack-no-clear 'vector))
)
(set! sv-128 (-> this mouse-pos))
(set! sv-144 (new 'stack-no-clear 'vector))
(let ((v1-18 (-> this mouse-hit-pick))
(a0-13 (-> this mouse-pos))
)
@@ -1051,18 +1032,21 @@
(.mov.vf.w vf6 vf0)
(.sub.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-144 quad) vf6)
(let ((a3-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0))
(t0-0 1024.0)
(t1-0 (vector-length s2-0))
(t2-0 s3-0)
)
(when (< f30-0 (s0-1 sv-128 sv-144 s1-0 a3-3 t0-0 t1-0 t2-0))
(let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos))))
(when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist)))
(set! (-> this selected-index) s4-0)
(set! (-> this selected-dist) f0-1)
(set! (-> this selected-node-edge?) #f)
)
(when (< f30-0 (s0-1
sv-128
sv-144
s1-0
(vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0)
1024.0
(vector-length s2-0)
s3-0
)
)
(let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos))))
(when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist)))
(set! (-> this selected-index) s4-0)
(set! (-> this selected-dist) f0-1)
(set! (-> this selected-node-edge?) #f)
)
)
)
@@ -2110,16 +2094,6 @@
)
(defun smooth-nav-graph ((arg0 string))
(local-vars
(sv-96 int)
(sv-112 int)
(sv-128 int)
(sv-144 mysql-nav-edge)
(sv-160 vector)
(sv-176 vector)
(sv-192 vector)
(sv-208 vector)
)
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
@@ -2132,52 +2106,54 @@
(s2-0 (new-stack-vector0))
(s0-0 (new-stack-vector0))
(s1-0 (new-stack-vector0))
(sv-96 0)
(sv-112 0)
)
(set! sv-96 0)
(set! sv-112 0)
(when (and (not (logtest? (-> s3-0 mysql-save-flag) (mysql-save-flag delete))) (= (-> s3-0 level_name) arg0))
(set! sv-128 0)
(while (< sv-128 (-> s5-0 edge-array length))
(set! sv-144 (-> s5-0 edge-array data sv-128))
(when (not (logtest? (-> sv-144 mysql-save-flag) (mysql-save-flag delete)))
(when (= (-> sv-144 runtime-node-id-1) s4-0)
(let ((v1-27 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-3 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
)
(set! sv-176 s1-0)
(set! sv-160 s1-0)
(let ((v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-3 position) (-> v1-27 position)) 1.0))
(let ((sv-128 0))
(while (< sv-128 (-> s5-0 edge-array length))
(let ((sv-144 (-> s5-0 edge-array data sv-128)))
(when (not (logtest? (-> sv-144 mysql-save-flag) (mysql-save-flag delete)))
(when (= (-> sv-144 runtime-node-id-1) s4-0)
(let ((v1-27 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-3 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
(sv-176 s1-0)
)
(let ((sv-160 s1-0)
(v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-3 position) (-> v1-27 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-160 quad))
(.lvf vf5 (&-> v0-0 quad))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-160 quad))
(.lvf vf5 (&-> v0-0 quad))
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
)
(+! sv-112 1)
sv-112
)
(when (= (-> sv-144 runtime-node-id-2) s4-0)
(let ((v1-40 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-9 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
(sv-208 s0-0)
)
(let ((sv-192 s0-0)
(v0-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-9 position) (-> v1-40 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-192 quad))
(.lvf vf5 (&-> v0-1 quad))
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-208 quad) vf6)
)
(+! sv-96 1)
sv-96
)
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-176 quad) vf6)
(set! sv-112 (+ sv-112 1))
sv-112
)
(when (= (-> sv-144 runtime-node-id-2) s4-0)
(let ((v1-40 (-> s5-0 node-array data (-> sv-144 runtime-node-id-1)))
(a1-9 (-> s5-0 node-array data (-> sv-144 runtime-node-id-2)))
)
(set! sv-208 s0-0)
(set! sv-192 s0-0)
(let ((v0-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> a1-9 position) (-> v1-40 position)) 1.0))
)
(.mov.vf.w vf6 vf0)
(.lvf vf4 (&-> sv-192 quad))
(.lvf vf5 (&-> v0-1 quad))
)
)
(.add.vf.xyz vf6 vf4 vf5)
(.svf (&-> sv-208 quad) vf6)
(set! sv-96 (+ sv-96 1))
sv-96
)
(+! sv-128 1)
)
(set! sv-128 (+ sv-128 1))
)
(cond
((and (>= sv-112 2) (= sv-96 1))
@@ -2221,7 +2197,6 @@
)
(defun update-width ((arg0 string))
(local-vars (sv-16 (array entity-nav-mesh)) (sv-32 int) (sv-48 uint) (sv-64 entity-nav-mesh))
(let ((s5-0 (-> (ppointer->process *nav-graph-editor*) nav-graph)))
(dotimes (s4-0 (-> s5-0 edge-array length))
(let ((s3-0 (-> s5-0 edge-array data s4-0)))
@@ -2239,32 +2214,31 @@
(dotimes (s0-0 (-> *level* length))
(let ((v1-25 (-> *level* level s0-0)))
(when (= (-> v1-25 status) 'active)
(set! sv-16 (-> v1-25 bsp nav-meshes))
(when (nonzero? sv-16)
(set! sv-32 0)
(while (< sv-32 (-> sv-16 length))
(set! sv-64 (-> sv-16 sv-32))
(set! sv-48 (-> sv-64 aid))
(let ((v1-36 (if (type? sv-64 entity-nav-mesh)
sv-64
)
)
)
(when (and v1-36 (= sv-48 (-> s2-0 nav_mesh_id)))
(let* ((f0-0 (nav-mesh-method-35 (-> v1-36 nav-mesh) (-> s2-0 position) (-> s1-0 position) 16384.0))
(f0-1 (+ -409.6 f0-0))
(let ((sv-16 (-> v1-25 bsp nav-meshes)))
(when (nonzero? sv-16)
(let ((sv-32 0))
(while (< sv-32 (-> sv-16 length))
(let* ((sv-64 (-> sv-16 sv-32))
(sv-48 (-> sv-64 aid))
(v1-36 (as-type sv-64 entity-nav-mesh))
)
(when (and (< 0.0 f0-1) (!= f0-1 (-> s3-0 width)))
(set! (-> s3-0 width) f0-1)
(logior! (-> s3-0 mysql-save-flag) (mysql-save-flag update))
)
(if (>= 0.0 f0-1)
(format #t "!!!! edge ~D ~D outside nav-mesh~%" (-> s2-0 nav_node_id) (-> s1-0 nav_node_id))
(when (and v1-36 (= sv-48 (-> s2-0 nav_mesh_id)))
(let* ((f0-0 (nav-mesh-method-35 (-> v1-36 nav-mesh) (-> s2-0 position) (-> s1-0 position) 16384.0))
(f0-1 (+ -409.6 f0-0))
)
(when (and (< 0.0 f0-1) (!= f0-1 (-> s3-0 width)))
(set! (-> s3-0 width) f0-1)
(logior! (-> s3-0 mysql-save-flag) (mysql-save-flag update))
)
(if (>= 0.0 f0-1)
(format #t "!!!! edge ~D ~D outside nav-mesh~%" (-> s2-0 nav_node_id) (-> s1-0 nav_node_id))
)
)
)
)
(+! sv-32 1)
)
)
(set! sv-32 (+ sv-32 1))
)
)
)
+24 -26
View File
@@ -204,11 +204,11 @@
;; WARN: Return type mismatch object vs none.
(defmethod init-from-entity! ((this viewer) (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
- collision information
- loading the skeleton group / bones
- sounds"
This commonly includes things such as:
- stack size
- collision information
- loading the skeleton group / bones
- sounds"
(set! *viewer* this)
(set! (-> this root) (new 'process 'trsqv))
(process-drawable-from-entity! this arg0)
@@ -233,31 +233,29 @@ This commonly includes things such as:
)
(defun add-a-bunch ((arg0 string) (arg1 int) (arg2 int) (arg3 float) (arg4 process-tree) (arg5 entity-actor))
(local-vars (sv-32 int) (sv-48 process) (sv-64 vector))
(dotimes (s0-0 arg1)
(set! sv-32 0)
(while (< sv-32 arg2)
(set! sv-64 (new 'stack-no-clear 'vector))
(set! (-> sv-64 quad) (the-as uint128 0))
(position-in-front-of-camera! sv-64 40960.0 4096.0)
(+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3))))
(+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3))))
(set! sv-48 (get-process *default-dead-pool* viewer #x4000))
(when sv-48
(let ((t9-2 (method-of-type viewer activate)))
(t9-2 (the-as viewer sv-48) arg4 (symbol->string (-> viewer symbol)) (the-as pointer #x70004000))
)
(let ((t9-3 run-function-in-process)
(a0-7 sv-48)
(a1-4 init-viewer-for-other)
(a2-6 arg0)
(t0-1 arg5)
(let ((sv-32 0))
(while (< sv-32 arg2)
(let ((sv-64 (new 'stack-no-clear 'vector)))
(set! (-> sv-64 quad) (the-as uint128 0))
(position-in-front-of-camera! sv-64 40960.0 4096.0)
(+! (-> sv-64 x) (the float (* (- s0-0 (/ arg1 2)) (the int arg3))))
(+! (-> sv-64 z) (the float (* (- sv-32 (/ arg2 2)) (the int arg3))))
(let ((sv-48 (get-process *default-dead-pool* viewer #x4000)))
(when sv-48
((method-of-type viewer activate)
(the-as viewer sv-48)
arg4
(symbol->string (-> viewer symbol))
(the-as pointer #x70004000)
)
(run-now-in-process sv-48 init-viewer-for-other arg0 sv-64 arg5)
(-> sv-48 ppointer)
)
((the-as (function object object object object object none) t9-3) a0-7 a1-4 a2-6 sv-64 t0-1)
)
)
(-> sv-48 ppointer)
(+! sv-32 1)
)
(set! sv-32 (+ sv-32 1))
)
)
#f