mirror of
https://github.com/open-goal/jak-project
synced 2026-09-10 04:22:13 -04:00
goal format
This commit is contained in:
@@ -350,7 +350,7 @@
|
||||
;; og:preserve-this
|
||||
(set! (-> *pc-shadow-queue* run (-> *pc-shadow-queue* cur-run) first) (the pc-shadow-request 0))
|
||||
(set! (-> *pc-shadow-queue* run (-> *pc-shadow-queue* cur-run) next) (the (pointer pc-shadow-request) 0))
|
||||
|
||||
|
||||
0
|
||||
(none))
|
||||
|
||||
@@ -694,7 +694,7 @@
|
||||
(settings (if (-> dc shadow-ctrl) (-> dc shadow-ctrl settings) *default-shadow-settings*))
|
||||
(flags (-> settings flags))
|
||||
)
|
||||
|
||||
|
||||
;; if fade is enabled, and we're all the way faded out, disable draw
|
||||
(when (not (logtest? flags (shadow-flags disable-fade)))
|
||||
(let ((dist (-> (scratchpad-object terrain-context) work foreground bone-mem work distance w)))
|
||||
@@ -703,29 +703,29 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; if disabled, early return
|
||||
(if (logtest? flags (shadow-flags disable-draw))
|
||||
(return dma-ptr)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
;; settings
|
||||
(mem-copy! (the pointer (-> pse settings)) (the pointer settings) (size-of shadow-settings))
|
||||
|
||||
|
||||
;; update the "center" position.
|
||||
(let ((center-pos (-> dc skeleton bones (-> dc shadow-joint-index) position)))
|
||||
(set! (-> pse settings center x) (-> center-pos x))
|
||||
(set! (-> pse settings center y) (-> center-pos y))
|
||||
(set! (-> pse settings center z) (-> center-pos z))
|
||||
)
|
||||
|
||||
|
||||
;; set the other properties
|
||||
(set! (-> pse geo-name) (-> sgeo name))
|
||||
(set! (-> pse mtx) mtx)
|
||||
(set! (-> pse num-joints) (-> sgeo header num-joints))
|
||||
(vector-copy! (-> pse color) (-> *time-of-day-context* current-shadow-color))
|
||||
|
||||
|
||||
;; set up linked list.
|
||||
(let* ((run (-> *pc-shadow-queue* run (-> *pc-shadow-queue* cur-run)))
|
||||
(next (-> run next))
|
||||
@@ -733,13 +733,13 @@
|
||||
|
||||
;; if we're the first in the list, store in the run
|
||||
(if (zero? (-> run first)) (set! (-> run first) pse))
|
||||
|
||||
|
||||
;; patch next pointer of previous
|
||||
(if (nonzero? next) (set! (-> next 0) pse))
|
||||
|
||||
|
||||
;; remember where to patch for the next one
|
||||
(set! (-> run next) (&-> pse next))
|
||||
|
||||
|
||||
;; clear our next pointer in case we're last
|
||||
(set! (-> pse next) (the pc-shadow-request 0))
|
||||
|
||||
@@ -752,7 +752,7 @@
|
||||
(set! (-> pse dma-next vif0) (new 'static 'vif-tag))
|
||||
(set! (-> pse dma-next vif1) (new 'static 'vif-tag))
|
||||
)
|
||||
|
||||
|
||||
dma-ptr
|
||||
)
|
||||
)
|
||||
|
||||
@@ -393,12 +393,12 @@
|
||||
;; og:preserve-this
|
||||
(defun pc-shadow-execute-all ()
|
||||
"Send PC shadow queue to the PC shadow renderer."
|
||||
|
||||
|
||||
;; bail if disabled
|
||||
(if (not (logtest? *vu1-enable-user* (vu1-renderer-mask shadow)))
|
||||
(return #f)
|
||||
)
|
||||
|
||||
|
||||
;; TODO: plus1 here?
|
||||
(dotimes (run-idx (-> *pc-shadow-queue* cur-run))
|
||||
(when (nonzero? (-> *pc-shadow-queue* run run-idx first))
|
||||
|
||||
@@ -1449,7 +1449,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; og:preserve-this
|
||||
(let ((v1-0 *pc-shadow-globals*))
|
||||
(dotimes (a0-0 2)
|
||||
@@ -1465,7 +1465,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
@@ -570,7 +570,7 @@
|
||||
"Add shadows for this draw-control to the *pc-shadow-queue* to be drawn in pc-shadow-execute-all.
|
||||
This places a pc-shadow-request in the DMA buffer and adds it to the linked list of requests
|
||||
for the currently selected run in *pc-shadow-queue*"
|
||||
|
||||
|
||||
(when (-> dc shadow-ctrl)
|
||||
;; update the "center" position of the shadow control, I guess to let some other thing look at it?
|
||||
(let ((center-pos (-> dc skeleton bones (-> dc shadow-joint-index) position))
|
||||
@@ -586,7 +586,7 @@
|
||||
(settings (if (-> dc shadow-ctrl) (-> dc shadow-ctrl settings) *default-shadow-settings*))
|
||||
(flags (-> settings flags))
|
||||
)
|
||||
|
||||
|
||||
;; if fade is enabled, and we're all the way faded out, disable draw
|
||||
(when (not (logtest? flags (shadow-flags disable-fade)))
|
||||
(let ((dist (-> (scratchpad-object foreground-work) distance w)))
|
||||
@@ -598,16 +598,16 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; if disabled, early return
|
||||
(if (logtest? flags (shadow-flags disable-draw))
|
||||
(return dma-ptr)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
;; settings
|
||||
(mem-copy! (the pointer (-> pse settings)) (the pointer settings) (size-of shadow-settings))
|
||||
|
||||
|
||||
;; update the "center" position.
|
||||
(let ((center-pos (-> dc skeleton bones (-> dc shadow-joint-index) position)))
|
||||
(set! (-> pse settings center x) (-> center-pos x))
|
||||
@@ -621,22 +621,22 @@
|
||||
(set! (-> pse num-joints) (-> sgeo num-joints))
|
||||
;; TODO: this is probably the wrong color!!!
|
||||
(vector-copy! (-> pse color) (-> *time-of-day-context* current-shadow-color))
|
||||
|
||||
|
||||
;; set up linked list.
|
||||
(let* ((run (-> *pc-shadow-globals* bucket (-> settings shadow-type)))
|
||||
(next (-> run next))
|
||||
)
|
||||
|
||||
;; if we're the first in the list, store in the run
|
||||
(when (zero? (-> run first))
|
||||
(when (zero? (-> run first))
|
||||
(set! (-> run first) (the pointer pse)))
|
||||
|
||||
|
||||
;; patch next pointer of previous
|
||||
(if (nonzero? next) (set! (-> (the (pointer structure) next) 0) pse))
|
||||
|
||||
|
||||
;; remember where to patch for the next one
|
||||
(set! (-> run next) (&-> pse next))
|
||||
|
||||
|
||||
;; clear our next pointer in case we're last
|
||||
(set! (-> pse next) (the pc-shadow-request 0))
|
||||
|
||||
@@ -649,7 +649,7 @@
|
||||
(set! (-> pse dma-next vif0) (new 'static 'vif-tag))
|
||||
(set! (-> pse dma-next vif1) (new 'static 'vif-tag))
|
||||
)
|
||||
|
||||
|
||||
dma-ptr
|
||||
)
|
||||
)
|
||||
|
||||
@@ -644,19 +644,19 @@
|
||||
;; og:preserve-this
|
||||
(defun pc-shadow-execute-all ()
|
||||
"Send PC shadow queue to the PC shadow renderer."
|
||||
|
||||
|
||||
;; bail if disabled
|
||||
(if (not (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask shadow)))
|
||||
(return #f)
|
||||
)
|
||||
|
||||
|
||||
(dotimes (i 2)
|
||||
(when (nonzero? (-> *pc-shadow-globals* bucket i first))
|
||||
;; patch the color of each request.
|
||||
(let ((iter (the pc-shadow-request (-> *pc-shadow-globals* bucket i first)))
|
||||
(color (new-stack-vector0))
|
||||
)
|
||||
|
||||
|
||||
(cond
|
||||
((= i 0)
|
||||
(vector-float*! color (-> *time-of-day-context* current-shadow-color) 128.0)
|
||||
@@ -669,16 +669,16 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(set! (-> color w) (the float (-> *pc-shadow-globals* bucket i shadow-color a)))
|
||||
|
||||
|
||||
(while (nonzero? iter)
|
||||
;(vector-copy! (-> iter color) color)
|
||||
(set! (-> iter color quad) (-> color quad))
|
||||
(set! iter (-> iter next))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (if (zero? i) (bucket-id shadow) (bucket-id shadow2)))
|
||||
(dma-buffer-add-ref-vif2
|
||||
dma-buf
|
||||
|
||||
@@ -1441,7 +1441,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; og:preserve-this
|
||||
(let ((v1-0 *pc-shadow-globals*))
|
||||
(dotimes (a0-0 3)
|
||||
|
||||
@@ -833,7 +833,7 @@
|
||||
"Add shadows for this draw-control to the *pc-shadow-queue* to be drawn in pc-shadow-execute-all.
|
||||
This places a pc-shadow-request in the DMA buffer and adds it to the linked list of requests
|
||||
for the currently selected run in *pc-shadow-queue*"
|
||||
|
||||
|
||||
(when (-> dc shadow-ctrl)
|
||||
;; update the "center" position of the shadow control, I guess to let some other thing look at it?
|
||||
(let ((center-pos (-> dc skeleton bones (-> dc shadow-joint-index) position))
|
||||
@@ -849,7 +849,7 @@
|
||||
(settings (if (-> dc shadow-ctrl) (-> dc shadow-ctrl settings) *default-shadow-settings*))
|
||||
(flags (-> settings flags))
|
||||
)
|
||||
|
||||
|
||||
;; if fade is enabled, and we're all the way faded out, disable draw
|
||||
(when (not (logtest? flags (shadow-flags disable-fade)))
|
||||
(let ((dist (-> (scratchpad-object foreground-work) distance w)))
|
||||
@@ -861,16 +861,16 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
;; if disabled, early return
|
||||
(if (logtest? flags (shadow-flags disable-draw))
|
||||
(return dma-ptr)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
;; settings
|
||||
(mem-copy! (the pointer (-> pse settings)) (the pointer settings) (size-of shadow-settings))
|
||||
|
||||
|
||||
;; update the "center" position.
|
||||
(let ((center-pos (-> dc skeleton bones (-> dc shadow-joint-index) position)))
|
||||
(set! (-> pse settings center x) (-> center-pos x))
|
||||
@@ -884,22 +884,22 @@
|
||||
(set! (-> pse num-joints) (-> sgeo num-joints))
|
||||
;; TODO: this is probably the wrong color!!!
|
||||
(vector-copy! (-> pse color) (-> *time-of-day-context* current-shadow-color))
|
||||
|
||||
|
||||
;; set up linked list.
|
||||
(let* ((run (-> *pc-shadow-globals* bucket (-> settings shadow-type)))
|
||||
(next (-> run next))
|
||||
)
|
||||
|
||||
;; if we're the first in the list, store in the run
|
||||
(when (zero? (-> run first))
|
||||
(when (zero? (-> run first))
|
||||
(set! (-> run first) (the pointer pse)))
|
||||
|
||||
|
||||
;; patch next pointer of previous
|
||||
(if (nonzero? next) (set! (-> (the (pointer structure) next) 0) pse))
|
||||
|
||||
|
||||
;; remember where to patch for the next one
|
||||
(set! (-> run next) (&-> pse next))
|
||||
|
||||
|
||||
;; clear our next pointer in case we're last
|
||||
(set! (-> pse next) (the pc-shadow-request 0))
|
||||
|
||||
@@ -912,7 +912,7 @@
|
||||
(set! (-> pse dma-next vif0) (new 'static 'vif-tag))
|
||||
(set! (-> pse dma-next vif1) (new 'static 'vif-tag))
|
||||
)
|
||||
|
||||
|
||||
dma-ptr
|
||||
)
|
||||
)
|
||||
|
||||
@@ -662,19 +662,19 @@
|
||||
;; og:preserve-this
|
||||
(defun pc-shadow-execute-all ()
|
||||
"Send PC shadow queue to the PC shadow renderer."
|
||||
|
||||
|
||||
;; bail if disabled
|
||||
(if (not (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask rn32)))
|
||||
(return #f)
|
||||
)
|
||||
|
||||
|
||||
(dotimes (i 3)
|
||||
(when (nonzero? (-> *pc-shadow-globals* bucket i first))
|
||||
;; patch the color of each request.
|
||||
(let ((iter (the pc-shadow-request (-> *pc-shadow-globals* bucket i first)))
|
||||
(color (new-stack-vector0))
|
||||
)
|
||||
|
||||
|
||||
(cond
|
||||
((= i 0)
|
||||
(vector-float*! color (-> *time-of-day-context* current-shadow-color) 128.0)
|
||||
@@ -687,16 +687,16 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(set! (-> color w) (the float (-> *pc-shadow-globals* bucket i shadow-color a)))
|
||||
|
||||
|
||||
(while (nonzero? iter)
|
||||
;(vector-copy! (-> iter color) color)
|
||||
(set! (-> iter color quad) (-> color quad))
|
||||
(set! iter (-> iter next))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
(with-dma-buffer-add-bucket ((dma-buf (-> (current-frame) global-buf)) (-> *pc-shadow-globals* bucket i bucket-id))
|
||||
(dma-buffer-add-ref-vif2
|
||||
dma-buf
|
||||
|
||||
Reference in New Issue
Block a user