From 981d4a34d8a6669ffc3e0d93f0be84d9eaa5567f Mon Sep 17 00:00:00 2001 From: cbt6 <91667135+cbt6@users.noreply.github.com> Date: Thu, 16 Mar 2023 22:13:05 +0800 Subject: [PATCH] Rename union room chat graphics --- .../bg.bin} | Bin .../bg.png} | Bin ...45AED8.png => character_select_cursor.png} | Bin .../icons.png} | Bin .../{unk_845AA64.pal => messages.pal} | 0 .../{unk_845AC14.pal => objects.pal} | 0 .../panel.bin} | Bin .../panel.png} | Bin .../{unk_845AF04.png => r_button.png} | Bin .../{unk_845AC34.png => selector_cursor.png} | Bin .../{unk_845AA24.pal => text_entry.pal} | 0 ...{unk_845AEB8.png => text_entry_cursor.png} | Bin .../{unk_845AA44.pal => unused.pal} | 0 include/graphics.h | 14 ++--- src/graphics.c | 14 ++--- src/union_room_chat_display.c | 24 ++++---- src/union_room_chat_objects.c | 58 +++++++++++++----- 17 files changed, 69 insertions(+), 41 deletions(-) rename graphics/{interface/union_room_chat.bin => union_room_chat/bg.bin} (100%) rename graphics/{interface/union_room_chat.png => union_room_chat/bg.png} (100%) rename graphics/union_room_chat/{unk_845AED8.png => character_select_cursor.png} (100%) rename graphics/{interface/union_room_chat_icons.png => union_room_chat/icons.png} (100%) rename graphics/union_room_chat/{unk_845AA64.pal => messages.pal} (100%) rename graphics/union_room_chat/{unk_845AC14.pal => objects.pal} (100%) rename graphics/{interface/union_room_chat_panel.bin => union_room_chat/panel.bin} (100%) rename graphics/{interface/union_room_chat_panel.png => union_room_chat/panel.png} (100%) rename graphics/union_room_chat/{unk_845AF04.png => r_button.png} (100%) rename graphics/union_room_chat/{unk_845AC34.png => selector_cursor.png} (100%) rename graphics/union_room_chat/{unk_845AA24.pal => text_entry.pal} (100%) rename graphics/union_room_chat/{unk_845AEB8.png => text_entry_cursor.png} (100%) rename graphics/union_room_chat/{unk_845AA44.pal => unused.pal} (100%) diff --git a/graphics/interface/union_room_chat.bin b/graphics/union_room_chat/bg.bin similarity index 100% rename from graphics/interface/union_room_chat.bin rename to graphics/union_room_chat/bg.bin diff --git a/graphics/interface/union_room_chat.png b/graphics/union_room_chat/bg.png similarity index 100% rename from graphics/interface/union_room_chat.png rename to graphics/union_room_chat/bg.png diff --git a/graphics/union_room_chat/unk_845AED8.png b/graphics/union_room_chat/character_select_cursor.png similarity index 100% rename from graphics/union_room_chat/unk_845AED8.png rename to graphics/union_room_chat/character_select_cursor.png diff --git a/graphics/interface/union_room_chat_icons.png b/graphics/union_room_chat/icons.png similarity index 100% rename from graphics/interface/union_room_chat_icons.png rename to graphics/union_room_chat/icons.png diff --git a/graphics/union_room_chat/unk_845AA64.pal b/graphics/union_room_chat/messages.pal similarity index 100% rename from graphics/union_room_chat/unk_845AA64.pal rename to graphics/union_room_chat/messages.pal diff --git a/graphics/union_room_chat/unk_845AC14.pal b/graphics/union_room_chat/objects.pal similarity index 100% rename from graphics/union_room_chat/unk_845AC14.pal rename to graphics/union_room_chat/objects.pal diff --git a/graphics/interface/union_room_chat_panel.bin b/graphics/union_room_chat/panel.bin similarity index 100% rename from graphics/interface/union_room_chat_panel.bin rename to graphics/union_room_chat/panel.bin diff --git a/graphics/interface/union_room_chat_panel.png b/graphics/union_room_chat/panel.png similarity index 100% rename from graphics/interface/union_room_chat_panel.png rename to graphics/union_room_chat/panel.png diff --git a/graphics/union_room_chat/unk_845AF04.png b/graphics/union_room_chat/r_button.png similarity index 100% rename from graphics/union_room_chat/unk_845AF04.png rename to graphics/union_room_chat/r_button.png diff --git a/graphics/union_room_chat/unk_845AC34.png b/graphics/union_room_chat/selector_cursor.png similarity index 100% rename from graphics/union_room_chat/unk_845AC34.png rename to graphics/union_room_chat/selector_cursor.png diff --git a/graphics/union_room_chat/unk_845AA24.pal b/graphics/union_room_chat/text_entry.pal similarity index 100% rename from graphics/union_room_chat/unk_845AA24.pal rename to graphics/union_room_chat/text_entry.pal diff --git a/graphics/union_room_chat/unk_845AEB8.png b/graphics/union_room_chat/text_entry_cursor.png similarity index 100% rename from graphics/union_room_chat/unk_845AEB8.png rename to graphics/union_room_chat/text_entry_cursor.png diff --git a/graphics/union_room_chat/unk_845AA44.pal b/graphics/union_room_chat/unused.pal similarity index 100% rename from graphics/union_room_chat/unk_845AA44.pal rename to graphics/union_room_chat/unused.pal diff --git a/include/graphics.h b/include/graphics.h index 15b4ce3cc..9c0330215 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4873,15 +4873,15 @@ extern const u32 gBagBgPalette[]; extern const u32 gBagBgPalette_FemaleOverride[]; // union_room_chat_display -extern const u16 gUnionRoomChatPanelBgPal_7[]; -extern const u32 gUnionRoomChatPanelBgTiles[]; -extern const u32 gUnionRoomChatPanelBgMap[]; -extern const u16 gLinkMiscMenu_Pal[]; -extern const u32 gLinkMiscMenu_Gfx[]; -extern const u32 gLinkMiscMenu_Tilemap[]; +extern const u16 gUnionRoomChat_Panel_Pal[]; +extern const u32 gUnionRoomChat_Panel_Gfx[]; +extern const u32 gUnionRoomChat_Panel_Tilemap[]; +extern const u16 gUnionRoomChat_Bg_Pal[]; +extern const u32 gUnionRoomChat_Bg_Gfx[]; +extern const u32 gUnionRoomChat_Bg_Tilemap[]; // union_room_chat_objects -extern const u32 gUnionRoomChatIcons[]; +extern const u32 gUnionRoomChat_Icons_Gfx[]; // battle_bg extern const u32 gFile_graphics_battle_transitions_vs_frame_sheet[]; diff --git a/src/graphics.c b/src/graphics.c index 90dbb1849..04f431469 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1232,10 +1232,10 @@ const u16 gFameCheckerBgTiles[] = INCBIN_U16("graphics/fame_checker/bg.4bpp"); const u16 gFameCheckerBg3Tilemap[] = INCBIN_U16("graphics/fame_checker/tilemap3.bin"); const u16 gFameCheckerBg2Tilemap[] = INCBIN_U16("graphics/fame_checker/tilemap2.bin"); -const u16 gLinkMiscMenu_Pal[] = INCBIN_U16("graphics/interface/union_room_chat.gbapal"); -const u32 gLinkMiscMenu_Gfx[] = INCBIN_U32("graphics/interface/union_room_chat.4bpp.lz"); -const u32 gLinkMiscMenu_Tilemap[] = INCBIN_U32("graphics/interface/union_room_chat.bin.lz"); -const u32 gUnionRoomChatIcons[] = INCBIN_U32("graphics/interface/union_room_chat_icons.4bpp.lz"); +const u16 gUnionRoomChat_Bg_Pal[] = INCBIN_U16("graphics/union_room_chat/bg.gbapal"); +const u32 gUnionRoomChat_Bg_Gfx[] = INCBIN_U32("graphics/union_room_chat/bg.4bpp.lz"); +const u32 gUnionRoomChat_Bg_Tilemap[] = INCBIN_U32("graphics/union_room_chat/bg.bin.lz"); +const u32 gUnionRoomChat_Icons_Gfx[] = INCBIN_U32("graphics/union_room_chat/icons.4bpp.lz"); const u16 gTilesetPalettes_General[][16] = { @@ -1322,9 +1322,9 @@ const u16 gTilesetPalettes_DepartmentStore[][16] = const u32 gTilesetTiles_DepartmentStore[] = INCBIN_U32("data/tilesets/secondary/department_store/tiles.4bpp.lz"); -const u16 gUnionRoomChatPanelBgPal_7[] = INCBIN_U16("graphics/interface/union_room_chat_panel.gbapal"); -const u32 gUnionRoomChatPanelBgTiles[] = INCBIN_U32("graphics/interface/union_room_chat_panel.4bpp.lz"); -const u32 gUnionRoomChatPanelBgMap[] = INCBIN_U32("graphics/interface/union_room_chat_panel.bin.lz"); +const u16 gUnionRoomChat_Panel_Pal[] = INCBIN_U16("graphics/union_room_chat/panel.gbapal"); +const u32 gUnionRoomChat_Panel_Gfx[] = INCBIN_U32("graphics/union_room_chat/panel.4bpp.lz"); +const u32 gUnionRoomChat_Panel_Tilemap[] = INCBIN_U32("graphics/union_room_chat/panel.bin.lz"); const u16 gCreditsMonPokeball_Pals[][16] = { diff --git a/src/union_room_chat_display.c b/src/union_room_chat_display.c index ab789ca83..6ded7d3af 100644 --- a/src/union_room_chat_display.c +++ b/src/union_room_chat_display.c @@ -119,9 +119,9 @@ static void InitScanlineEffect(void); static void FillScanlineEffectWithValue1col(s16 a0); static void FillScanlineEffectWithValue2col(s16 a0); -static const u16 sUnionRoomChatPanelBgPal_C[] = INCBIN_U16("graphics/union_room_chat/unk_845AA24.gbapal"); -static const u16 sBg1Pal8[] = INCBIN_U16("graphics/union_room_chat/unk_845AA44.gbapal"); -static const u16 sWin0PalF[] = INCBIN_U16("graphics/union_room_chat/unk_845AA64.gbapal"); +static const u16 sUnionRoomChat_TextEntry_Pal[] = INCBIN_U16("graphics/union_room_chat/text_entry.gbapal"); +static const u16 gUnionRoomChat_Unused_Pal[] = INCBIN_U16("graphics/union_room_chat/unused.gbapal"); // Loaded, but nothing uses it +static const u16 sUnionRoomChat_Messages_Pal[] = INCBIN_U16("graphics/union_room_chat/messages.gbapal"); static const struct BgTemplate sBgTemplates[] = { { @@ -1259,10 +1259,10 @@ static void ClearBg0(void) static void LoadUnionRoomChatPanelGfx(void) { - LoadPalette(gUnionRoomChatPanelBgPal_7, 0x70, 0x20); - LoadPalette(sUnionRoomChatPanelBgPal_C, 0xC0, 0x20); - DecompressAndCopyTileDataToVram(1, gUnionRoomChatPanelBgTiles, 0, 0, 0); - CopyToBgTilemapBuffer(1, gUnionRoomChatPanelBgMap, 0, 0); + LoadPalette(gUnionRoomChat_Panel_Pal, 0x70, 0x20); + LoadPalette(sUnionRoomChat_TextEntry_Pal, 0xC0, 0x20); + DecompressAndCopyTileDataToVram(1, gUnionRoomChat_Panel_Gfx, 0, 0, 0); + CopyToBgTilemapBuffer(1, gUnionRoomChat_Panel_Tilemap, 0, 0); CopyBgTilemapBufferToVram(1); } @@ -1270,21 +1270,21 @@ static void LoadLinkMiscMenuGfx(void) { u8 *ptr; - LoadPalette(gLinkMiscMenu_Pal, 0, 0x20); - ptr = DecompressAndCopyTileDataToVram(2, gLinkMiscMenu_Gfx, 0, 0, 0); - CopyToBgTilemapBuffer(2, gLinkMiscMenu_Tilemap, 0, 0); + LoadPalette(gUnionRoomChat_Bg_Pal, 0, 0x20); + ptr = DecompressAndCopyTileDataToVram(2, gUnionRoomChat_Bg_Gfx, 0, 0, 0); + CopyToBgTilemapBuffer(2, gUnionRoomChat_Bg_Tilemap, 0, 0); CopyBgTilemapBufferToVram(2); } static void LoadBg1Pal8(void) { - LoadPalette(sBg1Pal8, 0x80, 0x20); + LoadPalette(gUnionRoomChat_Unused_Pal, 0x80, 0x20); RequestDma3Fill(0, (void *)BG_CHAR_ADDR(1) + 0x20, 0x20, DMA3_32BIT); } static void LoadWin0(void) { - LoadPalette(sWin0PalF, 0xF0, 0x20); + LoadPalette(sUnionRoomChat_Messages_Pal, 0xF0, 0x20); PutWindowTilemap(0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); CopyWindowToVram(0, COPYWIN_FULL); diff --git a/src/union_room_chat_objects.c b/src/union_room_chat_objects.c index 24590c67a..23837d2e3 100644 --- a/src/union_room_chat_objects.c +++ b/src/union_room_chat_objects.c @@ -4,6 +4,14 @@ #include "graphics.h" #include "union_room_chat.h" +enum { + GFXTAG_SELECTOR_CURSOR, + GFXTAG_CHAR_SELECT_CURSOR, + GFXTAG_TEXT_ENTRY_CURSOR, + GFXTAG_R_BUTTON, + GFXTAG_ICONS, +}; + struct UnionRoomChat3 { struct Sprite *selectorCursorSprite; @@ -19,18 +27,38 @@ static EWRAM_DATA struct UnionRoomChat3 *sWork = NULL; static void SpriteCB_TextEntryCursor(struct Sprite *sprite); static void SpriteCB_CharacterSelectCursor(struct Sprite *sprite); -static const u16 sUnionRoomChatInterfacePal[] = INCBIN_U16("graphics/union_room_chat/unk_845AC14.gbapal"); -static const u32 sSelectorCursorGfxTiles[] = INCBIN_U32("graphics/union_room_chat/unk_845AC34.4bpp.lz"); -static const u32 sHorizontalBarGfxTiles[] = INCBIN_U32("graphics/union_room_chat/unk_845AEB8.4bpp.lz"); -static const u32 sMenuCursorGfxTiles[] = INCBIN_U32("graphics/union_room_chat/unk_845AED8.4bpp.lz"); -static const u32 sRButtonGfxTiles[] = INCBIN_U32("graphics/union_room_chat/unk_845AF04.4bpp.lz"); +static const u16 sUnionRoomChatInterfacePal[] = INCBIN_U16("graphics/union_room_chat/objects.gbapal"); +static const u32 sSelectorCursor_Gfx[] = INCBIN_U32("graphics/union_room_chat/selector_cursor.4bpp.lz"); +static const u32 sTextEntryCursor_Gfx[] = INCBIN_U32("graphics/union_room_chat/text_entry_cursor.4bpp.lz"); +static const u32 sCharacterSelectCursor_Gfx[] = INCBIN_U32("graphics/union_room_chat/character_select_cursor.4bpp.lz"); +static const u32 sRButton_Gfx[] = INCBIN_U32("graphics/union_room_chat/r_button.4bpp.lz"); static const struct CompressedSpriteSheet sSpriteSheets[] = { - {sSelectorCursorGfxTiles, 0x1000, 0}, - {sMenuCursorGfxTiles, 0x0040, 1}, - {sHorizontalBarGfxTiles, 0x0040, 2}, - {sRButtonGfxTiles, 0x0080, 3}, - {gUnionRoomChatIcons, 0x0400, 4} + { + .data = sSelectorCursor_Gfx, + .size = 128 * TILE_SIZE_4BPP, + .tag = GFXTAG_SELECTOR_CURSOR + }, + { + .data = sCharacterSelectCursor_Gfx, + .size = 2 * TILE_SIZE_4BPP, + .tag = GFXTAG_CHAR_SELECT_CURSOR + }, + { + .data = sTextEntryCursor_Gfx, + .size = 2 * TILE_SIZE_4BPP, + .tag = GFXTAG_TEXT_ENTRY_CURSOR + }, + { + .data = sRButton_Gfx, + .size = 4 * TILE_SIZE_4BPP, + .tag = GFXTAG_R_BUTTON + }, + { + .data = gUnionRoomChat_Icons_Gfx, + .size = 32 * TILE_SIZE_4BPP, + .tag = GFXTAG_ICONS + }, }; static const struct SpritePalette sSpritePalette = { @@ -71,7 +99,7 @@ static const union AnimCmd *const sSpriteAnims_SelectorCursor[] = { }; static const struct SpriteTemplate sSpriteTemplate_SelectorCursor = { - .tileTag = 0, + .tileTag = GFXTAG_SELECTOR_CURSOR, .paletteTag = 0, .oam = &sOamData_64x32_1, .anims = sSpriteAnims_SelectorCursor, @@ -86,7 +114,7 @@ static const struct OamData sOamData_8x16_2 = { }; static const struct SpriteTemplate sSpriteTemplate_TextEntryCursor = { - .tileTag = 2, + .tileTag = GFXTAG_TEXT_ENTRY_CURSOR, .paletteTag = 0, .oam = &sOamData_8x16_2, .anims = gDummySpriteAnimTable, @@ -95,7 +123,7 @@ static const struct SpriteTemplate sSpriteTemplate_TextEntryCursor = { }; static const struct SpriteTemplate sSpriteTemplate_CharacterSelectCursor = { - .tileTag = 1, + .tileTag = GFXTAG_CHAR_SELECT_CURSOR, .paletteTag = 0, .oam = &sOamData_8x16_2, .anims = gDummySpriteAnimTable, @@ -143,7 +171,7 @@ static const union AnimCmd *const sSpriteAnimTable_UnionRoomChatIcons[] = { }; static const struct SpriteTemplate sSpriteTemplate_RButton = { - .tileTag = 3, + .tileTag = GFXTAG_R_BUTTON, .paletteTag = 0, .oam = &sOamData_16x16_2, .anims = gDummySpriteAnimTable, @@ -152,7 +180,7 @@ static const struct SpriteTemplate sSpriteTemplate_RButton = { }; static const struct SpriteTemplate sSpriteTemplate_UnionRoomChatIcons = { - .tileTag = 4, + .tileTag = GFXTAG_ICONS, .paletteTag = 0, .oam = &sOamData_32x16_2, .anims = sSpriteAnimTable_UnionRoomChatIcons,