From 8946119f19bd0f5ac047a1ca80bf059870987bed Mon Sep 17 00:00:00 2001 From: ManDude <7569514+ManDude@users.noreply.github.com> Date: Tue, 3 Aug 2021 23:26:00 +0100 Subject: [PATCH] forgot something in `main` (#738) --- goal_src/engine/game/main.gc | 44 ++++++------------------------------ 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/goal_src/engine/game/main.gc b/goal_src/engine/game/main.gc index bc0506ca5f..7233659647 100644 --- a/goal_src/engine/game/main.gc +++ b/goal_src/engine/game/main.gc @@ -19,28 +19,12 @@ (defun letterbox () "Draw the letterbox black rectangles" - (let* ((dma-buf (current-display-frame global-buf)) - (gp-0 (-> dma-buf base)) - ) - ;; draw the sprites (gp-0 points to this DMA data) + (with-dma-buffer-add-bucket ((dma-buf (current-display-frame global-buf)) + (current-display-frame bucket-group) + (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets + ;; draw the two sprites (draw-sprite2d-xy dma-buf 0 0 512 25 (new 'static 'rgba :a #x80)) (draw-sprite2d-xy dma-buf 0 199 512 26 (new 'static 'rgba :a #x80)) - (let ((a3-2 (-> dma-buf base))) - (let ((pkt (the-as dma-packet (-> dma-buf base)))) - (set! (-> pkt dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> pkt vif0) (new 'static 'vif-tag)) - (set! (-> pkt vif1) (new 'static 'vif-tag)) - (set! (-> dma-buf base) (the-as pointer (&+ pkt 16))) - ) - - ;; add the sprites to debug-draw1, this makes sure it gets drawn at the very end. - (dma-bucket-insert-tag - (current-display-frame bucket-group) - (bucket-id debug-draw1) - gp-0 - (the-as (pointer dma-tag) a3-2) - ) - ) ) (none) ) @@ -61,24 +45,10 @@ (defun blackout () "Draw the blackout rectangle, convering the entire screen in darkness." - (let* ((dma-buf (current-display-frame global-buf)) - (sprite-dma-data (-> dma-buf base)) - ) + (with-dma-buffer-add-bucket ((dma-buf (current-display-frame global-buf)) + (current-display-frame bucket-group) + (bucket-id debug-draw1)) ;; debug-draw1 is one of the last buckets (draw-sprite2d-xy dma-buf 0 0 512 224 (new 'static 'rgba :a #x80)) - (let ((a3-1 (-> dma-buf base))) - (let ((pkt (the-as dma-packet (-> dma-buf base)))) - (set! (-> pkt dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> pkt vif0) (new 'static 'vif-tag)) - (set! (-> pkt vif1) (new 'static 'vif-tag)) - (set! (-> dma-buf base) (the-as pointer (&+ pkt 16))) - ) - (dma-bucket-insert-tag - (current-display-frame bucket-group) - (bucket-id debug-draw1) - sprite-dma-data - (the-as (pointer dma-tag) a3-1) - ) - ) ) (none) )