mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 12:14:20 +01:00
Use ARRAY_COUNT in InitBgsFromTemplates
This commit is contained in:
parent
bc20fda604
commit
3f9037d63a
@ -1158,7 +1158,7 @@ static void CB2_RunCreditsSequence(void)
|
||||
static void sub_8175548(void)
|
||||
{
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sBackgroundTemplates, 1);
|
||||
InitBgsFromTemplates(0, sBackgroundTemplates, ARRAY_COUNT(sBackgroundTemplates));
|
||||
SetBgTilemapBuffer(0, AllocZeroed(BG_SCREEN_SIZE));
|
||||
LoadPalette(gUnknown_085E56F0, 0x80, 0x40);
|
||||
InitWindows(sWindowTemplates);
|
||||
|
@ -168,7 +168,7 @@ static const struct BgTemplate sDiplomaBgTemplates[2] =
|
||||
static void InitDiplomaBg(void)
|
||||
{
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sDiplomaBgTemplates, 2);
|
||||
InitBgsFromTemplates(0, sDiplomaBgTemplates, ARRAY_COUNT(sDiplomaBgTemplates));
|
||||
SetBgTilemapBuffer(1, sDiplomaTilemapPtr);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
ShowBg(0);
|
||||
|
@ -742,7 +742,7 @@ void BagMenu_InitBGs(void)
|
||||
ResetVramOamAndBgCntRegs();
|
||||
memset(gBagMenu->tilemapBuffer, 0, 0x800);
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sBgTemplates_ItemMenu, 3);
|
||||
InitBgsFromTemplates(0, sBgTemplates_ItemMenu, ARRAY_COUNT(sBgTemplates_ItemMenu));
|
||||
SetBgTilemapBuffer(2, gBagMenu->tilemapBuffer);
|
||||
ResetAllBgsCoordinates();
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
|
@ -125,7 +125,7 @@ static void CB2_ExitMailReadFreeVars(void);
|
||||
|
||||
// .rodata
|
||||
|
||||
static const struct BgTemplate sUnknown_0859F290[] = {
|
||||
static const struct BgTemplate sBgTemplates[] = {
|
||||
{
|
||||
.bg = 0,
|
||||
.charBaseIndex = 2,
|
||||
@ -336,7 +336,7 @@ static bool8 MailReadBuildGraphics(void)
|
||||
break;
|
||||
case 6:
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, sUnknown_0859F290, 3);
|
||||
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
|
||||
SetBgTilemapBuffer(1, sMailRead->bg1TilemapBuffer);
|
||||
SetBgTilemapBuffer(2, sMailRead->bg2TilemapBuffer);
|
||||
break;
|
||||
|
@ -1799,7 +1799,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void)
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, 0);
|
||||
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);
|
||||
InitBgsFromTemplates(0, sMainMenuBgTemplates, 2);
|
||||
InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates));
|
||||
InitBgFromTemplate(&sBirchBgTemplate);
|
||||
SetVBlankCallback(NULL);
|
||||
SetGpuReg(REG_OFFSET_BG2CNT, 0);
|
||||
|
@ -288,8 +288,8 @@ static u32 (*const func_tbl[])(struct mevent_srv_common *) = {
|
||||
static u32 mevent_srv_exec_common(struct mevent_srv_common * svr)
|
||||
{
|
||||
u32 response;
|
||||
AGB_ASSERT(svr->mainseqno < NELEMS(func_tbl));
|
||||
AGB_ASSERT(svr->mainseqno < ARRAY_COUNT(func_tbl));
|
||||
response = func_tbl[svr->mainseqno](svr);
|
||||
AGB_ASSERT(svr->mainseqno < NELEMS(func_tbl));
|
||||
AGB_ASSERT(svr->mainseqno < ARRAY_COUNT(func_tbl));
|
||||
return response;
|
||||
}
|
||||
|
@ -419,7 +419,7 @@ static u32 LoopedTask_OpenConditionSearchResults(s32 state)
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
InitBgTemplates(sConditionSearchResultBgTemplates, NELEMS(sConditionSearchResultBgTemplates));
|
||||
InitBgTemplates(sConditionSearchResultBgTemplates, ARRAY_COUNT(sConditionSearchResultBgTemplates));
|
||||
DecompressAndCopyTileDataToVram(1, sConditionSearchResultTiles, 0, 0, 0);
|
||||
SetBgTilemapBuffer(1, searchList->buff);
|
||||
CopyToBgTilemapBuffer(1, sConditionSearchResultTilemap, 0, 0);
|
||||
|
@ -750,7 +750,7 @@ static void LoadPokenavOptionPalettes(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < NELEMS(sPokenavOptionsSpriteSheets); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sPokenavOptionsSpriteSheets); i++)
|
||||
LoadCompressedSpriteSheet(&sPokenavOptionsSpriteSheets[i]);
|
||||
Pokenav_AllocAndLoadPalettes(sPokenavOptionsSpritePalettes);
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ static u32 LoopedTask_OpenRibbonsMonList(s32 state)
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
InitBgTemplates(sMonRibbonListBgTemplates, NELEMS(sMonRibbonListBgTemplates));
|
||||
InitBgTemplates(sMonRibbonListBgTemplates, ARRAY_COUNT(sMonRibbonListBgTemplates));
|
||||
DecompressAndCopyTileDataToVram(1, sMonRibbonListFrameTiles, 0, 0, 0);
|
||||
SetBgTilemapBuffer(1, monMenu->buff);
|
||||
CopyToBgTilemapBuffer(1, sMonRibbonListFrameTilemap, 0, 0);
|
||||
|
@ -1677,7 +1677,7 @@ void CB2_OpenFlyMap(void)
|
||||
break;
|
||||
case 1:
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(1, sFlyMapBgTemplates, 3);
|
||||
InitBgsFromTemplates(1, sFlyMapBgTemplates, ARRAY_COUNT(sFlyMapBgTemplates));
|
||||
gMain.state++;
|
||||
break;
|
||||
case 2:
|
||||
|
@ -62,7 +62,7 @@ static const struct OamData sClockOamData =
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const struct BgTemplate gUnknown_085EFD88[3] =
|
||||
static const struct BgTemplate sBgTemplates[3] =
|
||||
{
|
||||
{
|
||||
.bg = 0,
|
||||
@ -212,7 +212,7 @@ static void CB2_SaveFailedScreen(void)
|
||||
LZ77UnCompVram(gBirchGrassTilemap, (void *)(BG_SCREEN_ADDR(15)));
|
||||
LZ77UnCompVram(sSaveFailedClockGfx, (void *)(VRAM + 0x10020));
|
||||
ResetBgsAndClearDma3BusyFlags(0);
|
||||
InitBgsFromTemplates(0, gUnknown_085EFD88, 3);
|
||||
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
|
||||
SetBgTilemapBuffer(0, (void *)&gDecompressionBuffer[0x2000]);
|
||||
CpuFill32(0, &gDecompressionBuffer[0x2000], 0x800);
|
||||
LoadBgTiles(0, gTextWindowFrame1_Gfx, 0x120, 0x214);
|
||||
|
Loading…
Reference in New Issue
Block a user