Add some missing sizeof usage for SpriteSheets

This commit is contained in:
GriffinR 2023-01-24 17:02:17 -05:00
parent 10230799d3
commit f4cb6d229f
8 changed files with 46 additions and 37 deletions

View File

@ -867,17 +867,17 @@ static const u8 *const sEasyChatKeyboardAlphabet[NUM_ALPHABET_ROWS] =
static const struct SpriteSheet sSpriteSheets[] = {
{
.data = sTriangleCursor_Gfx,
.size = 0x20,
.size = sizeof(sTriangleCursor_Gfx),
.tag = GFXTAG_TRIANGLE_CURSOR
},
{
.data = sScrollIndicator_Gfx,
.size = 0x100,
.size = sizeof(sScrollIndicator_Gfx),
.tag = GFXTAG_SCROLL_INDICATOR
},
{
.data = sStartSelectButtons_Gfx,
.size = 0x100,
.size = sizeof(sStartSelectButtons_Gfx),
.tag = GFXTAG_START_SELECT_BUTTONS
},
{0}

View File

@ -145,14 +145,14 @@ static const union AnimCmd *const sSpriteAnimTable_Egg[] =
static const struct SpriteSheet sEggHatch_Sheet =
{
.data = sEggHatchTiles,
.size = 0x800,
.size = sizeof(sEggHatchTiles),
.tag = GFXTAG_EGG,
};
static const struct SpriteSheet sEggShards_Sheet =
{
.data = sEggShardTiles,
.size = 0x80,
.size = sizeof(sEggShardTiles),
.tag = GFXTAG_EGG_SHARD,
};

View File

@ -205,7 +205,7 @@ static const union AffineAnimCmd *const sRotatingBallAnimCmds_FullRotation[] =
static const struct SpriteSheet sRotatingBallTable =
{
sRotatingBall_Gfx, 0x80, TAG_ROTATING_BALL_GFX
sRotatingBall_Gfx, sizeof(sRotatingBall_Gfx), TAG_ROTATING_BALL_GFX
};
static const struct SpritePalette sRotatingBallPaletteTable =

View File

@ -96,7 +96,7 @@ static const s16 sCeilingCrumblePositions[][3] =
static const struct SpriteSheet sCeilingCrumbleSpriteSheets[] =
{
{sMirageTowerCrumbles_Gfx, 0x80, TAG_CEILING_CRUMBLE},
{sMirageTowerCrumbles_Gfx, sizeof(sMirageTowerCrumbles_Gfx), TAG_CEILING_CRUMBLE},
{}
};

View File

@ -145,10 +145,17 @@
// The different versions of hearts are selected using animation
// commands.
#define APPEAL_HEART_EMPTY 0
#define APPEAL_HEART_FULL 1
#define JAM_HEART_EMPTY 2
#define JAM_HEART_FULL 3
enum {
APPEAL_HEART_EMPTY,
APPEAL_HEART_FULL,
JAM_HEART_EMPTY,
JAM_HEART_FULL,
};
#define TAG_MODE_ARROWS 5325
#define TAG_LIST_ARROWS 5425
#define GFXTAG_UI 5525
#define PALTAG_UI 5526
#define MAX_RELEARNER_MOVES max(MAX_LEVEL_UP_MOVES, 25)
@ -174,11 +181,11 @@ static EWRAM_DATA struct {
bool8 showContestInfo;
} sMoveRelearnerMenuSate = {0};
static const u16 sMoveRelearnerPaletteData[] = INCBIN_U16("graphics/interface/ui_learn_move.gbapal");
static const u16 sUI_Pal[] = INCBIN_U16("graphics/interface/ui_learn_move.gbapal");
// The arrow sprites in this spritesheet aren't used. The scroll-arrow system provides its own
// arrow sprites.
static const u8 sMoveRelearnerSpriteSheetData[] = INCBIN_U8("graphics/interface/ui_learn_move.4bpp");
static const u8 sUI_Tiles[] = INCBIN_U8("graphics/interface/ui_learn_move.4bpp");
static const struct OamData sHeartSpriteOamData =
{
@ -233,15 +240,15 @@ static const struct OamData sUnusedOam2 =
static const struct SpriteSheet sMoveRelearnerSpriteSheet =
{
.data = sMoveRelearnerSpriteSheetData,
.size = 0x180,
.tag = 5525
.data = sUI_Tiles,
.size = sizeof(sUI_Tiles),
.tag = GFXTAG_UI
};
static const struct SpritePalette sMoveRelearnerPalette =
{
.data = sMoveRelearnerPaletteData,
.tag = 5526
.data = sUI_Pal,
.tag = PALTAG_UI
};
static const struct ScrollArrowsTemplate sDisplayModeArrowsTemplate =
@ -254,8 +261,8 @@ static const struct ScrollArrowsTemplate sDisplayModeArrowsTemplate =
.secondY = 16,
.fullyUpThreshold = -1,
.fullyDownThreshold = -1,
.tileTag = 5325,
.palTag = 5325,
.tileTag = TAG_MODE_ARROWS,
.palTag = TAG_MODE_ARROWS,
.palNum = 0,
};
@ -269,8 +276,8 @@ static const struct ScrollArrowsTemplate sMoveListScrollArrowsTemplate =
.secondY = 104,
.fullyUpThreshold = 0,
.fullyDownThreshold = 0,
.tileTag = 5425,
.palTag = 5425,
.tileTag = TAG_LIST_ARROWS,
.palTag = TAG_LIST_ARROWS,
.palNum = 0,
};
@ -308,8 +315,8 @@ static const union AnimCmd *const sHeartSpriteAnimationCommands[] =
static const struct SpriteTemplate sConstestMoveHeartSprite =
{
.tileTag = 5525,
.paletteTag = 5526,
.tileTag = GFXTAG_UI,
.paletteTag = PALTAG_UI,
.oam = &sHeartSpriteOamData,
.anims = sHeartSpriteAnimationCommands,
.images = NULL,

View File

@ -27,6 +27,8 @@
#define WAVEFORM_WINDOW_HEIGHT 56
#define TAG_NEEDLE 0x2000
struct PokedexCryMeterNeedle {
s8 rotation;
s8 targetRotation;
@ -202,8 +204,8 @@ static const struct OamData sOamData_CryMeterNeedle =
static const struct SpriteTemplate sCryMeterNeedleSpriteTemplate =
{
.tileTag = 0x2000,
.paletteTag = 0x2000,
.tileTag = TAG_NEEDLE,
.paletteTag = TAG_NEEDLE,
.oam = &sOamData_CryMeterNeedle,
.anims = sSpriteAnimTable_CryMeterNeedle,
.images = NULL,
@ -213,13 +215,13 @@ static const struct SpriteTemplate sCryMeterNeedleSpriteTemplate =
static const struct SpriteSheet sCryMeterNeedleSpriteSheets[] =
{
{sCryMeterNeedle_Gfx, 0x800, 0x2000},
{sCryMeterNeedle_Gfx, sizeof(sCryMeterNeedle_Gfx), TAG_NEEDLE},
{}
};
static const struct SpritePalette sCryMeterNeedleSpritePalettes[] =
{
{sCryMeterNeedle_Pal, 0x2000},
{sCryMeterNeedle_Pal, TAG_NEEDLE},
{}
};

View File

@ -1240,7 +1240,7 @@ static const union AffineAnimCmd *const sAffineAnims_ReleaseMon[] =
static const u16 sUnusedColor = RGB(26, 29, 8);
static const struct SpriteSheet sSpriteSheet_Arrow = {sArrow_Gfx, 0x80, GFXTAG_ARROW};
static const struct SpriteSheet sSpriteSheet_Arrow = {sArrow_Gfx, sizeof(sArrow_Gfx), GFXTAG_ARROW};
static const struct OamData sOamData_BoxTitle =
{

View File

@ -264,14 +264,14 @@ static const struct OamData sOamData_RotatingGateRegular =
static const struct SpriteSheet sRotatingGatesGraphicsTable[] =
{
{sRotatingGateTiles_1, 0x200, ROTATING_GATE_TILE_TAG + GATE_SHAPE_L1},
{sRotatingGateTiles_2, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_L2},
{sRotatingGateTiles_3, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_L3},
{sRotatingGateTiles_4, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_L4},
{sRotatingGateTiles_5, 0x200, ROTATING_GATE_TILE_TAG + GATE_SHAPE_T1},
{sRotatingGateTiles_6, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_T2},
{sRotatingGateTiles_7, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_T3},
{sRotatingGateTiles_8, 0x800, ROTATING_GATE_TILE_TAG + GATE_SHAPE_T4},
{sRotatingGateTiles_1, sizeof(sRotatingGateTiles_1), ROTATING_GATE_TILE_TAG + GATE_SHAPE_L1},
{sRotatingGateTiles_2, sizeof(sRotatingGateTiles_2), ROTATING_GATE_TILE_TAG + GATE_SHAPE_L2},
{sRotatingGateTiles_3, sizeof(sRotatingGateTiles_3), ROTATING_GATE_TILE_TAG + GATE_SHAPE_L3},
{sRotatingGateTiles_4, sizeof(sRotatingGateTiles_4), ROTATING_GATE_TILE_TAG + GATE_SHAPE_L4},
{sRotatingGateTiles_5, sizeof(sRotatingGateTiles_5), ROTATING_GATE_TILE_TAG + GATE_SHAPE_T1},
{sRotatingGateTiles_6, sizeof(sRotatingGateTiles_6), ROTATING_GATE_TILE_TAG + GATE_SHAPE_T2},
{sRotatingGateTiles_7, sizeof(sRotatingGateTiles_7), ROTATING_GATE_TILE_TAG + GATE_SHAPE_T3},
{sRotatingGateTiles_8, sizeof(sRotatingGateTiles_8), ROTATING_GATE_TILE_TAG + GATE_SHAPE_T4},
{NULL},
};