Apply suggestions from code review
* Jaizu ran away *
This commit is contained in:
parent
074e601c1f
commit
fcccffce45
1 changed files with 8 additions and 9 deletions
|
@ -851,7 +851,7 @@ void CopyBattleSpriteInvisibility(u8 battlerId)
|
||||||
|
|
||||||
void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality)
|
void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bool32 megaEvo, bool8 trackEnemyPersonality)
|
||||||
{
|
{
|
||||||
u32 personalityValue, otId, position, paletteOffset, targetSpecies, personalityValueEnemyParty;
|
u32 personalityValue, otId, position, paletteOffset, targetSpecies;
|
||||||
const void *lzPaletteData, *src;
|
const void *lzPaletteData, *src;
|
||||||
void *dst;
|
void *dst;
|
||||||
|
|
||||||
|
@ -879,8 +879,9 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
||||||
if (GetBattlerSide(battlerAtk) == B_SIDE_PLAYER)
|
if (GetBattlerSide(battlerAtk) == B_SIDE_PLAYER)
|
||||||
{
|
{
|
||||||
if (trackEnemyPersonality)
|
if (trackEnemyPersonality)
|
||||||
personalityValueEnemyParty = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
else
|
||||||
|
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(FALSE,
|
HandleLoadSpecialPokePic(FALSE,
|
||||||
|
@ -891,8 +892,9 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (trackEnemyPersonality)
|
if (trackEnemyPersonality)
|
||||||
personalityValueEnemyParty = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
else
|
||||||
|
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||||
|
|
||||||
HandleLoadSpecialPokePic(TRUE,
|
HandleLoadSpecialPokePic(TRUE,
|
||||||
|
@ -923,10 +925,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform, bo
|
||||||
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
||||||
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
||||||
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
||||||
if (trackEnemyPersonality)
|
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
|
||||||
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValueEnemyParty);
|
|
||||||
else
|
|
||||||
lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue);
|
|
||||||
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
|
LZDecompressWram(lzPaletteData, gDecompressionBuffer);
|
||||||
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
|
LoadPalette(gDecompressionBuffer, paletteOffset, PLTT_SIZE_4BPP);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue