diff options
Diffstat (limited to 'src/battle_gfx_sfx_util.c')
-rw-r--r-- | src/battle_gfx_sfx_util.c | 27 |
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); } |