Document summary screen sprite manager

This commit is contained in:
GriffinR
2021-10-02 23:47:59 -04:00
parent 001a25e49c
commit 739e7d3c31
16 changed files with 243 additions and 204 deletions
+12 -15
View File
@@ -924,13 +924,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
if (IsContest())
{
position = 0;
position = B_POSITION_PLAYER_LEFT;
targetSpecies = gContestResources->moveAnim->targetSpecies;
personalityValue = gContestResources->moveAnim->personality;
otId = gContestResources->moveAnim->otId;
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
gMonSpritesGfxPtr->sprites.ptr[0],
gMonSpritesGfxPtr->sprites.ptr[position],
targetSpecies,
gContestResources->moveAnim->targetPersonality);
}
@@ -1001,7 +1001,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
if (!loadMonSprite)
{
if (IsContest())
position = 0;
position = B_POSITION_PLAYER_LEFT;
else
position = GetBattlerPosition(battlerId);
@@ -1260,11 +1260,11 @@ void AllocateMonSpritesGfx(void)
for (j = 0; j < 4; j++)
{
gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
gMonSpritesGfxPtr->field_74[i][j].size = MON_PIC_SIZE;
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE;
}
gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->field_74[i];
gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->frameImages[i];
}
gMonSpritesGfxPtr->barFontGfx = AllocZeroed(0x1000);
@@ -1275,17 +1275,14 @@ void FreeMonSpritesGfx(void)
if (gMonSpritesGfxPtr == NULL)
return;
if (gMonSpritesGfxPtr->buffer != NULL)
FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
if (gMonSpritesGfxPtr->field_178 != NULL)
FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_178);
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->unusedPtr);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->barFontGfx);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed);
gMonSpritesGfxPtr->sprites.ptr[0] = NULL;
gMonSpritesGfxPtr->sprites.ptr[1] = NULL;
gMonSpritesGfxPtr->sprites.ptr[2] = NULL;
gMonSpritesGfxPtr->sprites.ptr[3] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_RIGHT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT] = NULL;
FREE_AND_SET_NULL(gMonSpritesGfxPtr);
}