[jak2] fix compile error (#2862)

not sure how this passed tests....
This commit is contained in:
water111 2023-07-29 17:41:11 -04:00 committed by GitHub
parent 89e52e3114
commit a48df0683f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 53 additions and 50 deletions

View file

@ -58,6 +58,58 @@
)
(defun sphere-cull-for-ocean ((arg0 vector))
"Is the given sphere in the view frustum?
PC-port ocean version"
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf10 :class vf)
(vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
(vf19 :class vf)
(vf9 :class vf)
)
;; modified for PC: these register would be loaded by the draw method of bsp.
(cond
((-> *time-of-day-context* use-camera-other)
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane-other 0 quad))
(.lvf vf17 (&-> at-0 plane-other 1 quad))
(.lvf vf18 (&-> at-0 plane-other 2 quad))
(.lvf vf19 (&-> at-0 plane-other 3 quad))
)
)
(else
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
(.lvf vf18 (&-> at-0 plane 2 quad))
(.lvf vf19 (&-> at-0 plane 3 quad))
)
)
)
(init-vf0-vector)
(.lvf vf10 (&-> arg0 quad))
(.mul.x.vf acc vf16 vf10)
(.add.mul.y.vf acc vf17 vf10 acc)
(.add.mul.z.vf acc vf18 vf10 acc)
(.sub.mul.w.vf vf9 vf19 vf0 acc)
;; checking to see if we are inside all 4 planes.
;; using the inside part of the sphere
(.add.w.vf vf9 vf9 vf10)
(.mov v1-0 vf9)
(.pcgtw v1-1 0 v1-0)
(.ppach v1-2 (the-as uint128 0) v1-1)
(zero? (the-as int v1-2))
)
)
(defun guard-band-cull ((arg0 vector))
"Is the given sphere within the guard band, and possibly needs clipping?"
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))

View file

@ -939,53 +939,4 @@
)
)
(defun sphere-cull-for-ocean ((arg0 vector))
"Is the given sphere in the view frustum?
PC-port ocean version"
(local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf10 :class vf)
(vf16 :class vf)
(vf17 :class vf)
(vf18 :class vf)
(vf19 :class vf)
(vf9 :class vf)
)
;; modified for PC: these register would be loaded by the draw method of bsp.
(cond
((-> *time-of-day-context* use-camera-other)
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane-other 0 quad))
(.lvf vf17 (&-> at-0 plane-other 1 quad))
(.lvf vf18 (&-> at-0 plane-other 2 quad))
(.lvf vf19 (&-> at-0 plane-other 3 quad))
)
)
(else
(let ((at-0 *math-camera*))
(.lvf vf16 (&-> at-0 plane 0 quad))
(.lvf vf17 (&-> at-0 plane 1 quad))
(.lvf vf18 (&-> at-0 plane 2 quad))
(.lvf vf19 (&-> at-0 plane 3 quad))
)
)
)
(init-vf0-vector)
(.lvf vf10 (&-> arg0 quad))
(.mul.x.vf acc vf16 vf10)
(.add.mul.y.vf acc vf17 vf10 acc)
(.add.mul.z.vf acc vf18 vf10 acc)
(.sub.mul.w.vf vf9 vf19 vf0 acc)
;; checking to see if we are inside all 4 planes.
;; using the inside part of the sphere
(.add.w.vf vf9 vf9 vf10)
(.mov v1-0 vf9)
(.pcgtw v1-1 0 v1-0)
(.ppach v1-2 (the-as uint128 0) v1-1)
(zero? (the-as int v1-2))
)
)
(define-extern sphere-cull-for-ocean (function vector symbol))