summaryrefslogtreecommitdiff
path: root/src/egg_hatch.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/egg_hatch.c
parent6012cf43cbfc27e37fedae41136e13a62ccdd61c (diff)
parent6e62c057f5123b458ebc7d74e60c7ce8fb32e980 (diff)
Merge pull request #1509 from GriffinRichards/doc-sprman
Document remaining symbols in pokemon.c
Diffstat (limited to 'src/egg_hatch.c')
-rw-r--r--src/egg_hatch.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index 4b668881a..b8ab1b91e 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -411,21 +411,22 @@ bool8 CheckDaycareMonReceivedMail(void)
return _CheckDaycareMonReceivedMail(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
}
-static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc)
+static u8 EggHatchCreateMonSprite(u8 useAlt, u8 switchID, u8 pokeID, u16* speciesLoc)
{
- u8 r5 = 0;
+ u8 position = 0;
u8 spriteID = 0;
struct Pokemon* mon = NULL;
- if (a0 == 0)
+ if (useAlt == FALSE)
{
mon = &gPlayerParty[pokeID];
- r5 = 1;
+ position = B_POSITION_OPPONENT_LEFT;
}
- if (a0 == 1)
+ if (useAlt == TRUE)
{
+ // Alternate sprite allocation position. Never reached.
mon = &gPlayerParty[pokeID];
- r5 = 3;
+ position = B_POSITION_OPPONENT_RIGHT;
}
switch (switchID)
{
@@ -434,14 +435,14 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
- gMonSpritesGfxPtr->sprites.ptr [(a0 * 2) + 1],
+ gMonSpritesGfxPtr->sprites.ptr[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
species, pid);
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
*speciesLoc = species;
}
break;
case 1:
- SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, r5);
+ SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, position);
spriteID = CreateSprite(&gMultiuseSpriteTemplate, 120, 75, 6);
gSprites[spriteID].invisible = TRUE;
gSprites[spriteID].callback = SpriteCallbackDummy;
@@ -535,11 +536,11 @@ static void CB2_EggHatch_0(void)
gMain.state++;
break;
case 5:
- EggHatchCreateMonSprite(0, 0, sEggHatchData->eggPartyID, &sEggHatchData->species);
+ EggHatchCreateMonSprite(FALSE, 0, sEggHatchData->eggPartyID, &sEggHatchData->species);
gMain.state++;
break;
case 6:
- sEggHatchData->pokeSpriteID = EggHatchCreateMonSprite(0, 1, sEggHatchData->eggPartyID, &sEggHatchData->species);
+ sEggHatchData->pokeSpriteID = EggHatchCreateMonSprite(FALSE, 1, sEggHatchData->eggPartyID, &sEggHatchData->species);
gMain.state++;
break;
case 7: