summaryrefslogtreecommitdiff
path: root/src/hall_of_fame.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/hall_of_fame.c')
-rw-r--r--src/hall_of_fame.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c
index 037acd09c..590c0d01d 100644
--- a/src/hall_of_fame.c
+++ b/src/hall_of_fame.c
@@ -66,13 +66,12 @@ static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL;
extern struct MusicPlayerInfo gMPlayInfo_BGM;
-// this file's functions
static void ClearVramOamPltt_LoadHofPal(void);
static void LoadHofGfx(void);
static void InitHofBgs(void);
static bool8 CreateHofConfettiSprite(void);
static void StartCredits(void);
-static bool8 sub_8175024(void);
+static bool8 LoadHofBgs(void);
static void Task_Hof_InitMonData(u8 taskId);
static void Task_Hof_InitTeamSaveData(u8 taskId);
static void Task_Hof_SetMonDisplayTask(u8 taskId);
@@ -104,7 +103,6 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2);
static void Task_DoDomeConfetti(u8 taskId);
static void SpriteCB_HofConfetti(struct Sprite* sprite);
-// const rom data
static const struct BgTemplate sHof_BgTemplates[] =
{
{
@@ -136,12 +134,19 @@ static const struct BgTemplate sHof_BgTemplates[] =
},
};
-static const struct WindowTemplate sHof_WindowTemplate = {0, 2, 2, 0xE, 6, 0xE, 1};
+static const struct WindowTemplate sHof_WindowTemplate = {
+ .bg = 0,
+ .tilemapLeft = 2,
+ .tilemapTop = 2,
+ .width = 14,
+ .height = 6,
+ .paletteNum = 14,
+ .baseBlock = 1
+};
static const u8 sMonInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY};
static const u8 sPlayerInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY};
-
-static const u8 sUnused_085E538C[] = {4, 5, 0, 0};
+static const u8 sUnusedTextColors[4] = {TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_TRANSPARENT};
static const struct CompressedSpriteSheet sSpriteSheet_Confetti[] =
{
@@ -383,7 +388,7 @@ static bool8 InitHallOfFameScreen(void)
gMain.state++;
break;
case 3:
- if (!sub_8175024())
+ if (!LoadHofBgs())
{
SetVBlankCallback(VBlankCB_HallOfFame);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
@@ -712,9 +717,9 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId)
{
gTasks[taskId].tFrameCount--;
}
- else if (gSprites[gTasks[taskId].tPlayerSpriteID].pos1.x != 192)
+ else if (gSprites[gTasks[taskId].tPlayerSpriteID].x != 192)
{
- gSprites[gTasks[taskId].tPlayerSpriteID].pos1.x++;
+ gSprites[gTasks[taskId].tPlayerSpriteID].x++;
}
else
{
@@ -819,7 +824,7 @@ void CB2_DoHallOfFamePC(void)
gMain.state++;
break;
case 3:
- if (!sub_8175024())
+ if (!LoadHofBgs())
{
struct HallofFameTeam *fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer);
fameTeam->mon[0] = sDummyFameMon;
@@ -1301,7 +1306,7 @@ static void InitHofBgs(void)
ChangeBgY(3, 0, 0);
}
-static bool8 sub_8175024(void)
+static bool8 LoadHofBgs(void)
{
switch (sHofGfxPtr->state)
{
@@ -1340,18 +1345,18 @@ static bool8 sub_8175024(void)
static void SpriteCB_GetOnScreenAndAnimate(struct Sprite *sprite)
{
- if (sprite->pos1.x != sprite->tDestinationX
- || sprite->pos1.y != sprite->tDestinationY)
+ if (sprite->x != sprite->tDestinationX
+ || sprite->y != sprite->tDestinationY)
{
- if (sprite->pos1.x < sprite->tDestinationX)
- sprite->pos1.x += 15;
- if (sprite->pos1.x > sprite->tDestinationX)
- sprite->pos1.x -= 15;
-
- if (sprite->pos1.y < sprite->tDestinationY)
- sprite->pos1.y += 10;
- if (sprite->pos1.y > sprite->tDestinationY)
- sprite->pos1.y -= 10;
+ if (sprite->x < sprite->tDestinationX)
+ sprite->x += 15;
+ if (sprite->x > sprite->tDestinationX)
+ sprite->x -= 15;
+
+ if (sprite->y < sprite->tDestinationY)
+ sprite->y += 10;
+ if (sprite->y > sprite->tDestinationY)
+ sprite->y -= 10;
}
else
{
@@ -1373,7 +1378,7 @@ static void SpriteCB_GetOnScreenAndAnimate(struct Sprite *sprite)
static void SpriteCB_HofConfetti(struct Sprite* sprite)
{
- if (sprite->pos2.y > 120)
+ if (sprite->y2 > 120)
{
DestroySprite(sprite);
}
@@ -1382,12 +1387,12 @@ static void SpriteCB_HofConfetti(struct Sprite* sprite)
u16 rand;
u8 sineIdx;
- sprite->pos2.y++;
- sprite->pos2.y += sprite->sExtraY;
+ sprite->y2++;
+ sprite->y2 += sprite->sExtraY;
sineIdx = sprite->sSineIdx;
rand = (Random() % 4) + 8;
- sprite->pos2.x = rand * gSineTable[sineIdx] / 256;
+ sprite->x2 = rand * gSineTable[sineIdx] / 256;
sprite->sSineIdx += 4;
}
@@ -1398,7 +1403,7 @@ static bool8 CreateHofConfettiSprite(void)
u8 spriteID;
struct Sprite* sprite;
- s16 posX = Random() % 240;
+ s16 posX = Random() % DISPLAY_WIDTH;
s16 posY = -(Random() % 8);
spriteID = CreateSprite(&sSpriteTemplate_HofConfetti, posX, posY, 0);
@@ -1505,7 +1510,7 @@ static void Task_DoDomeConfetti(u8 taskId)
id = ConfettiUtil_AddNew(&sOamData_Confetti,
TAG_CONFETTI,
TAG_CONFETTI,
- Random() % 240,
+ Random() % DISPLAY_WIDTH,
-(Random() % 8),
Random() % ARRAY_COUNT(sAnims_Confetti),
id);