mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 02:31:30 -04:00
637990314b
Closes #736 --------- Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
1150 lines
41 KiB
Common Lisp
Vendored
Generated
1150 lines
41 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition (debug) for function add-debug-line-arrow
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defun-debug add-debug-line-arrow ()
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type vis-cell
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this vis-cell))
|
|
(dotimes (s5-0 (-> this segment-count))
|
|
(let ((s4-0 (-> this segment-array s5-0)))
|
|
(add-debug-line #t (bucket-id debug) (-> s4-0 vertex 0) (-> s4-0 vertex 1) *color-white* #f *color-black*)
|
|
(let ((s3-1 (vector-float*!
|
|
(new 'stack-no-clear 'vector)
|
|
(vector+! (new 'stack-no-clear 'vector) (-> s4-0 vertex 0) (-> s4-0 vertex 1))
|
|
0.5
|
|
)
|
|
)
|
|
(s2-0 add-debug-text-3d)
|
|
(s1-0 #t)
|
|
(s0-0 583)
|
|
)
|
|
(format (clear *temp-string*) "~d" (-> s4-0 branch clock-type))
|
|
(s2-0 s1-0 (the-as bucket-id s0-0) *temp-string* s3-1 (font-color red) (the-as vector2h #f))
|
|
)
|
|
(add-debug-x #t (bucket-id debug) (-> s4-0 vertex 1) *color-red*)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type vis-cell
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod reset-segment-counts ((this vis-cell))
|
|
(set! (-> this incoming-segment-count) 0)
|
|
(set! (-> this segment-count) 0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type grid-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod setup-grid-from-bounding-box ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int))
|
|
(mem-copy! (the-as pointer (-> this box)) arg0 32)
|
|
(let ((v1-0 (new 'stack-no-clear 'vector)))
|
|
(dotimes (a0-2 3)
|
|
(set! (-> v1-0 data a0-2) (- (-> this box max data a0-2) (-> this box min data a0-2)))
|
|
)
|
|
(let ((f0-5 (sqrtf (/ (the float arg1) (* (-> v1-0 x) (-> v1-0 z) (the float arg2))))))
|
|
(let ((a0-6 (min 126 (+ arg1 -1))))
|
|
(set! (-> this dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6)))
|
|
(set! (-> this dimension-array 1) arg2)
|
|
(set! (-> this dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6)))
|
|
)
|
|
(let* ((f1-11 (* f0-5 (-> v1-0 z)))
|
|
(f1-13 (- f1-11 (the float (the int f1-11))))
|
|
(f0-6 (* f0-5 (-> v1-0 x)))
|
|
)
|
|
(cond
|
|
((< f1-13 (- f0-6 (the float (the int f0-6))))
|
|
(if (>= arg1 (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2)))
|
|
(+! (-> this dimension-array 0) 1)
|
|
)
|
|
)
|
|
(else
|
|
(if (>= arg1 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1)))
|
|
(+! (-> this dimension-array 2) 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(dotimes (a0-24 3)
|
|
(set! (-> this axis-scale a0-24) (/ (the float (-> this dimension-array a0-24)) (-> v1-0 data a0-24)))
|
|
(set! (-> this cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> this dimension-array a0-24))))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type grid-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod lookup-cell-for-point ((this grid-info) (arg0 vis-grid-pos) (arg1 vector))
|
|
(set! (-> arg0 x) (max 0 (min
|
|
(the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0)))
|
|
(+ (-> this dimension-array 0) -1)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> arg0 y) (max 0 (min
|
|
(the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1)))
|
|
(+ (-> this dimension-array 1) -1)
|
|
)
|
|
)
|
|
)
|
|
(set! (-> arg0 z) (max 0 (min
|
|
(the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2)))
|
|
(+ (-> this dimension-array 2) -1)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type grid-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod lookup-box-for-sphere ((this grid-info) (arg0 vis-grid-box) (arg1 vector))
|
|
(rlet ((vf0 :class vf)
|
|
(vf4 :class vf)
|
|
(vf5 :class vf)
|
|
(vf6 :class vf)
|
|
)
|
|
(init-vf0-vector)
|
|
(let ((s5-0 (new 'stack-no-clear 'bounding-box)))
|
|
(let ((a0-1 (-> s5-0 min)))
|
|
(let ((v1-0 arg1))
|
|
(let ((a1-1 (- (-> arg1 w))))
|
|
(.mov vf6 a1-1)
|
|
)
|
|
(.lvf vf4 (&-> v1-0 quad))
|
|
)
|
|
(.add.x.vf.w vf5 vf0 vf0)
|
|
(.add.x.vf.xyz vf5 vf4 vf6)
|
|
(.svf (&-> a0-1 quad) vf5)
|
|
)
|
|
(let ((a0-2 (-> s5-0 max)))
|
|
(let ((v1-1 arg1))
|
|
(let ((a1-2 (-> arg1 w)))
|
|
(.mov vf6 a1-2)
|
|
)
|
|
(.lvf vf4 (&-> v1-1 quad))
|
|
)
|
|
(.add.x.vf.w vf5 vf0 vf0)
|
|
(.add.x.vf.xyz vf5 vf4 vf6)
|
|
(.svf (&-> a0-2 quad) vf5)
|
|
)
|
|
(lookup-cell-for-point this (-> arg0 min) (-> s5-0 min))
|
|
(lookup-cell-for-point this (-> arg0 max) (-> s5-0 max))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for method 13 of type grid-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw-cell ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba))
|
|
(let ((v1-0 (new 'stack-no-clear 'bounding-box)))
|
|
(dotimes (a3-0 3)
|
|
(set! (-> v1-0 min data a3-0)
|
|
(+ (-> this box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> this cell-size data a3-0)))
|
|
)
|
|
)
|
|
(vector+! (-> v1-0 max) (-> v1-0 min) (-> this cell-size))
|
|
(add-debug-box #t (bucket-id debug) (-> v1-0 min) (-> v1-0 max) arg1)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type grid-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw-grid ((this grid-info) (arg0 rgba))
|
|
(draw-grid (-> this box min) (-> this box max) (-> this dimension-array) arg0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type traffic-suppression-params
|
|
(defmethod try-creating-new-suppression-box ((this traffic-suppression-params))
|
|
(cond
|
|
((= (-> this id) -1)
|
|
(send-event *traffic-manager* 'new-suppression-box this)
|
|
(!= (-> this id) -1)
|
|
)
|
|
(else
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 10 of type traffic-suppression-params
|
|
(defmethod create-or-update-suppression-box ((this traffic-suppression-params))
|
|
(cond
|
|
((= (-> this id) -1)
|
|
(send-event *traffic-manager* 'new-suppression-box this)
|
|
(!= (-> this id) -1)
|
|
)
|
|
(else
|
|
(send-event *traffic-manager* 'update-suppression-box this)
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 12 of type traffic-suppression-params
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod kill-suppression-box ((this traffic-suppression-params))
|
|
(when (!= (-> this id) -1)
|
|
(let ((s5-0 (-> this duration)))
|
|
(set! (-> this duration) 0)
|
|
(send-event *traffic-manager* 'update-suppression-box this)
|
|
(set! (-> this duration) s5-0)
|
|
)
|
|
(set! (-> this id) -1)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type traffic-suppressor
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod reset-boxes ((this traffic-suppressor))
|
|
(logclear! (-> this flags) (traffic-suppressor-flag tfs0 needs-update))
|
|
(dotimes (v1-2 16)
|
|
(let ((a1-3 (-> this array v1-2)))
|
|
(logclear! (-> a1-3 flags) (traffic-suppression-box-flag in-use tfsb1))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type traffic-suppressor
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params))
|
|
(set! (-> arg0 id) -1)
|
|
(let ((v1-1 0))
|
|
(b! #t cfg-4 :delay (nop!))
|
|
(label cfg-1)
|
|
(let ((a2-2 (-> this array v1-1)))
|
|
(b! (logtest? (-> a2-2 flags) (traffic-suppression-box-flag in-use)) cfg-3 :delay (empty-form))
|
|
(set! (-> arg0 id) v1-1)
|
|
(set! (-> a2-2 flags) (traffic-suppression-box-flag in-use))
|
|
)
|
|
(update-box-from-params this arg0)
|
|
(b! #t cfg-6 :delay (nop!))
|
|
(label cfg-3)
|
|
(+! v1-1 1)
|
|
(label cfg-4)
|
|
(b! (< v1-1 16) cfg-1)
|
|
)
|
|
(label cfg-6)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type traffic-suppressor
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod remove-box-by-id ((this traffic-suppressor) (arg0 int))
|
|
(when (!= arg0 -1)
|
|
(logior! (-> this flags) (traffic-suppressor-flag needs-update))
|
|
(let ((v1-6 (-> this array arg0)))
|
|
(logclear! (-> v1-6 flags) (traffic-suppression-box-flag in-use))
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type traffic-suppressor
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod update-box-from-params ((this traffic-suppressor) (arg0 traffic-suppression-params))
|
|
(let ((v1-0 (-> arg0 id)))
|
|
(when (!= v1-0 -1)
|
|
(logior! (-> this flags) (traffic-suppressor-flag needs-update))
|
|
(let* ((s5-0 (-> this array v1-0))
|
|
(s4-1 (logior (-> s5-0 flags) (traffic-suppression-box-flag tfsb1)))
|
|
)
|
|
(mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32)
|
|
(set! (-> s5-0 duration) (the-as uint (-> arg0 duration)))
|
|
(set! (-> s5-0 flags) s4-1)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type traffic-suppressor
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this traffic-suppressor))
|
|
(let ((s5-0 (new 'stack-no-clear 'bounding-box)))
|
|
(new 'stack-no-clear 'vector4w)
|
|
(let ((s4-0 *color-red*))
|
|
(dotimes (s3-0 16)
|
|
(let ((v1-3 (-> this array s3-0)))
|
|
(when (logtest? (-> v1-3 flags) (traffic-suppression-box-flag in-use))
|
|
(vector-copy! (-> s5-0 min) (-> v1-3 bbox min))
|
|
(vector-copy! (-> s5-0 max) (-> v1-3 bbox max))
|
|
(set! (-> s5-0 min w) 1.0)
|
|
(set! (-> s5-0 max w) 1.0)
|
|
(add-debug-box #t (bucket-id debug-no-zbuf1) (-> s5-0 min) (-> s5-0 max) s4-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 14 of type city-level-info
|
|
(defmethod get-first-cell-in-box ((this city-level-info) (arg0 vis-grid-box))
|
|
(-> this
|
|
cell-array
|
|
(+ (-> arg0 min x)
|
|
(* (-> arg0 min z) (-> this grid-info dimension-array 0))
|
|
(* (* (-> arg0 min y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2))
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 15 of type city-level-info
|
|
(defmethod sphere-in-grid? ((this city-level-info) (arg0 vector) (arg1 int))
|
|
(let ((gp-0 #f))
|
|
(let ((s3-0 (new 'stack-no-clear 'vis-grid-box))
|
|
(s2-0 (new 'stack-no-clear 'vis-grid-box))
|
|
)
|
|
(lookup-box-for-sphere (-> this grid-info) s2-0 arg0)
|
|
(set! (-> s3-0 min y) (-> s2-0 min y))
|
|
(let ((v1-6 (+ (- 1 (-> s2-0 min y)) (-> s2-0 max y))))
|
|
(b! #t cfg-13 :delay (nop!))
|
|
(label cfg-1)
|
|
(+! v1-6 -1)
|
|
(set! (-> s3-0 min z) (-> s2-0 min z))
|
|
(let ((a0-7 (+ (- 1 (-> s2-0 min z)) (-> s2-0 max z))))
|
|
(b! #t cfg-11 :delay (nop!))
|
|
(label cfg-2)
|
|
(+! a0-7 -1)
|
|
(set! (-> s3-0 min x) (-> s2-0 min x))
|
|
(let ((a1-7 (+ (- 1 (-> s2-0 min x)) (-> s2-0 max x))))
|
|
(b! #t cfg-9 :delay (nop!))
|
|
(label cfg-3)
|
|
(+! a1-7 -1)
|
|
(let ((a3-0 this)
|
|
(t1-0 s3-0)
|
|
)
|
|
(b!
|
|
(not (logtest? (-> a3-0
|
|
cell-array
|
|
(+ (-> t1-0 min x)
|
|
(* (-> t1-0 min z) (-> a3-0 grid-info dimension-array 0))
|
|
(* (* (-> t1-0 min y) (-> a3-0 grid-info dimension-array 0)) (-> a3-0 grid-info dimension-array 2))
|
|
)
|
|
flags
|
|
)
|
|
(ash 1 arg1)
|
|
)
|
|
)
|
|
cfg-8
|
|
:delay (empty-form)
|
|
)
|
|
)
|
|
(set! gp-0 #t)
|
|
(b! #t cfg-15 :delay (nop!))
|
|
(label cfg-8)
|
|
(+! (-> s3-0 min x) 1)
|
|
(label cfg-9)
|
|
(b! (nonzero? a1-7) cfg-3 :delay (nop!))
|
|
)
|
|
(+! (-> s3-0 min z) 1)
|
|
(label cfg-11)
|
|
(b! (nonzero? a0-7) cfg-2 :delay (nop!))
|
|
)
|
|
(+! (-> s3-0 min y) 1)
|
|
(label cfg-13)
|
|
(b! (nonzero? v1-6) cfg-1 :delay (nop!))
|
|
)
|
|
)
|
|
(label cfg-15)
|
|
gp-0
|
|
)
|
|
)
|
|
|
|
;; definition for method 16 of type city-level-info
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Stack slot offset 28 signed mismatch
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Stack slot offset 28 signed mismatch
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Stack slot offset 28 signed mismatch
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Stack slot offset 28 signed mismatch
|
|
;; WARN: Stack slot offset 24 signed mismatch
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod callback-on-nav-segments-in-sphere ((this city-level-info)
|
|
(arg0 vector)
|
|
(arg1 int)
|
|
(arg2 traffic-find-segment-struct)
|
|
(arg3 (function traffic-find-segment-struct nav-segment none))
|
|
)
|
|
(let ((sv-16 this)
|
|
(sv-20 arg0)
|
|
(sv-24 arg1)
|
|
(sv-28 arg2)
|
|
(sv-32 arg3)
|
|
(sv-80 (new 'stack-no-clear 'vis-grid-box))
|
|
(sv-84 (new 'stack-no-clear 'vis-grid-box))
|
|
)
|
|
(lookup-box-for-sphere (-> sv-16 grid-info) sv-80 sv-20)
|
|
(set! (-> sv-84 min y) (-> sv-80 min y))
|
|
(countdown (gp-0 (+ (- 1 (-> sv-80 min y)) (-> sv-80 max y)))
|
|
(set! (-> sv-84 min z) (-> sv-80 min z))
|
|
(countdown (s5-0 (+ (- 1 (-> sv-80 min z)) (-> sv-80 max z)))
|
|
(set! (-> sv-84 min x) (-> sv-80 min x))
|
|
(countdown (s4-0 (+ (- 1 (-> sv-80 min x)) (-> sv-80 max x)))
|
|
(let* ((a0-17 sv-16)
|
|
(a2-2 sv-84)
|
|
(v1-18
|
|
(-> a0-17
|
|
cell-array
|
|
(+ (-> a2-2 min x)
|
|
(* (-> a2-2 min z) (-> a0-17 grid-info dimension-array 0))
|
|
(* (* (-> a2-2 min y) (-> a0-17 grid-info dimension-array 0)) (-> a0-17 grid-info dimension-array 2))
|
|
)
|
|
)
|
|
)
|
|
(s3-0 (-> v1-18 segment-array 0))
|
|
)
|
|
(countdown (s2-0 (-> v1-18 segment-count))
|
|
(if (and (= (-> s3-0 tracker-id) sv-24) (line-sphere-intersection? sv-20 (-> s3-0 vertex 0) (-> s3-0 vertex 1)))
|
|
(sv-32 sv-28 s3-0)
|
|
)
|
|
(&+! s3-0 48)
|
|
)
|
|
)
|
|
(+! (-> sv-84 min x) 1)
|
|
)
|
|
(+! (-> sv-84 min z) 1)
|
|
)
|
|
(+! (-> sv-84 min y) 1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 17 of type city-level-info
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod update-suppressions-from-traffic-engine ((this city-level-info) (arg0 traffic-engine))
|
|
(let ((v1-0 (-> this cell-count)))
|
|
(dotimes (a0-1 (the-as int v1-0))
|
|
(let ((a1-2 (-> this cell-array a0-1)))
|
|
(logclear! (-> a1-2 flags) (vis-cell-flag suppress))
|
|
)
|
|
)
|
|
)
|
|
(let ((s4-0 (new 'stack-no-clear 'inline-array 'vis-grid-pos 2)))
|
|
(dotimes (s3-0 16)
|
|
(let ((s2-0 (-> arg0 suppressor array s3-0)))
|
|
(when (logtest? (-> s2-0 flags) (traffic-suppression-box-flag in-use))
|
|
(lookup-cell-for-point (-> this grid-info) (-> s4-0 1) (-> s2-0 bbox min))
|
|
(lookup-cell-for-point (-> this grid-info) (-> s4-0 2) (-> s2-0 bbox max))
|
|
(set! (-> s4-0 0 y) (-> s4-0 1 y))
|
|
(countdown (v1-15 (+ (- 1 (-> s4-0 1 y)) (-> s4-0 2 y)))
|
|
(set! (-> s4-0 0 z) (-> s4-0 1 z))
|
|
(countdown (a0-9 (+ (- 1 (-> s4-0 1 z)) (-> s4-0 2 z)))
|
|
(set! (-> s4-0 0 x) (-> s4-0 1 x))
|
|
(countdown (a1-10 (+ (- 1 (-> s4-0 1 x)) (-> s4-0 2 x)))
|
|
(let* ((a3-1 this)
|
|
(t1-0 (-> s4-0 0))
|
|
(a2-8 (-> a3-1
|
|
cell-array
|
|
(+ (-> t1-0 x)
|
|
(* (-> t1-0 z) (-> a3-1 grid-info dimension-array 0))
|
|
(* (* (-> t1-0 y) (-> a3-1 grid-info dimension-array 0)) (-> a3-1 grid-info dimension-array 2))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(logior! (-> a2-8 flags) (vis-cell-flag suppress))
|
|
)
|
|
(+! (-> s4-0 0 x) 1)
|
|
)
|
|
(+! (-> s4-0 0 z) 1)
|
|
)
|
|
(+! (-> s4-0 0 y) 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type city-level-info
|
|
(defmethod lookup-cell-by-position ((this city-level-info) (arg0 vector))
|
|
(let ((s5-0 (new 'stack-no-clear 'vis-grid-pos)))
|
|
(lookup-cell-for-point (-> this grid-info) s5-0 arg0)
|
|
(-> this
|
|
cell-array
|
|
(+ (-> s5-0 x)
|
|
(* (-> s5-0 z) (-> this grid-info dimension-array 0))
|
|
(* (* (-> s5-0 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 10 of type city-level-info
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod init-vis-ray ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector))
|
|
(vector-copy! (-> arg0 pos) arg1)
|
|
(vector-copy! (-> arg0 dest-pos) arg2)
|
|
(let ((v1-2 (new 'stack-no-clear 'vector)))
|
|
(vector-! v1-2 arg2 arg1)
|
|
(set! (-> arg0 len) (vector-length v1-2))
|
|
(let ((a0-9 (-> arg0 dir))
|
|
(f0-1 (-> arg0 len))
|
|
)
|
|
(vector-float*! a0-9 v1-2 (/ 1.0 f0-1))
|
|
)
|
|
)
|
|
(lookup-cell-for-point (-> this grid-info) (-> arg0 grid-pos) arg1)
|
|
(set! (-> arg0 cell) (lookup-cell-by-position this arg1))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type city-level-info
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod city-level-info-method-11 ((this city-level-info) (arg0 vis-ray))
|
|
(local-vars (a3-3 int))
|
|
(let ((f0-0 (-> arg0 len))
|
|
(s4-0 -1)
|
|
)
|
|
(dotimes (v1-0 2)
|
|
(let ((a0-1 (* v1-0 2))
|
|
(a1-1 (new 'stack-no-clear 'vector))
|
|
)
|
|
(set! (-> a1-1 quad) (the-as uint128 0))
|
|
(set! (-> a1-1 data a0-1) -1.0)
|
|
(let ((f1-1 (-> this grid-info box min data a0-1))
|
|
(a2-6 1)
|
|
)
|
|
(let ((a3-2 (-> arg0 dir data a0-1)))
|
|
(shift-arith-right-32 a3-3 a3-2 31)
|
|
)
|
|
(set! (-> a1-1 w)
|
|
(+ f1-1
|
|
(* (the float (+ (- a2-6 (logand a3-3 1)) (-> (the-as (pointer int8) (+ a0-1 (the-as int arg0))) 64)))
|
|
(-> this grid-info cell-size data a0-1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(when (!= (-> arg0 dir data a0-1) 0.0)
|
|
(let ((f1-6 (/ (- (-> a1-1 w) (-> arg0 pos data a0-1)) (-> arg0 dir data a0-1))))
|
|
(when (< f1-6 f0-0)
|
|
(set! f0-0 f1-6)
|
|
(set! s4-0 a0-1)
|
|
(set! (-> arg0 plane quad) (-> a1-1 quad))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(cond
|
|
((= s4-0 -1)
|
|
(vector-copy! (-> arg0 pos) (-> arg0 dest-pos))
|
|
(set! (-> arg0 len) 0.0)
|
|
)
|
|
(else
|
|
(vector+float*! (-> arg0 pos) (-> arg0 pos) (-> arg0 dir) f0-0)
|
|
(set! (-> arg0 len) (vector-vector-distance (-> arg0 pos) (-> arg0 dest-pos)))
|
|
(+! (-> arg0 grid-pos data s4-0) (if (>= (-> arg0 dir data s4-0) 0.0)
|
|
1
|
|
-1
|
|
)
|
|
)
|
|
(let ((a1-4 (-> arg0 grid-pos)))
|
|
(set! (-> arg0 cell)
|
|
(-> this
|
|
cell-array
|
|
(+ (-> a1-4 x)
|
|
(* (-> a1-4 z) (-> this grid-info dimension-array 0))
|
|
(* (* (-> a1-4 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type city-level-info
|
|
;; INFO: Used lq/sq
|
|
(defmethod city-level-info-method-12 ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector))
|
|
(let ((s2-0 (-> arg1 dest-node))
|
|
(s3-0 #t)
|
|
(s5-0 (new 'stack-no-clear 'inline-array 'vector 7))
|
|
)
|
|
(let ((a1-1 s2-0)
|
|
(v1-0 (-> s5-0 2))
|
|
)
|
|
(vector-copy! v1-0 (-> a1-1 position))
|
|
(set! (-> v1-0 w) 1.0)
|
|
)
|
|
(let ((v1-1 s2-0)
|
|
(s1-0 (-> s5-0 3))
|
|
)
|
|
(let ((f0-2 (the float (-> v1-1 angle)))
|
|
(s0-0 (new 'stack-no-clear 'vector))
|
|
)
|
|
(sincos! s0-0 f0-2)
|
|
(set! (-> s1-0 x) (-> s0-0 y))
|
|
(set! (-> s1-0 y) 0.0)
|
|
(set! (-> s1-0 z) (- (-> s0-0 x)))
|
|
)
|
|
(set! (-> s1-0 w) 1.0)
|
|
)
|
|
(vector-! (-> s5-0 5) (-> s5-0 2) arg0)
|
|
(vector-copy! (-> s5-0 4) (-> s5-0 3))
|
|
(set! (-> s5-0 4 x) (-> s5-0 3 z))
|
|
(set! (-> s5-0 4 z) (- (-> s5-0 3 x)))
|
|
(when (< 0.0 (vector-dot (-> s5-0 5) (-> s5-0 4)))
|
|
(set! s3-0 #f)
|
|
(vector-float*! (-> s5-0 4) (-> s5-0 4) -1.0)
|
|
)
|
|
(let ((a1-8 (-> s5-0 6))
|
|
(v1-12 (-> s5-0 2))
|
|
(a0-9 (-> s5-0 4))
|
|
(a2-1 s2-0)
|
|
)
|
|
(vector+*! a1-8 v1-12 a0-9 (* 1024.0 (the float (-> a2-1 radius))))
|
|
)
|
|
(set! (-> s5-0 6 w) (* 1024.0 (the float (-> s2-0 radius))))
|
|
(vector-! (-> s5-0 0) (-> s5-0 6) arg0)
|
|
(set! (-> s5-0 0 y) 0.0)
|
|
(let* ((v1-17 (-> s5-0 0))
|
|
(f30-0 (sqrtf (+ (* (-> v1-17 x) (-> v1-17 x)) (* (-> v1-17 z) (-> v1-17 z)))))
|
|
(f28-0 (-> s5-0 6 w))
|
|
)
|
|
(vector-xz-normalize! (-> s5-0 0) 1.0)
|
|
(set! (-> s5-0 1 x) (-> s5-0 0 z))
|
|
(set! (-> s5-0 1 y) 0.0)
|
|
(set! (-> s5-0 1 z) (- (-> s5-0 0 x)))
|
|
(if s3-0
|
|
(vector-float*! (-> s5-0 1) (-> s5-0 1) -1.0)
|
|
)
|
|
(let* ((f1-12 (sqrtf (fabs (- (square f30-0) (square f28-0)))))
|
|
(f0-35 (/ (* f28-0 f1-12) f30-0))
|
|
)
|
|
(let ((f1-15 (/ (square f1-12) f30-0)))
|
|
(vector-copy! arg2 arg0)
|
|
(vector+*! arg2 arg2 (-> s5-0 0) f1-15)
|
|
)
|
|
(vector+*! arg2 arg2 (-> s5-0 1) f0-35)
|
|
)
|
|
)
|
|
(set! (-> arg2 y) (-> s5-0 2 y))
|
|
)
|
|
arg2
|
|
)
|
|
|
|
;; definition for method 18 of type city-level-info
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Stack slot offset 48 signed mismatch
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod city-level-info-method-18 ((this city-level-info))
|
|
(let* ((gp-0 (new 'stack-no-clear 'bounding-box))
|
|
(s5-0 (-> this nav-graph))
|
|
(sv-48 (-> s5-0 node-count))
|
|
)
|
|
(dotimes (s4-0 sv-48)
|
|
(let ((s3-0 (-> s5-0 node-array s4-0)))
|
|
(set-id-and-link-branches-back s3-0 (the-as uint s4-0))
|
|
(let ((a1-1 s3-0)
|
|
(v1-4 (-> gp-0 min))
|
|
)
|
|
(vector-copy! v1-4 (-> a1-1 position))
|
|
(set! (-> v1-4 w) 1.0)
|
|
)
|
|
(dotimes (s2-0 (-> s3-0 branch-count))
|
|
(let ((s1-0 (-> s3-0 branch-array s2-0)))
|
|
(let ((a1-4 (-> s1-0 dest-node))
|
|
(v1-6 (-> gp-0 max))
|
|
)
|
|
(vector-copy! v1-6 (-> a1-4 position))
|
|
(set! (-> v1-6 w) 1.0)
|
|
)
|
|
(set! (-> s1-0 max-user-count)
|
|
(the-as uint (max 1 (the int (/ (vector-vector-distance (-> gp-0 min) (-> gp-0 max))
|
|
(if (logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian))
|
|
24576.0
|
|
49152.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type city-level-info
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
;; WARN: Stack slot offset 100 signed mismatch
|
|
(defmethod city-level-info-method-9 ((this city-level-info))
|
|
(set! (-> this cell-count)
|
|
(the-as uint (* (* (-> this grid-info dimension-array 0) (-> this grid-info dimension-array 1))
|
|
(-> this grid-info dimension-array 2)
|
|
)
|
|
)
|
|
)
|
|
(let ((s5-0 (-> this cell-count)))
|
|
(dotimes (s4-0 (the-as int s5-0))
|
|
(reset-segment-counts (-> this cell-array s4-0))
|
|
)
|
|
(when (< 0.01 (-> this grid-info axis-scale 0))
|
|
(format 0 "segments not generates~%")
|
|
(return #t)
|
|
)
|
|
(let ((sv-96 (-> this nav-graph node-array))
|
|
(sv-100 (-> this nav-graph node-count))
|
|
(sv-104 (new 'stack-no-clear 'vis-ray))
|
|
)
|
|
(let ((sv-112 0))
|
|
(dotimes (s4-1 sv-100)
|
|
(let ((s3-0 (-> sv-96 s4-1)))
|
|
(dotimes (s2-0 (-> s3-0 branch-count))
|
|
(let* ((a2-0 (-> s3-0 branch-array s2-0))
|
|
(f0-1 0.0)
|
|
(v1-19 a2-0)
|
|
)
|
|
(when (< f0-1 (* 0.0078125 (the float (-> v1-19 density))))
|
|
(let ((sv-160 (-> a2-0 dest-node)))
|
|
)
|
|
(let ((sv-164 (new 'stack-no-clear 'vector))
|
|
(sv-168 (new 'stack-no-clear 'vector))
|
|
(sv-172 (the-as vis-cell #f))
|
|
(sv-176 0)
|
|
)
|
|
(let ((a1-1 s3-0)
|
|
(v1-26 sv-168)
|
|
)
|
|
(vector-copy! v1-26 (-> a1-1 position))
|
|
(set! (-> v1-26 w) 1.0)
|
|
)
|
|
(cond
|
|
((logtest? (-> s3-0 flags) (nav-node-flag-byte pedestrian))
|
|
(let ((a1-4 (-> a2-0 dest-node))
|
|
(v1-29 sv-164)
|
|
)
|
|
(vector-copy! v1-29 (-> a1-4 position))
|
|
(set! (-> v1-29 w) 1.0)
|
|
)
|
|
)
|
|
(else
|
|
(city-level-info-method-12 this sv-168 a2-0 sv-164)
|
|
)
|
|
)
|
|
(init-vis-ray this sv-104 sv-168 sv-164)
|
|
(while (< 0.0 (-> sv-104 len))
|
|
(set! sv-172 (-> sv-104 cell))
|
|
(city-level-info-method-11 this sv-104)
|
|
(+! (-> sv-172 segment-count) 1)
|
|
(+! sv-112 1)
|
|
(if (> sv-176 0)
|
|
(+! (-> sv-172 incoming-segment-count) 1)
|
|
)
|
|
(+! sv-176 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(format 0 "~d segments were generated~%" sv-112)
|
|
(set! (-> this segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112))))
|
|
)
|
|
(let ((v1-59 0))
|
|
(dotimes (a0-20 (the-as int s5-0))
|
|
(let ((a1-14 (-> this cell-array a0-20)))
|
|
(set! (-> a1-14 id) (the-as uint a0-20))
|
|
(set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) #f))
|
|
(when (> (-> a1-14 segment-count) 0)
|
|
(set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> this segment-array v1-59)))
|
|
(dotimes (a2-8 (-> a1-14 segment-count))
|
|
(let ((a3-5 (-> a1-14 segment-array a2-8)))
|
|
(set! (-> a3-5 id) (the-as uint v1-59))
|
|
(set! (-> a3-5 cell-id) (the-as uint #xffff))
|
|
)
|
|
(+! v1-59 1)
|
|
)
|
|
)
|
|
(set! (-> a1-14 flags) (the-as vis-cell-flag (-> a1-14 segment-count)))
|
|
(set! (-> a1-14 segment-count) 0)
|
|
(set! (-> a1-14 incoming-segment-count) 0)
|
|
)
|
|
0
|
|
)
|
|
(set! (-> this segment-count) v1-59)
|
|
)
|
|
(dotimes (s5-1 sv-100)
|
|
(let ((s4-2 (-> sv-96 s5-1)))
|
|
(dotimes (s3-1 (-> s4-2 branch-count))
|
|
(let* ((sv-184 (-> s4-2 branch-array s3-1))
|
|
(v1-63 sv-184)
|
|
)
|
|
(when (< 0.0 (* 0.0078125 (the float (-> v1-63 density))))
|
|
(let ((sv-240 (-> sv-184 dest-node)))
|
|
)
|
|
(let ((sv-244 (new 'stack-no-clear 'vector))
|
|
(sv-248 (new 'stack-no-clear 'vector))
|
|
(sv-252 (new 'stack-no-clear 'vector))
|
|
(sv-256 (the-as nav-segment #f))
|
|
(sv-260 (the-as vis-cell #f))
|
|
(sv-264 0)
|
|
)
|
|
(let ((a1-16 s4-2)
|
|
(v1-72 sv-244)
|
|
)
|
|
(vector-copy! v1-72 (-> a1-16 position))
|
|
(set! (-> v1-72 w) 1.0)
|
|
)
|
|
(cond
|
|
((logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian))
|
|
(let ((a1-19 (-> sv-184 dest-node))
|
|
(v1-76 sv-252)
|
|
)
|
|
(vector-copy! v1-76 (-> a1-19 position))
|
|
(set! (-> v1-76 w) 1.0)
|
|
)
|
|
)
|
|
(else
|
|
(city-level-info-method-12 this sv-244 sv-184 sv-252)
|
|
)
|
|
)
|
|
(init-vis-ray this sv-104 sv-244 sv-252)
|
|
(while (< 0.0 (-> sv-104 len))
|
|
(vector-copy! sv-248 (-> sv-104 pos))
|
|
(set! sv-260 (-> sv-104 cell))
|
|
(city-level-info-method-11 this sv-104)
|
|
(let ((a2-14 (-> sv-260 incoming-segment-count)))
|
|
(if (zero? sv-264)
|
|
(set! a2-14
|
|
(+ (- -1 (-> sv-260 segment-count)) (-> sv-260 incoming-segment-count) (-> sv-260 alloc-segment-count))
|
|
)
|
|
)
|
|
(when (or (< a2-14 0) (>= a2-14 (-> sv-260 alloc-segment-count)))
|
|
(format
|
|
0
|
|
"******************************************************** bad i-seg ~d ************************************************~%"
|
|
a2-14
|
|
)
|
|
(return #f)
|
|
)
|
|
(let ((s2-1 (-> sv-260 segment-array a2-14)))
|
|
(set! (-> s2-1 vertex 0 quad) (-> sv-248 quad))
|
|
(vector-copy! (-> s2-1 vertex 1) (-> sv-104 pos))
|
|
(set! (-> s2-1 length) (vector-vector-distance (-> s2-1 vertex 0) (-> s2-1 vertex 1)))
|
|
(let* ((f0-9 (if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian))
|
|
24576.0
|
|
49152.0
|
|
)
|
|
)
|
|
(f1-8 -1.0)
|
|
(v1-107 sv-184)
|
|
(f2-5 (fmax 0.0001 (* 0.0078125 (the float (-> v1-107 density)))))
|
|
)
|
|
(set! (-> s2-1 spawn-spacing) (* f0-9 (+ f1-8 (/ 1.0 f2-5))))
|
|
)
|
|
(set! (-> s2-1 cell-id) (-> sv-260 id))
|
|
(set! (-> s2-1 branch) sv-184)
|
|
(set! (-> s2-1 from-cell-id) (the-as uint #xffff))
|
|
(set! (-> s2-1 nav-mesh-id) (-> s4-2 nav-mesh-id))
|
|
(set! (-> s2-1 tracker-id) 0)
|
|
(if (logtest? (-> s4-2 flags) (nav-node-flag-byte pedestrian))
|
|
(set! (-> s2-1 tracker-id) 1)
|
|
)
|
|
(if sv-256
|
|
(set! (-> s2-1 from-cell-id) (-> (the-as nav-segment sv-256) cell-id))
|
|
)
|
|
(set! sv-256 s2-1)
|
|
)
|
|
)
|
|
0
|
|
(+! (-> sv-260 segment-count) 1)
|
|
(if (> sv-264 0)
|
|
(+! (-> sv-260 incoming-segment-count) 1)
|
|
)
|
|
(+! sv-264 1)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
;; definition for method 9 of type traffic-level-data
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod reset! ((this traffic-level-data))
|
|
(set! (-> this city-info) (the-as city-level-info 0))
|
|
(set! (-> this active-cell-count) (the-as uint 0))
|
|
(set! (-> this newly-active-cell-count) (the-as uint 0))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 10 of type traffic-level-data
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod add-active-cell ((this traffic-level-data) (arg0 vis-cell))
|
|
(let ((v1-0 (-> this active-cell-count)))
|
|
(when (< v1-0 (the-as uint 255))
|
|
(set! (-> this active-cell-list v1-0) arg0)
|
|
(+! (-> this active-cell-count) 1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 11 of type traffic-level-data
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod remove-active-cell ((this traffic-level-data) (arg0 int))
|
|
(let ((v1-1 (+ (-> this active-cell-count) -1)))
|
|
(when (>= v1-1 0)
|
|
(set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1))
|
|
(+! (-> this active-cell-count) -1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 12 of type traffic-level-data
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod add-newly-active-cell ((this traffic-level-data) (arg0 vis-cell))
|
|
(let ((v1-0 (-> this newly-active-cell-count)))
|
|
(when (< v1-0 (the-as uint 255))
|
|
(set! (-> this newly-active-cell-list v1-0) arg0)
|
|
(+! (-> this newly-active-cell-count) 1)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 13 of type traffic-level-data
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod per-frame-cell-update ((this traffic-level-data))
|
|
(set! (-> this newly-active-cell-count) (the-as uint 0))
|
|
(dotimes (v1-0 (the-as int (-> this active-cell-count)))
|
|
(let ((a0-3 (-> this active-cell-list v1-0)))
|
|
(set! (-> a0-3 prev-flags) (-> a0-3 flags))
|
|
)
|
|
)
|
|
(let ((s5-0 (math-camera-pos))
|
|
(f30-0 81920.0)
|
|
(f28-0 819200.0)
|
|
(f26-0 491520.0)
|
|
)
|
|
(dotimes (s4-0 (the-as int (-> this city-info cell-count)))
|
|
(let ((s3-0 (-> this city-info cell-array s4-0)))
|
|
(let ((f24-0 (vector-vector-distance-squared (-> s3-0 sphere) s5-0)))
|
|
(cond
|
|
((or (< (square (+ (-> s3-0 sphere r) f28-0)) f24-0)
|
|
(and (< (square (+ (-> s3-0 sphere r) f30-0)) f24-0) (not (sphere-in-view-frustum? (-> s3-0 sphere))))
|
|
)
|
|
(logclear! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))
|
|
)
|
|
((< (square (+ (-> s3-0 sphere r) f26-0)) f24-0)
|
|
(let ((v1-17 (logior (-> s3-0 flags) (vis-cell-flag active-vehicle))))
|
|
(set! (-> s3-0 flags) (logclear v1-17 (vis-cell-flag active-pedestrian)))
|
|
)
|
|
)
|
|
(else
|
|
(logior! (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))
|
|
)
|
|
)
|
|
)
|
|
(if (< (the-as uint (logand (-> s3-0 prev-flags) (vis-cell-flag active-vehicle active-pedestrian)))
|
|
(the-as uint (logand (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian)))
|
|
)
|
|
(add-newly-active-cell this s3-0)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(countdown (s5-1 (-> this active-cell-count))
|
|
(let ((v1-32 (-> this active-cell-list s5-1)))
|
|
(when (not (logtest? (-> v1-32 flags) (vis-cell-flag active-vehicle active-pedestrian)))
|
|
(logclear! (-> v1-32 prev-flags) (vis-cell-flag active-vehicle active-pedestrian))
|
|
(remove-active-cell this (the-as int s5-1))
|
|
)
|
|
)
|
|
)
|
|
(dotimes (s5-2 (the-as int (-> this newly-active-cell-count)))
|
|
(let ((a1-5 (-> this newly-active-cell-list s5-2)))
|
|
(add-active-cell this a1-5)
|
|
)
|
|
)
|
|
(let ((v1-43 (-> this active-cell-box)))
|
|
(set-vector!
|
|
(-> v1-43 min)
|
|
10000000000000000000000000000000000000.0
|
|
10000000000000000000000000000000000000.0
|
|
10000000000000000000000000000000000000.0
|
|
1.0
|
|
)
|
|
(set-vector!
|
|
(-> v1-43 max)
|
|
-10000000000000000000000000000000000000.0
|
|
-10000000000000000000000000000000000000.0
|
|
-10000000000000000000000000000000000000.0
|
|
1.0
|
|
)
|
|
(countdown (a0-23 (-> this active-cell-count))
|
|
(let ((a1-16 (-> this active-cell-list a0-23)))
|
|
(set! (-> v1-43 min x) (fmin (-> v1-43 min x) (- (-> a1-16 sphere x) (-> a1-16 sphere r))))
|
|
(set! (-> v1-43 min y) (fmin (-> v1-43 min y) (- (-> a1-16 sphere y) (-> a1-16 sphere r))))
|
|
(set! (-> v1-43 min z) (fmin (-> v1-43 min z) (- (-> a1-16 sphere z) (-> a1-16 sphere r))))
|
|
(set! (-> v1-43 max x) (fmax (-> v1-43 max x) (+ (-> a1-16 sphere x) (-> a1-16 sphere r))))
|
|
(set! (-> v1-43 max y) (fmax (-> v1-43 max y) (+ (-> a1-16 sphere y) (-> a1-16 sphere r))))
|
|
(set! (-> v1-43 max z) (fmax (-> v1-43 max z) (+ (-> a1-16 sphere z) (-> a1-16 sphere r))))
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 14 of type traffic-level-data
|
|
;; INFO: Used lq/sq
|
|
;; WARN: Return type mismatch int vs none.
|
|
(defmethod debug-draw ((this traffic-level-data))
|
|
(when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph)))
|
|
(let ((s5-0 (-> this city-info nav-graph)))
|
|
(let ((v1-6 (-> s5-0 node-array 0)))
|
|
(countdown (a0-3 (-> s5-0 node-count))
|
|
(logclear! (-> v1-6 flags) (nav-node-flag-byte visited))
|
|
(&+! v1-6 32)
|
|
)
|
|
)
|
|
(dotimes (s4-0 (the-as int (-> this active-cell-count)))
|
|
(let ((a0-4 (-> this active-cell-list s4-0)))
|
|
(dotimes (v1-11 (-> a0-4 segment-count))
|
|
(let ((a1-5 (-> a0-4 segment-array v1-11 branch src-node)))
|
|
(logior! (-> a1-5 flags) (nav-node-flag-byte visited))
|
|
)
|
|
)
|
|
(debug-draw a0-4)
|
|
)
|
|
)
|
|
(let ((sv-16 (-> s5-0 node-array 0)))
|
|
(countdown (gp-1 (-> s5-0 node-count))
|
|
(when (logtest? (-> sv-16 flags) (nav-node-flag-byte visited))
|
|
(debug-draw sv-16)
|
|
(dotimes (s5-1 (-> sv-16 branch-count))
|
|
(let* ((sv-20 (-> sv-16 branch-array s5-1))
|
|
(sv-80 (-> sv-20 dest-node))
|
|
(sv-84 (new 'stack-no-clear 'vector))
|
|
)
|
|
(let ((sv-88 (new 'stack-no-clear 'vector)))
|
|
(let ((sv-92 (new 'stack-no-clear 'vector)))
|
|
(let ((a1-7 sv-16)
|
|
(v1-35 sv-88)
|
|
)
|
|
(vector-copy! v1-35 (-> a1-7 position))
|
|
(set! (-> v1-35 w) 1.0)
|
|
)
|
|
(let ((a1-10 sv-80)
|
|
(v1-36 sv-92)
|
|
)
|
|
(vector-copy! v1-36 (-> a1-10 position))
|
|
(set! (-> v1-36 w) 1.0)
|
|
)
|
|
(vector-! sv-84 sv-92 sv-88)
|
|
)
|
|
(vector+float*! sv-84 sv-88 sv-84 0.5)
|
|
)
|
|
(let ((s4-1 add-debug-text-3d)
|
|
(s3-0 #t)
|
|
(s2-0 583)
|
|
)
|
|
(format (clear *temp-string*) "~D" (-> sv-20 user-count))
|
|
(s4-1
|
|
s3-0
|
|
(the-as bucket-id s2-0)
|
|
*temp-string*
|
|
sv-84
|
|
(if (< (-> sv-20 user-count) (-> sv-20 max-user-count))
|
|
(font-color yellow)
|
|
(font-color red)
|
|
)
|
|
(the-as vector2h #f)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(&+! sv-16 32)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|