Update the shadow renderer to use the common scnaline management routines

This commit is contained in:
Lucas Scharenbroich 2023-04-28 00:35:35 -05:00
parent c7a143b488
commit a5498e07eb

View File

@ -468,9 +468,10 @@ _RenderWithShadowing
; At this point, everything in the background has been rendered into the code field. Next, we need ; At this point, everything in the background has been rendered into the code field. Next, we need
; to create priority lists of scanline ranges. ; to create priority lists of scanline ranges.
jsr _FilterObjectList ; Walk the sorted list and create an array of objects that need to be rendered
jsr _ShadowOff ; Turn off shadowing and draw all the scanlines with sprites on them jsr _ShadowOff ; Turn off shadowing and draw all the scanlines with sprites on them
jsr _DrawShadowList jsr _DrawObjShadow ; Draw the background
jsr _DrawDirectSprites ; Draw the sprites directly to the Bank $01 graphics buffer (skipping the render-to-tile step) jsr _DrawDirectSprites ; Draw the sprites directly to the Bank $01 graphics buffer (skipping the render-to-tile step)
jsr _ShadowOn ; Turn shadowing back on jsr _ShadowOn ; Turn shadowing back on
@ -500,27 +501,6 @@ _RenderWithShadowing
:no_removal :no_removal
rts rts
; Iterate through the shadow list and call _BltRange on each
_DrawShadowList
ldx #0
bra :start
:loop
phx ; Save the index
lda _ShadowListTop,x
ldy _ShadowListBottom,x
tax
jsr _BltRange
plx
inx
inx
:start
cpx _ShadowListCount
bcc :loop
rts
; Run through the list of sprites that are not OFFSCREEN and not OVERLAYS and draw them directly to the graphics screen. We can use ; Run through the list of sprites that are not OFFSCREEN and not OVERLAYS and draw them directly to the graphics screen. We can use
; compiled sprites here, with limitations. ; compiled sprites here, with limitations.
_DrawDirectSprites _DrawDirectSprites