Designated initializers for gTrainerBackPicTable

This commit is contained in:
GriffinR 2020-11-30 15:32:08 -05:00
parent 7b1fee3239
commit 076b2c2edc
3 changed files with 16 additions and 13 deletions

View file

@ -295,11 +295,6 @@ const union AnimCmd *const gUnknown_082FF70C[] =
#define SPECIES_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species} #define SPECIES_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species}
#define SPECIES_SHINY_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species + SPECIES_SHINY_TAG} #define SPECIES_SHINY_PAL(species, pal) [SPECIES_##species] = {pal, SPECIES_##species + SPECIES_SHINY_TAG}
#define TRAINER_SPRITE(trainerPic, sprite, size) [TRAINER_PIC_##trainerPic] = {sprite, size, TRAINER_PIC_##trainerPic}
#define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic}
#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic}
#include "data/pokemon_graphics/unknown_anims.h" #include "data/pokemon_graphics/unknown_anims.h"
#include "data/pokemon_graphics/front_pic_coordinates.h" #include "data/pokemon_graphics/front_pic_coordinates.h"
#include "data/pokemon_graphics/still_front_pic_table.h" #include "data/pokemon_graphics/still_front_pic_table.h"

View file

@ -13,18 +13,22 @@ const struct MonCoords gTrainerBackPicCoords[] =
// this table goes functionally unused, since none of these pics are compressed // this table goes functionally unused, since none of these pics are compressed
// and the place they would get extracted to gets overwritten later anyway // and the place they would get extracted to gets overwritten later anyway
// the casts are so they'll play nice with the strict struct definition // the casts are so they'll play nice with the strict struct definition
#define TRAINER_BACK_SPRITE(trainerPic, sprite, size) [TRAINER_BACK_PIC_##trainerPic] = {(const u32 *)sprite, size, TRAINER_BACK_PIC_##trainerPic}
const struct CompressedSpriteSheet gTrainerBackPicTable[] = const struct CompressedSpriteSheet gTrainerBackPicTable[] =
{ {
(const u32 *)gTrainerBackPic_Brendan, 0x2000, TRAINER_BACK_PIC_BRENDAN, TRAINER_BACK_SPRITE(BRENDAN, gTrainerBackPic_Brendan, 0x2000),
(const u32 *)gTrainerBackPic_May, 0x2000, TRAINER_BACK_PIC_MAY, TRAINER_BACK_SPRITE(MAY, gTrainerBackPic_May, 0x2000),
(const u32 *)gTrainerBackPic_Red, 0x2800, TRAINER_BACK_PIC_RED, TRAINER_BACK_SPRITE(RED, gTrainerBackPic_Red, 0x2800),
(const u32 *)gTrainerBackPic_Leaf, 0x2800, TRAINER_BACK_PIC_LEAF, TRAINER_BACK_SPRITE(LEAF, gTrainerBackPic_Leaf, 0x2800),
(const u32 *)gTrainerBackPic_RubySapphireBrendan, 0x2000, TRAINER_BACK_PIC_RUBY_SAPPHIRE_BRENDAN, TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_BRENDAN, gTrainerBackPic_RubySapphireBrendan, 0x2000),
(const u32 *)gTrainerBackPic_RubySapphireMay, 0x2000, TRAINER_BACK_PIC_RUBY_SAPPHIRE_MAY, TRAINER_BACK_SPRITE(RUBY_SAPPHIRE_MAY, gTrainerBackPic_RubySapphireMay, 0x2000),
(const u32 *)gTrainerBackPic_Wally, 0x2000, TRAINER_BACK_PIC_WALLY, TRAINER_BACK_SPRITE(WALLY, gTrainerBackPic_Wally, 0x2000),
(const u32 *)gTrainerBackPic_Steven, 0x2000, TRAINER_BACK_PIC_STEVEN, TRAINER_BACK_SPRITE(STEVEN, gTrainerBackPic_Steven, 0x2000),
}; };
#define TRAINER_BACK_PAL(trainerPic, pal) [TRAINER_BACK_PIC_##trainerPic] = {pal, TRAINER_BACK_PIC_##trainerPic}
const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] = const struct CompressedSpritePalette gTrainerBackPicPaletteTable[] =
{ {
TRAINER_BACK_PAL(BRENDAN, gTrainerPalette_Brendan), TRAINER_BACK_PAL(BRENDAN, gTrainerPalette_Brendan),

View file

@ -95,6 +95,8 @@ const struct MonCoords gTrainerFrontPicCoords[] =
[TRAINER_PIC_RS_MAY] = {.size = 8, .y_offset = 1}, [TRAINER_PIC_RS_MAY] = {.size = 8, .y_offset = 1},
}; };
#define TRAINER_SPRITE(trainerPic, sprite, size) [TRAINER_PIC_##trainerPic] = {sprite, size, TRAINER_PIC_##trainerPic}
const struct CompressedSpriteSheet gTrainerFrontPicTable[] = const struct CompressedSpriteSheet gTrainerFrontPicTable[] =
{ {
TRAINER_SPRITE(HIKER, gTrainerFrontPic_Hiker, 0x800), TRAINER_SPRITE(HIKER, gTrainerFrontPic_Hiker, 0x800),
@ -192,6 +194,8 @@ const struct CompressedSpriteSheet gTrainerFrontPicTable[] =
TRAINER_SPRITE(RS_MAY, gTrainerFrontPic_RubySapphireMay, 0x800), TRAINER_SPRITE(RS_MAY, gTrainerFrontPic_RubySapphireMay, 0x800),
}; };
#define TRAINER_PAL(trainerPic, pal) [TRAINER_PIC_##trainerPic] = {pal, TRAINER_PIC_##trainerPic}
const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[] = const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[] =
{ {
TRAINER_PAL(HIKER, gTrainerPalette_Hiker), TRAINER_PAL(HIKER, gTrainerPalette_Hiker),