unify monSpritesGfx sprites/ptr and fix various compiler errors on o3/os/og (#4252)
This commit is contained in:
parent
3b45fda8e9
commit
a36cfb1093
22 changed files with 59 additions and 66 deletions
|
@ -973,15 +973,10 @@ struct BattleSpriteData
|
|||
struct MonSpritesGfx
|
||||
{
|
||||
void *firstDecompressed; // ptr to the decompressed sprite of the first Pokémon
|
||||
union {
|
||||
void *ptr[MAX_BATTLERS_COUNT];
|
||||
u8 *byte[MAX_BATTLERS_COUNT];
|
||||
} sprites;
|
||||
u8 *spritesGfx[MAX_BATTLERS_COUNT];
|
||||
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
|
||||
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][MAX_MON_PIC_FRAMES];
|
||||
u8 unusedArr[0x80];
|
||||
u8 *barFontGfx;
|
||||
void *unusedPtr;
|
||||
u16 *buffer;
|
||||
};
|
||||
|
||||
|
|
|
@ -2368,7 +2368,7 @@ void AnimTask_TransformMon(u8 taskId)
|
|||
else
|
||||
position = GetBattlerPosition(gBattleAnimAttacker);
|
||||
|
||||
src = gMonSpritesGfxPtr->sprites.ptr[position];
|
||||
src = gMonSpritesGfxPtr->spritesGfx[position];
|
||||
dest = animBg.bgTiles;
|
||||
CpuCopy32(src, dest, MON_PIC_SIZE);
|
||||
LoadBgTiles(1, animBg.bgTiles, 0x800, animBg.tilesOffset);
|
||||
|
|
|
@ -637,7 +637,7 @@ void BS_SetMaxMoveEffect(void)
|
|||
case MAX_EFFECT_SANDSTORM:
|
||||
case MAX_EFFECT_HAIL:
|
||||
{
|
||||
u8 weather, msg;
|
||||
u8 weather = 0, msg = 0;
|
||||
switch (maxEffect)
|
||||
{
|
||||
case MAX_EFFECT_SUN:
|
||||
|
|
|
@ -606,13 +606,13 @@ void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battler)
|
|||
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
species, currentPersonality);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
species, currentPersonality);
|
||||
}
|
||||
|
||||
|
@ -654,7 +654,7 @@ void DecompressTrainerFrontPic(u16 frontPicId, u8 battler)
|
|||
{
|
||||
u8 position = GetBattlerPosition(battler);
|
||||
DecompressPicFromTable(&gTrainerSprites[frontPicId].frontPic,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
LoadCompressedSpritePalette(&gTrainerSprites[frontPicId].palette);
|
||||
}
|
||||
|
||||
|
@ -662,7 +662,7 @@ void DecompressTrainerBackPic(u16 backPicId, u8 battler)
|
|||
{
|
||||
u8 position = GetBattlerPosition(battler);
|
||||
DecompressPicFromTable(&gTrainerBacksprites[backPicId].backPic,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
LoadCompressedPalette(gTrainerBacksprites[backPicId].palette.data,
|
||||
OBJ_PLTT_ID(battler), PLTT_SIZE_4BPP);
|
||||
}
|
||||
|
@ -883,7 +883,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
|||
isShiny = gContestResources->moveAnim->isShiny;
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gContestResources->moveAnim->targetPersonality);
|
||||
}
|
||||
|
@ -910,7 +910,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
|||
}
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gTransformedPersonalities[battlerAtk]);
|
||||
}
|
||||
|
@ -928,12 +928,12 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
|||
}
|
||||
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[position],
|
||||
gMonSpritesGfxPtr->spritesGfx[position],
|
||||
targetSpecies,
|
||||
gTransformedPersonalities[battlerAtk]);
|
||||
}
|
||||
}
|
||||
src = gMonSpritesGfxPtr->sprites.ptr[position];
|
||||
src = gMonSpritesGfxPtr->spritesGfx[position];
|
||||
dst = (void *)(OBJ_VRAM0 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32);
|
||||
DmaCopy32(3, src, dst, MON_PIC_SIZE);
|
||||
paletteOffset = OBJ_PLTT_ID(battlerAtk);
|
||||
|
@ -961,22 +961,21 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battler, bool8 loadMonSprite)
|
|||
|
||||
if (!loadMonSprite)
|
||||
{
|
||||
|
||||
if (IsContest())
|
||||
position = B_POSITION_PLAYER_LEFT;
|
||||
else
|
||||
position = GetBattlerPosition(battler);
|
||||
|
||||
if (IsContest())
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
else if (GetBattlerSide(battler) != B_SIDE_PLAYER)
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_Substitute, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_Substitute, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
else
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->sprites.ptr[position]);
|
||||
LZDecompressVram(gBattleAnimSpriteGfx_SubstituteBack, gMonSpritesGfxPtr->spritesGfx[position]);
|
||||
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
Dma3CopyLarge32_(gMonSpritesGfxPtr->sprites.ptr[position], &gMonSpritesGfxPtr->sprites.byte[position][MON_PIC_SIZE * i], MON_PIC_SIZE);
|
||||
Dma3CopyLarge32_(gMonSpritesGfxPtr->spritesGfx[position], &gMonSpritesGfxPtr->spritesGfx[position][MON_PIC_SIZE * i], MON_PIC_SIZE);
|
||||
}
|
||||
|
||||
palOffset = OBJ_PLTT_ID(battler);
|
||||
|
@ -1217,14 +1216,14 @@ void AllocateMonSpritesGfx(void)
|
|||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
gMonSpritesGfxPtr->sprites.ptr[i] = gMonSpritesGfxPtr->firstDecompressed + (i * MON_PIC_SIZE * 4);
|
||||
*(gMonSpritesGfxPtr->templates + i) = gBattlerSpriteTemplates[i];
|
||||
gMonSpritesGfxPtr->spritesGfx[i] = gMonSpritesGfxPtr->firstDecompressed + (i * MON_PIC_SIZE * 4);
|
||||
gMonSpritesGfxPtr->templates[i] = gBattlerSpriteTemplates[i];
|
||||
|
||||
for (j = 0; j < 4; j++)
|
||||
for (j = 0; j < MAX_MON_PIC_FRAMES; j++)
|
||||
{
|
||||
if (gMonSpritesGfxPtr->sprites.ptr[i])
|
||||
if (gMonSpritesGfxPtr->spritesGfx[i])
|
||||
{
|
||||
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
|
||||
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->spritesGfx[i] + (j * MON_PIC_SIZE);
|
||||
gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE;
|
||||
}
|
||||
}
|
||||
|
@ -1241,13 +1240,12 @@ void FreeMonSpritesGfx(void)
|
|||
return;
|
||||
|
||||
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[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;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_RIGHT] = NULL;
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT] = NULL;
|
||||
FREE_AND_SET_NULL(gMonSpritesGfxPtr);
|
||||
}
|
||||
|
||||
|
|
|
@ -586,7 +586,7 @@ void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8
|
|||
{
|
||||
int i, j;
|
||||
int offset = tilesOffset;
|
||||
CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
CpuCopy16(gMonSpritesGfxPtr->spritesGfx[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
LoadBgTiles(bgId, tiles, 0x1000, tilesOffset);
|
||||
for (i = y; i < y + 8; i++)
|
||||
{
|
||||
|
@ -603,7 +603,7 @@ static void UNUSED DrawBattlerOnBgDMA(u8 x, u8 y, u8 battlerPosition, u8 arg3, u
|
|||
{
|
||||
int i, j, offset;
|
||||
|
||||
DmaCopy16(3, gMonSpritesGfxPtr->sprites.ptr[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE);
|
||||
DmaCopy16(3, gMonSpritesGfxPtr->spritesGfx[battlerPosition] + BG_SCREEN_SIZE * arg3, (void *)BG_SCREEN_ADDR(0) + arg5, BG_SCREEN_SIZE);
|
||||
offset = (arg5 >> 5) - (arg7 << 9);
|
||||
for (i = y; i < y + 8; i++)
|
||||
{
|
||||
|
|
|
@ -2739,7 +2739,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
|||
}
|
||||
else // Erase bottom part of the sprite to create a smooth illusion of mon falling down.
|
||||
{
|
||||
u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (sprite->data[3] << 8);
|
||||
u8 *dst = &gMonSpritesGfxPtr->spritesGfx[GetBattlerPosition(sprite->sBattler)][(sprite->data[3] << 8)];
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
*(dst++) = 0;
|
||||
|
|
|
@ -4123,7 +4123,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (effect == 1)
|
||||
BattleScriptPushCursorAndCallback(BattleScript_OverworldStatusStarts);
|
||||
else if (effect == 2)
|
||||
|
@ -4989,7 +4989,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
|||
case ABILITYEFFECT_ABSORBING: // 3
|
||||
if (move != MOVE_NONE)
|
||||
{
|
||||
u8 statId;
|
||||
u8 statId = 0;
|
||||
u8 statAmount = 1;
|
||||
switch (gLastUsedAbility)
|
||||
{
|
||||
|
|
|
@ -3211,7 +3211,7 @@ static u8 CreateContestantSprite(u16 species, bool8 isShiny, u32 personality, u3
|
|||
u8 spriteId;
|
||||
species = SanitizeSpecies(species);
|
||||
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT], species, personality);
|
||||
|
||||
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, isShiny, personality), OBJ_PLTT_ID(2), PLTT_SIZE_4BPP);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_PLAYER_LEFT);
|
||||
|
|
|
@ -368,18 +368,18 @@ static void InitContestMonPixels(u16 species, bool8 backPic)
|
|||
if (!backPic)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
species,
|
||||
gContestPaintingWinner->personality);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleLoadSpecialPokePic(FALSE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT],
|
||||
species,
|
||||
gContestPaintingWinner->personality);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
_InitContestMonPixels(gMonSpritesGfxPtr->spritesGfx[B_POSITION_PLAYER_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -893,7 +893,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
|
|||
personality = gContestMons[i].personality;
|
||||
isShiny = gContestMons[i].isShiny;
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
species,
|
||||
personality);
|
||||
|
||||
|
@ -2570,7 +2570,7 @@ void ShowContestEntryMonPic(void)
|
|||
taskId = CreateTask(Task_ShowContestEntryMonPic, 0x50);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
gTasks[taskId].data[1] = species;
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
|
||||
LoadCompressedSpritePaletteWithTag(GetMonSpritePalFromSpeciesAndPersonality(species, isShiny, personality), species);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_OPPONENT_LEFT);
|
||||
|
|
|
@ -442,7 +442,7 @@ static u8 EggHatchCreateMonSprite(u8 useAlt, u8 state, u8 partyId, u16 *speciesL
|
|||
{
|
||||
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
|
||||
species, pid);
|
||||
LoadCompressedSpritePaletteWithTag(GetMonFrontSpritePal(mon), species);
|
||||
*speciesLoc = species;
|
||||
|
|
|
@ -258,7 +258,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u
|
|||
currSpecies = GetMonData(mon, MON_DATA_SPECIES);
|
||||
isShiny = GetMonData(mon, MON_DATA_IS_SHINY);
|
||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
currSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
@ -273,7 +273,7 @@ void EvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, bool8 canStopEvo, u
|
|||
gSprites[id].invisible = TRUE;
|
||||
|
||||
// postEvo sprite
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
@ -350,7 +350,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
|
|||
FreeAllSpritePalettes();
|
||||
gReservedSpritePaletteCount = 4;
|
||||
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
@ -420,7 +420,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
|
|||
{
|
||||
bool8 isShiny = GetMonData(mon, MON_DATA_IS_SHINY);
|
||||
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
@ -484,7 +484,7 @@ void TradeEvolutionScene(struct Pokemon *mon, u16 postEvoSpecies, u8 preEvoSprit
|
|||
sEvoStructPtr = AllocZeroed(sizeof(struct EvoInfo));
|
||||
sEvoStructPtr->preEvoSpriteId = preEvoSpriteId;
|
||||
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
LoadSpecialPokePic(gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
postEvoSpecies,
|
||||
personality,
|
||||
TRUE);
|
||||
|
|
|
@ -24,7 +24,7 @@ s32 AgbRFU_checkID(u8 maxTries)
|
|||
{
|
||||
u16 ieBak;
|
||||
vu16 *regTMCNTL;
|
||||
s32 id;
|
||||
s32 id = 0;
|
||||
|
||||
// Interrupts must be enabled
|
||||
if (REG_IME == 0)
|
||||
|
|
|
@ -545,7 +545,7 @@ static u8 FrameType_ProcessInput(u8 selection)
|
|||
|
||||
static void FrameType_DrawChoices(u8 selection)
|
||||
{
|
||||
u8 text[16];
|
||||
u8 text[16] = {EOS};
|
||||
u8 n = selection + 1;
|
||||
u16 i;
|
||||
|
||||
|
|
0
src/palette_util.c
Executable file → Normal file
0
src/palette_util.c
Executable file → Normal file
|
@ -727,7 +727,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
|
|||
// Load mon gfx
|
||||
species = GetMonData(mon, MON_DATA_SPECIES_OR_EGG);
|
||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
sPokeblockFeed->loadGfxState++;
|
||||
break;
|
||||
case 1:
|
||||
|
|
|
@ -1643,7 +1643,7 @@ static void SetMonMoveSlot_KeepPP(struct Pokemon *mon, u16 move, u8 slot)
|
|||
u8 ppBonuses = GetMonData(mon, MON_DATA_PP_BONUSES, NULL);
|
||||
u8 currPP = GetMonData(mon, MON_DATA_PP1 + slot, NULL);
|
||||
u8 newPP = CalculatePPWithBonus(move, ppBonuses, slot);
|
||||
u8 finalPP = min(currPP, newPP);
|
||||
u16 finalPP = min(currPP, newPP);
|
||||
|
||||
SetMonData(mon, MON_DATA_MOVE1 + slot, &move);
|
||||
SetMonData(mon, MON_DATA_PP1 + slot, &finalPP);
|
||||
|
@ -5607,7 +5607,7 @@ static inline bool32 CanFirstMonBoostHeldItemRarity(void)
|
|||
u32 ability;
|
||||
if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG))
|
||||
return FALSE;
|
||||
|
||||
|
||||
ability = GetMonAbility(&gPlayerParty[0]);
|
||||
if ((OW_COMPOUND_EYES < GEN_9) && ability == ABILITY_COMPOUND_EYES)
|
||||
return TRUE;
|
||||
|
|
|
@ -1114,7 +1114,7 @@ void CB2_Debug_Pokemon(void)
|
|||
palette = GetMonSpritePalStructCustom(species, data->isFemale, data->isShiny);
|
||||
LoadCompressedSpritePaletteWithTag(palette, species);
|
||||
//Front
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[1], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[1], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
data->isShiny = FALSE;
|
||||
data->isFemale = FALSE;
|
||||
BattleLoadOpponentMonSpriteGfxCustom(species, data->isFemale, data->isShiny, 1);
|
||||
|
@ -1129,7 +1129,7 @@ void CB2_Debug_Pokemon(void)
|
|||
LoadAndCreateEnemyShadowSpriteCustom(data, species);
|
||||
|
||||
//Back
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->sprites.ptr[2], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->spritesGfx[2], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
BattleLoadOpponentMonSpriteGfxCustom(species, data->isFemale, data->isShiny, 4);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 2);
|
||||
offset_y = gSpeciesInfo[species].backPicYOffset;
|
||||
|
@ -1666,7 +1666,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
|
|||
palette = GetMonSpritePalStructCustom(species, data->isFemale, data->isShiny);
|
||||
LoadCompressedSpritePaletteWithTag(palette, species);
|
||||
//Front
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[1], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[1], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
BattleLoadOpponentMonSpriteGfxCustom(species, data->isFemale, data->isShiny, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||
gMultiuseSpriteTemplate.paletteTag = species;
|
||||
|
@ -1679,7 +1679,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
|
|||
LoadAndCreateEnemyShadowSpriteCustom(data, species);
|
||||
|
||||
//Back
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->sprites.ptr[2], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
HandleLoadSpecialPokePic(FALSE, gMonSpritesGfxPtr->spritesGfx[2], species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
|
||||
BattleLoadOpponentMonSpriteGfxCustom(species, data->isFemale, data->isShiny, 5);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 2);
|
||||
offset_y = gSpeciesInfo[species].backPicYOffset;
|
||||
|
|
|
@ -5987,7 +5987,7 @@ static bool8 UpdateCursorPos(void)
|
|||
|
||||
static void InitNewCursorPos(u8 newCursorArea, u8 newCursorPosition)
|
||||
{
|
||||
u16 x, y;
|
||||
u16 x = 0, y = 0;
|
||||
|
||||
GetCursorCoordsByPos(newCursorArea, newCursorPosition, &x, &y);
|
||||
sStorage->newCursorArea = newCursorArea;
|
||||
|
|
|
@ -4026,7 +4026,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
|
|||
if (gMain.inBattle)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
summary->species2,
|
||||
summary->pid);
|
||||
}
|
||||
|
@ -4035,7 +4035,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
|
|||
if (gMonSpritesGfxPtr != NULL)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_LEFT],
|
||||
summary->species2,
|
||||
summary->pid);
|
||||
}
|
||||
|
|
|
@ -470,7 +470,7 @@ static void EnterNewlyCreatedSecretBase_WaitFadeIn(u8 taskId)
|
|||
|
||||
static void EnterNewlyCreatedSecretBase_StartFadeIn(void)
|
||||
{
|
||||
s16 x, y;
|
||||
s16 x = 0, y = 0;
|
||||
|
||||
LockPlayerFieldControls();
|
||||
HideMapNamePopUpWindow();
|
||||
|
@ -519,7 +519,7 @@ bool8 CurMapIsSecretBase(void)
|
|||
void InitSecretBaseAppearance(bool8 hidePC)
|
||||
{
|
||||
u16 secretBaseIdx;
|
||||
s16 x, y;
|
||||
s16 x, y = 0;
|
||||
u8 *decorations;
|
||||
u8 *decorPos;
|
||||
|
||||
|
|
|
@ -2788,7 +2788,7 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
|
|||
case 0:
|
||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
HandleLoadSpecialPokePic(TRUE, gMonSpritesGfxPtr->spritesGfx[whichParty * 2 + B_POSITION_OPPONENT_LEFT], species, personality);
|
||||
|
||||
LoadCompressedSpritePaletteWithTag(GetMonFrontSpritePal(mon), species);
|
||||
sTradeAnim->monSpecies[whichParty] = species;
|
||||
|
@ -3784,7 +3784,7 @@ static bool8 DoTradeAnim_Cable(void)
|
|||
if (gSprites[sTradeAnim->bouncingPokeballSpriteId].callback == SpriteCallbackDummy)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
sTradeAnim->monSpecies[TRADE_PARTNER],
|
||||
sTradeAnim->monPersonalities[TRADE_PARTNER]);
|
||||
sTradeAnim->state++;
|
||||
|
@ -4281,7 +4281,7 @@ static bool8 DoTradeAnim_Wireless(void)
|
|||
if (gSprites[sTradeAnim->bouncingPokeballSpriteId].callback == SpriteCallbackDummy)
|
||||
{
|
||||
HandleLoadSpecialPokePic(TRUE,
|
||||
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
|
||||
gMonSpritesGfxPtr->spritesGfx[B_POSITION_OPPONENT_RIGHT],
|
||||
sTradeAnim->monSpecies[TRADE_PARTNER],
|
||||
sTradeAnim->monPersonalities[TRADE_PARTNER]);
|
||||
sTradeAnim->state++;
|
||||
|
|
Loading…
Reference in a new issue