summaryrefslogtreecommitdiff
path: root/src/battle_gfx_sfx_util.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-10-08 10:38:29 -0400
committerGitHub <noreply@github.com>2021-10-08 10:38:29 -0400
commite26f9d10d7bebee5ea512fc4729ce6adafec66a0 (patch)
treeb868ba0c0b0618c38064037d840c52971ca10111 /src/battle_gfx_sfx_util.c
parent6012cf43cbfc27e37fedae41136e13a62ccdd61c (diff)
parent6e62c057f5123b458ebc7d74e60c7ce8fb32e980 (diff)
Merge pull request #1509 from GriffinRichards/doc-sprman
Document remaining symbols in pokemon.c
Diffstat (limited to 'src/battle_gfx_sfx_util.c')
-rw-r--r--src/battle_gfx_sfx_util.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c
index 77755775e..da15c07a0 100644
--- a/src/battle_gfx_sfx_util.c
+++ b/src/battle_gfx_sfx_util.c
@@ -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);
}