Files
jak-project/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc
T
ManDude b50b9eadb2 [decompiler] new features + fixes, + other jak2 fixes (#2796)
Fixes empty boxed arrays of strings breaking some decomp
(`ctywide-speech` and `race-info`).

Adds `decomp-as` tag to decompiler types so that the static data
decompiler can use macros like `meters` and `seconds` on fields that
aren't of type `meters` or `time-frame`.

Adds `override` tag to decompiler types which overrides the type of
field with that name. The type must be a child type of the original
field's type (or the same type, but why would you do this?).

Fixes the camera being offset for `drillmtn` after loading `palout`
once.

This is a huge refactor sadly.
2023-07-04 17:23:24 -04:00

103 lines
4.1 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *los-time-offset*, type time-frame
(define *los-time-offset* (the-as time-frame 0))
;; definition for method 9 of type los-control
;; INFO: Used lq/sq
;; WARN: Return type mismatch time-frame vs none.
(defmethod los-control-method-9 los-control ((obj los-control) (process process-focusable) (trans-vec vector) (radius float))
(when (and (>= (- (current-time) (-> obj last-check-time)) (-> obj check-interval))
(-> obj src-proc)
(or process (-> obj dst-proc))
)
(let* ((process-source (handle->process (-> obj src-proc)))
(process-focus (if (type? process-source process-focusable)
(the-as process-focusable process-source)
)
)
)
(when process-focus
(when (not process)
(let ((process-dest (handle->process (-> obj dst-proc))))
(set! process (if (type? process-dest process-focusable)
(the-as process-focusable process-dest)
)
)
)
)
(when process
(let ((start-pos (new 'stack-no-clear 'vector)))
(set! (-> start-pos quad) (-> (get-trans process-focus 3) quad))
(if (not trans-vec)
(set! trans-vec (get-trans process 3))
)
(let ((distance (vector-! (new 'stack-no-clear 'vector) trans-vec start-pos))
(cquery (new 'stack-no-clear 'collide-query))
)
(set! (-> cquery start-pos quad) (-> start-pos quad))
(set! (-> cquery move-dist quad) (-> distance quad))
(let ((query cquery))
(set! (-> query radius) radius)
(set! (-> query collide-with) (-> obj collide-with))
(set! (-> query ignore-process0) process-focus)
(set! (-> query ignore-process1) process)
(set! (-> query ignore-pat) (-> process-focus root pat-ignore-mask))
(set! (-> query action-mask) (collide-action solid))
)
(fill-using-line-sphere *collide-cache* cquery)
(let ((f30-0 (probe-using-line-sphere *collide-cache* cquery)))
(quad-copy! (the-as pointer (-> obj last-collide-result)) (the-as pointer (-> cquery best-other-tri)) 6)
(if (>= 0.0 f30-0)
(set! (-> obj have-no-los) (current-time))
(set! (-> obj have-los) (current-time))
)
)
)
)
(set! (-> obj last-check-time) (current-time))
)
)
)
)
(none)
)
;; definition for method 10 of type los-control
(defmethod check-los? los-control ((obj los-control) (arg0 time-frame))
(and (>= (- (current-time) (-> obj have-los)) (+ (-> obj check-interval) arg0))
(< (- (current-time) (-> obj have-no-los)) (-> obj check-interval))
)
)
;; definition for method 11 of type los-control
(defmethod skip-check-los? los-control ((obj los-control) (arg0 int))
(and (>= (- (current-time) (-> obj have-no-los)) (+ (-> obj check-interval) arg0))
(< (- (current-time) (-> obj have-los)) (-> obj check-interval))
)
)
;; definition for method 12 of type los-control
;; WARN: Return type mismatch int vs none.
(defmethod set-dst-proc! los-control ((obj los-control) (dst handle))
(set! (-> obj dst-proc) dst)
0
(none)
)
;; definition for method 13 of type los-control
;; WARN: Return type mismatch int vs none.
(defmethod new-source! los-control ((obj los-control) (proc process) (check-interval time-frame) (c-spec collide-spec))
(set! (-> obj src-proc) (process->handle proc))
(set! (-> obj dst-proc) (the-as handle #f))
(set! (-> obj have-los) 0)
(set! (-> obj have-no-los) 0)
(set! (-> obj last-check-time) *los-time-offset*)
(set! (-> obj check-interval) check-interval)
(set! (-> obj collide-with) c-spec)
(set! *los-time-offset* (+ *los-time-offset* 1))
0
(none)
)