Rename _UpdateSprites to _UpdateActiveSprites and create UpdateActiveSprites in home back (along with the existing UpdateSprites)

This commit is contained in:
xCrystal 2023-10-21 18:46:56 +02:00
parent 961d2f0b6e
commit e9ad1f5612
7 changed files with 25 additions and 18 deletions

View File

@ -297,7 +297,7 @@ wMapStatus == MAPSTATUS_HANDLE: <c>the remainder of the code goes at this level<
> DelayFrames(hOverworldDelay) > DelayFrames(hOverworldDelay)
> <f>**HandleMapBackground**</f> <c>_UpdateSprites + ScrollScreen</c> > <f>**HandleMapBackground**</f> <c>UpdateActiveSprites + ScrollScreen</c>
> <f>CheckPlayerState:</f>\ > <f>CheckPlayerState:</f>\
> wPlayerStepFlags[PLAYERSTEP_CONTINUE_F] == FALSE:\ > wPlayerStepFlags[PLAYERSTEP_CONTINUE_F] == FALSE:\

View File

@ -288,7 +288,7 @@ BoardMenu_BreakDieAnimation:
ld a, $4 * SPRITEOAMSTRUCT_LENGTH ; w/o SPRITE_ANIM_OBJ_BOARD_MENU_APPEAR_DIE_NUMBER ld a, $4 * SPRITEOAMSTRUCT_LENGTH ; w/o SPRITE_ANIM_OBJ_BOARD_MENU_APPEAR_DIE_NUMBER
.go .go
ldh [hUsedSpriteIndex], a ldh [hUsedSpriteIndex], a
farcall _UpdateSpritesAfterOffset farcall _UpdateActiveSpritesAfterOffset
ld de, SFX_STRENGTH ld de, SFX_STRENGTH
call PlaySFX call PlaySFX
@ -315,7 +315,7 @@ BoardMenu_BreakDieAnimation:
ld a, $4 * SPRITEOAMSTRUCT_LENGTH ld a, $4 * SPRITEOAMSTRUCT_LENGTH
ldh [hUsedSpriteIndex], a ldh [hUsedSpriteIndex], a
farcall _UpdateSpritesAfterOffset farcall _UpdateActiveSpritesAfterOffset
; play move die number animation ; play move die number animation
ld a, 43 ; total duration of SPRITE_ANIM_FRAMESET_BOARD_MENU_MOVE_DIE_NUMBER ld a, 43 ; total duration of SPRITE_ANIM_FRAMESET_BOARD_MENU_MOVE_DIE_NUMBER

View File

@ -57,7 +57,7 @@ EndSpaceScript::
; clear spaces left sprites ; clear spaces left sprites
ld hl, wDisplaySecondarySprites ld hl, wDisplaySecondarySprites
res SECONDARYSPRITES_SPACES_LEFT_F, [hl] res SECONDARYSPRITES_SPACES_LEFT_F, [hl]
farcall _UpdateSprites call UpdateActiveSprites
; fade out slow to white ; fade out slow to white
ld b, RGBFADE_TO_WHITE_8BGP_8OBP ld b, RGBFADE_TO_WHITE_8BGP_8OBP
jp DoRGBFadeEffect jp DoRGBFadeEffect
@ -94,8 +94,7 @@ ArriveToRegularSpace:
ld a, [wPlayerTile] ld a, [wPlayerTile]
cp COLL_END_SPACE cp COLL_END_SPACE
ret nz ret nz
farcall _UpdateSprites jp UpdateActiveSprites
ret
LandedInRegularSpaceScript: LandedInRegularSpaceScript:
callasm LandedInRegularSpace callasm LandedInRegularSpace

View File

@ -240,7 +240,7 @@ HandleMapObjects:
ret ret
HandleMapBackground: HandleMapBackground:
farcall _UpdateSprites call UpdateActiveSprites
farcall ScrollScreen farcall ScrollScreen
ret ret

View File

@ -2201,14 +2201,14 @@ RespawnPlayerAndOpponent:
jr z, .skip_opponent jr z, .skip_opponent
call RespawnObject call RespawnObject
.skip_opponent .skip_opponent
call _UpdateSprites call _UpdateActiveSprites
ret ret
RespawnPlayer: RespawnPlayer:
call HideAllObjects call HideAllObjects
ld a, PLAYER ld a, PLAYER
call RespawnObject call RespawnObject
call _UpdateSprites call _UpdateActiveSprites
ret ret
RespawnObject: RespawnObject:
@ -2754,13 +2754,13 @@ ResetObject:
db SPRITEMOVEDATA_STANDING_LEFT db SPRITEMOVEDATA_STANDING_LEFT
db SPRITEMOVEDATA_STANDING_RIGHT db SPRITEMOVEDATA_STANDING_RIGHT
_UpdateSpritesAfterOffset:: _UpdateActiveSpritesAfterOffset::
ld a, [wVramState] ld a, [wVramState]
bit 0, a bit 0, a
ret z ret z
jr _UpdateSprites.go jr _UpdateActiveSprites.go
_UpdateSprites:: _UpdateActiveSprites::
ld a, [wVramState] ld a, [wVramState]
bit 0, a bit 0, a
ret z ret z
@ -3079,10 +3079,11 @@ InitSprites:
dw wObject12Struct dw wObject12Struct
_UpdateSecondarySprites:: _UpdateSecondarySprites::
; this is a shorter _UpdateSprites for when only secondary sprites have changed since the last sprites update, ; this is a shorter _UpdateActiveSprites for when only secondary sprites
; but NOT expanded or shrinked, which would require to displace primary (NPC) sprites in OAM. ; have changed since the last sprites update, but NOT expanded or shrinked,
; which would require to displace primary (NPC) sprites in OAM.
; if it is detected that the size of secondary sprites has increased in the end, ; if it is detected that the size of secondary sprites has increased in the end,
; fall back to calling _UpdateSprites to avoid corruption. ; fall back to calling _UpdateActiveSprites to avoid corruption.
ld a, [wVramState] ld a, [wVramState]
bit 0, a bit 0, a
ret z ret z
@ -3105,7 +3106,7 @@ _UpdateSecondarySprites::
pop af pop af
cp c cp c
ret nc ret nc
jp _UpdateSprites jp _UpdateActiveSprites
InitSecondarySprites: InitSecondarySprites:
ld a, [wDisplaySecondarySprites] ld a, [wDisplaySecondarySprites]

View File

@ -984,7 +984,7 @@ Script_disappear:
ldh a, [hMapObjectIndex] ldh a, [hMapObjectIndex]
ld b, 1 ; set ld b, 1 ; set
call ApplyEventActionAppearDisappear call ApplyEventActionAppearDisappear
farcall _UpdateSprites call UpdateActiveSprites
ret ret
ApplyEventActionAppearDisappear: ApplyEventActionAppearDisappear:

View File

@ -545,7 +545,14 @@ UpdateSprites::
bit 0, a bit 0, a
ret z ret z
farcall UpdateAllObjectsFrozen farcall UpdateAllObjectsFrozen
farcall _UpdateSprites farcall _UpdateActiveSprites
ret
UpdateActiveSprites::
ld a, [wVramState]
bit 0, a
ret z
farcall _UpdateActiveSprites
ret ret
UpdateSecondarySprites:: UpdateSecondarySprites::