From b252bd029279b6f28518c59df1ba03caf44d756f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 27 Oct 2018 00:53:07 +0200 Subject: [PATCH] Window priority to window bg --- include/window.h | 4 +- src/battle_bg.c | 98 ++++++++++++++++++------------------ src/battle_dome.c | 42 ++++++++-------- src/battle_factory.c | 30 +++++------ src/battle_pyramid_bag.c | 18 +++---- src/battle_records.c | 4 +- src/berry_blender.c | 16 +++--- src/berry_tag_screen.c | 8 +-- src/cable_club.c | 6 +-- src/clear_save_data_screen.c | 8 +-- src/credits.c | 16 +++--- src/daycare.c | 2 +- src/decoration.c | 8 +-- src/diploma.c | 19 +++---- src/egg_hatch.c | 16 +++--- src/field_region_map.c | 4 +- src/field_specials.c | 8 +-- src/item_menu.c | 32 ++++++------ src/mail.c | 2 +- src/main_menu.c | 46 ++++++++--------- src/map_name_popup.c | 2 +- src/menu.c | 10 ++-- src/mystery_event_menu.c | 4 +- src/naming_screen.c | 10 ++-- src/option_menu.c | 4 +- src/player_pc.c | 18 +++---- src/pokeblock.c | 24 ++++----- src/pokemon_summary_screen.c | 64 +++++++++++------------ src/save_failed_screen.c | 6 +-- src/shop.c | 32 ++++++------ src/starter_choose.c | 12 ++--- src/text_window.c | 10 ++-- src/wallclock.c | 8 +-- src/window.c | 66 ++++++++++++------------ 34 files changed, 325 insertions(+), 332 deletions(-) diff --git a/include/window.h b/include/window.h index 29fdf8833..692ca1d81 100644 --- a/include/window.h +++ b/include/window.h @@ -3,7 +3,7 @@ enum { - WINDOW_PRIORITY, + WINDOW_BG, WINDOW_TILEMAP_LEFT, WINDOW_TILEMAP_TOP, WINDOW_WIDTH, @@ -15,7 +15,7 @@ enum struct WindowTemplate { - u8 priority; + u8 bg; u8 tilemapLeft; u8 tilemapTop; u8 width; diff --git a/src/battle_bg.c b/src/battle_bg.c index a6c66b3c4..bbe50cc70 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -162,10 +162,10 @@ const struct BgTemplate gBattleBgTemplates[] = }, }; -static const struct WindowTemplate gUnknown_0831AA18[] = +static const struct WindowTemplate gUnknown_0831AA18[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 26, @@ -174,7 +174,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0090, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 35, .width = 14, @@ -183,7 +183,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x01c0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 17, .tilemapTop = 35, .width = 12, @@ -192,7 +192,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0190, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 55, .width = 8, @@ -201,7 +201,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0300, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 55, .width = 8, @@ -210,7 +210,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0310, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 57, .width = 8, @@ -219,7 +219,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0320, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 57, .width = 8, @@ -228,7 +228,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0330, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 55, .width = 4, @@ -237,7 +237,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0290, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 57, .width = 0, @@ -246,7 +246,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0298, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 25, .tilemapTop = 55, .width = 4, @@ -255,7 +255,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0298, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 57, .width = 8, @@ -264,7 +264,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x02a0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 55, .width = 8, @@ -273,7 +273,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x02b0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 26, .tilemapTop = 9, .width = 3, @@ -282,7 +282,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0100, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 19, .tilemapTop = 8, .width = 10, @@ -291,7 +291,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0100, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 18, .tilemapTop = 0, .width = 12, @@ -300,7 +300,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x016e, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 3, .width = 6, @@ -309,7 +309,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0020, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 2, .tilemapTop = 3, .width = 6, @@ -318,7 +318,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0040, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 2, .width = 6, @@ -327,7 +327,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0020, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 2, .tilemapTop = 2, .width = 6, @@ -336,7 +336,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0040, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 6, .width = 6, @@ -345,7 +345,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0060, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 2, .tilemapTop = 6, .width = 6, @@ -354,7 +354,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x0080, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 12, .tilemapTop = 2, .width = 6, @@ -363,7 +363,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x00a0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 4, .tilemapTop = 2, .width = 7, @@ -372,7 +372,7 @@ static const struct WindowTemplate gUnknown_0831AA18[] = .baseBlock = 0x00a0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 19, .tilemapTop = 2, .width = 7, @@ -383,10 +383,10 @@ static const struct WindowTemplate gUnknown_0831AA18[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gUnknown_0831AAE0[] = +static const struct WindowTemplate gUnknown_0831AAE0[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 26, @@ -395,7 +395,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0090, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 35, .width = 14, @@ -404,7 +404,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x01c0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 17, .tilemapTop = 35, .width = 12, @@ -413,7 +413,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0190, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 55, .width = 8, @@ -422,7 +422,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0300, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 55, .width = 8, @@ -431,7 +431,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0310, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 57, .width = 8, @@ -440,7 +440,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0320, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 57, .width = 8, @@ -449,7 +449,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0330, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 55, .width = 4, @@ -458,7 +458,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0290, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 57, .width = 0, @@ -467,7 +467,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0298, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 25, .tilemapTop = 55, .width = 4, @@ -476,7 +476,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0298, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 57, .width = 8, @@ -485,7 +485,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x02a0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 55, .width = 8, @@ -494,7 +494,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x02b0, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 26, .tilemapTop = 9, .width = 3, @@ -503,7 +503,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0100, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 19, .tilemapTop = 8, .width = 10, @@ -512,7 +512,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0100, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 18, .tilemapTop = 0, .width = 12, @@ -521,7 +521,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x016e, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 6, .tilemapTop = 1, .width = 8, @@ -530,7 +530,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0100, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 14, .tilemapTop = 1, .width = 2, @@ -539,7 +539,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0110, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 1, .width = 8, @@ -548,7 +548,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0114, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 12, .tilemapTop = 4, .width = 6, @@ -557,7 +557,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0124, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 12, .tilemapTop = 6, .width = 6, @@ -566,7 +566,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0130, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 12, .tilemapTop = 8, .width = 6, @@ -575,7 +575,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x013c, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 8, .tilemapTop = 11, .width = 14, @@ -584,7 +584,7 @@ static const struct WindowTemplate gUnknown_0831AAE0[] = .baseBlock = 0x0148, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 26, diff --git a/src/battle_dome.c b/src/battle_dome.c index 00f461ada..4aec0a336 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -792,7 +792,7 @@ static const struct BgTemplate gUnknown_0860CE84[4] = static const struct WindowTemplate gUnknown_0860CE94[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 3, .width = 8, @@ -801,7 +801,7 @@ static const struct WindowTemplate gUnknown_0860CE94[] = .baseBlock = 16, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 3, .width = 8, @@ -810,7 +810,7 @@ static const struct WindowTemplate gUnknown_0860CE94[] = .baseBlock = 144, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 8, .tilemapTop = 1, .width = 14, @@ -824,7 +824,7 @@ static const struct WindowTemplate gUnknown_0860CE94[] = static const struct WindowTemplate gUnknown_0860CEB4[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 2, .width = 26, @@ -833,7 +833,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 1, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 5, .width = 8, @@ -842,7 +842,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 53, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 19, .tilemapTop = 7, .width = 9, @@ -851,7 +851,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 69, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 10, .width = 8, @@ -860,7 +860,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 96, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 12, .width = 26, @@ -869,7 +869,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 112, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 5, .tilemapTop = 2, .width = 23, @@ -878,7 +878,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 294, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 5, .width = 8, @@ -887,7 +887,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 340, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 20, .tilemapTop = 5, .width = 8, @@ -896,7 +896,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 356, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 16, .width = 26, @@ -905,7 +905,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 372, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 2, .width = 26, @@ -914,7 +914,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 1, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 16, .tilemapTop = 5, .width = 8, @@ -923,7 +923,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 53, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 19, .tilemapTop = 7, .width = 9, @@ -932,7 +932,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 69, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 16, .tilemapTop = 10, .width = 8, @@ -941,7 +941,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 96, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 12, .width = 26, @@ -950,7 +950,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 112, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 5, .tilemapTop = 2, .width = 23, @@ -959,7 +959,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 294, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 5, .width = 8, @@ -968,7 +968,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 340, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 20, .tilemapTop = 5, .width = 8, @@ -977,7 +977,7 @@ static const struct WindowTemplate gUnknown_0860CEB4[] = .baseBlock = 356, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 16, .width = 26, diff --git a/src/battle_factory.c b/src/battle_factory.c index 7ebcfe8b3..c2a3207a6 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -323,7 +323,7 @@ static const struct BgTemplate sSelect_BgTemplates[] = static const struct WindowTemplate sSelect_WindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 2, .width = 12, @@ -332,7 +332,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .baseBlock = 0x0001, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 19, .tilemapTop = 2, .width = 11, @@ -341,7 +341,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .baseBlock = 0x0019, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 15, .width = 20, @@ -350,7 +350,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .baseBlock = 0x002f, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 14, .width = 8, @@ -359,7 +359,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .baseBlock = 0x006b, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 14, .width = 8, @@ -368,7 +368,7 @@ static const struct WindowTemplate sSelect_WindowTemplates[] = .baseBlock = 0x009b, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 15, .tilemapTop = 0, .width = 15, @@ -907,7 +907,7 @@ static const struct BgTemplate sSwap_BgTemplates[4] = static const struct WindowTemplate sSwap_WindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 2, .width = 12, @@ -916,7 +916,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x0001, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 19, .tilemapTop = 2, .width = 11, @@ -925,7 +925,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x0019, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 15, .width = 20, @@ -934,7 +934,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x002f, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 14, .width = 9, @@ -943,7 +943,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x006b, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 14, .width = 8, @@ -952,7 +952,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x00a1, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 21, .tilemapTop = 15, .width = 9, @@ -961,7 +961,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x006b, }, { - .priority = 2, + .bg = 2, .tilemapLeft = 10, .tilemapTop = 2, .width = 4, @@ -970,7 +970,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x00c1, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 19, .tilemapTop = 2, .width = 11, @@ -979,7 +979,7 @@ static const struct WindowTemplate sSwap_WindowTemplates[] = .baseBlock = 0x00c9, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 15, .tilemapTop = 0, .width = 15, diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 94099aee8..fce8c9e2a 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -188,7 +188,7 @@ static const u8 sColorTable[][3] = static const struct WindowTemplate gUnknown_0861F328[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 14, .tilemapTop = 2, .width = 15, @@ -197,7 +197,7 @@ static const struct WindowTemplate gUnknown_0861F328[] = .baseBlock = 30 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, .width = 14, @@ -206,7 +206,7 @@ static const struct WindowTemplate gUnknown_0861F328[] = .baseBlock = 270 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -215,7 +215,7 @@ static const struct WindowTemplate gUnknown_0861F328[] = .baseBlock = 354 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 24, .tilemapTop = 17, .width = 5, @@ -229,7 +229,7 @@ static const struct WindowTemplate gUnknown_0861F328[] = static const struct WindowTemplate gUnknown_0861F350[] = { { - .priority = 1, + .bg = 1, .tilemapLeft = 22, .tilemapTop = 17, .width = 7, @@ -238,7 +238,7 @@ static const struct WindowTemplate gUnknown_0861F350[] = .baseBlock = 472 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 22, .tilemapTop = 15, .width = 7, @@ -247,7 +247,7 @@ static const struct WindowTemplate gUnknown_0861F350[] = .baseBlock = 472 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 15, .tilemapTop = 15, .width = 14, @@ -256,7 +256,7 @@ static const struct WindowTemplate gUnknown_0861F350[] = .baseBlock = 472 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 15, .tilemapTop = 13, .width = 14, @@ -265,7 +265,7 @@ static const struct WindowTemplate gUnknown_0861F350[] = .baseBlock = 472 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 24, .tilemapTop = 15, .width = 5, diff --git a/src/battle_records.c b/src/battle_records.c index feaec74db..f64b5f494 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -65,7 +65,7 @@ static const struct BgTemplate sTrainerHillRecordsBgTemplates[] = static const struct WindowTemplate sTrainerHillRecordsWindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, .width = 26, @@ -78,7 +78,7 @@ static const struct WindowTemplate sTrainerHillRecordsWindowTemplates[] = static const struct WindowTemplate sLinkBattleRecordsWindow = { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, .width = 26, diff --git a/src/berry_blender.c b/src/berry_blender.c index 8e0bc8043..643bd2e30 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -323,7 +323,7 @@ static const struct BgTemplate sBerryBlenderBgTemplates[3] = static const struct WindowTemplate sBerryBlender_WindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 6, .width = 7, @@ -332,7 +332,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = .baseBlock = 0x28, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 6, .width = 7, @@ -341,7 +341,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = .baseBlock = 0x36, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 12, .width = 7, @@ -350,7 +350,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = .baseBlock = 0x44, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 12, .width = 7, @@ -359,7 +359,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = .baseBlock = 0x52, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -368,7 +368,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = .baseBlock = 0x60, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 5, .tilemapTop = 3, .width = 21, @@ -381,7 +381,7 @@ static const struct WindowTemplate sBerryBlender_WindowTemplates[] = static const struct WindowTemplate sBlender_YesNoWindowTemplate = { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, @@ -846,7 +846,7 @@ static const u8 sUnknown_08339CD2[] = static const struct WindowTemplate sBlenderRecordWindowTemplate = { - .priority = 0, + .bg = 0, .tilemapLeft = 6, .tilemapTop = 4, .width = 18, diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 07fb6bd9e..39927ab99 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -102,7 +102,7 @@ static const u8 sTextColors[2][3] = static const struct WindowTemplate sWindowTemplates[] = { { // WIN_BERRY_NAME - .priority = 1, + .bg = 1, .tilemapLeft = 11, .tilemapTop = 4, .width = 8, @@ -111,7 +111,7 @@ static const struct WindowTemplate sWindowTemplates[] = .baseBlock = 69, }, { // WIN_SIZE_FIRM - .priority = 1, + .bg = 1, .tilemapLeft = 11, .tilemapTop = 7, .width = 18, @@ -120,7 +120,7 @@ static const struct WindowTemplate sWindowTemplates[] = .baseBlock = 85, }, { // WIN_DESC - .priority = 1, + .bg = 1, .tilemapLeft = 4, .tilemapTop = 14, .width = 25, @@ -129,7 +129,7 @@ static const struct WindowTemplate sWindowTemplates[] = .baseBlock = 157, }, { // WIN_BERRY_TAG - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 0, .width = 8, diff --git a/src/cable_club.c b/src/cable_club.c index c54df5f24..b0e5f0500 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -34,7 +34,7 @@ extern u8 gUnknown_02032298[2]; extern u8 gUnknown_0203CEF8[]; static const struct WindowTemplate gUnknown_08550594 = { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 11, .width = 11, @@ -421,7 +421,7 @@ bool32 sub_80B2AF4(u16 *arg0, u16 *arg1) gStringVar1[0] = EOS; gStringVar2[0] = EOS; - + for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) @@ -1151,7 +1151,7 @@ static void sub_80B3950(void) void nullsub_37(void) { - + } void sub_80B3968(void) diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 839a77e4a..51f3bd291 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -11,8 +11,8 @@ #include "text_window.h" #include "constants/songs.h" -extern u8 gText_ClearAllSaveData[]; -extern u8 gText_ClearingData[]; +extern const u8 gText_ClearAllSaveData[]; +extern const u8 gText_ClearingData[]; static void Task_DoClearSaveDataScreenYesNo(u8); static void Task_ClearSaveDataScreenYesNoChoice(u8); @@ -46,7 +46,7 @@ static const struct BgTemplate sClearSaveBgTemplates[2] = static const struct WindowTemplate sClearSaveTextWindow[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 15, .width = 26, @@ -60,7 +60,7 @@ static const struct WindowTemplate sClearSaveTextWindow[] = static const struct WindowTemplate sClearSaveYesNo[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 2, .width = 5, diff --git a/src/credits.c b/src/credits.c index 608c17cc6..df17ec70b 100644 --- a/src/credits.c +++ b/src/credits.c @@ -949,7 +949,7 @@ static const struct BgTemplate gUnknown_085E6F68[] = static const struct WindowTemplate gUnknown_085E6F6C[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 9, .width = 30, @@ -1142,7 +1142,7 @@ static void sub_81754DC(void) { RunTasks(); AnimateSprites(); - + if ((gMain.heldKeys & B_BUTTON) && gHasHallOfFameRecords != 0 && gTasks[gUnknown_0203BCE2].func == sub_8175774) @@ -1182,9 +1182,9 @@ static void sub_81755BC(const u8 *string, u8 y, u8 a2) { u8 x; u8 color[3]; - + color[0] = 0; - + if (a2 == 1) { color[1] = 3; @@ -1195,7 +1195,7 @@ static void sub_81755BC(const u8 *string, u8 y, u8 a2) color[1] = 1; color[2] = 2; } - + x = GetStringCenterAlignXOffsetWithLetterSpacing(1, string, 0xF0, 1); AddTextPrinterParameterized4(0, 1, x, y, 1, 0, color, -1, string); } @@ -1230,7 +1230,7 @@ void sub_8175620(void) gTasks[taskIdC].data[TDC_0] = 40; SetGpuReg(REG_OFFSET_BG0VOFS, 0xFFFC); - + taskIdB = CreateTask(sub_8175DA0, 0); gTasks[taskIdB].data[TDB_TASK_A_ID] = taskIdA; @@ -1546,9 +1546,9 @@ static void sub_8175DA0(u8 taskIdB) { for (i = 0; i < 5; i++) sub_81755BC(gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->text, 5 + i * 16, gCreditsEntryPointerTable[gTasks[taskIdB].data[TDB_CURRENT_PAGE]][i]->var_1); - + CopyWindowToVram(0, 2); - + gTasks[taskIdB].data[TDB_CURRENT_PAGE] += 1; gTasks[taskIdB].data[TDB_0] += 1; diff --git a/src/daycare.c b/src/daycare.c index c80a8b743..db46b3a4f 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -63,7 +63,7 @@ EWRAM_DATA static u16 sHatchedEggMotherMoves[4] = {0}; static const struct WindowTemplate sDaycareLevelMenuWindowTemplate = { - .priority = 0, + .bg = 0, .tilemapLeft = 15, .tilemapTop = 1, .width = 14, diff --git a/src/decoration.c b/src/decoration.c index 0cafad800..8bbe11039 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -217,7 +217,7 @@ void (*const SecretBasePC_SelectedDecorActions[][2])(u8 taskId) = { const struct WindowTemplate gUnknown_085A6B90[4] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 18, @@ -226,7 +226,7 @@ const struct WindowTemplate gUnknown_085A6B90[4] = .baseBlock = 0x0001 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 13, @@ -235,7 +235,7 @@ const struct WindowTemplate gUnknown_085A6B90[4] = .baseBlock = 0x0091 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 17, .tilemapTop = 1, .width = 12, @@ -244,7 +244,7 @@ const struct WindowTemplate gUnknown_085A6B90[4] = .baseBlock = 0x017b }, { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 13, .width = 13, diff --git a/src/diploma.c b/src/diploma.c index a1d37a70d..e2f2c6d07 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -11,19 +11,14 @@ #include "window.h" #include "string_util.h" #include "text.h" +#include "overworld.h" +#include "menu.h" -extern void reset_temp_tile_data_buffers(void); -extern int decompress_and_copy_tile_data_to_vram(u8 bg_id, void *src, int size, u16 offset, u8 mode); -extern bool8 free_temp_tile_data_buffers_if_possible(void); -extern void sub_80861E8(void); // rom4 extern bool16 sub_80C0944(void); -extern void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, u8 *color, s8 speed, u8 *str); -extern u16 gUnknown_0860F074[]; - -extern u8 gText_DexNational[]; -extern u8 gText_DexHoenn[]; -extern u8 gText_PokedexDiploma[]; +extern const u8 gText_DexNational[]; +extern const u8 gText_DexHoenn[]; +extern const u8 gText_PokedexDiploma[]; static void MainCB2(void); static void Task_DiplomaFadeIn(u8); @@ -34,7 +29,7 @@ static void InitDiplomaBg(void); static void InitDiplomaWindow(void); static void PrintDiplomaText(u8 *, u8, u8); -EWRAM_DATA static void **sDiplomaTilemapPtr = {NULL}; +EWRAM_DATA static u8 *sDiplomaTilemapPtr = NULL; static void VBlankCB(void) { @@ -186,7 +181,7 @@ static void InitDiplomaBg(void) static const struct WindowTemplate sDiplomaWinTemplates[2] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 5, .tilemapTop = 2, .width = 20, diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 9f2526295..eeae72f36 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -26,6 +26,11 @@ #include "constants/abilities.h" #include "daycare.h" #include "overworld.h" +#include "scanline_effect.h" +#include "field_weather.h" +#include "international_string_util.h" +#include "naming_screen.h" +#include "field_screen.h" #include "battle.h" // to get rid of later struct EggHatchData @@ -55,14 +60,7 @@ extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_NickHatchPrompt[]; -extern u8 sav1_map_get_name(void); -extern void TVShowConvertInternationalString(u8* str1, u8* str2, u8); -extern void FadeScreen(u8, u8); -extern void overworld_free_bg_tilemaps(void); -extern void sub_80AF168(void); -extern void ScanlineEffect_Stop(void); extern void play_some_sound(void); -extern void DoNamingScreen(u8, const u8*, u16, u8, u32, MainCallback); extern u16 sub_80D22D0(void); extern u8 CountPartyAliveNonEggMonsExcept(u8); @@ -254,7 +252,7 @@ static const struct BgTemplate sBgTemplates_EggHatch[2] = static const struct WindowTemplate sWinTemplates_EggHatch[2] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 26, @@ -267,7 +265,7 @@ static const struct WindowTemplate sWinTemplates_EggHatch[2] = static const struct WindowTemplate sYesNoWinTemplate = { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, diff --git a/src/field_region_map.c b/src/field_region_map.c index 7e8794cab..c15959afc 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -58,7 +58,7 @@ static const struct BgTemplate gUnknown_085E5068[] = { static const struct WindowTemplate gUnknown_085E5070[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 17, .tilemapTop = 17, .width = 12, @@ -67,7 +67,7 @@ static const struct WindowTemplate gUnknown_085E5070[] = .baseBlock = 1 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 1, .width = 7, diff --git a/src/field_specials.c b/src/field_specials.c index a74bf40f6..4b6ac47d0 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1680,7 +1680,7 @@ void sub_8139980(void) } const struct WindowTemplate gUnknown_085B2BAC = { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 1, .width = 8, @@ -3069,7 +3069,7 @@ void sub_813A8FC(void) void sub_813A958(void) { static const struct WindowTemplate gUnknown_085B311C = { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 6, @@ -3122,7 +3122,7 @@ u16 sub_813AA04(void) void sub_813AA18(void) { static const struct WindowTemplate gUnknown_085B3124 = { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 9, .width = 4, @@ -3284,7 +3284,7 @@ void sub_813AC7C(void) static void sub_813ACE8(u8 a0, u16 a1) { static const struct WindowTemplate gUnknown_085B3220 = { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 7, .width = 12, diff --git a/src/item_menu.c b/src/item_menu.c index bb619cac8..7dbdf716f 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -268,7 +268,7 @@ const u8 gUnknown_08614164[][3] = { const struct WindowTemplate gUnknown_08614174[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 14, .tilemapTop = 2, .width = 15, @@ -277,7 +277,7 @@ const struct WindowTemplate gUnknown_08614174[] = .baseBlock = 0x27, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, .width = 14, @@ -286,7 +286,7 @@ const struct WindowTemplate gUnknown_08614174[] = .baseBlock = 0x117, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 4, .tilemapTop = 1, .width = 8, @@ -295,7 +295,7 @@ const struct WindowTemplate gUnknown_08614174[] = .baseBlock = 0x1A1, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 13, .width = 5, @@ -304,7 +304,7 @@ const struct WindowTemplate gUnknown_08614174[] = .baseBlock = 0x16B, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 7, .tilemapTop = 13, .width = 4, @@ -313,7 +313,7 @@ const struct WindowTemplate gUnknown_08614174[] = .baseBlock = 0x189, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -327,7 +327,7 @@ const struct WindowTemplate gUnknown_08614174[] = const struct WindowTemplate gUnknown_086141AC[] = { { - .priority = 1, + .bg = 1, .tilemapLeft = 22, .tilemapTop = 17, .width = 7, @@ -336,7 +336,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 22, .tilemapTop = 15, .width = 7, @@ -345,7 +345,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 15, .tilemapTop = 15, .width = 14, @@ -354,7 +354,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 15, .tilemapTop = 13, .width = 14, @@ -363,7 +363,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -372,7 +372,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x1B1, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 24, .tilemapTop = 15, .width = 5, @@ -381,7 +381,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, @@ -390,7 +390,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 24, .tilemapTop = 17, .width = 5, @@ -399,7 +399,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x21D, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 18, .tilemapTop = 11, .width = 10, @@ -408,7 +408,7 @@ const struct WindowTemplate gUnknown_086141AC[] = .baseBlock = 0x245, }, { - .priority = 1, + .bg = 1, .tilemapLeft = 1, .tilemapTop = 1, .width = 10, diff --git a/src/mail.c b/src/mail.c index 3c12bed3f..513900746 100644 --- a/src/mail.c +++ b/src/mail.c @@ -146,7 +146,7 @@ static const struct BgTemplate sUnknown_0859F290[] = { static const struct WindowTemplate sUnknown_0859F29C[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 3, .width = 26, diff --git a/src/main_menu.c b/src/main_menu.c index 521b92b35..8539ab027 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -165,7 +165,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = // No saved game // NEW GAME { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN0, .width = MENU_WIDTH, @@ -175,7 +175,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // OPTIONS { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN1, .width = MENU_WIDTH, @@ -186,7 +186,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = // Has saved game // CONTINUE { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN2, .width = MENU_WIDTH, @@ -196,7 +196,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // NEW GAME { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN3, .width = MENU_WIDTH, @@ -206,7 +206,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // OPTION / MYSTERY GIFT { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN4, .width = MENU_WIDTH, @@ -216,7 +216,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // OPTION / MYSTERY EVENTS { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN5, .width = MENU_WIDTH, @@ -226,7 +226,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // OPTION { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT, .tilemapTop = MENU_TOP_WIN6, .width = MENU_WIDTH, @@ -236,7 +236,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = }, // Error message window { - .priority = 0, + .bg = 0, .tilemapLeft = MENU_LEFT_ERROR, .tilemapTop = MENU_TOP_ERROR, .width = MENU_WIDTH_ERROR, @@ -250,7 +250,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = static const struct WindowTemplate gUnknown_082FF080[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -259,7 +259,7 @@ static const struct WindowTemplate gUnknown_082FF080[] = .baseBlock = 1 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 5, .width = 6, @@ -268,7 +268,7 @@ static const struct WindowTemplate gUnknown_082FF080[] = .baseBlock = 0x6D }, { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 2, .width = 9, @@ -323,7 +323,7 @@ static const union AffineAnimCmd sSpriteAffineAnim_PlayerShrink[] = { AFFINEANIMCMD_END }; -static const union AffineAnimCmd *const sSpriteAffineAnimTable_PlayerShrink[] = +static const union AffineAnimCmd *const sSpriteAffineAnimTable_PlayerShrink[] = { sSpriteAffineAnim_PlayerShrink }; @@ -2083,21 +2083,21 @@ static void DrawMainMenuWindowBorder(const struct WindowTemplate *template, u16 u16 sp14 = 7 + baseTileNum; u16 r6 = 8 + baseTileNum; - FillBgTilemapBufferRect(template->priority, baseTileNum, template->tilemapLeft - 1, template->tilemapTop - 1, 1, 1, 2); - FillBgTilemapBufferRect(template->priority, r9, template->tilemapLeft, template->tilemapTop - 1, template->width, 1, 2); - FillBgTilemapBufferRect(template->priority, r10, template->tilemapLeft + template->width, template->tilemapTop - 1, 1, 1, 2); - FillBgTilemapBufferRect(template->priority, sp18, template->tilemapLeft - 1, template->tilemapTop, 1, template->height, 2); - FillBgTilemapBufferRect(template->priority, spC, template->tilemapLeft + template->width, template->tilemapTop, 1, template->height, 2); - FillBgTilemapBufferRect(template->priority, sp10, template->tilemapLeft - 1, template->tilemapTop + template->height, 1, 1, 2); - FillBgTilemapBufferRect(template->priority, sp14, template->tilemapLeft, template->tilemapTop + template->height, template->width, 1, 2); - FillBgTilemapBufferRect(template->priority, r6, template->tilemapLeft + template->width, template->tilemapTop + template->height, 1, 1, 2); - CopyBgTilemapBufferToVram(template->priority); + FillBgTilemapBufferRect(template->bg, baseTileNum, template->tilemapLeft - 1, template->tilemapTop - 1, 1, 1, 2); + FillBgTilemapBufferRect(template->bg, r9, template->tilemapLeft, template->tilemapTop - 1, template->width, 1, 2); + FillBgTilemapBufferRect(template->bg, r10, template->tilemapLeft + template->width, template->tilemapTop - 1, 1, 1, 2); + FillBgTilemapBufferRect(template->bg, sp18, template->tilemapLeft - 1, template->tilemapTop, 1, template->height, 2); + FillBgTilemapBufferRect(template->bg, spC, template->tilemapLeft + template->width, template->tilemapTop, 1, template->height, 2); + FillBgTilemapBufferRect(template->bg, sp10, template->tilemapLeft - 1, template->tilemapTop + template->height, 1, 1, 2); + FillBgTilemapBufferRect(template->bg, sp14, template->tilemapLeft, template->tilemapTop + template->height, template->width, 1, 2); + FillBgTilemapBufferRect(template->bg, r6, template->tilemapLeft + template->width, template->tilemapTop + template->height, 1, 1, 2); + CopyBgTilemapBufferToVram(template->bg); } static void ClearMainMenuWindowTilemap(const struct WindowTemplate *template) { - FillBgTilemapBufferRect(template->priority, 0, template->tilemapLeft - 1, template->tilemapTop - 1, template->tilemapLeft + template->width + 1, template->tilemapTop + template->height + 1, 2); - CopyBgTilemapBufferToVram(template->priority); + FillBgTilemapBufferRect(template->bg, 0, template->tilemapLeft - 1, template->tilemapTop - 1, template->tilemapLeft + template->width + 1, template->tilemapTop + template->height + 1, 2); + CopyBgTilemapBufferToVram(template->bg); } static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, u8 e, u8 unused) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 3feffd70d..1e4ba5e1e 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -541,7 +541,7 @@ static void LoadMapNamePopUpWindowBg(void) } popUpThemeId = gRegionMapSectionId_To_PopUpThemeIdMapping[regionMapSectionId]; - LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_PRIORITY), &(gMapPopUp_Outline_Table[popUpThemeId][0]), 0x400, 0x21D); + LoadBgTiles(GetWindowAttribute(popupWindowId, WINDOW_BG), &(gMapPopUp_Outline_Table[popUpThemeId][0]), 0x400, 0x21D); CallWindowFunction(popupWindowId, sub_80D4A78); PutWindowTilemap(popupWindowId); if(gMapHeader.weather == WEATHER_BUBBLES) diff --git a/src/menu.c b/src/menu.c index 0e5d1b856..e5dce2ee0 100644 --- a/src/menu.c +++ b/src/menu.c @@ -66,7 +66,7 @@ static const u8 gUnknown_0860F094[] = { 8, 4, 1 }; static const struct WindowTemplate gUnknown_0860F098[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -79,7 +79,7 @@ static const struct WindowTemplate gUnknown_0860F098[] = static const struct WindowTemplate gUnknown_0860F0A8 = { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, @@ -782,9 +782,9 @@ u8 sub_81980F0(u8 bg, u8 xPos, u8 yPos, u8 palette, u16 baseTile) memset(&window, 0, sizeof(window)); if (bg > 3) - window.priority = 0; + window.bg = 0; else - window.priority = bg; + window.bg = bg; window.tilemapTop = yPos; window.height = 2; @@ -1147,7 +1147,7 @@ void sub_81989B8(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const stru void SetWindowTemplateFields(struct WindowTemplate *template, u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock) { - template->priority = bg; + template->bg = bg; template->tilemapLeft = left; template->tilemapTop = top; template->width = width; diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 7e09a4d70..0de4675d9 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -43,7 +43,7 @@ static const struct BgTemplate sBgTemplates[] = static const struct WindowTemplate sWindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 4, .tilemapTop = 15, .width = 22, @@ -52,7 +52,7 @@ static const struct WindowTemplate sWindowTemplates[] = .baseBlock = 20 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 7, .tilemapTop = 6, .width = 16, diff --git a/src/naming_screen.c b/src/naming_screen.c index ee1e78c60..a67516602 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -103,7 +103,7 @@ static const struct BgTemplate gUnknown_0858BE00[] = static const struct WindowTemplate gUnknown_0858BE10[] = { { - .priority = 1, + .bg = 1, .tilemapLeft = 3, .tilemapTop = 10, .width = 19, @@ -112,7 +112,7 @@ static const struct WindowTemplate gUnknown_0858BE10[] = .baseBlock = 0x030 }, { - .priority = 2, + .bg = 2, .tilemapLeft = 3, .tilemapTop = 10, .width = 19, @@ -121,7 +121,7 @@ static const struct WindowTemplate gUnknown_0858BE10[] = .baseBlock = 0x0C8 }, { - .priority = 3, + .bg = 3, .tilemapLeft = 8, .tilemapTop = 6, .width = 17, @@ -130,7 +130,7 @@ static const struct WindowTemplate gUnknown_0858BE10[] = .baseBlock = 0x030 }, { - .priority = 3, + .bg = 3, .tilemapLeft = 8, .tilemapTop = 4, .width = 17, @@ -139,7 +139,7 @@ static const struct WindowTemplate gUnknown_0858BE10[] = .baseBlock = 0x052 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 30, diff --git a/src/option_menu.c b/src/option_menu.c index 6cb208c63..122ba8d8a 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -92,7 +92,7 @@ static const u8 *const sOptionMenuItemsNames[MENUITEM_COUNT] = static const struct WindowTemplate sOptionMenuWinTemplates[] = { { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 1, .width = 26, @@ -101,7 +101,7 @@ static const struct WindowTemplate sOptionMenuWinTemplates[] = .baseBlock = 2 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 5, .width = 26, diff --git a/src/player_pc.c b/src/player_pc.c index bdbef1b43..7a8b4192b 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -185,7 +185,7 @@ const struct MenuAction gMailboxMailOptions[] = static const struct WindowTemplate gUnknown_085DFF24[3] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 9, @@ -194,7 +194,7 @@ static const struct WindowTemplate gUnknown_085DFF24[3] = .baseBlock = 1 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 9, @@ -203,7 +203,7 @@ static const struct WindowTemplate gUnknown_085DFF24[3] = .baseBlock = 1 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 10, @@ -243,7 +243,7 @@ static const struct ListMenuTemplate gUnknown_085DFF44 = static const struct WindowTemplate gUnknown_085DFF5C[5] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 1, .width = 13, @@ -252,7 +252,7 @@ static const struct WindowTemplate gUnknown_085DFF5C[5] = .baseBlock = 0x0001 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 13, .width = 13, @@ -261,7 +261,7 @@ static const struct WindowTemplate gUnknown_085DFF5C[5] = .baseBlock = 0x00EB }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 8, .width = 3, @@ -270,7 +270,7 @@ static const struct WindowTemplate gUnknown_085DFF5C[5] = .baseBlock = 0x0153 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 13, @@ -279,7 +279,7 @@ static const struct WindowTemplate gUnknown_085DFF5C[5] = .baseBlock = 0x0139 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 8, .tilemapTop = 9, .width = 6, @@ -291,7 +291,7 @@ static const struct WindowTemplate gUnknown_085DFF5C[5] = static const struct WindowTemplate gUnknown_085DFF84 = { - .priority = 0, + .bg = 0, .tilemapLeft = 9, .tilemapTop = 7, .width = 5, diff --git a/src/pokeblock.c b/src/pokeblock.c index d0a867b3a..1382ff6a7 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -295,7 +295,7 @@ static const struct Pokeblock sFavoritePokeblocksTable[] = static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, .width = 9, @@ -304,7 +304,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x1E }, { - .priority = 0, + .bg = 0, .tilemapLeft = 15, .tilemapTop = 1, .width = 14, @@ -313,7 +313,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x30 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 13, .width = 5, @@ -322,7 +322,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x12C }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 5, @@ -331,7 +331,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x136 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 17, .width = 5, @@ -340,7 +340,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x140 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 8, .tilemapTop = 13, .width = 5, @@ -349,7 +349,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x14A }, { - .priority = 0, + .bg = 0, .tilemapLeft = 8, .tilemapTop = 15, .width = 5, @@ -358,7 +358,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x154 }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 17, .width = 2, @@ -367,7 +367,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x15E }, { - .priority = 1, + .bg = 1, .tilemapLeft = 7, .tilemapTop = 5, .width = 6, @@ -376,7 +376,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x162 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 7, .tilemapTop = 7, .width = 6, @@ -385,7 +385,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = .baseBlock = 0x186 }, { - .priority = 1, + .bg = 1, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -398,7 +398,7 @@ static const struct WindowTemplate sWindowTemplatesForPokeblockMenu[] = static const struct WindowTemplate sTossPkblockWindowTemplate = { - .priority = 1, + .bg = 1, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index db2a07909..e1c2c79eb 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -314,7 +314,7 @@ static const s8 gUnknown_0861CC1C[] = {0, 2, 3, 1, 4, 5}; static const struct WindowTemplate gUnknown_0861CC24[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 11, @@ -323,7 +323,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 1, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 11, @@ -332,7 +332,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 23, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 11, @@ -341,7 +341,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 45, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 11, @@ -350,7 +350,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 67, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 0, .width = 8, @@ -359,7 +359,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 89, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 0, .width = 8, @@ -368,7 +368,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 105, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 0, .width = 8, @@ -377,7 +377,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 121, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 4, .width = 0, @@ -386,7 +386,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 137, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 4, .width = 18, @@ -395,7 +395,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 137, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 6, .width = 18, @@ -404,7 +404,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 173, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 10, .tilemapTop = 7, .width = 6, @@ -413,7 +413,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 209, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 7, .width = 5, @@ -422,7 +422,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 245, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 10, .tilemapTop = 14, .width = 11, @@ -431,7 +431,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 275, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 18, .width = 6, @@ -440,7 +440,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 319, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 15, .width = 9, @@ -449,7 +449,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 331, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 15, .width = 5, @@ -458,7 +458,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 367, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 4, .width = 0, @@ -467,7 +467,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 387, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 2, .width = 4, @@ -476,7 +476,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 387, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 12, .width = 9, @@ -485,7 +485,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = .baseBlock = 395, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 14, .width = 9, @@ -498,7 +498,7 @@ static const struct WindowTemplate gUnknown_0861CC24[] = static const struct WindowTemplate gUnknown_0861CCCC[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 4, .width = 11, @@ -507,7 +507,7 @@ static const struct WindowTemplate gUnknown_0861CCCC[] = .baseBlock = 449, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 22, .tilemapTop = 4, .width = 7, @@ -516,7 +516,7 @@ static const struct WindowTemplate gUnknown_0861CCCC[] = .baseBlock = 471, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 9, .width = 18, @@ -525,7 +525,7 @@ static const struct WindowTemplate gUnknown_0861CCCC[] = .baseBlock = 485, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 11, .tilemapTop = 14, .width = 18, @@ -537,7 +537,7 @@ static const struct WindowTemplate gUnknown_0861CCCC[] = static const struct WindowTemplate gUnknown_0861CCEC[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 10, .tilemapTop = 4, .width = 10, @@ -546,7 +546,7 @@ static const struct WindowTemplate gUnknown_0861CCEC[] = .baseBlock = 449, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 20, .tilemapTop = 4, .width = 10, @@ -555,7 +555,7 @@ static const struct WindowTemplate gUnknown_0861CCEC[] = .baseBlock = 469, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 16, .tilemapTop = 7, .width = 6, @@ -564,7 +564,7 @@ static const struct WindowTemplate gUnknown_0861CCEC[] = .baseBlock = 489, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 27, .tilemapTop = 7, .width = 3, @@ -573,7 +573,7 @@ static const struct WindowTemplate gUnknown_0861CCEC[] = .baseBlock = 525, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 24, .tilemapTop = 14, .width = 6, @@ -585,7 +585,7 @@ static const struct WindowTemplate gUnknown_0861CCEC[] = static const struct WindowTemplate gUnknown_0861CD14[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 15, .tilemapTop = 4, .width = 9, @@ -594,7 +594,7 @@ static const struct WindowTemplate gUnknown_0861CD14[] = .baseBlock = 449, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 24, .tilemapTop = 4, .width = 6, @@ -603,7 +603,7 @@ static const struct WindowTemplate gUnknown_0861CD14[] = .baseBlock = 539, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 10, .tilemapTop = 15, .width = 20, diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index ae23f8245..010279a87 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -95,7 +95,7 @@ static const struct BgTemplate gUnknown_085EFD88[3] = static const struct WindowTemplate gUnknown_085EFD94[] = { { - .priority = 255, + .bg = 255, .tilemapLeft = 0, .tilemapTop = 0, .width = 0, @@ -108,7 +108,7 @@ static const struct WindowTemplate gUnknown_085EFD94[] = static const struct WindowTemplate gUnknown_085EFD9C[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 13, .width = 28, @@ -121,7 +121,7 @@ static const struct WindowTemplate gUnknown_085EFD9C[] = static const struct WindowTemplate gUnknown_085EFDA4[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 14, .tilemapTop = 9, .width = 2, diff --git a/src/shop.c b/src/shop.c index 510c9f4f7..35f52c8f9 100755 --- a/src/shop.c +++ b/src/shop.c @@ -95,14 +95,14 @@ static const struct YesNoFuncTable sShopPurchaseYesNoFuncs = BuyMenuReturnToItemList }; -static const struct MenuAction sShopMenuActions_BuySellQuit[] = +static const struct MenuAction sShopMenuActions_BuySellQuit[] = { { gText_ShopBuy, {.void_u8=Task_HandleShopMenuBuy} }, { gText_ShopSell, {.void_u8=Task_HandleShopMenuSell} }, { gText_ShopQuit, {.void_u8=Task_HandleShopMenuQuit} } }; -static const struct MenuAction sShopMenuActions_BuyQuit[] = +static const struct MenuAction sShopMenuActions_BuyQuit[] = { { gText_ShopBuy, {.void_u8=Task_HandleShopMenuBuy} }, { gText_ShopQuit, {.void_u8=Task_HandleShopMenuQuit} } @@ -111,7 +111,7 @@ static const struct MenuAction sShopMenuActions_BuyQuit[] = static const struct WindowTemplate sShopMenuWindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, .width = 9, @@ -120,7 +120,7 @@ static const struct WindowTemplate sShopMenuWindowTemplates[] = .baseBlock = 0x0008, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 1, .width = 9, @@ -195,7 +195,7 @@ static const struct BgTemplate sShopBuyMenuBgTemplates[] = static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 1, .width = 10, @@ -204,7 +204,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .baseBlock = 0x001E, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 14, .tilemapTop = 2, .width = 15, @@ -213,7 +213,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .baseBlock = 0x0032, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 13, .width = 14, @@ -222,7 +222,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .baseBlock = 0x0122, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 1, .tilemapTop = 11, .width = 12, @@ -231,7 +231,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .baseBlock = 0x0176, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 18, .tilemapTop = 11, .width = 10, @@ -240,7 +240,7 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = .baseBlock = 0x018E, }, { - .priority = 0, + .bg = 0, .tilemapLeft = 2, .tilemapTop = 15, .width = 27, @@ -251,9 +251,9 @@ static const struct WindowTemplate sShopBuyMenuWindowTemplates[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate sShopBuyMenuYesNoWindowTemplates = +static const struct WindowTemplate sShopBuyMenuYesNoWindowTemplates = { - .priority = 0, + .bg = 0, .tilemapLeft = 21, .tilemapTop = 9, .width = 5, @@ -808,7 +808,7 @@ static void BuyMenuCollectEventObjectData(void) gShopDataPtr->viewportObjects[r8][X_COORD] = x; gShopDataPtr->viewportObjects[r8][Y_COORD] = y; gShopDataPtr->viewportObjects[r8][LAYER_TYPE] = MapGridGetMetatileLayerTypeAt(facingX - 4 + x, facingY - 2 + y); - + switch (gEventObjects[eventObjId].facingDirection) { case DIR_SOUTH: @@ -850,7 +850,7 @@ static void BuyMenuDrawEventObjects(void) (u16)gShopDataPtr->viewportObjects[i][X_COORD] * 16 + 8, (u16)gShopDataPtr->viewportObjects[i][Y_COORD] * 16 + 48 - graphicsInfo->height / 2, 2); - + if (BuyMenuCheckIfEventObjectOverlapsMenuBg(gShopDataPtr->viewportObjects[i]) == TRUE) { gSprites[spriteId].subspriteTableNum = 4; @@ -867,7 +867,7 @@ static bool8 BuyMenuCheckIfEventObjectOverlapsMenuBg(s16 *object) { return TRUE; } - else + else { return FALSE; } @@ -1000,7 +1000,7 @@ static void Task_BuyHowManyDialogueInit(u8 taskId) { gShopDataPtr->maxQuantity = maxQuantity; } - + gTasks[taskId].func = Task_BuyHowManyDialogueHandleInput; } diff --git a/src/starter_choose.c b/src/starter_choose.c index 5af652ccc..298c74db0 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -73,10 +73,10 @@ const u32 gUnknown_085B18AC[] = INCBIN_U32("graphics/misc/birch_ballarrow.4bpp.l const u32 gUnknown_085B1BCC[] = INCBIN_U32("graphics/misc/birch_circle.4bpp.lz"); -static const struct WindowTemplate gUnknown_085B1DCC[] = +static const struct WindowTemplate gUnknown_085B1DCC[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 15, .width = 24, @@ -87,9 +87,9 @@ static const struct WindowTemplate gUnknown_085B1DCC[] = DUMMY_WIN_TEMPLATE, }; -static const struct WindowTemplate gUnknown_085B1DDC = +static const struct WindowTemplate gUnknown_085B1DDC = { - .priority = 0, + .bg = 0, .tilemapLeft = 24, .tilemapTop = 9, .width = 5, @@ -98,9 +98,9 @@ static const struct WindowTemplate gUnknown_085B1DDC = .baseBlock = 0x0260 }; -static const struct WindowTemplate gUnknown_085B1DE4 = +static const struct WindowTemplate gUnknown_085B1DE4 = { - .priority = 0, + .bg = 0, .tilemapLeft = 0, .tilemapTop = 0, .width = 13, diff --git a/src/text_window.c b/src/text_window.c index e7e8f0ca6..517f4bdb9 100644 --- a/src/text_window.c +++ b/src/text_window.c @@ -93,7 +93,7 @@ const struct TilesPal *GetWindowFrameTilesPal(u8 id) void LoadMessageBoxGfx(u8 windowId, u16 destOffset, u8 palOffset) { - LoadBgTiles(GetWindowAttribute(windowId, WINDOW_PRIORITY), gMessageBox_Gfx, 0x1C0, destOffset); + LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), gMessageBox_Gfx, 0x1C0, destOffset); LoadPalette(GetOverworldTextboxPalettePtr(), palOffset, 0x20); } @@ -104,7 +104,7 @@ void LoadUserWindowBorderGfx_(u8 windowId, u16 destOffset, u8 palOffset) void LoadWindowGfx(u8 windowId, u8 frameId, u16 destOffset, u8 palOffset) { - LoadBgTiles(GetWindowAttribute(windowId, WINDOW_PRIORITY), sWindowFrames[frameId].tiles, 0x120, destOffset); + LoadBgTiles(GetWindowAttribute(windowId, WINDOW_BG), sWindowFrames[frameId].tiles, 0x120, destOffset); LoadPalette(sWindowFrames[frameId].pal, palOffset, 0x20); } @@ -115,7 +115,7 @@ void LoadUserWindowBorderGfx(u8 windowId, u16 destOffset, u8 palOffset) void sub_8098858(u8 windowId, u16 tileNum, u8 palNum) { - u8 bgLayer = GetWindowAttribute(windowId, WINDOW_PRIORITY); + u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG); u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT); u16 tilemapTop = GetWindowAttribute(windowId, WINDOW_TILEMAP_TOP); u16 width = GetWindowAttribute(windowId, WINDOW_WIDTH); @@ -133,7 +133,7 @@ void sub_8098858(u8 windowId, u16 tileNum, u8 palNum) void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum) { - u8 bgLayer = GetWindowAttribute(windowId, WINDOW_PRIORITY); + u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG); u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT); u16 tilemapTop = GetWindowAttribute(windowId, WINDOW_TILEMAP_TOP); u16 width = GetWindowAttribute(windowId, WINDOW_WIDTH); @@ -151,7 +151,7 @@ void sub_80989E0(u8 windowId, u16 tileNum, u8 palNum) void rbox_fill_rectangle(u8 windowId) { - u8 bgLayer = GetWindowAttribute(windowId, WINDOW_PRIORITY); + u8 bgLayer = GetWindowAttribute(windowId, WINDOW_BG); u16 tilemapLeft = GetWindowAttribute(windowId, WINDOW_TILEMAP_LEFT); u16 tilemapTop = GetWindowAttribute(windowId, WINDOW_TILEMAP_TOP); u16 width = GetWindowAttribute(windowId, WINDOW_WIDTH); diff --git a/src/wallclock.c b/src/wallclock.c index d6b2b5d50..947b7f103 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -60,10 +60,10 @@ static void SpriteCB_PMIndicator(struct Sprite *sprite); static const u32 sUnknown_085B1F58[] = INCBIN_U32("graphics/wallclock/graphics_85b1f58.4bpp.lz"); static const u16 sUnknown_085B21D4[] = INCBIN_U16("graphics/wallclock/palette_85b21d4.gbapal"); -static const struct WindowTemplate gUnknown_085B21DC[] = +static const struct WindowTemplate gUnknown_085B21DC[] = { { - .priority = 0, + .bg = 0, .tilemapLeft = 3, .tilemapTop = 17, .width = 24, @@ -72,7 +72,7 @@ static const struct WindowTemplate gUnknown_085B21DC[] = .baseBlock = 512 }, { - .priority = 2, + .bg = 2, .tilemapLeft = 24, .tilemapTop = 16, .width = 6, @@ -84,7 +84,7 @@ static const struct WindowTemplate gUnknown_085B21DC[] = }; static const struct WindowTemplate gUnknown_085B21F4 = { - .priority = 0, + .bg = 0, .tilemapLeft = 24, .tilemapTop = 9, .width = 5, diff --git a/src/window.c b/src/window.c index 57c8f5092..8efd1c281 100644 --- a/src/window.c +++ b/src/window.c @@ -52,7 +52,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) gWindows[i].tileData = NULL; } - for (i = 0, allocatedBaseBlock = 0, bgLayer = templates[i].priority; bgLayer != 0xFF && i < 0x20; ++i, bgLayer = templates[i].priority) + for (i = 0, allocatedBaseBlock = 0, bgLayer = templates[i].bg; bgLayer != 0xFF && i < 0x20; ++i, bgLayer = templates[i].bg) { if (gUnneededFireRedVariable == 1) { @@ -121,14 +121,14 @@ u16 AddWindow(const struct WindowTemplate *template) for (win = 0; win < WINDOWS_MAX; ++win) { - if ((bgLayer = gWindows[win].window.priority) == 0xFF) + if ((bgLayer = gWindows[win].window.bg) == 0xFF) break; } if (win == WINDOWS_MAX) return 0xFF; - bgLayer = template->priority; + bgLayer = template->bg; allocatedBaseBlock = 0; if (gUnneededFireRedVariable == 1) @@ -190,14 +190,14 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template) for (win = 0; win < WINDOWS_MAX; ++win) { - if (gWindows[win].window.priority == 0xFF) + if (gWindows[win].window.bg == 0xFF) break; } if (win == WINDOWS_MAX) return 0xFF; - bgLayer = template->priority; + bgLayer = template->bg; allocatedBaseBlock = 0; if (gUnneededFireRedVariable == 1) @@ -221,7 +221,7 @@ int AddWindowWithoutTileMap(const struct WindowTemplate *template) void RemoveWindow(u8 windowId) { - u8 bgLayer = gWindows[windowId].window.priority; + u8 bgLayer = gWindows[windowId].window.bg; if (gUnneededFireRedVariable == 1) { @@ -277,14 +277,14 @@ void CopyWindowToVram(u8 windowId, u8 mode) switch (mode) { case 1: - CopyBgTilemapBufferToVram(windowLocal.window.priority); + CopyBgTilemapBufferToVram(windowLocal.window.bg); break; case 2: - LoadBgTiles(windowLocal.window.priority, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); break; case 3: - LoadBgTiles(windowLocal.window.priority, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); - CopyBgTilemapBufferToVram(windowLocal.window.priority); + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); + CopyBgTilemapBufferToVram(windowLocal.window.bg); break; } } @@ -309,14 +309,14 @@ void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h) switch (mode) { case 1: - CopyBgTilemapBufferToVram(windowLocal.window.priority); + CopyBgTilemapBufferToVram(windowLocal.window.bg); break; case 2: - LoadBgTiles(windowLocal.window.priority, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); break; case 3: - LoadBgTiles(windowLocal.window.priority, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); - CopyBgTilemapBufferToVram(windowLocal.window.priority); + LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); + CopyBgTilemapBufferToVram(windowLocal.window.bg); break; } } @@ -327,8 +327,8 @@ void PutWindowTilemap(u8 windowId) struct Window windowLocal = gWindows[windowId]; WriteSequenceToBgTilemapBuffer( - windowLocal.window.priority, - GetBgAttribute(windowLocal.window.priority, 0xA) + windowLocal.window.baseBlock, + windowLocal.window.bg, + GetBgAttribute(windowLocal.window.bg, 0xA) + windowLocal.window.baseBlock, windowLocal.window.tilemapLeft, windowLocal.window.tilemapTop, windowLocal.window.width, @@ -340,13 +340,13 @@ void PutWindowTilemap(u8 windowId) void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 height, u8 palette) { struct Window windowLocal = gWindows[windowId]; - u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.priority, 0xA); + u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, 0xA); int i; for (i = 0; i < height; ++i) { WriteSequenceToBgTilemapBuffer( - windowLocal.window.priority, + windowLocal.window.bg, currentRow, windowLocal.window.tilemapLeft + x, windowLocal.window.tilemapTop + y + i, @@ -364,7 +364,7 @@ void ClearWindowTilemap(u8 windowId) struct Window windowLocal = gWindows[windowId]; FillBgTilemapBufferRect( - windowLocal.window.priority, + windowLocal.window.bg, gUnknown_03002F60, windowLocal.window.tilemapLeft, windowLocal.window.tilemapTop, @@ -376,13 +376,13 @@ void ClearWindowTilemap(u8 windowId) void PutWindowRectTilemap(u8 windowId, u8 x, u8 y, u8 width, u8 height) { struct Window windowLocal = gWindows[windowId]; - u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.priority, 0xA); + u16 currentRow = windowLocal.window.baseBlock + (y * windowLocal.window.width) + x + GetBgAttribute(windowLocal.window.bg, 0xA); int i; for (i = 0; i < height; ++i) { WriteSequenceToBgTilemapBuffer( - windowLocal.window.priority, + windowLocal.window.bg, currentRow, windowLocal.window.tilemapLeft + x, windowLocal.window.tilemapTop + y + i, @@ -529,7 +529,7 @@ void ScrollWindow(u8 windowId, u8 direction, u8 distance, u8 fillValue) void CallWindowFunction(u8 windowId, void ( *func)(u8, u8, u8, u8, u8, u8)) { struct WindowTemplate window = gWindows[windowId].window; - func(window.priority, window.tilemapLeft, window.tilemapTop, window.width, window.height, window.paletteNum); + func(window.bg, window.tilemapLeft, window.tilemapTop, window.width, window.height, window.paletteNum); } bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value) @@ -551,7 +551,7 @@ bool8 SetWindowAttribute(u8 windowId, u8 attributeId, u32 value) case WINDOW_TILE_DATA: gWindows[windowId].tileData = (u8*)(value); return TRUE; - case WINDOW_PRIORITY: + case WINDOW_BG: case WINDOW_WIDTH: case WINDOW_HEIGHT: default: @@ -563,8 +563,8 @@ u32 GetWindowAttribute(u8 windowId, u8 attributeId) { switch (attributeId) { - case WINDOW_PRIORITY: - return gWindows[windowId].window.priority; + case WINDOW_BG: + return gWindows[windowId].window.bg; case WINDOW_TILEMAP_LEFT: return gWindows[windowId].window.tilemapLeft; case WINDOW_TILEMAP_TOP: @@ -590,7 +590,7 @@ static u8 GetNumActiveWindowsOnBg(u8 bgId) s32 i; for (i = 0; i < WINDOWS_MAX; i++) { - if (gWindows[i].window.priority == bgId) + if (gWindows[i].window.bg == bgId) windowsNum++; } return windowsNum; @@ -609,12 +609,12 @@ u16 AddWindow8Bit(struct WindowTemplate *template) for (windowId = 0; windowId < 32; windowId++) { - if (gWindows[windowId].window.priority == 0xFF) + if (gWindows[windowId].window.bg == 0xFF) break; } if (windowId == WINDOWS_MAX) return 0xFF; - bgLayer = template->priority; + bgLayer = template->bg; if (gUnknown_03002F70[bgLayer] == 0) { u16 attribute = GetBgAttribute(bgLayer, 8); @@ -693,14 +693,14 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode) switch (mode) { case 1: - CopyBgTilemapBufferToVram(sWindowPtr->window.priority); + CopyBgTilemapBufferToVram(sWindowPtr->window.bg); break; case 2: - LoadBgTiles(sWindowPtr->window.priority, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); + LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); break; case 3: - LoadBgTiles(sWindowPtr->window.priority, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); - CopyBgTilemapBufferToVram(sWindowPtr->window.priority); + LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); + CopyBgTilemapBufferToVram(sWindowPtr->window.bg); break; } } @@ -711,7 +711,7 @@ static u8 GetNumActiveWindowsOnBg8Bit(u8 bgId) s32 i; for (i = 0; i < WINDOWS_MAX; i++) { - if (gWindows[i].window.priority == bgId) + if (gWindows[i].window.bg == bgId) windowsNum++; } return windowsNum;