Skip to content

Commit

Permalink
Moved mon pic tables to gSpeciesInfo + macro cleanup (#5597)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Jan 20, 2025
1 parent da9943d commit 4825e52
Show file tree
Hide file tree
Showing 12 changed files with 2,683 additions and 8,083 deletions.
6,632 changes: 0 additions & 6,632 deletions src/data/object_events/object_event_pic_tables_followers.h

This file was deleted.

92 changes: 28 additions & 64 deletions src/data/pokemon/species_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,77 +45,41 @@
#define OVERWORLD_PAL_FEMALE(...)
#endif //OW_PKMN_OBJECTS_SHARE_PALETTES == FALSE

#define OVERWORLD(picTable, _size, shadow, _tracks, ...) \
.overworldData = { \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
.reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \
.size = (_size == SIZE_32x32 ? 512 : 2048), \
.width = (_size == SIZE_32x32 ? 32 : 64), \
.height = (_size == SIZE_32x32 ? 32 : 64), \
.paletteSlot = PALSLOT_NPC_1, \
.shadowSize = shadow, \
.inanimate = FALSE, \
.compressed = COMP, \
.tracks = _tracks, \
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = sAnimTable_Following, \
.images = picTable, \
.affineAnims = gDummySpriteAffineAnimTable, \
}, \
OVERWORLD_PAL(__VA_ARGS__)

#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...) \
.overworldData = { \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
.reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \
.size = (_size == SIZE_32x32 ? 512 : 2048), \
.width = (_size == SIZE_32x32 ? 32 : 64), \
.height = (_size == SIZE_32x32 ? 32 : 64), \
.paletteSlot = PALSLOT_NPC_1, \
.shadowSize = shadow, \
.inanimate = FALSE, \
.compressed = COMP, \
.tracks = _tracks, \
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = _anims, \
.images = picTable, \
.affineAnims = gDummySpriteAffineAnimTable, \
}, \
#define OVERWORLD_DATA(objEventPic, _size, shadow, _tracks, _anims) \
{ \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
.reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \
.size = (_size == SIZE_32x32 ? 512 : 2048), \
.width = (_size == SIZE_32x32 ? 32 : 64), \
.height = (_size == SIZE_32x32 ? 32 : 64), \
.paletteSlot = PALSLOT_NPC_1, \
.shadowSize = shadow, \
.inanimate = FALSE, \
.compressed = COMP, \
.tracks = _tracks, \
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = _anims, \
.images = (const struct SpriteFrameImage[]) { overworld_ascending_frames(objEventPic, SIZE_32x32 ? 4 : 8, SIZE_32x32 ? 4 : 8), }, \
.affineAnims = gDummySpriteAffineAnimTable, \
}

#define OVERWORLD(objEventPic, _size, shadow, _tracks, _anims, ...) \
.overworldData = OVERWORLD_DATA(objEventPic, _size, shadow, _tracks, _anims), \
OVERWORLD_PAL(__VA_ARGS__)

#if P_GENDER_DIFFERENCES
#define OVERWORLD_FEMALE(picTable, _size, shadow, _tracks, ...) \
.overworldDataFemale = { \
.tileTag = TAG_NONE, \
.paletteTag = OBJ_EVENT_PAL_TAG_DYNAMIC, \
.reflectionPaletteTag = OBJ_EVENT_PAL_TAG_NONE, \
.size = (_size == SIZE_32x32 ? 512 : 2048), \
.width = (_size == SIZE_32x32 ? 32 : 64), \
.height = (_size == SIZE_32x32 ? 32 : 64), \
.paletteSlot = PALSLOT_NPC_1, \
.shadowSize = shadow, \
.inanimate = FALSE, \
.compressed = COMP, \
.tracks = _tracks, \
.oam = (_size == SIZE_32x32 ? &gObjectEventBaseOam_32x32 : &gObjectEventBaseOam_64x64), \
.subspriteTables = (_size == SIZE_32x32 ? sOamTables_32x32 : sOamTables_64x64), \
.anims = sAnimTable_Following, \
.images = picTable, \
.affineAnims = gDummySpriteAffineAnimTable, \
}, \
#define OVERWORLD_FEMALE(objEventPic, _size, shadow, _tracks, _anims, ...) \
.overworldDataFemale = OVERWORLD_DATA(objEventPic, _size, shadow, _tracks, _anims), \
OVERWORLD_PAL_FEMALE(__VA_ARGS__)
#else
#define OVERWORLD_FEMALE(picTable, _size, shadow, _tracks, ...)
#define OVERWORLD_FEMALE(...)
#endif //P_GENDER_DIFFERENCES

#else
#define OVERWORLD(picTable, _size, shadow, _tracks, ...)
#define OVERWORLD_SET_ANIM(picTable, _size, shadow, _tracks, _anims, ...)
#define OVERWORLD_FEMALE(picTable, _size, shadow, _tracks, ...)
#define OVERWORLD(...)
#define OVERWORLD_FEMALE(...)
#define OVERWORLD_PAL(...)
#define OVERWORLD_PAL_FEMALE(...)
#endif //OW_POKEMON_OBJECT_EVENTS
Expand Down Expand Up @@ -175,7 +139,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
.oam = &gObjectEventBaseOam_32x32,
.subspriteTables = sOamTables_32x32,
.anims = sAnimTable_Following,
.images = sPicTable_Substitute,
.images = (const struct SpriteFrameImage[]) { overworld_ascending_frames(gObjectEventPic_Substitute, 4, 4), },
.affineAnims = gDummySpriteAffineAnimTable,
},
#endif
Expand Down
Loading

0 comments on commit 4825e52

Please sign in to comment.