Files
water111 637990314b wip: better stack var support (#4222)
Closes #736

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2026-04-19 00:14:44 +02:00

715 lines
27 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for method 8 of type drawable-region-prim
;; WARN: Return type mismatch int vs drawable-region-prim.
(defmethod mem-usage ((this drawable-region-prim) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 50 (-> usage length)))
(set! (-> usage data 49 name) "region")
(+! (-> usage data 49 count) 1)
(let ((v1-6 (asize-of this)))
(+! (-> usage data 49 used) v1-6)
(+! (-> usage data 49 total) (logand -16 (+ v1-6 15)))
)
(mem-usage (-> this region) usage (logior flags 128))
(the-as drawable-region-prim 0)
)
;; definition for method 8 of type drawable-inline-array-region-prim
;; WARN: Return type mismatch int vs drawable-inline-array-region-prim.
(defmethod mem-usage ((this drawable-inline-array-region-prim) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) (symbol->string 'drawable-group))
(+! (-> usage data 0 count) 1)
(let ((v1-7 32))
(+! (-> usage data 0 used) v1-7)
(+! (-> usage data 0 total) (logand -16 (+ v1-7 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
(the-as drawable-inline-array-region-prim 0)
)
;; definition for method 10 of type drawable-tree-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod draw ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame))
0
(none)
)
;; definition for method 15 of type drawable-tree-region-prim
(defmethod unpack-vis ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8)))
arg1
)
;; definition for method 16 of type drawable-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod collect-regions ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list))
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
@param area-of-interest The area defined by a sphere that we care about overlaps
@param _count The amount of [[drawable]]s in the object to enumerate through
@param! region-list Stores the overlapping regions and a count for how many were found
@returns none"
(dotimes (count _count)
(when (spheres-overlap? area-of-interest (the-as sphere (-> this bsphere)))
(set! (-> region-list items (-> region-list num-items)) this)
(+! (-> region-list num-items) 1)
)
(&+! this 32)
)
0
(none)
)
;; definition for method 16 of type drawable-inline-array-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod collect-regions ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
@param area-of-interest The area defined by a sphere that we care about overlaps
@param _count The amount of [[drawable]]s in the object to enumerate through
@param! region-list Stores the overlapping regions and a count for how many were found
@returns none"
(collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2)
0
(none)
)
;; definition for method 16 of type drawable-tree-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod collect-regions ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
"Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count
@param area-of-interest The area defined by a sphere that we care about overlaps
@param _count The amount of [[drawable]]s in the object to enumerate through
@param! region-list Stores the overlapping regions and a count for how many were found
@returns none"
(collect-regions (-> this data2 0) arg0 (-> this length) arg2)
0
(none)
)
;; definition for method 17 of type drawable-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw-region ((this drawable-region-prim) (arg0 int))
(let ((sv-32 (new 'stack 'vector2h))
(sv-36 (-> this bsphere))
)
(add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80))
(when (nonzero? (-> this region))
(let ((s5-0 add-debug-text-3d)
(s4-0 #t)
(s3-0 318)
)
(format (clear *temp-string*) "region-~D~%" (-> this region id))
(s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
(let ((s5-1 (-> this region on-enter)))
(when s5-1
(let ((s4-1 add-debug-text-3d)
(s3-1 #t)
(s2-1 318)
)
(format (clear *temp-string*) "(on-enter ~S)" s5-1)
(s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
)
(let ((s5-2 (-> this region on-inside)))
(when s5-2
(let ((s4-2 add-debug-text-3d)
(s3-2 #t)
(s2-2 318)
)
(format (clear *temp-string*) "(on-inside ~S)" s5-2)
(s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
)
(let ((gp-1 (-> this region on-exit)))
(when gp-1
(let ((s5-3 add-debug-text-3d)
(s4-3 #t)
(s3-3 318)
)
(format (clear *temp-string*) "(on-exit ~S)" gp-1)
(s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color white) sv-32)
)
(+! (-> sv-32 y) 8)
)
)
)
)
0
(none)
)
;; definition for method 18 of type drawable-region-prim
(defmethod track-region ((this drawable-region-prim) (arg0 region-prim-area))
"TODO"
#f
)
;; definition for method 19 of type drawable-region-prim
(defmethod within-area? ((this drawable-region-prim) (arg0 region-prim-area))
"@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent"
#f
)
;; definition for method 9 of type region-prim-area
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement.
(defmethod track-entered-region! ((this region-prim-area) (region-sphere drawable-region-sphere))
"Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit
otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count`
@param region-sphere Defines the region in question
@returns nothing"
(let ((regions-entered (-> this region-enter-count)))
(let ((region (-> region-sphere region)))
(countdown (idx regions-entered)
(if (= (-> this region-enter-list idx) region)
(return #f)
)
)
(set! (-> this region-enter-list regions-entered) region)
)
(set! (-> this region-enter-prim-list regions-entered) region-sphere)
(set! (-> this region-enter-count) (+ regions-entered 1))
)
0
(none)
)
;; definition for method 10 of type region-prim-area
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement.
(defmethod track-exited-region! ((this region-prim-area) (arg0 drawable-region-sphere))
"Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit
otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count`
@param region-sphere Defines the region in question
@returns nothing"
(let ((regions-exited (-> this region-exit-count)))
(let ((region (-> arg0 region)))
(countdown (idx regions-exited)
(if (= (-> this region-exit-list idx) region)
(return #f)
)
)
(set! (-> this region-exit-list regions-exited) region)
)
(set! (-> this region-exit-prim-list regions-exited) arg0)
(set! (-> this region-exit-count) (+ regions-exited 1))
)
0
(none)
)
;; definition for method 11 of type region-prim-area
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement.
(defmethod track-inside-region! ((this region-prim-area) (arg0 drawable-region-sphere))
"Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit
otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count`
@param region-sphere Defines the region in question
@returns nothing"
(let ((regions-inside (-> this region-inside-count)))
(let ((region (-> arg0 region)))
(countdown (idx regions-inside)
(if (= (-> this region-inside-list idx) region)
(return #f)
)
)
(set! (-> this region-inside-list regions-inside) region)
)
(set! (-> this region-inside-prim-list regions-inside) arg0)
(set! (-> this region-inside-count) (+ regions-inside 1))
)
0
(none)
)
;; definition for method 12 of type region-prim-area
;; WARN: Return type mismatch int vs none.
;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement.
(defmethod track-start-region! ((this region-prim-area) (arg0 drawable-region-sphere))
"Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit
otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count`
@param region-sphere Defines the region in question
@returns nothing"
(let ((regions-started (-> this region-start-count)))
(let ((region (-> arg0 region)))
(countdown (idx regions-started)
(if (= (-> this region-start-list idx) region)
(return #f)
)
)
(set! (-> this region-start-list regions-started) region)
)
(set! (-> this region-start-prim-list regions-started) arg0)
(set! (-> this region-start-count) (+ regions-started 1))
)
0
(none)
)
;; definition for method 17 of type drawable-region-sphere
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw-region ((this drawable-region-sphere) (arg0 int))
(let ((t9-0 (method-of-type drawable-region-prim debug-draw-region)))
(t9-0 this arg0)
)
(let ((a2-0 (-> this bsphere)))
(add-debug-sphere #t (bucket-id debug2) a2-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x80))
)
0
(none)
)
;; definition for method 18 of type drawable-region-sphere
(defmethod track-region ((this drawable-region-sphere) (area region-prim-area))
"TODO"
(-> this region)
(let ((area-of-interest (-> this bsphere)))
(if (< 0.0 (ray-sphere-intersect (-> area pos) (-> area ray) area-of-interest (-> area-of-interest w)))
(track-entered-region! area this)
)
(if (< 0.0 (ray-sphere-intersect
(-> area unknown-vector-uiyb1)
(-> area unknown-vector-t3edh)
area-of-interest
(-> area-of-interest w)
)
)
(track-exited-region! area this)
)
(if (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere area-of-interest))
(track-start-region! area this)
)
(when (spheres-overlap? (the-as sphere (-> area unknown-vector-uiyb1)) (the-as sphere area-of-interest))
(track-inside-region! area this)
#t
)
)
)
;; definition for method 19 of type drawable-region-sphere
(defmethod within-area? ((this drawable-region-sphere) (area region-prim-area))
"@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent"
(spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> this bsphere)))
)
;; definition for method 17 of type drawable-region-face
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw-region ((this drawable-region-face) (arg0 int))
(when (zero? arg0)
(let ((t9-0 (method-of-type drawable-region-prim debug-draw-region)))
(t9-0 this arg0)
)
)
(let ((s5-0 (-> this bsphere)))
(add-debug-vector
#t
(bucket-id debug-no-zbuf1)
s5-0
(-> this data normal)
(meters 2)
(new 'static 'rgba :r #xff :g #xff :a #x80)
)
(add-debug-sphere #t (bucket-id debug2) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30))
)
(add-debug-bound
(bucket-id debug2)
(-> this data points)
(the-as int (-> this data num-points))
(new 'static 'rgba :r #xff :g #xff :a #x80)
(new 'static 'rgba :r #xff :a #x80)
0
)
0
(none)
)
;; definition for method 18 of type drawable-region-face
(defmethod track-region ((this drawable-region-face) (arg0 region-prim-area))
"TODO"
(-> this region)
(let* ((s4-0 (-> this data))
(v1-1 (-> s4-0 normal))
(a0-3 (>= 0.0 (- (vector-dot (-> arg0 pos) v1-1) (-> v1-1 w))))
(s3-0 (>= 0.0 (- (vector-dot (-> arg0 unknown-vector-uiyb1) v1-1) (-> v1-1 w))))
)
(when (!= a0-3 s3-0)
(when (nonzero? (-> s4-0 num-points))
(let ((sv-48 (new 'stack-no-clear 'vector))
(sv-52 (new 'stack-no-clear 'vector))
(sv-56 (-> s4-0 points))
)
(ray-plane-intersect sv-48 sv-52 (-> arg0 pos) (-> arg0 ray) (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
(let ((s4-1 (-> s4-0 num-points))
(s2-0 0)
(s1-0 (vector-negate! (new 'stack-no-clear 'vector) sv-52))
)
(while (< (+ s2-0 2) (the-as int s4-1))
(if (or (point-in-triangle-cross sv-48 sv-52 (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
(point-in-triangle-cross sv-48 s1-0 (-> sv-56 0) (-> sv-56 1) (-> sv-56 2))
)
(goto cfg-17)
)
(+! s2-0 1)
(set! sv-56 (the-as (inline-array vector) (-> sv-56 1)))
)
)
)
(set! s3-0 s3-0)
(goto cfg-20)
)
(label cfg-17)
(if s3-0
(track-entered-region! arg0 (the-as drawable-region-sphere this))
(track-exited-region! arg0 (the-as drawable-region-sphere this))
)
)
(label cfg-20)
s3-0
)
)
;; definition for method 17 of type drawable-region-volume
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw-region ((this drawable-region-volume) (arg0 int))
(let ((t9-0 (method-of-type drawable-region-prim debug-draw-region)))
(t9-0 this arg0)
)
(let* ((s5-0 (-> this faces length))
(s4-0 0)
(a0-3 (-> this faces data s4-0))
)
(while (< s4-0 s5-0)
(debug-draw-region a0-3 1)
(+! s4-0 1)
(set! a0-3 (-> this faces data s4-0))
)
)
0
(none)
)
;; definition for method 18 of type drawable-region-volume
(defmethod track-region ((this drawable-region-volume) (area region-prim-area))
"TODO"
(if (within-area? this area)
(track-start-region! area (the-as drawable-region-sphere this))
)
(let* ((s4-0 (-> this faces length))
(s3-0 0)
(a0-4 (-> this faces data s3-0))
)
(while (< s3-0 s4-0)
(if (not (track-region a0-4 area))
(return #f)
)
(+! s3-0 1)
(set! a0-4 (-> this faces data s3-0))
)
)
(track-inside-region! area (the-as drawable-region-sphere this))
#t
)
;; definition for method 19 of type drawable-region-volume
(defmethod within-area? ((this drawable-region-volume) (arg0 region-prim-area))
"@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent"
(let* ((v1-1 (-> this faces length))
(a2-0 0)
(a3-2 (-> this faces data a2-0))
)
(while (< a2-0 v1-1)
(let ((a3-4 (-> a3-2 data normal)))
(if (< 0.0 (- (vector-dot (-> arg0 pos) a3-4) (-> a3-4 w)))
(return #f)
)
)
(+! a2-0 1)
(set! a3-2 (-> this faces data a2-0))
)
)
#t
)
;; definition for method 17 of type drawable-tree-region-prim
(defmethod drawable-tree-region-prim-method-17 ((this drawable-tree-region-prim) (arg0 vector))
(sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0)
(let* ((s5-0 (-> this data2 (+ (-> this length) -1) length))
(s4-0 0)
(a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))))
)
(while (< s4-0 s5-0)
(if (within-area? (the-as drawable-region-prim a0-8) (the-as region-prim-area (+ #x70000000 0)))
(return #t)
)
(+! s4-0 1)
(set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))
)
)
#f
)
;; definition for method 9 of type region
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs symbol.
(defmethod point-in-region-debug! ((this region) (arg0 vector))
"Debug check to see if point is in region. This is not efficient, since it has to find the parent geometry of this region."
(sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0)
(dotimes (s5-0 (-> *level* length))
(let ((s4-0 (-> *level* level s5-0)))
(when (= (-> s4-0 status) 'active)
(when (nonzero? (-> s4-0 bsp region-trees))
(let* ((s3-0 (-> s4-0 bsp region-trees length))
(s2-0 0)
(s1-0 (-> s4-0 bsp region-trees s2-0))
)
(while (< s2-0 s3-0)
(let* ((s0-0 (-> s1-0 data2 (+ (-> s1-0 length) -1) length))
(sv-16 0)
(sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1)))))
)
(while (< sv-16 s0-0)
(if (and (= (-> (the-as drawable-region-prim sv-32) region) this)
(within-area?
(the-as drawable-region-prim sv-32)
(the-as region-prim-area (-> (the-as region-prim-area #x70000000) region-prim-list))
)
)
(return (the-as symbol sv-32))
)
(+! sv-16 1)
(set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1)))))
)
)
(+! s2-0 1)
(set! s1-0 (-> s4-0 bsp region-trees s2-0))
)
)
)
)
)
)
(the-as symbol #f)
)
;; definition for method 18 of type drawable-tree-region-prim
;; WARN: Return type mismatch int vs none.
(defmethod debug-print ((this drawable-tree-region-prim) (arg0 vector) (arg1 object))
(sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg0 0.0)
(let* ((s4-0 (-> this data2 (+ (-> this length) -1) length))
(s3-0 0)
(s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))))
)
(while (< s3-0 s4-0)
(if (within-area? (the-as drawable-region-prim s2-0) (the-as region-prim-area (+ #x70000000 0)))
(format
arg1
" splitbox-~D ~A~%"
(-> (the-as drawable-region-prim s2-0) id)
(the-as drawable-region-prim s2-0)
)
)
(+! s3-0 1)
(set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))
)
)
0
(none)
)
;; definition for function region-tree-execute
;; WARN: Return type mismatch int vs none.
(defun region-tree-execute ((arg0 symbol) (arg1 vector) (arg2 vector))
(let ((sv-32 (vector-average! (new 'stack-no-clear 'vector) arg1 arg2)))
(set! (-> sv-32 w) (* 0.5 (vector-vector-distance arg1 arg2)))
(set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0)
(set! (-> (the-as region-prim-area #x70000000) region-enter-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-exit-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0)
(set! (-> (the-as region-prim-area #x70000000) region-start-count) 0)
(sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg1 0.0)
(sphere<-vector+r! (the-as sphere (+ 1312 #x70000000)) arg2 0.0)
(vector-! (the-as vector (+ 1328 #x70000000)) arg2 arg1)
(vector-! (the-as vector (+ 1344 #x70000000)) arg1 arg2)
(dotimes (s5-1 (-> *level* length))
(let ((v1-17 (-> *level* level s5-1)))
(when (= (-> v1-17 status) 'active)
(let ((s4-1 (-> v1-17 bsp region-trees)))
(when (nonzero? s4-1)
(let* ((s3-0 (-> s4-1 length))
(s2-0 0)
(a0-14 (-> s4-1 s2-0))
)
(while (< s2-0 s3-0)
(if (= (-> a0-14 name) arg0)
(collect-regions a0-14 (the-as sphere sv-32) 0 (the-as region-prim-list (+ #x70000000 0)))
)
(+! s2-0 1)
(set! a0-14 (-> s4-1 s2-0))
)
)
)
)
)
)
)
)
(countdown (gp-1 (-> (the-as region-prim-area #x70000000) region-prim-list num-items))
(track-region
(-> (the-as region-prim-area (+ (* gp-1 4) #x70000000)) region-prim-list items 0)
(the-as region-prim-area (-> (the-as region-prim-area #x70000000) region-prim-list))
)
)
(let ((gp-2 (-> (the-as region-prim-area #x70000000) region-enter-count)))
(while (begin (label cfg-22) (nonzero? gp-2))
(+! gp-2 -1)
(let* ((a2-5 (-> (the-as region-prim-area (+ (* gp-2 4) #x70000000)) region-enter-list 0))
(s5-2 (-> a2-5 on-enter))
)
(when s5-2
(countdown (v1-47 (-> (the-as region-prim-area #x70000000) region-start-count))
(if (= a2-5 (-> (the-as region-prim-area #x70000000) region-start-list v1-47))
(goto cfg-22)
)
)
(script-eval
s5-2
:key a2-5
:vector (-> (the-as region-prim-area (+ (* gp-2 4) #x70000000)) region-enter-prim-list 0 bsphere)
)
)
)
)
)
(let ((gp-3 (-> (the-as region-prim-area #x70000000) region-exit-count)))
(while (begin (label cfg-31) (nonzero? gp-3))
(+! gp-3 -1)
(let* ((a2-6 (-> (the-as region-prim-area (+ (* gp-3 4) #x70000000)) region-exit-list 0))
(s5-3 (-> a2-6 on-exit))
)
(when s5-3
(countdown (v1-64 (-> (the-as region-prim-area #x70000000) region-inside-count))
(if (= a2-6 (-> (the-as region-prim-area (+ (* v1-64 4) #x70000000)) region-inside-list 0))
(goto cfg-31)
)
)
(script-eval
s5-3
:key a2-6
:vector (-> (the-as region-prim-area (+ (* gp-3 4) #x70000000)) region-exit-prim-list 0 bsphere)
)
)
)
)
)
(countdown (gp-4 (-> (the-as region-prim-area #x70000000) region-inside-count))
(let* ((a2-7 (-> (the-as region-prim-area (+ (* gp-4 4) #x70000000)) region-inside-list 0))
(s5-4 (-> a2-7 on-inside))
)
(if s5-4
(script-eval
s5-4
:key a2-7
:vector (-> (the-as region-prim-area (+ (* gp-4 4) #x70000000)) region-inside-prim-list 0 bsphere)
)
)
)
)
0
(none)
)
;; definition for function region-execute
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defun region-execute ()
(set! (-> *level* camera-pos 1 quad) (-> *level* camera-pos 0 quad))
(set! (-> *level* camera-pos 0 quad) (-> (camera-pos) quad))
(set! (-> *level* target-pos 1 quad) (-> *level* target-pos 0 quad))
(set! (-> *level* target-pos 0 quad) (-> (target-pos 0) quad))
(when (and *execute-regions* (-> *setting-control* user-current region-mode) (not (paused?)))
(region-tree-execute 'camera (-> *level* camera-pos 1) (-> *level* camera-pos 0))
(region-tree-execute 'target (-> *level* target-pos 1) (-> *level* target-pos 0))
)
0
(none)
)
;; definition for function region-prim-lookup-by-id
;; WARN: Return type mismatch int vs drawable-region-prim.
(defun region-prim-lookup-by-id ((arg0 int) (arg1 symbol) (arg2 int))
(let ((v1-0 -1))
(dotimes (a3-0 (-> *level* length))
(let ((t0-3 (-> *level* level a3-0)))
(when (= (-> t0-3 status) 'active)
(when (nonzero? (-> t0-3 bsp region-trees))
(let* ((t1-8 (-> t0-3 bsp region-trees length))
(t2-1 0)
(t3-2 (-> t0-3 bsp region-trees t2-1))
)
(while (< t2-1 t1-8)
(when (or (not arg1) (= (-> t3-2 name) arg1))
(let* ((t4-10 (-> t3-2 data2 (+ (-> t3-2 length) -1) length))
(t5-0 0)
(t6-2 (the-as object (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1))))))
)
(while (< t5-0 t4-10)
(when (= (-> (the-as drawable-region-prim t6-2) region id) arg0)
(+! v1-0 1)
(if (= v1-0 arg2)
(return (the-as drawable-region-prim t6-2))
)
)
(+! t5-0 1)
(set! t6-2 (+ (+ (* t5-0 32) 32) (the-as int (-> t3-2 data2 (+ (-> t3-2 length) -1)))))
)
)
)
(+! t2-1 1)
(set! t3-2 (-> t0-3 bsp region-trees t2-1))
)
)
)
)
)
)
)
(the-as drawable-region-prim #f)
)
;; definition for function region-lookup-by-id
(defun region-lookup-by-id ((arg0 int))
(dotimes (v1-0 (-> *level* length))
(let ((a1-3 (-> *level* level v1-0)))
(when (= (-> a1-3 status) 'active)
(when (nonzero? (-> a1-3 bsp region-array))
(let* ((a2-8 (-> a1-3 bsp region-array length))
(a3-1 0)
(t0-2 (-> a1-3 bsp region-array data a3-1))
)
(while (< a3-1 a2-8)
(if (= (-> t0-2 id) arg0)
(return t0-2)
)
(+! a3-1 1)
(set! t0-2 (-> a1-3 bsp region-array data a3-1))
)
)
)
)
)
)
(the-as region #f)
)