Fixed player render glitch related to scrolling

This commit is contained in:
blondie7575 2023-12-23 10:33:24 -07:00
parent d0bfa23d60
commit 0634837dbc

View File

@ -35,8 +35,6 @@ beginGameplay:
ldy #0 ldy #0
jsr renderPlayerHeader jsr renderPlayerHeader
jsr protectPlayers
jsr protectProjectiles
jsr prepareRowRendering jsr prepareRowRendering
jsr compileTerrain jsr compileTerrain
@ -44,6 +42,7 @@ beginGameplay:
jsr renderTerrain jsr renderTerrain
jsr renderInventory jsr renderInventory
jsr protectPlayers
jsr renderPlayers jsr renderPlayers
; Fade in from menu ; Fade in from menu
@ -153,6 +152,12 @@ gameplayLoopRender:
stz terrainDirty stz terrainDirty
; Render players ; Render players
lda playersDirty ; Check if terrain moved since last protect
beq gameplayLoopRenderPlayersAnyway
jsr unrenderPlayers
jsr protectPlayers
gameplayLoopRenderPlayersAnyway:
jsr renderPlayers jsr renderPlayers
gameplayLoopExplosions: gameplayLoopExplosions:
@ -348,14 +353,10 @@ scrollMapApplyScrolling:
lda #$ffff lda #$ffff
sta mapScrollRequested sta mapScrollRequested
jsr protectPlayers
jsr protectProjectiles
jsr renderPlayers
jsr renderProjectiles ; Prevents flicker, but ads jitter to shot tracking
lda #1 lda #1
sta playersDirty
sta projectilesDirty
sta terrainDirty sta terrainDirty
stz projectilesDirty
rts rts
@ -482,6 +483,8 @@ playerMoveRequested:
.word $0000 .word $0000
terrainDirty: terrainDirty:
.word 1 .word 1
playersDirty:
.word 0
projectilesDirty: projectilesDirty:
.word 1 .word 1
inventoryDirty: inventoryDirty: