Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Trainer sprites #3597

Merged
merged 25 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9d37bdc
Added TrainerSprite struct with coordinates
fdeblasio Nov 24, 2023
2ca0ae8
Added .frontPic to struct
fdeblasio Nov 24, 2023
c26e83c
Added .palette to TrainerSprite struct
fdeblasio Nov 24, 2023
0e5eb53
Added .animation to the struct
fdeblasio Nov 24, 2023
35428dc
Added define for sprite size
fdeblasio Nov 24, 2023
d1f5632
Condensed animations since they were all the same
fdeblasio Nov 24, 2023
eebf31b
Improved TRAINER_SPRITE/PAL defines
fdeblasio Nov 24, 2023
80440e2
Simplified seemingly unused .y_offset and TRAINER_PIC_SIZE values
fdeblasio Nov 24, 2023
fb98310
Condensed TRAINER_SPRITE and TRAINER_PAL into TRAINER_PIC
fdeblasio Nov 24, 2023
a0543ee
Renamed .size to .y_offset since that what it appears to actually be
fdeblasio Nov 24, 2023
052ee2e
Moved y_offset into TRAINER_PIC
fdeblasio Nov 24, 2023
1a03fcc
Moved animation inside of TRAINER_PIC
fdeblasio Nov 24, 2023
0a8cc5e
Added array number to preproc
fdeblasio Nov 25, 2023
af34d2c
Removed trailing spaces
fdeblasio Nov 26, 2023
71c2399
Added sprite/palette files to preproc
fdeblasio Nov 26, 2023
06def9d
Revert adding sprites to preproc as it fails agbcc
fdeblasio Nov 26, 2023
fd06116
Added backsprite struct
fdeblasio Nov 26, 2023
0d04fed
Added animations to backsprite struct
fdeblasio Nov 26, 2023
268681e
Changed TRAINER_PIC to TRAINER_SPRITE
fdeblasio Nov 26, 2023
0045d17
Added animation to backsprite preproc
fdeblasio Nov 27, 2023
dcc7c49
Added .backPic to struct
fdeblasio Nov 28, 2023
d5679e2
Moved array number into backsprite preproc
fdeblasio Nov 28, 2023
3c53683
Removed definitions for trainer sprites
fdeblasio Nov 28, 2023
208c73b
Hardcoded sAnims_Trainer into struct since every sprite uses it
fdeblasio Dec 18, 2023
15c5642
Fixed TRAINER_SPRITE arguments
fdeblasio Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions include/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ struct MonCoords
u8 y_offset;
};

struct TrainerSprite
{
u8 y_offset;
struct CompressedSpriteSheet frontPic;
struct CompressedSpritePalette palette;
const union AnimCmd *const *const animation;
};

struct TrainerBacksprite
{
struct MonCoords coordinates;
struct CompressedSpriteSheet backPic;
struct CompressedSpritePalette palette;
const union AnimCmd *const *const animation;
};

#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8))
#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8)
#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8)
Expand Down Expand Up @@ -91,15 +107,10 @@ extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteOpponentSide[];
extern const union AffineAnimCmd *const gAffineAnims_BattleSpriteContest[];

extern const union AnimCmd sAnim_GeneralFrame0[];
extern const union AnimCmd sAnim_GeneralFrame3[];
extern const union AnimCmd *const gAnims_MonPic[];
extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[];
extern const struct MonCoords gTrainerFrontPicCoords[];
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[];
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[];
extern const union AnimCmd *const *const gTrainerBackAnimsPtrTable[];
extern const struct MonCoords gTrainerBackPicCoords[];
extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; // functionally unused
extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[];
extern const struct TrainerSprite gTrainerSprites[];
extern const struct TrainerBacksprite gTrainerBacksprites[];

extern const struct Trainer gTrainers[];
extern const struct Trainer gBattlePartners[];
Expand Down
201 changes: 0 additions & 201 deletions include/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,207 +65,6 @@ extern const u32 gOpenPokeballGfx[];
// pokemon gfx
extern const u16 gMonIconPalettes[][16];

// trainer sprites
extern const u32 gTrainerFrontPic_Hiker[];
extern const u32 gTrainerFrontPic_AquaGruntM[];
extern const u32 gTrainerFrontPic_PokemonBreederF[];
extern const u32 gTrainerFrontPic_CoolTrainerM[];
extern const u32 gTrainerFrontPic_BirdKeeper[];
extern const u32 gTrainerFrontPic_Collector[];
extern const u32 gTrainerFrontPic_AquaGruntF[];
extern const u32 gTrainerFrontPic_SwimmerM[];
extern const u32 gTrainerFrontPic_MagmaGruntM[];
extern const u32 gTrainerFrontPic_ExpertM[];
extern const u32 gTrainerFrontPic_AquaAdminM[];
extern const u32 gTrainerFrontPic_BlackBelt[];
extern const u32 gTrainerFrontPic_AquaAdminF[];
extern const u32 gTrainerFrontPic_AquaLeaderArchie[];
extern const u32 gTrainerFrontPic_HexManiac[];
extern const u32 gTrainerFrontPic_AromaLady[];
extern const u32 gTrainerFrontPic_RuinManiac[];
extern const u32 gTrainerFrontPic_Interviewer[];
extern const u32 gTrainerFrontPic_TuberF[];
extern const u32 gTrainerFrontPic_TuberM[];
extern const u32 gTrainerFrontPic_CoolTrainerF[];
extern const u32 gTrainerFrontPic_Lady[];
extern const u32 gTrainerFrontPic_Beauty[];
extern const u32 gTrainerFrontPic_RichBoy[];
extern const u32 gTrainerFrontPic_ExpertF[];
extern const u32 gTrainerFrontPic_Pokemaniac[];
extern const u32 gTrainerFrontPic_MagmaGruntF[];
extern const u32 gTrainerFrontPic_Guitarist[];
extern const u32 gTrainerFrontPic_Kindler[];
extern const u32 gTrainerFrontPic_Camper[];
extern const u32 gTrainerFrontPic_Picnicker[];
extern const u32 gTrainerFrontPic_BugManiac[];
extern const u32 gTrainerFrontPic_PokemonBreederM[];
extern const u32 gTrainerFrontPic_PsychicM[];
extern const u32 gTrainerFrontPic_PsychicF[];
extern const u32 gTrainerFrontPic_Gentleman[];
extern const u32 gTrainerFrontPic_EliteFourSidney[];
extern const u32 gTrainerFrontPic_EliteFourPhoebe[];
extern const u32 gTrainerFrontPic_EliteFourGlacia[];
extern const u32 gTrainerFrontPic_EliteFourDrake[];
extern const u32 gTrainerFrontPic_LeaderRoxanne[];
extern const u32 gTrainerFrontPic_LeaderBrawly[];
extern const u32 gTrainerFrontPic_LeaderWattson[];
extern const u32 gTrainerFrontPic_LeaderFlannery[];
extern const u32 gTrainerFrontPic_LeaderNorman[];
extern const u32 gTrainerFrontPic_LeaderWinona[];
extern const u32 gTrainerFrontPic_LeaderTateAndLiza[];
extern const u32 gTrainerFrontPic_LeaderJuan[];
extern const u32 gTrainerFrontPic_SchoolKidM[];
extern const u32 gTrainerFrontPic_SchoolKidF[];
extern const u32 gTrainerFrontPic_SrAndJr[];
extern const u32 gTrainerFrontPic_PokefanM[];
extern const u32 gTrainerFrontPic_PokefanF[];
extern const u32 gTrainerFrontPic_Youngster[];
extern const u32 gTrainerFrontPic_ChampionWallace[];
extern const u32 gTrainerFrontPic_Fisherman[];
extern const u32 gTrainerFrontPic_CyclingTriathleteM[];
extern const u32 gTrainerFrontPic_CyclingTriathleteF[];
extern const u32 gTrainerFrontPic_RunningTriathleteM[];
extern const u32 gTrainerFrontPic_RunningTriathleteF[];
extern const u32 gTrainerFrontPic_SwimmingTriathleteM[];
extern const u32 gTrainerFrontPic_SwimmingTriathleteF[];
extern const u32 gTrainerFrontPic_DragonTamer[];
extern const u32 gTrainerFrontPic_NinjaBoy[];
extern const u32 gTrainerFrontPic_BattleGirl[];
extern const u32 gTrainerFrontPic_ParasolLady[];
extern const u32 gTrainerFrontPic_SwimmerF[];
extern const u32 gTrainerFrontPic_Twins[];
extern const u32 gTrainerFrontPic_Sailor[];
extern const u32 gTrainerFrontPic_MagmaAdmin[];
extern const u32 gTrainerFrontPic_Wally[];
extern const u32 gTrainerFrontPic_Brendan[];
extern const u32 gTrainerFrontPic_May[];
extern const u32 gTrainerFrontPic_BugCatcher[];
extern const u32 gTrainerFrontPic_PokemonRangerM[];
extern const u32 gTrainerFrontPic_PokemonRangerF[];
extern const u32 gTrainerFrontPic_MagmaLeaderMaxie[];
extern const u32 gTrainerFrontPic_Lass[];
extern const u32 gTrainerFrontPic_YoungCouple[];
extern const u32 gTrainerFrontPic_OldCouple[];
extern const u32 gTrainerFrontPic_SisAndBro[];
extern const u32 gTrainerFrontPic_Steven[];
extern const u32 gTrainerFrontPic_SalonMaidenAnabel[];
extern const u32 gTrainerFrontPic_DomeAceTucker[];
extern const u32 gTrainerFrontPic_PalaceMavenSpenser[];
extern const u32 gTrainerFrontPic_ArenaTycoonGreta[];
extern const u32 gTrainerFrontPic_FactoryHeadNoland[];
extern const u32 gTrainerFrontPic_PikeQueenLucy[];
extern const u32 gTrainerFrontPic_PyramidKingBrandon[];
extern const u32 gTrainerFrontPic_Red[];
extern const u32 gTrainerFrontPic_Leaf[];
extern const u32 gTrainerFrontPic_RubySapphireBrendan[];
extern const u32 gTrainerFrontPic_RubySapphireMay[];

extern const u32 gTrainerPalette_Hiker[];
extern const u32 gTrainerPalette_AquaGruntM[];
extern const u32 gTrainerPalette_PokemonBreederF[];
extern const u32 gTrainerPalette_CoolTrainerM[];
extern const u32 gTrainerPalette_BirdKeeper[];
extern const u32 gTrainerPalette_Collector[];
extern const u32 gTrainerPalette_AquaGruntF[];
extern const u32 gTrainerPalette_SwimmerM[];
extern const u32 gTrainerPalette_MagmaGruntM[];
extern const u32 gTrainerPalette_ExpertM[];
extern const u32 gTrainerPalette_AquaAdminM[];
extern const u32 gTrainerPalette_BlackBelt[];
extern const u32 gTrainerPalette_AquaAdminF[];
extern const u32 gTrainerPalette_AquaLeaderArchie[];
extern const u32 gTrainerPalette_HexManiac[];
extern const u32 gTrainerPalette_AromaLady[];
extern const u32 gTrainerPalette_RuinManiac[];
extern const u32 gTrainerPalette_Interviewer[];
extern const u32 gTrainerPalette_TuberF[];
extern const u32 gTrainerPalette_TuberM[];
extern const u32 gTrainerPalette_CoolTrainerF[];
extern const u32 gTrainerPalette_Lady[];
extern const u32 gTrainerPalette_Beauty[];
extern const u32 gTrainerPalette_RichBoy[];
extern const u32 gTrainerPalette_ExpertF[];
extern const u32 gTrainerPalette_Pokemaniac[];
extern const u32 gTrainerPalette_MagmaGruntF[];
extern const u32 gTrainerPalette_Guitarist[];
extern const u32 gTrainerPalette_Kindler[];
extern const u32 gTrainerPalette_Camper[];
extern const u32 gTrainerPalette_Picnicker[];
extern const u32 gTrainerPalette_BugManiac[];
extern const u32 gTrainerPalette_PokemonBreederM[];
extern const u32 gTrainerPalette_PsychicM[];
extern const u32 gTrainerPalette_PsychicF[];
extern const u32 gTrainerPalette_Gentleman[];
extern const u32 gTrainerPalette_EliteFourSidney[];
extern const u32 gTrainerPalette_EliteFourPhoebe[];
extern const u32 gTrainerPalette_EliteFourGlacia[];
extern const u32 gTrainerPalette_EliteFourDrake[];
extern const u32 gTrainerPalette_LeaderRoxanne[];
extern const u32 gTrainerPalette_LeaderBrawly[];
extern const u32 gTrainerPalette_LeaderWattson[];
extern const u32 gTrainerPalette_LeaderFlannery[];
extern const u32 gTrainerPalette_LeaderNorman[];
extern const u32 gTrainerPalette_LeaderWinona[];
extern const u32 gTrainerPalette_LeaderTateAndLiza[];
extern const u32 gTrainerPalette_LeaderJuan[];
extern const u32 gTrainerPalette_SchoolKidM[];
extern const u32 gTrainerPalette_SchoolKidF[];
extern const u32 gTrainerPalette_SrAndJr[];
extern const u32 gTrainerPalette_PokefanM[];
extern const u32 gTrainerPalette_PokefanF[];
extern const u32 gTrainerPalette_Youngster[];
extern const u32 gTrainerPalette_ChampionWallace[];
extern const u32 gTrainerPalette_Fisherman[];
extern const u32 gTrainerPalette_CyclingTriathleteM[];
extern const u32 gTrainerPalette_CyclingTriathleteF[];
extern const u32 gTrainerPalette_RunningTriathleteM[];
extern const u32 gTrainerPalette_RunningTriathleteF[];
extern const u32 gTrainerPalette_SwimmingTriathleteM[];
extern const u32 gTrainerPalette_SwimmingTriathleteF[];
extern const u32 gTrainerPalette_DragonTamer[];
extern const u32 gTrainerPalette_NinjaBoy[];
extern const u32 gTrainerPalette_BattleGirl[];
extern const u32 gTrainerPalette_ParasolLady[];
extern const u32 gTrainerPalette_SwimmerF[];
extern const u32 gTrainerPalette_Twins[];
extern const u32 gTrainerPalette_Sailor[];
extern const u32 gTrainerPalette_MagmaAdmin[];
extern const u32 gTrainerPalette_Wally[];
extern const u32 gTrainerPalette_Brendan[];
extern const u32 gTrainerPalette_May[];
extern const u32 gTrainerPalette_BugCatcher[];
extern const u32 gTrainerPalette_PokemonRangerM[];
extern const u32 gTrainerPalette_PokemonRangerF[];
extern const u32 gTrainerPalette_MagmaLeaderMaxie[];
extern const u32 gTrainerPalette_Lass[];
extern const u32 gTrainerPalette_YoungCouple[];
extern const u32 gTrainerPalette_OldCouple[];
extern const u32 gTrainerPalette_SisAndBro[];
extern const u32 gTrainerPalette_Steven[];
extern const u32 gTrainerPalette_SalonMaidenAnabel[];
extern const u32 gTrainerPalette_DomeAceTucker[];
extern const u32 gTrainerPalette_PalaceMavenSpenser[];
extern const u32 gTrainerPalette_ArenaTycoonGreta[];
extern const u32 gTrainerPalette_FactoryHeadNoland[];
extern const u32 gTrainerPalette_PikeQueenLucy[];
extern const u32 gTrainerPalette_PyramidKingBrandon[];
extern const u32 gTrainerPalette_Red[];
extern const u32 gTrainerPalette_Leaf[];
extern const u32 gTrainerPalette_RubySapphireBrendan[];
extern const u32 gTrainerPalette_RubySapphireMay[];

extern const u8 gTrainerBackPic_Brendan[];
extern const u8 gTrainerBackPic_May[];
extern const u8 gTrainerBackPic_Red[];
extern const u8 gTrainerBackPic_Leaf[];
extern const u8 gTrainerBackPic_RubySapphireBrendan[];
extern const u8 gTrainerBackPic_RubySapphireMay[];
extern const u8 gTrainerBackPic_Wally[];
extern const u8 gTrainerBackPic_Steven[];

extern const u32 gTrainerBackPicPalette_Red[];
extern const u32 gTrainerBackPicPalette_Leaf[];

// pokeblock
extern const u32 gMenuPokeblock_Gfx[];
extern const u32 gMenuPokeblock_Pal[];
Expand Down
2 changes: 1 addition & 1 deletion src/battle_controller_link_opponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ static void LinkOpponentHandleDrawTrainerPic(u32 battler)
}

BtlController_HandleDrawTrainerPic(battler, trainerPicId, TRUE,
xPos, 40 + 4 * (8 - gTrainerFrontPicCoords[trainerPicId].size),
xPos, 40 + 4 * (8 - gTrainerSprites[trainerPicId].y_offset),
-1);
}

Expand Down
4 changes: 2 additions & 2 deletions src/battle_controller_link_partner.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static void LinkPartnerHandleDrawTrainerPic(u32 battler)

trainerPicId = LinkPlayerGetTrainerPicId(GetBattlerMultiplayerId(battler));
BtlController_HandleDrawTrainerPic(battler, trainerPicId, FALSE,
xPos, 80 + 4 * (8 - gTrainerBackPicCoords[trainerPicId].size),
xPos, 80 + 4 * (8 - gTrainerBacksprites[trainerPicId].coordinates.size),
-1);
}

Expand All @@ -261,7 +261,7 @@ static void LinkPartnerHandleHealthBarUpdate(u32 battler)
static void LinkPartnerHandleIntroTrainerBallThrow(u32 battler)
{
u32 trainerPicId = LinkPlayerGetTrainerPicId(GetBattlerMultiplayerId(battler));
const u32 *trainerPal = gTrainerBackPicPaletteTable[trainerPicId].data;
const u32 *trainerPal = gTrainerBacksprites[trainerPicId].palette.data;
// Link partner uses the same intro sequence as the player partner.
BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F9, trainerPal, 24, Controller_PlayerPartnerShowIntroHealthbox);
}
Expand Down
2 changes: 1 addition & 1 deletion src/battle_controller_opponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static void OpponentHandleDrawTrainerPic(u32 battler)
}

BtlController_HandleDrawTrainerPic(battler, trainerPicId, TRUE,
xPos, 40 + 4 * (8 - gTrainerFrontPicCoords[trainerPicId].size),
xPos, 40 + 4 * (8 - gTrainerSprites[trainerPicId].y_offset),
-1);
}

Expand Down
8 changes: 4 additions & 4 deletions src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -1879,18 +1879,18 @@ static void PlayerHandleDrawTrainerPic(u32 battler)
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && gPartnerTrainerId < TRAINER_PARTNER(PARTNER_NONE))
{
xPos = 90;
yPos = (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerSprites[trainerPicId].y_offset) * 4 + 80;
}
else
{
yPos = (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerBacksprites[trainerPicId].coordinates.size) * 4 + 80;
}

}
else
{
xPos = 80;
yPos = (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerBacksprites[trainerPicId].coordinates.size) * 4 + 80;
}

// Use front pic table for any tag battles unless your partner is Steven or a custom partner.
Expand Down Expand Up @@ -2233,7 +2233,7 @@ static void PlayerHandleOneReturnValue_Duplicate(u32 battler)

static void PlayerHandleIntroTrainerBallThrow(u32 battler)
{
const u32 *trainerPal = gTrainerBackPicPaletteTable[gSaveBlock2Ptr->playerGender].data;
const u32 *trainerPal = gTrainerBacksprites[gSaveBlock2Ptr->playerGender].palette.data;
BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F8, trainerPal, 31, Intro_TryShinyAnimShowHealthbox);
}

Expand Down
12 changes: 6 additions & 6 deletions src/battle_controller_player_partner.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,19 +301,19 @@ static void PlayerPartnerHandleDrawTrainerPic(u32 battler)
{
trainerPicId = gBattlePartners[gPartnerTrainerId - TRAINER_PARTNER(PARTNER_NONE)].trainerPic;
xPos = 90;
yPos = (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerBacksprites[trainerPicId].coordinates.size) * 4 + 80;
}
else if (IsAiVsAiBattle())
{
trainerPicId = gTrainers[gPartnerTrainerId].trainerPic;
xPos = 60;
yPos = (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerSprites[trainerPicId].y_offset) * 4 + 80;
}
else
{
trainerPicId = GetFrontierTrainerFrontSpriteId(gPartnerTrainerId);
xPos = 32;
yPos = (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerSprites[trainerPicId].y_offset) * 4 + 80;
}

// Use back pic only if the partner Steven or is custom.
Expand Down Expand Up @@ -435,11 +435,11 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(u32 battler)
const u32 *trainerPal;

if (gPartnerTrainerId > TRAINER_PARTNER(PARTNER_NONE))
trainerPal = gTrainerBackPicPaletteTable[gPartnerSpriteId].data;
trainerPal = gTrainerBacksprites[gPartnerSpriteId].palette.data;
else if (IsAiVsAiBattle())
trainerPal = gTrainerFrontPicPaletteTable[gTrainers[gPartnerTrainerId].trainerPic].data;
trainerPal = gTrainerSprites[gTrainers[gPartnerTrainerId].trainerPic].palette.data;
else
trainerPal = gTrainerFrontPicPaletteTable[GetFrontierTrainerFrontSpriteId(gPartnerTrainerId)].data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.
trainerPal = gTrainerSprites[GetFrontierTrainerFrontSpriteId(gPartnerTrainerId)].palette.data; // 2 vs 2 multi battle in Battle Frontier, load front sprite and pal.

BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F9, trainerPal, 24, Controller_PlayerPartnerShowIntroHealthbox);
}
Expand Down
2 changes: 1 addition & 1 deletion src/battle_controller_recorded_opponent.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static void RecordedOpponentHandleDrawTrainerPic(u32 battler)
}

BtlController_HandleDrawTrainerPic(battler, trainerPicId, TRUE,
xPos, 40 + 4 * (8 - gTrainerFrontPicCoords[trainerPicId].size),
xPos, 40 + 4 * (8 - gTrainerSprites[trainerPicId].y_offset),
-1);
}

Expand Down
8 changes: 4 additions & 4 deletions src/battle_controller_recorded_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,18 +393,18 @@ static void RecordedPlayerHandleDrawTrainerPic(u32 battler)
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
{
xPos = 90;
yPos = (8 - gTrainerFrontPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerSprites[trainerPicId].y_offset) * 4 + 80;
}
else
{
yPos = (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerBacksprites[trainerPicId].coordinates.size) * 4 + 80;
}

}
else
{
xPos = 80;
yPos = (8 - gTrainerBackPicCoords[trainerPicId].size) * 4 + 80;
yPos = (8 - gTrainerBacksprites[trainerPicId].coordinates.size) * 4 + 80;
}

if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER)
Expand Down Expand Up @@ -517,7 +517,7 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(u32 battler)
else
trainerPicId = gSaveBlock2Ptr->playerGender + TRAINER_BACK_PIC_BRENDAN;

trainerPal = gTrainerFrontPicPaletteTable[trainerPicId].data;
trainerPal = gTrainerSprites[trainerPicId].palette.data;
BtlController_HandleIntroTrainerBallThrow(battler, 0xD6F9, trainerPal, 24, Intro_TryShinyAnimShowHealthbox);
}

Expand Down
Loading
Loading