diff --git a/include/battle/party_gauge.h b/include/battle/party_gauge.h new file mode 100644 index 0000000000..b239852bbd --- /dev/null +++ b/include/battle/party_gauge.h @@ -0,0 +1,105 @@ +#ifndef POKEPLATINUM_BATTLE_PARTY_GAUGE_H +#define POKEPLATINUM_BATTLE_PARTY_GAUGE_H + +#include "struct_decls/struct_02002F38_decl.h" +#include "struct_decls/struct_0200C6E4_decl.h" +#include "struct_decls/struct_0200C704_decl.h" +#include "overlay016/struct_ov16_0226D160_decl.h" + +enum PartyGaugeSide { + PARTY_GAUGE_OURS, + PARTY_GAUGE_THEIRS, +}; + +enum ShowPartyGaugeType { + SHOW_PARTY_GAUGE_BATTLE_START, + SHOW_PARTY_GAUGE_MID_BATTLE, +}; + +enum HidePartyGaugeType { + HIDE_PARTY_GAUGE_BATTLE_START, + HIDE_PARTY_GAUGE_MID_BATTLE, +}; + +enum PartyGaugePosition { + PARTY_GAUGE_POSITION_HIGH, + PARTY_GAUGE_POSITION_MIDDLE, + PARTY_GAUGE_POSITION_LOW, +}; + +enum HideArrowType { + HIDE_ARROW_FADE_AND_SCROLL, + HIDE_ARROW_FADE_IN_PLACE, +}; + +/** + * @brief Load the graphics resources needed for the Party Gauge into memory. + * + * @param renderer + * @param gfxHandler + * @param palette + */ +void PartyGauge_LoadGraphics(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, PaletteData *palette); + +/** + * @brief Free the graphics resources needed for the Party Gauge from memory. + * + * @param gfxHandler + */ +void PartyGauge_FreeGraphics(SpriteGfxHandler *gfxHandler); + +/** + * @brief Show the Party Gauge. + * + * @param ballStatus The status of each battler's, represented as a Pokeball with a particular + * masking filter. Plain Pokeballs represent healthy battlers, gray represent + * fainted, darkened represent those afflicted with a status condition. For + * possible values, see enum PartyGaugeBallStatus. + * + * @param side The side of the battle for which the gauge should be displayed. + * + * @param showType How the gauge should be displayed, whether at the start of a battle (a slow + * inward scroll) or mid-battle after a KO (a faster inward scroll). + * + * @param pos Vertical position of the gauge; only applicable for double battles, so that + * the gauge does not overlap the HP bar. + * @param renderer + * @param gfxHandler + * @return Pointer to the constructed PartyGauge struct, for tracking its progress + * and eventually hiding it. + */ +PartyGauge* PartyGauge_Show(u8 ballStatus[], enum PartyGaugeSide side, enum ShowPartyGaugeType showType, enum PartyGaugePosition pos, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); + +/** + * @brief Check if the Party Gauge has finished the inward scrolling animation. + * + * @param gauge + * @return TRUE if the Party Gauge has finished its animation, else FALSE. + */ +BOOL PartyGauge_ShowIsDone(PartyGauge *gauge); + +/** + * @brief Hide the Party Gauge. + * + * @param gauge Gauge to be hidden. + * @param hideArrowType Method by which the arrow element should be hidden. + * @param hideGaugeType Method by which the gauge Pokeballs should be hidden. + */ +void PartyGauge_Hide(PartyGauge *gauge, enum HideArrowType hideArrowType, enum HidePartyGaugeType hideGaugeType); + +/** + * @brief Check if the Party Gauge has finished the outward vanishing animation. + * + * @param gauge + * @return TRUE if the Party Gauge has finished its animation, else FALSE. + */ +BOOL PartyGauge_HideIsDone(PartyGauge *gauge); + +/** + * @brief Free the Party Gauge and its resources back to the heap. + * + * @param gauge + */ +void PartyGauge_Free(PartyGauge *gauge); + +#endif // POKEPLATINUM_BATTLE_PARTY_GAUGE_H diff --git a/include/constants/palette.h b/include/constants/palette.h new file mode 100644 index 0000000000..daf1186720 --- /dev/null +++ b/include/constants/palette.h @@ -0,0 +1,47 @@ +#ifndef POKEPLATINUM_CONSTANTS_PALETTE_H +#define POKEPLATINUM_CONSTANTS_PALETTE_H + +enum PaletteBufferId { + PLTTBUF_MAIN_BG = 0, + PLTTBUF_SUB_BG, + PLTTBUF_MAIN_OBJ, + PLTTBUF_SUB_OBJ, + PLTTBUF_EX_BEGIN, + + PLTTBUF_MAIN_EX_BG_0 = PLTTBUF_EX_BEGIN, + PLTTBUF_MAIN_EX_BG_1, + PLTTBUF_MAIN_EX_BG_2, + PLTTBUF_MAIN_EX_BG_3, + PLTTBUF_SUB_EX_BG_0, + PLTTBUF_SUB_EX_BG_1, + PLTTBUF_SUB_EX_BG_2, + PLTTBUF_SUB_EX_BG_3, + PLTTBUF_MAIN_EX_OBJ, + PLTTBUF_SUB_EX_OBJ, + + PLTTBUF_MAX, +}; + +#define PLTTBUF_MAIN_BG_F (1< @@ -13,11 +13,11 @@ u32 ov17_0224F098(void); u32 ov17_0224F09C(void); u8 ov17_0224F0A0(int param0); u32 ov17_0224F0B8(void); -void ov17_0224F0BC(CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); -void ov17_0224F0F0(CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, u32 param3); -void ov17_0224F138(AnimationResourceCollection * param0, u32 param1); -void ov17_0224F140(AnimationResourceCollection * param0, u32 param1, u32 param2); -CellActorData * ov17_0224F154(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, const UnkStruct_ov104_0223F9E0 * param3); +void ov17_0224F0BC(SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); +void ov17_0224F0F0(SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, u32 param3); +void ov17_0224F138(SpriteGfxHandler * param0, u32 param1); +void ov17_0224F140(SpriteGfxHandler * param0, u32 param1, u32 param2); +CellActorData * ov17_0224F154(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, const SpriteTemplate * param3); void ov17_0224F184(CellActorData * param0); #endif // POKEPLATINUM_OV17_0224F080_H diff --git a/include/overlay017/ov17_02252AB0.h b/include/overlay017/ov17_02252AB0.h index c4ca9c35ec..00061b4917 100644 --- a/include/overlay017/ov17_02252AB0.h +++ b/include/overlay017/ov17_02252AB0.h @@ -6,9 +6,9 @@ #include "struct_decls/struct_0200C704_decl.h" #include "overlay017/struct_ov17_02252B48_decl.h" -void ov17_02252AB0(CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, u32 param3, u32 param4, u32 param5, u32 param6); -void ov17_02252B20(AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4); -UnkStruct_ov17_02252B48 * ov17_02252B48(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); +void ov17_02252AB0(SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, u32 param3, u32 param4, u32 param5, u32 param6); +void ov17_02252B20(SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4); +UnkStruct_ov17_02252B48 * ov17_02252B48(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); void ov17_02252BCC(UnkStruct_ov17_02252B48 * param0); void ov17_02252BF0(UnkStruct_ov17_02252B48 * param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, fx32 param9); void ov17_02252C78(UnkStruct_ov17_02252B48 * param0, int param1, int param2, int param3, int param4, fx32 param5); diff --git a/include/overlay017/struct_ov17_0223F744.h b/include/overlay017/struct_ov17_0223F744.h index 2ac281ee81..e1181b7c70 100644 --- a/include/overlay017/struct_ov17_0223F744.h +++ b/include/overlay017/struct_ov17_0223F744.h @@ -6,7 +6,7 @@ typedef struct { SysTask * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; s32 unk_08; const u16 * unk_0C; u8 unk_10; diff --git a/include/overlay017/struct_ov17_0223F88C.h b/include/overlay017/struct_ov17_0223F88C.h index 7e1573df71..7b014478f8 100644 --- a/include/overlay017/struct_ov17_0223F88C.h +++ b/include/overlay017/struct_ov17_0223F88C.h @@ -22,8 +22,8 @@ typedef struct { UnkStruct_02095C48_sub1 * unk_00; UnkStruct_02007768 * unk_04; Sprite * unk_08[4]; - CellTransferStateData * unk_18; - AnimationResourceCollection * unk_1C; + SpriteRenderer * unk_18; + SpriteGfxHandler * unk_1C; UnkStruct_ov12_0221FCDC * unk_20; BGL * unk_24; Window unk_28[1]; @@ -33,7 +33,7 @@ typedef struct { MessageLoader * unk_44; UnkStruct_0200B358 * unk_48; Strbuf* unk_4C; - PaletteSys * unk_50; + PaletteData * unk_50; UnkStruct_02012744 * unk_54; UnkStruct_ov16_0223E0C8 unk_58[4]; UnkStruct_ov16_0223E0C8 unk_98; diff --git a/include/overlay017/struct_ov17_0224145C.h b/include/overlay017/struct_ov17_0224145C.h index 2ab1e3cce4..4c40303910 100644 --- a/include/overlay017/struct_ov17_0224145C.h +++ b/include/overlay017/struct_ov17_0224145C.h @@ -5,7 +5,7 @@ #include "struct_decls/sys_task.h" typedef struct { - PaletteSys * unk_00; + PaletteData * unk_00; SysTask * unk_04; s16 unk_08; u8 unk_0A; diff --git a/include/overlay017/struct_ov17_022476F8.h b/include/overlay017/struct_ov17_022476F8.h index cf66fa8aa4..6f9937623d 100644 --- a/include/overlay017/struct_ov17_022476F8.h +++ b/include/overlay017/struct_ov17_022476F8.h @@ -21,14 +21,14 @@ typedef struct { UnkStruct_02007768 * unk_04; Sprite * unk_08[4]; Sprite * unk_18; - CellTransferStateData * unk_1C; - AnimationResourceCollection * unk_20; + SpriteRenderer * unk_1C; + SpriteGfxHandler * unk_20; BGL * unk_24; Window unk_28[1]; MessageLoader * unk_38; UnkStruct_0200B358 * unk_3C; Strbuf* unk_40; - PaletteSys * unk_44; + PaletteData * unk_44; UnkStruct_ov16_0223E0C8 unk_48[4]; CellActorData * unk_88[8]; UnkStruct_ov17_0223F6E8 unk_A8; diff --git a/include/overlay017/struct_ov17_0224A1EC.h b/include/overlay017/struct_ov17_0224A1EC.h index 4b0fa4d2fd..285d58ab1b 100644 --- a/include/overlay017/struct_ov17_0224A1EC.h +++ b/include/overlay017/struct_ov17_0224A1EC.h @@ -32,14 +32,14 @@ typedef struct { UnkStruct_ov17_0224B09C unk_04[4]; UnkStruct_02007768 * unk_44; Sprite * unk_48[4]; - CellTransferStateData * unk_58; - AnimationResourceCollection * unk_5C; + SpriteRenderer * unk_58; + SpriteGfxHandler * unk_5C; BGL * unk_60; Window unk_64[2]; MessageLoader * unk_84; UnkStruct_0200B358 * unk_88; Strbuf* unk_8C; - PaletteSys * unk_90; + PaletteData * unk_90; UnkStruct_02012744 * unk_94; UnkStruct_ov16_0223E0C8 unk_98[4]; CellActorData * unk_D8[68]; diff --git a/include/overlay017/struct_ov17_022507C4.h b/include/overlay017/struct_ov17_022507C4.h index 2560add0ab..c3cf6ac8f1 100644 --- a/include/overlay017/struct_ov17_022507C4.h +++ b/include/overlay017/struct_ov17_022507C4.h @@ -22,14 +22,14 @@ typedef struct { UnkStruct_02095C48_sub1 * unk_00; UnkStruct_02007768 * unk_04; Sprite * unk_08[4]; - CellTransferStateData * unk_18; - AnimationResourceCollection * unk_1C; + SpriteRenderer * unk_18; + SpriteGfxHandler * unk_1C; BGL * unk_20; Window unk_24[9]; MessageLoader * unk_B4; UnkStruct_0200B358 * unk_B8; Strbuf* unk_BC; - PaletteSys * unk_C0; + PaletteData * unk_C0; UnkStruct_02012744 * unk_C4; UnkStruct_ov16_0223E0C8 unk_C8[4]; UnkStruct_ov17_0223F6E8 unk_108; diff --git a/include/overlay021/struct_ov21_021E8E0C.h b/include/overlay021/struct_ov21_021E8E0C.h index e43ac198d0..548d011cd8 100644 --- a/include/overlay021/struct_ov21_021E8E0C.h +++ b/include/overlay021/struct_ov21_021E8E0C.h @@ -8,7 +8,7 @@ typedef struct { BGL * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; UnkStruct_02007768 * unk_08; int unk_0C; Pokemon * unk_10; diff --git a/include/overlay062/struct_ov62_0223118C.h b/include/overlay062/struct_ov62_0223118C.h index 0ce21bc595..0a8d5fe9d8 100644 --- a/include/overlay062/struct_ov62_0223118C.h +++ b/include/overlay062/struct_ov62_0223118C.h @@ -19,11 +19,11 @@ typedef struct { NARC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; u8 padding_0C[4]; BGL * unk_10; - PaletteSys * unk_14; + PaletteData * unk_14; UnkStruct_02023FCC * unk_18; UnkUnion_02022594 unk_1C[5]; BOOL unk_30; diff --git a/include/overlay062/struct_ov62_02246BF4_sub2.h b/include/overlay062/struct_ov62_02246BF4_sub2.h index b5fed27f48..7ddf661f6a 100644 --- a/include/overlay062/struct_ov62_02246BF4_sub2.h +++ b/include/overlay062/struct_ov62_02246BF4_sub2.h @@ -11,10 +11,10 @@ typedef struct { NARC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; BGL * unk_0C; - PaletteSys * unk_10; + PaletteData * unk_10; UnkStruct_02023FCC * unk_14; UnkUnion_02022594 unk_18[24]; BOOL unk_78; diff --git a/include/overlay063/ov63_0222AE60.h b/include/overlay063/ov63_0222AE60.h index c5e0ed1a63..61589df613 100644 --- a/include/overlay063/ov63_0222AE60.h +++ b/include/overlay063/ov63_0222AE60.h @@ -8,7 +8,7 @@ #include "overlay063/struct_ov63_0222BB38_decl.h" #include "overlay064/struct_ov64_022302EC.h" -UnkStruct_ov63_0222AE60 * ov63_0222AE60(GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3); +UnkStruct_ov63_0222AE60 * ov63_0222AE60(GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3); void ov63_0222AF14(UnkStruct_ov63_0222AE60 * param0); void ov63_0222AF94(UnkStruct_ov63_0222AE60 * param0, u32 param1, u32 param2, int param3, u32 param4); void ov63_0222AFD0(UnkStruct_ov63_0222AE60 * param0, u32 param1); diff --git a/include/overlay063/ov63_0222CCE4.h b/include/overlay063/ov63_0222CCE4.h index 3a5cdc703c..8aa69a1b95 100644 --- a/include/overlay063/ov63_0222CCE4.h +++ b/include/overlay063/ov63_0222CCE4.h @@ -8,8 +8,8 @@ #include "overlay063/struct_ov63_0222CD2C.h" #include "overlay063/struct_ov63_0222CE44.h" -UnkStruct_ov63_0222CD2C * ov63_0222CCE4(GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3, u32 param4); -UnkStruct_ov63_0222CD2C * ov63_0222CD2C(GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3, int param4, u32 param5, u32 param6); +UnkStruct_ov63_0222CD2C * ov63_0222CCE4(GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3, u32 param4); +UnkStruct_ov63_0222CD2C * ov63_0222CD2C(GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3, int param4, u32 param5, u32 param6); void ov63_0222CD9C(UnkStruct_ov63_0222CD2C * param0); void ov63_0222CDE8(UnkStruct_ov63_0222CD2C * param0, u32 param1, int param2, u32 param3); void ov63_0222CE0C(UnkStruct_ov63_0222CD2C * param0, u32 param1); diff --git a/include/overlay076/ov76_0223B870.h b/include/overlay076/ov76_0223B870.h index 92f209feb7..6b93f02af5 100644 --- a/include/overlay076/ov76_0223B870.h +++ b/include/overlay076/ov76_0223B870.h @@ -41,14 +41,14 @@ void ov76_0223C4AC(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C544(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C568(UnkStruct_ov76_0223DE00 * param0, int param1); void ov76_0223C588(UnkStruct_ov76_0223DE00 * param0); -void ov76_0223C5A4(CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10); +void ov76_0223C5A4(SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10); void ov76_0223C61C(UnkStruct_ov76_0223DE00 * param0, NARC * param1); void ov76_0223C7E0(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C80C(UnkStruct_ov76_0223DE00 * param0, int param1, int param2); void ov76_0223C88C(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C8BC(UnkStruct_ov76_0223DE00 * param0); -void ov76_0223C8EC(BGL * param0, PaletteSys * param1, int param2); -void ov76_0223C974(BGL * param0, PaletteSys * param1, int param2); +void ov76_0223C8EC(BGL * param0, PaletteData * param1, int param2); +void ov76_0223C974(BGL * param0, PaletteData * param1, int param2); void ov76_0223CA30(Window * param0, int param1); void ov76_0223CA98(BGL * param0, Window * param1, int param2, int param3, int param4, int param5, int param6, int param7); void ov76_0223CB58(UnkStruct_ov76_0223DE00 * param0); diff --git a/include/overlay076/struct_ov76_0223C398.h b/include/overlay076/struct_ov76_0223C398.h index f23a5b7eeb..b5722faa1c 100644 --- a/include/overlay076/struct_ov76_0223C398.h +++ b/include/overlay076/struct_ov76_0223C398.h @@ -25,10 +25,10 @@ typedef struct { int unk_00; BOOL unk_04; - CellTransferStateData * unk_08; - AnimationResourceCollection * unk_0C; + SpriteRenderer * unk_08; + SpriteGfxHandler * unk_0C; BGL * unk_10; - PaletteSys * unk_14; + PaletteData * unk_14; Window unk_18[11]; ResourceMetadata * unk_C8; UIControlData * unk_CC; diff --git a/include/overlay079/struct_ov79_021D0E1C.h b/include/overlay079/struct_ov79_021D0E1C.h index 3897affd73..80f113010d 100644 --- a/include/overlay079/struct_ov79_021D0E1C.h +++ b/include/overlay079/struct_ov79_021D0E1C.h @@ -53,8 +53,8 @@ typedef struct UnkStruct_ov79_021D0E1C_t { NNSG2dScreenData * unk_E0; NNSG2dScreenData * unk_E4; Window unk_E8[13]; - CellTransferStateData * unk_1B8; - AnimationResourceCollection * unk_1BC; + SpriteRenderer * unk_1B8; + SpriteGfxHandler * unk_1BC; GraphicElementData * unk_1C0[3]; GraphicElementData * unk_1CC[5]; GraphicElementData * unk_1E0[6]; diff --git a/include/overlay080/ov80_021D2AF4.h b/include/overlay080/ov80_021D2AF4.h index b148ed1eae..9378b157fe 100644 --- a/include/overlay080/ov80_021D2AF4.h +++ b/include/overlay080/ov80_021D2AF4.h @@ -8,7 +8,7 @@ #include "overlay080/struct_ov80_021D2C5C.h" #include "overlay080/struct_ov80_021D2E10.h" -UnkStruct_ov80_021D2C1C * ov80_021D2AF4(CellTransferStateData * param0, AnimationResourceCollection * param1, u8 * param2, short param3, int param4); +UnkStruct_ov80_021D2C1C * ov80_021D2AF4(SpriteRenderer * param0, SpriteGfxHandler * param1, u8 * param2, short param3, int param4); void ov80_021D2C1C(UnkStruct_ov80_021D2C1C * param0); UnkStruct_ov80_021D2C5C * ov80_021D2C5C(UnkStruct_ov80_021D2C1C * param0, int param1, int param2, int param3); int ov80_021D2CC0(UnkStruct_ov80_021D2C1C * param0, int param1, int param2, int param3); diff --git a/include/overlay080/struct_ov80_021D2A08.h b/include/overlay080/struct_ov80_021D2A08.h index ff11f58e77..d966924f2c 100644 --- a/include/overlay080/struct_ov80_021D2A08.h +++ b/include/overlay080/struct_ov80_021D2A08.h @@ -59,8 +59,8 @@ typedef struct UnkStruct_ov80_021D2A08_t { NNSG2dScreenData * unk_CC; NNSG2dScreenData * unk_D0; NNSG2dScreenData * unk_D4; - CellTransferStateData * unk_D8; - AnimationResourceCollection * unk_DC; + SpriteRenderer * unk_D8; + SpriteGfxHandler * unk_DC; CellActorData * unk_E0; } UnkStruct_ov80_021D2A08; diff --git a/include/overlay084/struct_ov84_0223B5A0.h b/include/overlay084/struct_ov84_0223B5A0.h index 56733ff40c..5af1903303 100644 --- a/include/overlay084/struct_ov84_0223B5A0.h +++ b/include/overlay084/struct_ov84_0223B5A0.h @@ -30,8 +30,8 @@ typedef struct { TrainerInfo * unk_CC; AnimationControlFlags * unk_D0; NARC * unk_D4; - CellTransferStateData * unk_D8; - AnimationResourceCollection * unk_DC; + SpriteRenderer * unk_D8; + SpriteGfxHandler * unk_DC; CellActorData * unk_E0[12]; UnkStruct_0200C440 * unk_110; MessageLoader * unk_114; diff --git a/include/overlay099/struct_ov99_021D2CB0.h b/include/overlay099/struct_ov99_021D2CB0.h index 0aabdf7cb7..826bb290df 100644 --- a/include/overlay099/struct_ov99_021D2CB0.h +++ b/include/overlay099/struct_ov99_021D2CB0.h @@ -24,11 +24,11 @@ typedef struct { UnkStruct_0203E274 * unk_00; BOOL unk_04; BGL * unk_08; - PaletteSys * unk_0C; + PaletteData * unk_0C; GenericPointerData * unk_10; SysTask * unk_14; - CellTransferStateData * unk_18; - AnimationResourceCollection * unk_1C; + SpriteRenderer * unk_18; + SpriteGfxHandler * unk_1C; MessageLoader * unk_20; Window * unk_24; UnkStruct_020203AC * unk_28; diff --git a/include/overlay100/struct_ov100_021D46C8.h b/include/overlay100/struct_ov100_021D46C8.h index a63c36d079..4890c4b995 100644 --- a/include/overlay100/struct_ov100_021D46C8.h +++ b/include/overlay100/struct_ov100_021D46C8.h @@ -20,10 +20,10 @@ typedef struct { NARC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; BGL * unk_0C; - PaletteSys * unk_10; + PaletteData * unk_10; GenericPointerData * unk_14; UnkStruct_020203AC * unk_18; NNSFndAllocator unk_1C; diff --git a/include/overlay104/ov104_0223D768.h b/include/overlay104/ov104_0223D768.h index 82c725798c..6d46c69d39 100644 --- a/include/overlay104/ov104_0223D768.h +++ b/include/overlay104/ov104_0223D768.h @@ -7,9 +7,9 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_decls/cell_actor_data.h" -void ov104_0223D768(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, PaletteSys * param3, u16 param4); -void ov104_0223D7EC(AnimationResourceCollection * param0, u16 param1); -CellActorData * ov104_0223D828(CellTransferStateData * param0, AnimationResourceCollection * param1, u16 param2); +void ov104_0223D768(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, PaletteData * param3, u16 param4); +void ov104_0223D7EC(SpriteGfxHandler * param0, u16 param1); +CellActorData * ov104_0223D828(SpriteRenderer * param0, SpriteGfxHandler * param1, u16 param2); void ov104_0223D858(CellActorData * param0); #endif // POKEPLATINUM_OV104_0223D768_H diff --git a/include/overlay104/ov104_0223D9E4.h b/include/overlay104/ov104_0223D9E4.h index 84474ed18c..ab5ce3e050 100644 --- a/include/overlay104/ov104_0223D9E4.h +++ b/include/overlay104/ov104_0223D9E4.h @@ -5,7 +5,7 @@ #include "struct_decls/struct_02018340_decl.h" #include "overlay104/struct_ov104_0223DA28_decl.h" -UnkStruct_ov104_0223DA28 * ov104_0223D9E4(BGL * param0, PaletteSys * param1); +UnkStruct_ov104_0223DA28 * ov104_0223D9E4(BGL * param0, PaletteData * param1); void ov104_0223DA28(UnkStruct_ov104_0223DA28 * param0); #endif // POKEPLATINUM_OV104_0223D9E4_H diff --git a/include/overlay104/struct_ov104_0223C4CC.h b/include/overlay104/struct_ov104_0223C4CC.h index 3ff103ff8b..ae690baa3e 100644 --- a/include/overlay104/struct_ov104_0223C4CC.h +++ b/include/overlay104/struct_ov104_0223C4CC.h @@ -23,7 +23,7 @@ typedef struct UnkStruct_ov104_0223C4CC_t { BGL * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; UnkStruct_0209B75C * unk_08; GenericPointerData * unk_0C; UnkStruct_ov104_0223D5F0 * unk_10; @@ -36,8 +36,8 @@ typedef struct UnkStruct_ov104_0223C4CC_t { UnkStruct_ov63_0222D848 * unk_2C; UnkStruct_ov63_0222D77C * unk_30; struct { - CellTransferStateData * unk_00; - AnimationResourceCollection * unk_04; + SpriteRenderer * unk_00; + SpriteGfxHandler * unk_04; } unk_34; UnkStruct_ov104_0223D3B0_1 unk_3C; CellActorData * unk_80[4]; diff --git a/include/overlay104/struct_ov104_0223F9E0.h b/include/overlay104/struct_ov104_0223F9E0.h deleted file mode 100644 index 08d77a6432..0000000000 --- a/include/overlay104/struct_ov104_0223F9E0.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_OV104_0223F9E0_H -#define POKEPLATINUM_STRUCT_OV104_0223F9E0_H - -typedef struct { - s16 unk_00; - s16 unk_02; - s16 unk_04; - u16 unk_06; - int unk_08; - int unk_0C; - int unk_10; - int unk_14[6]; - int unk_2C; - int unk_30; -} UnkStruct_ov104_0223F9E0; - -#endif // POKEPLATINUM_STRUCT_OV104_0223F9E0_H diff --git a/include/overlay116/struct_ov116_022649E4.h b/include/overlay116/struct_ov116_022649E4.h index 2b2ddac0bb..85a6a989ad 100644 --- a/include/overlay116/struct_ov116_022649E4.h +++ b/include/overlay116/struct_ov116_022649E4.h @@ -15,10 +15,10 @@ typedef struct { NARC * unk_00; NARC * unk_04; - CellTransferStateData * unk_08; - AnimationResourceCollection * unk_0C; + SpriteRenderer * unk_08; + SpriteGfxHandler * unk_0C; BGL * unk_10; - PaletteSys * unk_14; + PaletteData * unk_14; GenericPointerData * unk_18; UnkStruct_020203AC * unk_1C; u8 padding_20[4]; diff --git a/include/overlay117/ov117_02263AF0.h b/include/overlay117/ov117_02263AF0.h index 9e2503e8b2..c9616d25ad 100644 --- a/include/overlay117/ov117_02263AF0.h +++ b/include/overlay117/ov117_02263AF0.h @@ -46,7 +46,7 @@ void ov117_02265ABC(UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C void ov117_02265B3C(UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C * param1); void ov117_02265B58(UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C * param1, int param2, int param3, int param4); void ov117_02265C1C(UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C * param1); -void ov117_02265DB8(BGL * param0, AnimationResourceCollection * param1, UnkStruct_02012744 * param2, UnkStruct_ov117_02265EB0 * param3, const Strbuf *param4, int param5, u32 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14); +void ov117_02265DB8(BGL * param0, SpriteGfxHandler * param1, UnkStruct_02012744 * param2, UnkStruct_ov117_02265EB0 * param3, const Strbuf *param4, int param5, u32 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14); void ov117_02265EB0(UnkStruct_ov117_02265EB0 * param0); void ov117_02265EC8(UnkStruct_ov117_02265EC8 * param0); void ov117_02265F34(UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265EC8 * param1); diff --git a/include/overlay117/struct_ov117_02261280.h b/include/overlay117/struct_ov117_02261280.h index cb4c2d236a..7cd89f0c2b 100644 --- a/include/overlay117/struct_ov117_02261280.h +++ b/include/overlay117/struct_ov117_02261280.h @@ -42,14 +42,14 @@ typedef struct UnkStruct_ov117_02261280_t { u32 unk_0C[4]; UnkStruct_ov114_0225CAD4 * unk_1C; int unk_20; - CellTransferStateData * unk_24; - AnimationResourceCollection * unk_28; + SpriteRenderer * unk_24; + SpriteGfxHandler * unk_28; BGL * unk_2C; Window unk_30[5]; MessageLoader * unk_80; UnkStruct_0200B358 * unk_84; Strbuf* unk_88; - PaletteSys * unk_8C; + PaletteData * unk_8C; UnkStruct_02012744 * unk_90; SysTask * unk_94; GenericPointerData * unk_98; diff --git a/include/overlay119/ov119_021D0D80.h b/include/overlay119/ov119_021D0D80.h index 4ffd9fd58f..dae85c16ff 100644 --- a/include/overlay119/ov119_021D0D80.h +++ b/include/overlay119/ov119_021D0D80.h @@ -22,14 +22,14 @@ void ov119_021D0FD0(void * param0); void ov119_021D1004(void); void ov119_021D1028(void); void ov119_021D1048(void); -void ov119_021D1068(BGL * param0, PaletteSys * param1, int param2); +void ov119_021D1068(BGL * param0, PaletteData * param1, int param2); void ov119_021D10F0(BGL * param0, Window * param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8); int ov119_021D1158(Window * param0, int param1, Pokemon * param2, int param3); void ov119_021D11E4(UnkStruct_ov119_021D0FD0 * param0, BGL * param1, Window * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9); void ov119_021D12CC(UnkStruct_ov119_021D0FD0 * param0); void ov119_021D12F8(Window * param0); -void ov119_021D1308(BGL * param0, PaletteSys * param1); -void ov119_021D135C(BGL * param0, PaletteSys * param1); +void ov119_021D1308(BGL * param0, PaletteData * param1); +void ov119_021D135C(BGL * param0, PaletteData * param1); void ov119_021D145C(UnkStruct_02014014 * param0); UnkStruct_ov119_021D14DC * ov119_021D14AC(UnkStruct_ov119_021D1930 * param0); void ov119_021D14DC(UnkStruct_ov119_021D14DC * param0, int param1); diff --git a/include/overlay119/struct_ov119_021D17B8.h b/include/overlay119/struct_ov119_021D17B8.h index ec69503e66..6b31e4a8ba 100644 --- a/include/overlay119/struct_ov119_021D17B8.h +++ b/include/overlay119/struct_ov119_021D17B8.h @@ -16,7 +16,7 @@ typedef struct { BGL * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; int unk_08; int unk_0C; int unk_10; @@ -27,8 +27,8 @@ typedef struct { UnkStruct_ov119_021D14DC * unk_40; ResourceMetadata * unk_44; UIControlData * unk_48; - AnimationResourceCollection * unk_4C; - CellTransferStateData * unk_50; + SpriteGfxHandler * unk_4C; + SpriteRenderer * unk_50; PokemonAnimationSys * unk_54; } UnkStruct_ov119_021D17B8; diff --git a/include/pokemon.h b/include/pokemon.h index d19974bc93..c11a80fa2b 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -665,7 +665,7 @@ u8 BoxPokemon_SpriteYOffset(BoxPokemon *boxMon, u8 face, BOOL preferDP); */ u8 LoadPokemonSpriteYOffset(u16 species, u8 gender, u8 face, u8 form, u32 personality); void sub_0207697C(ArchivedSprite *param0, u16 param1); -CellActorData *sub_02076994(CellTransferStateData *param0, AnimationResourceCollection *param1, PaletteSys *param2, int param3, int param4, int param5, int param6, int param7, int heapID); +CellActorData *sub_02076994(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, int param3, int param4, int param5, int param6, int param7, int heapID); void sub_02076AAC(int param0, int param1, UnkStruct_ov5_021DE5D0 *param2); /** diff --git a/include/struct_decls/struct_02002F38_decl.h b/include/struct_decls/struct_02002F38_decl.h index 17e8a897df..da02ed0d28 100644 --- a/include/struct_decls/struct_02002F38_decl.h +++ b/include/struct_decls/struct_02002F38_decl.h @@ -1,6 +1,6 @@ #ifndef POKEPLATINUM_STRUCT_02002F38_DECL_H #define POKEPLATINUM_STRUCT_02002F38_DECL_H -typedef struct UnkStruct_02002F38_t PaletteSys; +typedef struct UnkStruct_02002F38_t PaletteData; #endif // POKEPLATINUM_STRUCT_02002F38_DECL_H diff --git a/include/struct_decls/struct_0200C6E4_decl.h b/include/struct_decls/struct_0200C6E4_decl.h index ab90f306fc..f5ae111a6f 100644 --- a/include/struct_decls/struct_0200C6E4_decl.h +++ b/include/struct_decls/struct_0200C6E4_decl.h @@ -1,6 +1,6 @@ #ifndef POKEPLATINUM_STRUCT_0200C6E4_DECL_H #define POKEPLATINUM_STRUCT_0200C6E4_DECL_H -typedef struct CellTransferStateData_t CellTransferStateData; +typedef struct CellTransferStateData_t SpriteRenderer; #endif // POKEPLATINUM_STRUCT_0200C6E4_DECL_H diff --git a/include/struct_decls/struct_0200C704_decl.h b/include/struct_decls/struct_0200C704_decl.h index 540f026d6d..9ba5b94a9a 100644 --- a/include/struct_decls/struct_0200C704_decl.h +++ b/include/struct_decls/struct_0200C704_decl.h @@ -1,6 +1,6 @@ #ifndef POKEPLATINUM_STRUCT_0200C704_DECL_H #define POKEPLATINUM_STRUCT_0200C704_DECL_H -typedef struct AnimationResourceCollection_t AnimationResourceCollection; +typedef struct AnimationResourceCollection_t SpriteGfxHandler; #endif // POKEPLATINUM_STRUCT_0200C704_DECL_H diff --git a/include/struct_defs/battle_system.h b/include/struct_defs/battle_system.h index 3732bcf726..46544de660 100644 --- a/include/struct_defs/battle_system.h +++ b/include/struct_defs/battle_system.h @@ -54,7 +54,7 @@ struct BattleSystem { SysTask * unk_1C; SysTask * unk_20; SysTask * unk_24; - PaletteSys * unk_28; + PaletteData * unk_28; u32 battleType; BattleContext *battleCtx; BattlerData *battlers[MAX_BATTLERS]; @@ -68,8 +68,8 @@ struct BattleSystem { ChatotCry * unk_78[4]; UnkStruct_02007768 * unk_88; UnkStruct_ov12_0221FCDC * unk_8C; - CellTransferStateData * unk_90; - AnimationResourceCollection * unk_94; + SpriteRenderer * unk_90; + SpriteGfxHandler * unk_94; UnkStruct_02056B24 * unk_98; UnkStruct_0206D140 * unk_9C; u16 trainerIDs[4]; diff --git a/include/struct_defs/sprite_template.h b/include/struct_defs/sprite_template.h new file mode 100644 index 0000000000..f0c48bc299 --- /dev/null +++ b/include/struct_defs/sprite_template.h @@ -0,0 +1,22 @@ +#ifndef POKEPLATINUM_STRUCT_DEFS_SPRITE_TEMPLATE_H +#define POKEPLATINUM_STRUCT_DEFS_SPRITE_TEMPLATE_H + +#include + +#define MAX_SPRITE_RESOURCES 6 +#define SPRITE_RESOURCE_NONE -1 + +typedef struct SpriteTemplate { + s16 x; //!< Starting X-coordinate of the sprite + s16 y; //!< Starting Y-coordinate of the sprite + s16 z; //!< Starting Z-coordinate of the sprite + u16 animIdx; //!< Index in the animation file to use + int priority; //!< Priority layer to draw the sprite against + int plttIdx; //!< Index in the palette file to use + enum NNS_G2D_VRAM_TYPE vramType; //!< VRAM type which will own any loaded resources + int resources[MAX_SPRITE_RESOURCES]; //!< Set of resource IDs to register as loaded into VRAM + int bgPriority; + BOOL transferToVRAM; +} SpriteTemplate; + +#endif // POKEPLATINUM_STRUCT_DEFS_SPRITE_TEMPLATE_H diff --git a/include/struct_defs/struct_0207A778.h b/include/struct_defs/struct_0207A778.h index fa5d42a0dd..21822c1a28 100644 --- a/include/struct_defs/struct_0207A778.h +++ b/include/struct_defs/struct_0207A778.h @@ -11,7 +11,7 @@ typedef struct { BattleParams * unk_00; BGL * unk_04; Window * unk_08; - PaletteSys * unk_0C; + PaletteData * unk_0C; UnkStruct_02027F8C * unk_10[4]; u8 unk_20[0x1000]; u8 unk_1020; diff --git a/include/struct_defs/struct_0207AE68_t.h b/include/struct_defs/struct_0207AE68_t.h index 9cd0d3a24d..d8830268ab 100644 --- a/include/struct_defs/struct_0207AE68_t.h +++ b/include/struct_defs/struct_0207AE68_t.h @@ -29,7 +29,7 @@ struct UnkStruct_0207AE68_t { MessageLoader * unk_08; UnkStruct_0200B358 * unk_0C; Strbuf* unk_10; - PaletteSys * unk_14; + PaletteData * unk_14; UnkStruct_02007768 * unk_18; Sprite * unk_1C[2]; Party * unk_24; diff --git a/include/struct_defs/struct_0207F248.h b/include/struct_defs/struct_0207F248.h index 50f2c996c2..c0f0d271d2 100644 --- a/include/struct_defs/struct_0207F248.h +++ b/include/struct_defs/struct_0207F248.h @@ -32,8 +32,8 @@ typedef struct { u16 unk_3E4[96]; u16 unk_4A4[128]; PartyManagementData * unk_5A4; - CellTransferStateData * unk_5A8; - AnimationResourceCollection * unk_5AC; + SpriteRenderer * unk_5A8; + SpriteGfxHandler * unk_5AC; GraphicElementData * unk_5B0[29]; CellActorData * unk_624[29]; UnkStruct_0200C440 * unk_698; diff --git a/include/struct_defs/struct_02089688_sub1.h b/include/struct_defs/struct_02089688_sub1.h index 84eace5b2e..c2c0ee9314 100644 --- a/include/struct_defs/struct_02089688_sub1.h +++ b/include/struct_defs/struct_02089688_sub1.h @@ -15,10 +15,10 @@ typedef struct { NARC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; BGL * unk_0C; - PaletteSys * unk_10; + PaletteData * unk_10; UnkStruct_02023FCC * unk_14; UnkUnion_02022594 unk_18[28]; BOOL unk_88; diff --git a/include/struct_defs/struct_0208B878_sub1.h b/include/struct_defs/struct_0208B878_sub1.h index dab3d2cee0..544c499de4 100644 --- a/include/struct_defs/struct_0208B878_sub1.h +++ b/include/struct_defs/struct_0208B878_sub1.h @@ -8,9 +8,9 @@ typedef struct { NARC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; - PaletteSys * unk_0C; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; + PaletteData * unk_0C; } UnkStruct_0208B878_sub1; #endif // POKEPLATINUM_STRUCT_0208B878_SUB1_H diff --git a/include/struct_defs/struct_0208D7BC.h b/include/struct_defs/struct_0208D7BC.h index 95b789828a..d1255729f2 100644 --- a/include/struct_defs/struct_0208D7BC.h +++ b/include/struct_defs/struct_0208D7BC.h @@ -29,8 +29,8 @@ typedef struct { UnkStruct_02091850 unk_350[4]; UnkStruct_02091850 unk_3B0[4]; u32 unk_410; - CellTransferStateData * unk_414; - AnimationResourceCollection * unk_418; + SpriteRenderer * unk_414; + SpriteGfxHandler * unk_418; GraphicElementData * unk_41C[77]; CellActorData * unk_550[77]; UnkStruct_0200C440 * unk_684; diff --git a/include/unk_02002F38.h b/include/unk_02002F38.h index 595b93a287..8ee9840720 100644 --- a/include/unk_02002F38.h +++ b/include/unk_02002F38.h @@ -3,31 +3,31 @@ #include "struct_decls/struct_02002F38_decl.h" -PaletteSys * sub_02002F38(int param0); -void sub_02002F54(PaletteSys * param0); -void sub_02002F5C(PaletteSys * param0, int param1, void * param2, void * param3, u32 param4); -void sub_02002F70(PaletteSys * param0, int param1, u32 param2, u32 param3); -void sub_02002FA0(PaletteSys * param0, int param1); -void sub_02002FBC(PaletteSys * param0, const void * param1, int param2, u16 param3, u16 param4); -void sub_02002FEC(PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7); -void PaletteSys_LoadPalette(PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6); -void sub_02003070(PaletteSys * param0, int param1, u16 param2, u32 param3); +PaletteData * sub_02002F38(int param0); +void sub_02002F54(PaletteData * param0); +void sub_02002F5C(PaletteData * param0, int param1, void * param2, void * param3, u32 param4); +void sub_02002F70(PaletteData * param0, int param1, u32 param2, u32 param3); +void sub_02002FA0(PaletteData * param0, int param1); +void sub_02002FBC(PaletteData * param0, const void * param1, int param2, u16 param3, u16 param4); +void sub_02002FEC(PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7); +void PaletteSys_LoadPalette(PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6); +void sub_02003070(PaletteData * param0, int param1, u16 param2, u32 param3); void sub_020030E4(u32 param0, u32 param1, u32 param2, u32 param3, u16 param4, void * param5); -void sub_02003120(PaletteSys * param0, int param1, u16 param2, int param3, u16 param4, u16 param5); -u16 * sub_02003164(PaletteSys * param0, int param1); -u16 * sub_0200316C(PaletteSys * param0, int param1); -u8 sub_02003178(PaletteSys * param0, u16 param1, u16 param2, s8 param3, u8 param4, u8 param5, u16 param6); -void sub_02003694(PaletteSys * param0); -u16 sub_0200384C(PaletteSys * param0); -void sub_02003858(PaletteSys * param0, int param1); -void sub_0200387C(PaletteSys * param0, u8 param1); -void sub_020038B0(PaletteSys * param0, int param1, int param2, u16 param3, u16 param4, u16 param5); -u16 sub_02003910(PaletteSys * param0, int param1, int param2, u16 param3); +void sub_02003120(PaletteData * param0, int param1, u16 param2, int param3, u16 param4, u16 param5); +u16 * sub_02003164(PaletteData * param0, int param1); +u16 * sub_0200316C(PaletteData * param0, int param1); +u8 sub_02003178(PaletteData * param0, u16 param1, u16 param2, s8 param3, u8 param4, u8 param5, u16 param6); +void sub_02003694(PaletteData * param0); +u16 sub_0200384C(PaletteData * param0); +void sub_02003858(PaletteData * param0, int param1); +void sub_0200387C(PaletteData * param0, u8 param1); +void sub_020038B0(PaletteData * param0, int param1, int param2, u16 param3, u16 param4, u16 param5); +u16 sub_02003910(PaletteData * param0, int param1, int param2, u16 param3); void sub_0200393C(const u16 * param0, u16 * param1, u16 param2, u8 param3, u16 param4); -void sub_020039B0(PaletteSys * param0, int param1, u16 param2, u16 param3, u8 param4, u16 param5); +void sub_020039B0(PaletteData * param0, int param1, u16 param2, u16 param3, u8 param4, u16 param5); void sub_020039F8(const u16 * param0, u16 * param1, u16 param2, u8 param3, u16 param4); -void sub_02003A2C(PaletteSys * param0, int param1, u16 param2, u8 param3, u16 param4); +void sub_02003A2C(PaletteData * param0, int param1, u16 param2, u8 param3, u16 param4); void sub_02003A8C(u16 * param0, int param1, int param2, int param3, int param4); -void sub_02003B08(PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, int param7, int param8, int param9); +void sub_02003B08(PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, int param7, int param8, int param9); #endif // POKEPLATINUM_UNK_02002F38_H diff --git a/include/unk_0200C6E4.h b/include/unk_0200C6E4.h index bde8127e93..5787e98a7b 100644 --- a/include/unk_0200C6E4.h +++ b/include/unk_0200C6E4.h @@ -1,6 +1,8 @@ #ifndef POKEPLATINUM_UNK_0200C6E4_H #define POKEPLATINUM_UNK_0200C6E4_H +#include "constants/palette.h" + #include "struct_decls/struct_02002F38_decl.h" #include "struct_decls/struct_02006C24_decl.h" #include "struct_decls/struct_0200C6E4_decl.h" @@ -11,7 +13,7 @@ #include "struct_decls/struct_02022550_decl.h" #include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -19,46 +21,46 @@ #include #include -CellTransferStateData * sub_0200C6E4(int param0); -AnimationResourceCollection * sub_0200C704(CellTransferStateData * param0); -UnkStruct_0200C738 * sub_0200C738(CellTransferStateData * param0); -BOOL sub_0200C73C(CellTransferStateData * param0, const UnkStruct_ov104_0224133C * param1, const UnkStruct_ov104_022412F4 * param2, int param3); -BOOL sub_0200C7C0(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2); +SpriteRenderer * sub_0200C6E4(int param0); +SpriteGfxHandler * sub_0200C704(SpriteRenderer * param0); +UnkStruct_0200C738 * sub_0200C738(SpriteRenderer * param0); +BOOL sub_0200C73C(SpriteRenderer * param0, const UnkStruct_ov104_0224133C * param1, const UnkStruct_ov104_022412F4 * param2, int param3); +BOOL sub_0200C7C0(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2); void sub_0200C7E4(GraphicElementData * param0); -void sub_0200C7EC(AnimationResourceCollection * param0); +void sub_0200C7EC(SpriteGfxHandler * param0); void sub_0200C800(void); void sub_0200C808(void); -void sub_0200C810(AnimationResourceCollection * param0); -void sub_0200C81C(AnimationResourceCollection * param0); -void sub_0200C82C(AnimationResourceCollection * param0); -void sub_0200C880(CellTransferStateData * param0); -void sub_0200C8A0(CellTransferStateData * param0, AnimationResourceCollection * param1); -void sub_0200C8B0(CellTransferStateData * param0, AnimationResourceCollection * param1); -void sub_0200C8D4(CellTransferStateData * param0); -BOOL sub_0200C8F0(CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov7_0224F2EC * param2); -GraphicElementData * sub_0200CA08(CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov7_0224F358 * param2); -GraphicElementData * sub_0200CA44(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); -BOOL sub_0200CB30(CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov104_02241308 * param2); -BOOL sub_0200CBDC(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5, int param6); -BOOL sub_0200CC3C(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6); -s8 sub_0200CC9C(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5, int param6, int param7); -s8 sub_0200CD0C(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6, int param7); -u8 sub_0200CD7C(PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, int param4, int param5, int param6, int param7, int param8, int param9); -u8 sub_0200CDC4(PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, NARC * param4, int param5, int param6, int param7, int param8, int param9); -BOOL sub_0200CE0C(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5); -BOOL sub_0200CE24(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5); -BOOL sub_0200CE3C(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5); -BOOL sub_0200CE54(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5); -CellActorData * sub_0200CE6C(CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov104_0223F9E0 * param2); -const NNSG2dImagePaletteProxy * sub_0200D04C(AnimationResourceCollection * param0, int param1); -u32 sub_0200D05C(AnimationResourceCollection * param0, int param1, NNS_G2D_VRAM_TYPE param2); -BOOL sub_0200D070(AnimationResourceCollection * param0, int param1); -BOOL sub_0200D080(AnimationResourceCollection * param0, int param1); -BOOL sub_0200D090(AnimationResourceCollection * param0, int param1); -BOOL sub_0200D0A0(AnimationResourceCollection * param0, int param1); -void sub_0200D0B0(CellTransferStateData * param0, AnimationResourceCollection * param1); +void sub_0200C810(SpriteGfxHandler * param0); +void sub_0200C81C(SpriteGfxHandler * param0); +void sub_0200C82C(SpriteGfxHandler * param0); +void sub_0200C880(SpriteRenderer * param0); +void sub_0200C8A0(SpriteRenderer * param0, SpriteGfxHandler * param1); +void sub_0200C8B0(SpriteRenderer * param0, SpriteGfxHandler * param1); +void sub_0200C8D4(SpriteRenderer * param0); +BOOL sub_0200C8F0(SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov7_0224F2EC * param2); +GraphicElementData * sub_0200CA08(SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov7_0224F358 * param2); +GraphicElementData * sub_0200CA44(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13); +BOOL sub_0200CB30(SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov104_02241308 * param2); +BOOL sub_0200CBDC(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL SpriteRenderer_LoadCharResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int vram, int resID); +s8 sub_0200CC9C(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5, int param6, int param7); +s8 sub_0200CD0C(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, int param4, int param5, int param6, int param7); +u8 sub_0200CD7C(PaletteData * param0, int param1, SpriteRenderer * param2, SpriteGfxHandler * param3, int param4, int param5, int param6, int param7, int param8, int param9); +u8 SpriteRenderer_LoadPalette(PaletteData *palette, enum PaletteBufferId paletteBuffer, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int palID, int vram, int resID); +BOOL sub_0200CE0C(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5); +BOOL SpriteRenderer_LoadCellResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int resID); +BOOL sub_0200CE3C(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5); +BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, NARC *narc, int fileID, BOOL compressed, int resID); +CellActorData * SpriteActor_LoadResources(SpriteRenderer * param0, SpriteGfxHandler * param1, const SpriteTemplate * param2); +const NNSG2dImagePaletteProxy * sub_0200D04C(SpriteGfxHandler * param0, int param1); +u32 sub_0200D05C(SpriteGfxHandler * param0, int param1, NNS_G2D_VRAM_TYPE param2); +BOOL SpriteGfxHandler_UnloadCharObjById(SpriteGfxHandler * param0, int param1); +BOOL SpriteGfxHandler_UnloadPlttObjById(SpriteGfxHandler * param0, int param1); +BOOL SpriteGfxHandler_UnloadCellObjById(SpriteGfxHandler * param0, int param1); +BOOL SpriteGfxHandler_UnloadAnimObjById(SpriteGfxHandler * param0, int param1); +void sub_0200D0B0(SpriteRenderer * param0, SpriteGfxHandler * param1); void sub_0200D0F4(CellActorData * param0); -void sub_0200D324(GraphicElementData * param0); +void SpriteActor_UpdateObject(GraphicElementData * param0); void sub_0200D330(CellActorData * param0); void sub_0200D33C(CellActorData * param0); void sub_0200D34C(CellActorData * param0, fx32 param1); @@ -76,7 +78,7 @@ void sub_0200D3C4(GraphicElementData * param0, u16 param1); void sub_0200D3CC(CellActorData * param0, u16 param1); u16 sub_0200D3D8(GraphicElementData * param0); u16 sub_0200D3E0(CellActorData * param0); -void sub_0200D3EC(GraphicElementData * param0, int param1); +void SpriteActor_DrawSprite(GraphicElementData * param0, int param1); void sub_0200D3F4(CellActorData * param0, int param1); int sub_0200D400(GraphicElementData * param0); int sub_0200D408(CellActorData * param0); @@ -93,11 +95,11 @@ void sub_0200D474(CellActorData * param0, int param1); u32 sub_0200D480(GraphicElementData * param0); u32 sub_0200D488(CellActorData * param0); void sub_0200D494(GraphicElementData * param0, s16 param1, s16 param2); -void sub_0200D4C4(CellActorData * param0, s16 param1, s16 param2); +void SpriteActor_SetSpritePositionXY(CellActorData * param0, s16 param1, s16 param2); void sub_0200D4D0(GraphicElementData * param0, s16 param1, s16 param2, fx32 param3); void sub_0200D500(CellActorData * param0, s16 param1, s16 param2, fx32 param3); void sub_0200D50C(GraphicElementData * param0, s16 * param1, s16 * param2); -void sub_0200D550(CellActorData * param0, s16 * param1, s16 * param2); +void SpriteActor_GetSpritePositionXY(CellActorData * param0, s16 * param1, s16 * param2); void sub_0200D55C(GraphicElementData * param0, s16 * param1, s16 * param2, fx32 param3); void sub_0200D5A0(CellActorData * param0, s16 * param1, s16 * param2, fx32 param3); void sub_0200D5AC(GraphicElementData * param0, s16 param1, s16 param2); @@ -124,14 +126,14 @@ void sub_0200D7D4(CellActorData * param0, int param1); void sub_0200D7E0(CellActorData * param0, s16 param1, s16 param2); void sub_0200D7FC(CellActorData * param0, BOOL param1); void sub_0200D808(GraphicElementData * param0, GXOamMode param1); -void sub_0200D810(CellActorData * param0, GXOamMode param1); +void SpriteActor_SetOAMMode(CellActorData * param0, GXOamMode param1); u32 sub_0200D81C(CellActorData * param0); -BOOL sub_0200D828(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D888(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5, int param6); -BOOL sub_0200D8E8(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, BOOL param4, int param5, int param6); -void sub_0200D948(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5); -void sub_0200D97C(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5); -GraphicElementManager * sub_0200D9B0(AnimationResourceCollection * param0); -void sub_0200D9B4(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, BOOL param4, int param5); +BOOL sub_0200D828(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL sub_0200D888(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6); +BOOL sub_0200D8E8(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5, int param6); +void sub_0200D948(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5); +void sub_0200D97C(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5); +GraphicElementManager * sub_0200D9B0(SpriteGfxHandler * param0); +void sub_0200D9B4(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5); #endif // POKEPLATINUM_UNK_0200C6E4_H diff --git a/include/unk_0201567C.h b/include/unk_0201567C.h index 1913c7e243..7b9c4d1426 100644 --- a/include/unk_0201567C.h +++ b/include/unk_0201567C.h @@ -3,7 +3,7 @@ #include "struct_decls/struct_02002F38_decl.h" -void * sub_0201567C(PaletteSys * param0, u16 param1, u16 param2, u32 param3); +void * sub_0201567C(PaletteData * param0, u16 param1, u16 param2, u32 param3); void sub_02015738(void * param0, u8 param1); void sub_02015760(void * param0); diff --git a/include/unk_020218BC.h b/include/unk_020218BC.h index 5d537f9027..9c55878430 100644 --- a/include/unk_020218BC.h +++ b/include/unk_020218BC.h @@ -37,12 +37,12 @@ u16 sub_02021D30(const GraphicElementData * param0); int sub_02021D34(const GraphicElementData * param0); int sub_02021D3C(const GraphicElementData * param0); u32 sub_02021D44(const GraphicElementData * param0); -void sub_02021D6C(GraphicElementData * param0, u32 param1); +void SpriteActor_SetSpriteAnimActive(GraphicElementData * param0, u32 param1); void sub_02021DCC(GraphicElementData * param0, u32 param1); void sub_02021DE0(GraphicElementData * param0); u32 sub_02021E24(const GraphicElementData * param0); void sub_02021E2C(GraphicElementData * param0, fx32 param1); -void sub_02021E50(GraphicElementData * param0, u16 param1); +void SpriteActor_SetAnimFrame(GraphicElementData * param0, u16 param1); u16 sub_02021E74(const GraphicElementData * param0); void sub_02021E80(GraphicElementData * param0, u8 param1); u8 sub_02021E88(const GraphicElementData * param0); diff --git a/include/unk_0207C908.h b/include/unk_0207C908.h index 476aedf023..75f1686ed2 100644 --- a/include/unk_0207C908.h +++ b/include/unk_0207C908.h @@ -5,7 +5,7 @@ #include "struct_decls/struct_0200C6E4_decl.h" #include "struct_decls/struct_0200C704_decl.h" #include "struct_decls/cell_actor_data.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include @@ -15,20 +15,20 @@ u32 sub_0207C924(void); u32 sub_0207C928(void); u8 sub_0207C92C(int param0); u32 sub_0207C944(void); -void sub_0207C948(CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); -void sub_0207C97C(CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, u32 param3); -void sub_0207C9B0(PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, NNS_G2D_VRAM_TYPE param4, u32 param5); -void sub_0207C9EC(CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, u32 param3); -void sub_0207CA34(AnimationResourceCollection * param0, u32 param1); -void sub_0207CA3C(AnimationResourceCollection * param0, u32 param1); -void sub_0207CA44(AnimationResourceCollection * param0, u32 param1, u32 param2); -CellActorData * sub_0207CA58(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, const UnkStruct_ov104_0223F9E0 * param3); +void sub_0207C948(SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); +void sub_0207C97C(SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, u32 param3); +void sub_0207C9B0(PaletteData * param0, int param1, SpriteRenderer * param2, SpriteGfxHandler * param3, NNS_G2D_VRAM_TYPE param4, u32 param5); +void sub_0207C9EC(SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, u32 param3); +void sub_0207CA34(SpriteGfxHandler * param0, u32 param1); +void sub_0207CA3C(SpriteGfxHandler * param0, u32 param1); +void sub_0207CA44(SpriteGfxHandler * param0, u32 param1, u32 param2); +CellActorData * sub_0207CA58(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, const SpriteTemplate * param3); void sub_0207CA88(CellActorData * param0); u32 sub_0207CA90(int param0); u8 sub_0207CAA8(int param0); u32 sub_0207CAC0(void); -void sub_0207CAC4(CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); -void sub_0207CAF8(AnimationResourceCollection * param0, u32 param1); +void sub_0207CAC4(SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4); +void sub_0207CAF8(SpriteGfxHandler * param0, u32 param1); void sub_0207CB00(CellActorData * param0); #endif // POKEPLATINUM_UNK_0207C908_H diff --git a/include/unk_0208B284.h b/include/unk_0208B284.h index 0457a7496b..6f591b25f0 100644 --- a/include/unk_0208B284.h +++ b/include/unk_0208B284.h @@ -7,7 +7,7 @@ #include "struct_defs/struct_0208B284.h" #include "struct_defs/struct_0208B878.h" -UnkStruct_0208B878 * sub_0208B284(UnkStruct_0208B284 param0, CellTransferStateData * param1, AnimationResourceCollection * param2, PaletteSys * param3); +UnkStruct_0208B878 * sub_0208B284(UnkStruct_0208B284 param0, SpriteRenderer * param1, SpriteGfxHandler * param2, PaletteData * param3); void sub_0208B63C(UnkStruct_0208B878 * param0, int param1); BOOL sub_0208B878(UnkStruct_0208B878 * param0, int param1); BOOL sub_0208B8B0(UnkStruct_0208B878 * param0, BOOL param1); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index a0fe074569..a1274eb983 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -702,7 +702,7 @@ Overlay overlay16 Object main.nef.p/src_overlay016_ov16_02266F1C.c.o Object main.nef.p/src_overlay016_ov16_02268520.c.o Object main.nef.p/src_overlay016_ov16_0226871C.c.o - Object main.nef.p/src_overlay016_ov16_0226D094.c.o + Object main.nef.p/src_overlay016_party_gauge.c.o Object main.nef.p/src_overlay016_ov16_0226DB7C.c.o Object main.nef.p/src_overlay016_ov16_0226DE44.c.o Object main.nef.p/src_overlay016_ov16_0226E148.c.o diff --git a/src/meson.build b/src/meson.build index b4f930f02b..155fba02f9 100644 --- a/src/meson.build +++ b/src/meson.build @@ -540,7 +540,7 @@ pokeplatinum_c = files( 'overlay016/ov16_02266F1C.c', 'overlay016/ov16_02268520.c', 'overlay016/ov16_0226871C.c', - 'overlay016/ov16_0226D094.c', + 'overlay016/party_gauge.c', 'overlay016/ov16_0226DB7C.c', 'overlay016/ov16_0226DE44.c', 'overlay016/ov16_0226E148.c', diff --git a/src/overlay005/ov5_021D2F14.c b/src/overlay005/ov5_021D2F14.c index ae76a46ef7..5fffef0a87 100644 --- a/src/overlay005/ov5_021D2F14.c +++ b/src/overlay005/ov5_021D2F14.c @@ -13,7 +13,7 @@ #include "overlay007/struct_ov7_0224F2EC.h" #include "overlay007/struct_ov7_0224F358.h" #include "overlay019/struct_ov19_021DA864.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay115/struct_ov115_02261520.h" @@ -122,7 +122,7 @@ GraphicElementData * ov5_021D3104 (UnkStruct_ov5_021D30A8 * param0, const UnkStr v1 = sub_02021AA0(&v0); GF_ASSERT(v1); - sub_02021D6C(v1, param1->unk_0A); + SpriteActor_SetSpriteAnimActive(v1, param1->unk_0A); sub_02021EC4(v1, param1->unk_10); return v1; @@ -334,7 +334,7 @@ static void ov5_021D3518 (UnkStruct_ov5_021D30A8 * param0, NARC * param1, int pa GF_ASSERT(0); } -CellActorData * ov5_021D3584 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_ov104_0223F9E0 * param1) +CellActorData * ov5_021D3584 (UnkStruct_ov5_021D30A8 * param0, const SpriteTemplate * param1) { int v0; int v1; @@ -349,7 +349,7 @@ CellActorData * ov5_021D3584 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_o v2->unk_04 = v2->unk_08->unk_00; for (v0 = 0; v0 < 6; v0++) { - v4[v0] = param1->unk_14[v0]; + v4[v0] = param1->resources[v0]; } if ((param0->unk_194[4] == NULL) || (param0->unk_194[5] == NULL)) { @@ -365,15 +365,15 @@ CellActorData * ov5_021D3584 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_o } } - sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->unk_30, param1->unk_2C, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); + sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param1->transferToVRAM, param1->bgPriority, param0->unk_194[0], param0->unk_194[1], param0->unk_194[2], param0->unk_194[3], param0->unk_194[4], param0->unk_194[5]); v3.unk_00 = param0->unk_00; v3.unk_04 = v2->unk_04; - v3.unk_08.x = FX32_CONST(param1->unk_00); - v3.unk_08.y = FX32_CONST(param1->unk_02); - v3.unk_08.z = FX32_CONST(param1->unk_04); + v3.unk_08.x = FX32_CONST(param1->x); + v3.unk_08.y = FX32_CONST(param1->y); + v3.unk_08.z = FX32_CONST(param1->z); - if (param1->unk_10 == NNS_G2D_VRAM_TYPE_2DSUB) { + if (param1->vramType == NNS_G2D_VRAM_TYPE_2DSUB) { v3.unk_08.y += (192 << FX32_SHIFT); } @@ -381,16 +381,16 @@ CellActorData * ov5_021D3584 (UnkStruct_ov5_021D30A8 * param0, const UnkStruct_o v3.unk_14.y = FX32_ONE; v3.unk_14.z = FX32_ONE; v3.unk_20 = 0; - v3.unk_24 = param1->unk_08; - v3.unk_28 = param1->unk_10; + v3.unk_24 = param1->priority; + v3.unk_28 = param1->vramType; v3.unk_2C = param0->unk_1C6; v2->unk_00 = sub_02021AA0(&v3); if (v2->unk_00 != NULL) { v1 = sub_02021EE8(v2->unk_00); - sub_02021D6C(v2->unk_00, param1->unk_06); - sub_02021E90(v2->unk_00, v1 + param1->unk_0C); + SpriteActor_SetSpriteAnimActive(v2->unk_00, param1->animIdx); + sub_02021E90(v2->unk_00, v1 + param1->plttIdx); } else { GF_ASSERT(FALSE); } diff --git a/src/overlay005/ov5_021D5EB8.c b/src/overlay005/ov5_021D5EB8.c index 06e745a418..d4d2c6be7c 100644 --- a/src/overlay005/ov5_021D5EB8.c +++ b/src/overlay005/ov5_021D5EB8.c @@ -2245,7 +2245,7 @@ static void ov5_021D78A4 (UnkStruct_ov5_021DB4B8 * param0, int param1) v3[0] = 0; v4 = v6 % 3; - sub_02021E50(v1->unk_04, v4); + SpriteActor_SetAnimFrame(v1->unk_04, v4); v2 = (v6 % 20); v3[2] = 10 * (v4 + 1) + v2; @@ -2294,7 +2294,7 @@ static void ov5_021D7960 (UnkStruct_ov5_021D6FA8 * param0) } else { v2[3] = 1; v2[0] = 4; - sub_02021E50(v1->unk_04, 3); + SpriteActor_SetAnimFrame(v1->unk_04, 3); } } @@ -2444,7 +2444,7 @@ static void ov5_021D7C40 (UnkStruct_ov5_021DB4B8 * param0, int param1) v4 = (s32 *)v2->unk_08; v5 = MTRNG_Next() % 4; - sub_02021E50(v2->unk_04, v5); + SpriteActor_SetAnimFrame(v2->unk_04, v5); v4[4] = 10; v4[5] = 0; @@ -2685,7 +2685,7 @@ static void ov5_021D8098 (UnkStruct_ov5_021DB4B8 * param0, int param1) v4[1] = 4 + (MTRNG_Next() % (46 - 4)); v7 = (v4[1] - 4) / (((46 - 4) / 3) + 1); - sub_02021E50(v1->unk_04, v7); + SpriteActor_SetAnimFrame(v1->unk_04, v7); v4[4] = -1 * (v7 + 1); v4[2] = v6[v2] * (v7 + 1); @@ -3230,7 +3230,7 @@ static void ov5_021D8B88 (UnkStruct_ov5_021DB4B8 * param0, int param1) v5[2] += v5[2] / 2; } - sub_02021E50(v1->unk_04, v6); + SpriteActor_SetAnimFrame(v1->unk_04, v6); { VecFx32 v9; @@ -3548,7 +3548,7 @@ static void ov5_021D92C4 (UnkStruct_ov5_021DB4B8 * param0, int param1) v4[1] = 18 + (MTRNG_Next() % (24 - 18)); v5 = MTRNG_Next() % 4; - sub_02021E50(v1->unk_04, v5); + SpriteActor_SetAnimFrame(v1->unk_04, v5); v4[4] = Unk_ov5_021F8CDC[v2] * ((v5) + 1); v4[2] = Unk_ov5_021F8CEC[v2] * ((v5) + 1); @@ -3768,7 +3768,7 @@ static void ov5_021D9690 (UnkStruct_ov5_021DB4B8 * param0, int param1) v5 = MTRNG_Next() % 4; } - sub_02021E50(v1->unk_04, v5); + SpriteActor_SetAnimFrame(v1->unk_04, v5); } } @@ -4288,7 +4288,7 @@ static void ov5_021DA0A8 (UnkStruct_ov5_021DB4B8 * param0, int param1) v3[0] = 0; v6 = v8 % 3; - sub_02021E50(v1->unk_04, v6); + SpriteActor_SetAnimFrame(v1->unk_04, v6); v3[4] = -24 * (v6 + 1); v3[2] = 24 * (v6 + 1); @@ -4331,7 +4331,7 @@ static void ov5_021DA1A8 (UnkStruct_ov5_021D6FA8 * param0) } else { v2[3] = 1; v2[0] = 4; - sub_02021E50(v1->unk_04, 3); + SpriteActor_SetAnimFrame(v1->unk_04, 3); } } @@ -4524,7 +4524,7 @@ static void ov5_021DA5A0 (UnkStruct_ov5_021DB4B8 * param0, int param1) v5 = (s32 *)v2->unk_08; v4 = MTRNG_Next() % 4; - sub_02021E50(v2->unk_04, v4); + SpriteActor_SetAnimFrame(v2->unk_04, v4); v5[4] = 10; v5[5] = 0; @@ -4770,7 +4770,7 @@ static void ov5_021DA9DC (UnkStruct_ov5_021DB4B8 * param0, int param1) v2 = (s32 *)v1->unk_08; v4 = MTRNG_Next() % 0xe; - sub_02021E50(v1->unk_04, v4); + SpriteActor_SetAnimFrame(v1->unk_04, v4); v3 = v4 / 4; v3++; diff --git a/src/overlay005/ov5_021E2338.c b/src/overlay005/ov5_021E2338.c index 41f9199e5c..d8518af842 100644 --- a/src/overlay005/ov5_021E2338.c +++ b/src/overlay005/ov5_021E2338.c @@ -692,9 +692,9 @@ void ov5_021E2B54 (SysTask * param0, void * param1) ov5_021DDF9C(v0, v1->unk_44, 96, 6, 0, (255 * FX32_ONE), (FX32_ONE * 10)); - sub_02021D6C( + SpriteActor_SetSpriteAnimActive( v1->unk_21C[0], 1); - sub_02021D6C( + SpriteActor_SetSpriteAnimActive( v1->unk_21C[1], 2); ov5_021DDE14(&v1->unk_2C, 0, (255 * FX32_ONE), (FX32_ONE * 10), 6); @@ -2567,7 +2567,7 @@ static void ov5_021E5128 (UnkStruct_ov5_021E5128 * param0, UnkStruct_ov5_021DE47 if (v0 != 3) { sub_02021CF8(param0->unk_04[v0], 2); - sub_02021D6C(param0->unk_04[v0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04[v0], 1); ov5_021DDDBC(¶m0->unk_14[v0], FX32_CONST(2), FX32_CONST(1), 6); } else { @@ -3034,7 +3034,7 @@ static BOOL ov5_021E5890 (UnkStruct_ov5_021DDC28 * param0, u32 param1, const Unk v0->unk_2CC[v5] = ov5_021DE62C( &v0->unk_5C, v7, 0, 0, 0, 0); sub_02021CAC(v0->unk_2CC[v5], 0); - sub_02021D6C(v0->unk_2CC[v5], v8); + SpriteActor_SetSpriteAnimActive(v0->unk_2CC[v5], v8); sub_02021E80(v0->unk_2CC[v5], 1); } diff --git a/src/overlay006/ov6_022426AC.c b/src/overlay006/ov6_022426AC.c index 4d2a5435de..7deee4078d 100644 --- a/src/overlay006/ov6_022426AC.c +++ b/src/overlay006/ov6_022426AC.c @@ -223,6 +223,6 @@ static void ov6_022428F8 (UnkStruct_ov6_022426B8 * param0) param0->unk_1C8 = sub_02021AA0(&v2); sub_02021CC8(param0->unk_1C8, 0); - sub_02021D6C(param0->unk_1C8, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_1C8, 0); } } diff --git a/src/overlay006/ov6_02243258.c b/src/overlay006/ov6_02243258.c index 928c0ed0f1..30fec9a91a 100644 --- a/src/overlay006/ov6_02243258.c +++ b/src/overlay006/ov6_02243258.c @@ -600,7 +600,7 @@ static GraphicElementData * ov6_02243848 (UnkStruct_ov6_02243258 * param0, int p v1 = ov6_02243740(param0, &v0, 2, v2, 2, 1, 0, 131); sub_02021CAC(v1, 0); - sub_02021D6C(v1, 6); + SpriteActor_SetSpriteAnimActive(v1, 6); return v1; } @@ -739,7 +739,7 @@ static void ov6_02243950 (UnkStruct_ov101_021D5D90 * param0) sub_02021C60(v3, &v4); sub_02021C70(v3, &v5); sub_02021C94(v3, sub_0201D2A4(0)); - sub_02021D6C(v3, 2); + SpriteActor_SetSpriteAnimActive(v3, 2); } ov6_02243F2C(); @@ -868,7 +868,7 @@ static int ov6_02243BEC (UnkStruct_ov6_02249110 * param0) static int ov6_02243CD8 (UnkStruct_ov6_02249110 * param0) { sub_02021CAC(param0->unk_68, 0); - sub_02021D6C(param0->unk_58.unk_08, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_58.unk_08, 1); param0->unk_04 = 0; param0->unk_01++; @@ -902,7 +902,7 @@ static int ov6_02243CFC (UnkStruct_ov6_02249110 * param0) sub_02021C70(param0->unk_68, &v1); sub_02021C94(param0->unk_68, sub_0201D2A4(((param0->unk_38) / FX32_ONE))); sub_02021CAC(param0->unk_68, 1); - sub_02021D6C(param0->unk_58.unk_08, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_58.unk_08, 6); sub_02021CC8(param0->unk_58.unk_08, 1); } @@ -971,7 +971,7 @@ static int ov6_02243ECC (UnkStruct_ov6_02249110 * param0) param0->unk_04++; if (param0->unk_04 == 8) { - sub_02021D6C(param0->unk_58.unk_08, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_58.unk_08, 1); ov6_02243F74(param0->unk_58.unk_04, 0); } @@ -1435,7 +1435,7 @@ static int ov6_022444D0 (UnkStruct_ov6_02243FFC * param0) return 0; } - sub_02021D6C(param0->unk_248, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_248, 1); param0->unk_00++; return 0; @@ -1872,7 +1872,7 @@ static GraphicElementData * ov6_02244CD4 (UnkStruct_ov6_02243FFC * param0, const GraphicElementData * v0; v0 = ov6_02244C20(param0, param1, 1, 0, 1, 0, 0, param2); - sub_02021D6C(v0, param3); + SpriteActor_SetSpriteAnimActive(v0, param3); return v0; } @@ -1889,7 +1889,7 @@ static GraphicElementData * ov6_02244CFC (UnkStruct_ov6_02243FFC * param0, const v0 = ov6_02244C20(param0, param1, 2, v1, 2, 1, 0, 131); sub_02021CAC(v0, 0); - sub_02021D6C(v0, 6); + SpriteActor_SetSpriteAnimActive(v0, 6); return v0; } @@ -2618,7 +2618,7 @@ static int ov6_022459B0 (UnkStruct_ov6_02249198 * param0) { GraphicElementData * v0 = param0->unk_5C.unk_00->unk_248; - sub_02021D6C(v0, 3); + SpriteActor_SetSpriteAnimActive(v0, 3); { fx32 v1, v2; @@ -2760,7 +2760,7 @@ static void ov6_02245B80 (UnkStruct_ov101_021D5D90 * param0) v0 = *v1; sub_020715D4(param0, &v0); - sub_02021D6C(v2->unk_20, 5); + SpriteActor_SetSpriteAnimActive(v2->unk_20, 5); } static void ov6_02245BC8 (UnkStruct_ov101_021D5D90 * param0) @@ -2777,7 +2777,7 @@ static void ov6_02245BC8 (UnkStruct_ov101_021D5D90 * param0) ov6_022437C8(v1->unk_20, &v0); sub_020715D4(param0, &v0); - sub_02021D6C(v1->unk_20, 4); + SpriteActor_SetSpriteAnimActive(v1->unk_20, 4); } static int ov6_02245C04 (UnkStruct_ov101_021D5D90 * param0, void * param1) diff --git a/src/overlay007/ov7_0224BE9C.c b/src/overlay007/ov7_0224BE9C.c index b56ea09038..97f7d679de 100644 --- a/src/overlay007/ov7_0224BE9C.c +++ b/src/overlay007/ov7_0224BE9C.c @@ -661,7 +661,7 @@ static void ov7_0224C768 (UnkStruct_ov7_0224C768 * param0, BGL * param1, u32 par v3.unk_08.y = v4[v0] * FX32_ONE; param0->unk_158[v0] = sub_02021B90(&v3); - sub_02021D6C(param0->unk_158[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_158[v0], v0); sub_02021CC8(param0->unk_158[v0], 1); } } diff --git a/src/overlay010/ov10_0221F800.c b/src/overlay010/ov10_0221F800.c index f39c78d003..f5f8bf6294 100644 --- a/src/overlay010/ov10_0221F800.c +++ b/src/overlay010/ov10_0221F800.c @@ -27,7 +27,7 @@ #include "overlay061/struct_ov61_0222C884.h" #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -102,11 +102,11 @@ typedef struct { typedef struct UnkStruct_ov10_0221FB28_t { UnkStruct_ov10_0221F800 * unk_00; const UnkFuncPtr_ov10_02222AD0 * unk_04; - PaletteSys * unk_08; + PaletteData * unk_08; BGL * unk_0C; Window unk_10[24]; - CellTransferStateData * unk_190; - AnimationResourceCollection * unk_194; + SpriteRenderer * unk_190; + SpriteGfxHandler * unk_194; CellActorData * unk_198[30]; u32 unk_210; UnkStruct_ov10_0221FB28_sub1 unk_214[6]; @@ -1226,23 +1226,23 @@ static void ov10_02220B00 (UnkStruct_ov10_0221FB28 * param0, UnkStruct_ov104_022 static CellActorData * ov10_02220BA0 (UnkStruct_ov10_0221FB28 * param0, const u32 * param1) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = param1[5]; - v0.unk_0C = param1[6]; - v0.unk_10 = NNS_G2D_VRAM_TYPE_2DMAIN; - v0.unk_14[0] = param1[0]; - v0.unk_14[1] = param1[1]; - v0.unk_14[2] = param1[2]; - v0.unk_14[3] = param1[3]; - v0.unk_2C = param1[4]; - v0.unk_30 = 0; + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = param1[5]; + v0.plttIdx = param1[6]; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.resources[0] = param1[0]; + v0.resources[1] = param1[1]; + v0.resources[2] = param1[2]; + v0.resources[3] = param1[3]; + v0.bgPriority = param1[4]; + v0.transferToVRAM = FALSE; - return sub_0200CE6C(param0->unk_190, param0->unk_194, &v0); + return SpriteActor_LoadResources(param0->unk_190, param0->unk_194, &v0); } static void ov10_02220BE8 (UnkStruct_ov10_0221FB28 * param0) @@ -1505,10 +1505,10 @@ static void ov10_022210F4 (UnkStruct_ov10_0221FB28 * param0) v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param0->unk_00->unk_24); - sub_0200CC3C(param0->unk_190, param0->unk_194, v0, 208, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 208, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); sub_0200CC9C(param0->unk_190, param0->unk_194, 108, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47111); - sub_0200CE24(param0->unk_190, param0->unk_194, v0, 207, 1, 47111); - sub_0200CE54(param0->unk_190, param0->unk_194, v0, 209, 1, 47111); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 207, 1, 47111); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 209, 1, 47111); NARC_dtor(v0); } @@ -1518,7 +1518,7 @@ static void ov10_02221188 (UnkStruct_ov10_0221FB28 * param0, u8 param1, s16 para u8 v1[] = {0, 3, 6, 9}; for (v0 = 0; v0 < 3; v0++) { - sub_0200D4C4(param0->unk_198[v1[param1] + v0], param0->unk_B58[param1] + v0 * 19 + param2, param0->unk_B5C[param1] + param3); + SpriteActor_SetSpritePositionXY(param0->unk_198[v1[param1] + v0], param0->unk_B58[param1] + v0 * 19 + param2, param0->unk_B5C[param1] + param3); } } @@ -1708,9 +1708,9 @@ static void ov10_0222166C (UnkStruct_ov10_0221FB28 * param0) v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__VS_DEMO_GRA, param0->unk_00->unk_24); - sub_0200CC3C(param0->unk_190, param0->unk_194, v0, 5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); - sub_0200CE24(param0->unk_190, param0->unk_194, v0, 6, 0, 47112); - sub_0200CE54(param0->unk_190, param0->unk_194, v0, 7, 0, 47112); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 6, 0, 47112); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 7, 0, 47112); NARC_dtor(v0); } @@ -1720,26 +1720,26 @@ static void ov10_022216E0 (UnkStruct_ov10_0221FB28 * param0) sub_0200D3F4(param0->unk_198[13], 0); if (param0->unk_00->unk_2A == 3) { - sub_0200D4C4(param0->unk_198[12], 128, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[12], 128, (96 - 24)); sub_0200D364(param0->unk_198[12], 3 - 1); return; } if (ov10_02220AD0() == 1) { if (param0->unk_00->unk_2A == 1) { - sub_0200D4C4(param0->unk_198[12], 48, (96 - 24)); - sub_0200D4C4(param0->unk_198[13], 208, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[12], 48, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[13], 208, (96 - 24)); } else { - sub_0200D4C4(param0->unk_198[12], 208, (96 - 24)); - sub_0200D4C4(param0->unk_198[13], 48, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[12], 208, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[13], 48, (96 - 24)); } } else { if (param0->unk_00->unk_2A == 1) { - sub_0200D4C4(param0->unk_198[12], 208, (96 - 24)); - sub_0200D4C4(param0->unk_198[13], 48, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[12], 208, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[13], 48, (96 - 24)); } else { - sub_0200D4C4(param0->unk_198[12], 48, (96 - 24)); - sub_0200D4C4(param0->unk_198[13], 208, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[12], 48, (96 - 24)); + SpriteActor_SetSpritePositionXY(param0->unk_198[13], 208, (96 - 24)); } } @@ -2103,7 +2103,7 @@ static void ov10_02221EEC (UnkStruct_ov10_0221FB28 * param0, u32 param1) for (v0 = 0; v0 < 5; v0++) { param0->unk_198[param1 * 5 + v0] = ov10_02220BA0(param0, &Unk_ov10_02222F3C[param1 * 5 + v0][0]); - sub_0200D4C4(param0->unk_198[param1 * 5 + v0], Unk_ov10_02222C6C[param1][v0 * 2], Unk_ov10_02222C6C[param1][v0 * 2 + 1]); + SpriteActor_SetSpritePositionXY(param0->unk_198[param1 * 5 + v0], Unk_ov10_02222C6C[param1][v0 * 2], Unk_ov10_02222C6C[param1][v0 * 2 + 1]); } if (param0->unk_214[param1].unk_04 == 0) { @@ -2166,11 +2166,11 @@ static void ov10_022220B4 (UnkStruct_ov10_0221FB28 * param0) v1 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_24); sub_0200CD0C(param0->unk_190, param0->unk_194, v1, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 47112); - sub_0200CE24(param0->unk_190, param0->unk_194, v1, PokeIcon32KCellsFileIndex(), 0, 47113); - sub_0200CE54(param0->unk_190, param0->unk_194, v1, PokeIcon32KAnimationFileIndex(), 0, 47113); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, PokeIcon32KCellsFileIndex(), 0, 47113); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, PokeIcon32KAnimationFileIndex(), 0, 47113); for (v0 = 0; v0 < 6; v0++) { - sub_0200CC3C(param0->unk_190, param0->unk_194, v1, param0->unk_214[v0].unk_00, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47113 + v0); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v1, param0->unk_214[v0].unk_00, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47113 + v0); } NARC_dtor(v1); @@ -2182,10 +2182,10 @@ static void ov10_0222216C (UnkStruct_ov10_0221FB28 * param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_24); - sub_0200CC3C(param0->unk_190, param0->unk_194, v0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47119); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 20, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47119); sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 21, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47113); - sub_0200CE24(param0->unk_190, param0->unk_194, v0, 19, 0, 47114); - sub_0200CE54(param0->unk_190, param0->unk_194, v0, 18, 0, 47114); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 19, 0, 47114); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 18, 0, 47114); NARC_dtor(v0); } @@ -2195,10 +2195,10 @@ static void ov10_02222208 (UnkStruct_ov10_0221FB28 * param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PST_GRA, param0->unk_00->unk_24); - sub_0200CC3C(param0->unk_190, param0->unk_194, v0, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47120); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47120); sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 65, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 47114); - sub_0200CE24(param0->unk_190, param0->unk_194, v0, 63, 0, 47115); - sub_0200CE54(param0->unk_190, param0->unk_194, v0, 62, 0, 47115); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 63, 0, 47115); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 62, 0, 47115); NARC_dtor(v0); } @@ -2208,10 +2208,10 @@ static void ov10_022222A4 (UnkStruct_ov10_0221FB28 * param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_24); - sub_0200CC3C(param0->unk_190, param0->unk_194, v0, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47121); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47121); sub_0200CD0C(param0->unk_190, param0->unk_194, v0, 8, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47115); - sub_0200CE24(param0->unk_190, param0->unk_194, v0, 1, 0, 47116); - sub_0200CE54(param0->unk_190, param0->unk_194, v0, 0, 0, 47116); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 1, 0, 47116); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_190, param0->unk_194, v0, 0, 0, 47116); NARC_dtor(v0); } @@ -2229,7 +2229,7 @@ static void ov10_02222340 (UnkStruct_ov10_0221FB28 * param0, s16 param1) for (v0 = 0; v0 < 3; v0++) { for (v1 = 0; v1 < 5; v1++) { - sub_0200D4C4( + SpriteActor_SetSpritePositionXY( param0->unk_198[(v2 + v0) * 5 + v1], Unk_ov10_02222C6C[v2 + v0][v1 * 2] + param1, Unk_ov10_02222C6C[v2 + v0][v1 * 2 + 1]); } } diff --git a/src/overlay011/ov11_0221F800.c b/src/overlay011/ov11_0221F800.c index 1339233abf..c64f1520af 100644 --- a/src/overlay011/ov11_0221F800.c +++ b/src/overlay011/ov11_0221F800.c @@ -430,7 +430,7 @@ const u16 * ov11_0221F800 (int param0) return v0; } -void ov11_0221F81C (PaletteSys * param0, int param1, int param2, int param3, int param4) +void ov11_0221F81C (PaletteData * param0, int param1, int param2, int param3, int param4) { const u16 * v0; diff --git a/src/overlay012/ov12_0221FC20.c b/src/overlay012/ov12_0221FC20.c index aa848bf57a..db68fd8089 100644 --- a/src/overlay012/ov12_0221FC20.c +++ b/src/overlay012/ov12_0221FC20.c @@ -29,7 +29,7 @@ #include "overlay016/struct_ov16_02264408.h" #include "overlay016/struct_ov16_02264408_sub1.h" #include "overlay016/struct_ov16_02265BBC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "spl.h" @@ -74,7 +74,7 @@ typedef struct UnkStruct_ov12_02223178_t { int unk_18; UnkStruct_02014014 * unk_1C[16]; UnkSPLStruct6 * unk_5C[20]; - CellTransferStateData * unk_AC; + SpriteRenderer * unk_AC; UnkStruct_ov16_0223E0C8 * unk_B0[4]; u8 unk_C0[4]; Sprite * unk_C4[4]; @@ -100,7 +100,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; CellActorData * unk_08; BOOL unk_0C; } UnkStruct_ov12_02221810; @@ -126,11 +126,11 @@ typedef struct UnkStruct_ov12_0221FCDC_t { UnkFuncPtr_ov12_02239EEC unk_B8; UnkStruct_ov12_02223178 * unk_BC; BGL * unk_C0; - PaletteSys * unk_C4; - AnimationResourceCollection * unk_C8[4]; + PaletteData * unk_C4; + SpriteGfxHandler * unk_C8[4]; CellActorData * unk_D8[10]; - UnkStruct_ov104_0223F9E0 unk_100; - AnimationResourceCollection * unk_134; + SpriteTemplate unk_100; + SpriteGfxHandler * unk_134; CellActorData * unk_138[5]; BOOL unk_14C[5]; UnkStruct_ov12_0222118C * unk_160[5]; @@ -768,18 +768,18 @@ CellActorData * ov12_022202C0 (UnkStruct_ov12_0221FCDC * param0, int param1) return param0->unk_138[param1]; } -AnimationResourceCollection * ov12_022202EC (UnkStruct_ov12_0221FCDC * param0) +SpriteGfxHandler * ov12_022202EC (UnkStruct_ov12_0221FCDC * param0) { GF_ASSERT(param0 != NULL); return param0->unk_134; } -AnimationResourceCollection * ov12_02220300 (UnkStruct_ov12_0221FCDC * param0) +SpriteGfxHandler * ov12_02220300 (UnkStruct_ov12_0221FCDC * param0) { return param0->unk_C8[0]; } -CellTransferStateData * ov12_02220308 (UnkStruct_ov12_0221FCDC * param0) +SpriteRenderer * ov12_02220308 (UnkStruct_ov12_0221FCDC * param0) { return param0->unk_BC->unk_AC; } @@ -1324,7 +1324,7 @@ static void ov12_02220798 (UnkStruct_ov12_0221FCDC * param0) } if (ov12_0221FDD4(param0) == 0) { - ov16_0223F9F0(); + Battle_SetDefaultBlend(); sub_02019690(ov12_022233B0(param0, 1), 0x4000, 0, ov12_0221FDE4(param0)); sub_02019EBC(ov12_02220278(param0), ov12_022233B0(param0, 1)); @@ -1965,7 +1965,7 @@ static void ov12_0222118C (SysTask * param0, void * param1) v2 = sub_020080C0(v0->unk_04.unk_04, 1); v2 -= sub_020080C0(v0->unk_04.unk_04, 41); - sub_0200D4C4(v0->unk_00, v1, v2); + SpriteActor_SetSpritePositionXY(v0->unk_00, v1, v2); } static void ov12_022211D8 (SysTask * param0, void * param1) @@ -2139,10 +2139,10 @@ static void ov12_022214C4 (UnkStruct_ov12_0221FCDC * param0) v0[4] = 0; v0[5] = 0; - sub_0200CC3C(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v0[0]); - sub_0200CDC4(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v0[1]); - sub_0200CE24(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 77, 0, v0[2]); - sub_0200CE54(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 78, 0, v0[3]); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v0[0]); + SpriteRenderer_LoadPalette(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v0[1]); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 77, 0, v0[2]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_134, param0->unk_1A0[1], 78, 0, v0[3]); } static void ov12_02221580 (UnkStruct_ov12_0221FCDC * param0) @@ -2186,7 +2186,7 @@ static void ov12_02221580 (UnkStruct_ov12_0221FCDC * param0) v0 = param0->unk_BC->unk_B0[v7]->unk_00; v10 = param0->unk_BC->unk_E8[v7]; { - UnkStruct_ov104_0223F9E0 v11; + SpriteTemplate v11; Sprite * v12 = ov12_022232FC(param0, v7); int v13; int v14; @@ -2199,21 +2199,21 @@ static void ov12_02221580 (UnkStruct_ov12_0221FCDC * param0) v16 -= sub_020080C0(v12, 41); } - v11.unk_00 = v15; - v11.unk_02 = v16; - v11.unk_04 = 0; - v11.unk_06 = 0; - v11.unk_08 = 100; - v11.unk_0C = 0; - v11.unk_10 = 1; - v11.unk_2C = 1; - v11.unk_30 = 0; + v11.x = v15; + v11.y = v16; + v11.z = 0; + v11.animIdx = 0; + v11.priority = 100; + v11.plttIdx = 0; + v11.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v11.bgPriority = 1; + v11.transferToVRAM = FALSE; for (v14 = 0; v14 < 6; v14++) { - v11.unk_14[v14] = v2[v14]; + v11.resources[v14] = v2[v14]; } - v1 = sub_0200CE6C(param0->unk_BC->unk_AC, param0->unk_134, &v11); + v1 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_134, &v11); if (v12 == NULL) { sub_0200D3F4(v1, 0); @@ -2777,7 +2777,7 @@ static BOOL ov12_02221D50 (SysTask * param0, UnkStruct_ov12_02221BBC * param1) break; case 4: if (ov12_0221FDD4(param1->unk_48) == 0) { - ov16_0223F9F0(); + Battle_SetDefaultBlend(); } else { ov17_022413D8(); } @@ -3617,7 +3617,7 @@ static void ov12_02222D84 (UnkStruct_ov12_0221FCDC * param0) v1 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - sub_0200CC3C(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[2], v1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v1 + 5000); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[2], v1, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v1 + 5000); } static void ov12_02222DCC (UnkStruct_ov12_0221FCDC * param0) @@ -3637,7 +3637,7 @@ static void ov12_02222DCC (UnkStruct_ov12_0221FCDC * param0) v2 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - sub_0200CDC4(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[3], v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v2, v1 + 5000); + SpriteRenderer_LoadPalette(param0->unk_C4, 2, param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[3], v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v2, v1 + 5000); } static void ov12_02222E2C (UnkStruct_ov12_0221FCDC * param0) @@ -3653,7 +3653,7 @@ static void ov12_02222E2C (UnkStruct_ov12_0221FCDC * param0) v1 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - sub_0200CE24(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[4], v1, 1, v1 + 5000); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[4], v1, 1, v1 + 5000); } static void ov12_02222E74 (UnkStruct_ov12_0221FCDC * param0) @@ -3669,7 +3669,7 @@ static void ov12_02222E74 (UnkStruct_ov12_0221FCDC * param0) v1 = inline_ov12_022204C4(param0->unk_18); param0->unk_18 += 1; - sub_0200CE54(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[5], v1, 1, v1 + 5000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_BC->unk_AC, param0->unk_C8[v0], param0->unk_1A0[5], v1, 1, v1 + 5000); } static void ov12_02222EBC (UnkStruct_ov12_0221FCDC * param0) @@ -3690,29 +3690,29 @@ static void ov12_02222EBC (UnkStruct_ov12_0221FCDC * param0) param0->unk_18 += 1; { - UnkStruct_ov104_0223F9E0 v6; + SpriteTemplate v6; int v7; v7 = ov12_02220248(param0); - v6.unk_00 = ov12_022258E0(param0, v7, 0); - v6.unk_02 = ov12_022258E0(param0, v7, 1); - v6.unk_04 = 0; - v6.unk_06 = 0; - v6.unk_08 = 100; - v6.unk_0C = 0; - v6.unk_10 = 1; - v6.unk_2C = 1; - v6.unk_30 = 0; + v6.x = ov12_022258E0(param0, v7, 0); + v6.y = ov12_022258E0(param0, v7, 1); + v6.z = 0; + v6.animIdx = 0; + v6.priority = 100; + v6.plttIdx = 0; + v6.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v6.bgPriority = 1; + v6.transferToVRAM = FALSE; for (v0 = 0; v0 < 6; v0++) { - v6.unk_14[v0] = inline_ov12_022204C4(param0->unk_18) + 5000; + v6.resources[v0] = inline_ov12_022204C4(param0->unk_18) + 5000; param0->unk_18 += 1; } param0->unk_100 = v6; - v4 = sub_0200CE6C(param0->unk_BC->unk_AC, param0->unk_C8[v2], &v6); + v4 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v2], &v6); } v3 = inline_ov12_022204C4(param0->unk_18); @@ -3748,29 +3748,29 @@ static void ov12_02222FC8 (UnkStruct_ov12_0221FCDC * param0) param0->unk_18 += 1; { - UnkStruct_ov104_0223F9E0 v5; + SpriteTemplate v5; int v6; v6 = ov12_02220248(param0); - v5.unk_00 = ov12_022258E0(param0, v6, 0); - v5.unk_02 = ov12_022258E0(param0, v6, 1); - v5.unk_04 = 0; - v5.unk_06 = 0; - v5.unk_08 = 100; - v5.unk_0C = 0; - v5.unk_10 = 1; - v5.unk_2C = 1; - v5.unk_30 = 0; + v5.x = ov12_022258E0(param0, v6, 0); + v5.y = ov12_022258E0(param0, v6, 1); + v5.z = 0; + v5.animIdx = 0; + v5.priority = 100; + v5.plttIdx = 0; + v5.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v5.bgPriority = 1; + v5.transferToVRAM = FALSE; for (v0 = 0; v0 < 6; v0++) { - v5.unk_14[v0] = inline_ov12_022204C4(param0->unk_18) + 5000; + v5.resources[v0] = inline_ov12_022204C4(param0->unk_18) + 5000; param0->unk_18 += 1; } param0->unk_100 = v5; - v3 = sub_0200CE6C(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v5); + v3 = SpriteActor_LoadResources(param0->unk_BC->unk_AC, param0->unk_C8[v1], &v5); GF_ASSERT(param0->unk_D8[v2] == NULL); param0->unk_D8[v2] = v3; } @@ -3944,7 +3944,7 @@ BOOL ov12_0222325C (UnkStruct_ov12_0221FCDC * param0, int param1[], int param2) return 1; } -UnkStruct_ov104_0223F9E0 ov12_0222329C (UnkStruct_ov12_0221FCDC * param0) +SpriteTemplate ov12_0222329C (UnkStruct_ov12_0221FCDC * param0) { return param0->unk_100; } @@ -3987,7 +3987,7 @@ Sprite * ov12_022232FC (UnkStruct_ov12_0221FCDC * param0, int param1) } } -PaletteSys * ov12_0222332C (UnkStruct_ov12_0221FCDC * param0) +PaletteData * ov12_0222332C (UnkStruct_ov12_0221FCDC * param0) { return param0->unk_C4; } @@ -4241,10 +4241,10 @@ UnkStruct_ov12_02223764 * ov12_022234F8 (BattleSystem * param0, int param1, int v3[4] = 0; v3[5] = 0; - sub_0200CC3C(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v3[0]); - sub_0200CDC4(v2->unk_08.unk_08, 2, v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v3[1]); - sub_0200CE24(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 77, 0, v3[2]); - sub_0200CE54(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 78, 0, v3[3]); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 76, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v3[0]); + SpriteRenderer_LoadPalette(v2->unk_08.unk_08, 2, v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 75, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, v3[1]); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 77, 0, v3[2]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2->unk_08.unk_00, v2->unk_08.unk_04, v4, 78, 0, v3[3]); } NARC_dtor(v4); @@ -4278,7 +4278,7 @@ UnkStruct_ov12_02223764 * ov12_022234F8 (BattleSystem * param0, int param1, int { int v11; - UnkStruct_ov104_0223F9E0 v12; + SpriteTemplate v12; Sprite * v13; s16 v14, v15; @@ -4292,21 +4292,21 @@ UnkStruct_ov12_02223764 * ov12_022234F8 (BattleSystem * param0, int param1, int continue; } - v12.unk_00 = v14; - v12.unk_02 = v15; - v12.unk_04 = 0; - v12.unk_06 = 0; - v12.unk_08 = v1[v2->unk_44[v5]]; - v12.unk_0C = 0; - v12.unk_10 = 1; - v12.unk_2C = 1; - v12.unk_30 = 0; + v12.x = v14; + v12.y = v15; + v12.z = 0; + v12.animIdx = 0; + v12.priority = v1[v2->unk_44[v5]]; + v12.plttIdx = 0; + v12.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v12.bgPriority = 1; + v12.transferToVRAM = FALSE; for (v11 = 0; v11 < 6; v11++) { - v12.unk_14[v11] = v9[v11]; + v12.resources[v11] = v9[v11]; } - v10 = sub_0200CE6C(v2->unk_08.unk_00, v2->unk_08.unk_04, &v12); + v10 = SpriteActor_LoadResources(v2->unk_08.unk_00, v2->unk_08.unk_04, &v12); sub_0200D330(v10); v2->unk_24[v5] = v10; @@ -4362,8 +4362,8 @@ void ov12_02223770 (UnkStruct_ov12_02223764 * param0) continue; } - sub_0200D070(param0->unk_08.unk_04, param0->unk_14[v0]); - sub_0200D080(param0->unk_08.unk_04, param0->unk_14[v0]); + SpriteGfxHandler_UnloadCharObjById(param0->unk_08.unk_04, param0->unk_14[v0]); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_08.unk_04, param0->unk_14[v0]); sub_0200D0F4(param0->unk_24[v0]); } @@ -4379,8 +4379,8 @@ void ov12_022237A4 (UnkStruct_ov12_02223764 * param0, int param1) continue; } - sub_0200D070(param0->unk_08.unk_04, param0->unk_14[v0]); - sub_0200D080(param0->unk_08.unk_04, param0->unk_14[v0]); + SpriteGfxHandler_UnloadCharObjById(param0->unk_08.unk_04, param0->unk_14[v0]); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_08.unk_04, param0->unk_14[v0]); sub_0200D0F4(param0->unk_24[v0]); } diff --git a/src/overlay012/ov12_02225864.c b/src/overlay012/ov12_02225864.c index 83495755a0..50ada81015 100644 --- a/src/overlay012/ov12_02225864.c +++ b/src/overlay012/ov12_02225864.c @@ -72,7 +72,7 @@ typedef struct UnkStruct_ov12_022267D4_t { s8 unk_15; s8 unk_16; s8 unk_17; - PaletteSys * unk_18; + PaletteData * unk_18; } UnkStruct_ov12_022267D4; static void ov12_022268DC(u16 * param0, u16 param1); @@ -217,7 +217,7 @@ u32 ov12_022259AC (fx32 param0, fx32 param1, fx32 param2) void ov12_022259DC (UnkStruct_ov12_02225F6C * param0, CellActorData * param1, s16 param2, s16 param3) { - sub_0200D4C4(param1, param2 + param0->unk_00, param3 + param0->unk_02); + SpriteActor_SetSpritePositionXY(param1, param2 + param0->unk_00, param3 + param0->unk_02); } void ov12_022259FC (UnkStruct_ov12_02225F6C * param0, CellActorData * param1) @@ -620,8 +620,8 @@ void ov12_0222605C (CellActorData * param0, s16 param1, s16 param2, fx32 param3, v1 = param1 - param2; } - sub_0200D550(param0, &v2, &v3); - sub_0200D4C4(param0, v2, v1 + v0); + SpriteActor_GetSpritePositionXY(param0, &v2, &v3); + SpriteActor_SetSpritePositionXY(param0, v2, v1 + v0); } BOOL ov12_022260A8 (UnkStruct_ov12_02225F6C * param0, CellActorData * param1) @@ -778,7 +778,7 @@ BOOL ov12_02226274 (UnkStruct_ov12_02226274 * param0) if (v1[v0]) { if (param0->unk_AE == 0) { - sub_0200D4C4(param0->unk_98[v0], param0->unk_00 + param0->unk_04[v0].unk_00, param0->unk_02 + param0->unk_04[v0].unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_98[v0], param0->unk_00 + param0->unk_04[v0].unk_00, param0->unk_02 + param0->unk_04[v0].unk_02); } else { ov12_02225FA4(¶m0->unk_04[v0], &v2, &v3); sub_0200D6E8(param0->unk_98[v0], v2, v3); @@ -1154,7 +1154,7 @@ void ov12_02226858 (UnkStruct_ov12_022267D4 * param0) Heap_FreeToHeap(param0); } -UnkStruct_ov12_022267D4 * ov12_02226870 (PaletteSys * param0, int param1, int param2, u16 param3, u16 param4, s8 param5, s8 param6, u8 param7, u8 param8, u16 param9, int param10) +UnkStruct_ov12_022267D4 * ov12_02226870 (PaletteData * param0, int param1, int param2, u16 param3, u16 param4, s8 param5, s8 param6, u8 param7, u8 param8, u16 param9, int param10) { UnkStruct_ov12_022267D4 * v0 = NULL; @@ -1203,7 +1203,7 @@ static void ov12_022268DC (u16 * param0, u16 param1) void ov12_02226924 (UnkStruct_ov12_0221FCDC * param0) { - PaletteSys * v0; + PaletteData * v0; u16 * v1; v0 = ov12_0222332C(param0); @@ -1218,7 +1218,7 @@ void ov12_02226924 (UnkStruct_ov12_0221FCDC * param0) void ov12_02226954 (UnkStruct_ov12_0221FCDC * param0) { - PaletteSys * v0; + PaletteData * v0; v0 = ov12_0222332C(param0); diff --git a/src/overlay012/ov12_022269C0.c b/src/overlay012/ov12_022269C0.c index c0f90f482b..951b895ce7 100644 --- a/src/overlay012/ov12_022269C0.c +++ b/src/overlay012/ov12_022269C0.c @@ -8,7 +8,7 @@ #include "overlay012/struct_ov12_0221FCDC_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "unk_0200D9E8.h" @@ -34,8 +34,8 @@ typedef struct { typedef struct { u8 unk_00; UnkStruct_ov12_0221FCDC * unk_04; - CellTransferStateData * unk_08; - AnimationResourceCollection * unk_0C; + SpriteRenderer * unk_08; + SpriteGfxHandler * unk_0C; CellActorData * unk_10; CellActorData * unk_14[100]; GraphicElementData * unk_1A4[10]; @@ -133,9 +133,9 @@ static void ov12_02226AAC (SysTask * param0, void * param1) switch (v0->unk_00) { case 0: - sub_0200D324(v0->unk_14[0]->unk_00); - sub_0200D324(v0->unk_14[1]->unk_00); - sub_0200D324(v0->unk_14[2]->unk_00); + SpriteActor_UpdateObject(v0->unk_14[0]->unk_00); + SpriteActor_UpdateObject(v0->unk_14[1]->unk_00); + SpriteActor_UpdateObject(v0->unk_14[2]->unk_00); sub_0200D5AC(v0->unk_14[0]->unk_00, 1, 0); sub_0200D5AC(v0->unk_14[1]->unk_00, -1, 0); @@ -155,10 +155,10 @@ static void ov12_02226AAC (SysTask * param0, void * param1) } } -void ov12_02226B1C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02226B1C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02226AAC * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v0 = Heap_AllocFromHeap(5, sizeof(UnkStruct_ov12_02226AAC)); @@ -177,7 +177,7 @@ void ov12_02226B1C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa int v2; for (v2 = 1; v2 < 3; v2++) { - v0->unk_14[v2] = sub_0200CE6C(v0->unk_08, v0->unk_0C, &v1); + v0->unk_14[v2] = SpriteActor_LoadResources(v0->unk_08, v0->unk_0C, &v1); } } diff --git a/src/overlay012/ov12_02226B84.c b/src/overlay012/ov12_02226B84.c index 568b54176f..656446d01d 100644 --- a/src/overlay012/ov12_02226B84.c +++ b/src/overlay012/ov12_02226B84.c @@ -87,8 +87,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; CellActorData * unk_14; @@ -103,7 +103,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; } UnkStruct_ov12_02227808; typedef struct { @@ -119,7 +119,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; int unk_08; s16 unk_0C; s16 unk_0E; @@ -153,7 +153,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; UnkStruct_ov12_02226454 unk_08; } UnkStruct_ov12_0222813C; @@ -321,7 +321,7 @@ typedef struct { int unk_24; BGL * unk_28; UnkStruct_ov12_0221FCDC * unk_2C; - AnimationResourceCollection * unk_30; + SpriteGfxHandler * unk_30; UnkStruct_ov12_02235998 unk_34[4]; UnkStruct_ov12_02235998 unk_84[4]; UnkStruct_ov12_02225F6C unk_D4; @@ -471,7 +471,7 @@ static void ov12_02226BA0 (SysTask * param0, void * param1) continue; } - sub_0200D4C4(v1->unk_2C[v0].unk_0C, v1->unk_2C[v0].unk_04.unk_00 + v1->unk_7C.unk_00, v1->unk_2C[v0].unk_04.unk_02 + v1->unk_7C.unk_02); + SpriteActor_SetSpritePositionXY(v1->unk_2C[v0].unk_0C, v1->unk_2C[v0].unk_04.unk_00 + v1->unk_7C.unk_00, v1->unk_2C[v0].unk_04.unk_02 + v1->unk_7C.unk_02); sub_0200D330(v1->unk_2C[v0].unk_0C); } @@ -963,7 +963,7 @@ void ov12_02227534 (UnkStruct_ov12_0221FCDC * param0) static void ov12_02227620 (UnkStruct_ov12_02227620 * param0, s16 param1, s16 param2) { sub_0200D3F4(param0->unk_14, 1); - sub_0200D4C4(param0->unk_14, param1, param2); + SpriteActor_SetSpritePositionXY(param0->unk_14, param1, param2); param0->unk_40 = 0; ov12_02225E68(¶m0->unk_18, 10, 10, 14, 4); } @@ -1038,7 +1038,7 @@ static void ov12_02227738 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_0222777C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222777C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02227620 * v0; Sprite * v1; @@ -1385,7 +1385,7 @@ void ov12_02227CBC (UnkStruct_ov12_0221FCDC * param0) sub_0200D474(v0->unk_10, 100); sub_0200D460(v0->unk_10, 1); - sub_0200D810(v0->unk_10, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_10, 2); ov12_02235780(v0->unk_00, v0->unk_38, 16 - v0->unk_38); @@ -1625,7 +1625,7 @@ void ov12_02228168 (UnkStruct_ov12_0221FCDC * param0) for (v2 = 0; v2 < 4; v2++) { if (v1 & (1 << v2)) { v3 = ov12_022202C0(v0->unk_00, v2); - sub_0200D810(v3, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v3, GX_OAM_MODE_XLU); } } @@ -2086,7 +2086,7 @@ void ov12_02228B40 (UnkStruct_ov12_0221FCDC * param0) v1->unk_24 = ov12_022202C0(v1->unk_04.unk_04, 0); - sub_0200D810(v1->unk_24, GX_OAM_MODE_OBJWND); + SpriteActor_SetOAMMode(v1->unk_24, GX_OAM_MODE_OBJWND); sub_0200D6A4(v1->unk_24, 2); sub_0200D6E8(v1->unk_24, 1.2f, 1.2f); @@ -3219,7 +3219,7 @@ static void ov12_0222A178 (SysTask * param0, void * param1) sub_0200C7EC(v1->unk_00.unk_10); } -void ov12_0222A1AC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222A1AC (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222A178 * v0 = NULL; @@ -3366,7 +3366,7 @@ static void ov12_0222A1F4 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222A34C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222A34C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222A1F478 * v0 = NULL; @@ -3382,7 +3382,7 @@ void ov12_0222A34C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa s16 v2 = ov12_022258E0(param0, v1, 0); s16 v3 = ov12_022258E0(param0, v1, 1); - sub_0200D4C4(v0->unk_1C, v2, v3); + SpriteActor_SetSpritePositionXY(v0->unk_1C, v2, v3); } if (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4) { @@ -3415,7 +3415,7 @@ static void ov12_0222A3DC (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222A410 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222A410 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222A3DC * v0; @@ -3443,7 +3443,7 @@ void ov12_0222A410 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa } } - sub_0200D4C4(v0->unk_1C, v3, v4); + SpriteActor_SetSpritePositionXY(v0->unk_1C, v3, v4); sub_0200D364(v0->unk_1C, v1); } @@ -3471,7 +3471,7 @@ static void ov12_0222A4A0 (SysTask * param0, void * param1) BOOL v2 = sub_0200D3B8(v0->unk_1C); if (v2 == 0) { - sub_0200D810(v0->unk_1C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); v0->unk_20 = 16; v0->unk_21 = 0; ov12_02235780(v0->unk_00.unk_04, v0->unk_20, v0->unk_21); @@ -3505,7 +3505,7 @@ static void ov12_0222A4A0 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222A5C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222A5C0 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222A4A0 * v0; @@ -3513,7 +3513,7 @@ void ov12_0222A5C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa ov12_0223595C(param0, &v0->unk_00); v0->unk_1C = param3; - sub_0200D4C4(v0->unk_1C, -30, 160); + SpriteActor_SetSpritePositionXY(v0->unk_1C, -30, 160); sub_0200D460(v0->unk_1C, ov12_02223428(v0->unk_00.unk_04, 2)); ov12_022201E8(v0->unk_00.unk_04, ov12_0222A4A0, v0); @@ -3616,7 +3616,7 @@ static void ov12_0222A624 (UnkStruct_ov12_0222A624 * param0) { s16 v0, v1; - sub_0200D550(param0->unk_1C, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_1C, &v0, &v1); if (v1 > 130) { sub_0200D3F4(param0->unk_1C, 0); diff --git a/src/overlay012/ov12_0222AC70.c b/src/overlay012/ov12_0222AC70.c index 62484fd2ff..4852074a09 100644 --- a/src/overlay012/ov12_0222AC70.c +++ b/src/overlay012/ov12_0222AC70.c @@ -18,7 +18,7 @@ #include "overlay012/struct_ov12_02235350.h" #include "overlay012/struct_ov12_0223595C.h" #include "overlay012/struct_ov12_02235998.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_0200762C.h" @@ -39,8 +39,8 @@ typedef struct { u8 unk_05; u8 unk_06; UnkStruct_ov12_0221FCDC * unk_08; - CellTransferStateData * unk_0C; - AnimationResourceCollection * unk_10; + SpriteRenderer * unk_0C; + SpriteGfxHandler * unk_10; CellActorData * unk_14[3]; UnkStruct_ov12_02225F6C unk_20; } UnkStruct_ov12_0222AC70; @@ -79,7 +79,7 @@ typedef struct { s16 unk_0A; UnkStruct_ov12_0221FCDC * unk_0C; Sprite * unk_10; - AnimationResourceCollection * unk_14; + SpriteGfxHandler * unk_14; CellActorData * unk_18[4]; UnkStruct_ov12_02225F6C unk_28[4]; } UnkStruct_ov12_0222B4C8; @@ -117,7 +117,7 @@ typedef struct { typedef struct { u8 unk_00; u8 unk_01; - PaletteSys * unk_04; + PaletteData * unk_04; UnkStruct_ov12_0221FCDC * unk_08; UnkStruct_ov12_022267D4 * unk_0C; Sprite * unk_10; @@ -139,7 +139,7 @@ typedef struct { u8 unk_00; u8 unk_01; UnkStruct_ov12_0221FCDC * unk_04; - AnimationResourceCollection * unk_08; + SpriteGfxHandler * unk_08; CellActorData * unk_0C; CellActorData * unk_10; } UnkStruct_ov12_0222BFF4; @@ -159,7 +159,7 @@ typedef struct { s8 unk_08; Sprite * unk_0C; UnkStruct_ov12_0221FCDC * unk_10; - AnimationResourceCollection * unk_14; + SpriteGfxHandler * unk_14; UnkStruct_ov12_0222C1A4_sub1 unk_18[3]; } UnkStruct_ov12_0222C1A4; @@ -171,7 +171,7 @@ typedef struct { int unk_04; BGL * unk_08; UnkStruct_ov12_0221FCDC * unk_0C; - AnimationResourceCollection * unk_10; + SpriteGfxHandler * unk_10; UnkStruct_ov12_02235998 unk_14[4]; UnkStruct_ov12_02235998 unk_64[4]; UnkStruct_ov12_02225F6C unk_B4; @@ -185,7 +185,7 @@ typedef struct { UnkStruct_ov12_02235350 unk_04; BGL * unk_08; UnkStruct_ov12_0221FCDC * unk_0C; - AnimationResourceCollection * unk_10; + SpriteGfxHandler * unk_10; Sprite * unk_14; CellActorData * unk_18; UnkStruct_ov12_02225F6C unk_1C; @@ -269,8 +269,8 @@ typedef struct { int unk_08; u8 unk_0C; UnkStruct_ov12_0221FCDC * unk_10; - CellTransferStateData * unk_14; - AnimationResourceCollection * unk_18; + SpriteRenderer * unk_14; + SpriteGfxHandler * unk_18; Sprite * unk_1C; s16 unk_20; int unk_24; @@ -300,7 +300,7 @@ static void ov12_0222AC70 (SysTask * param0, void * param1) for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { { s16 v2, v3; - sub_0200D550(v1->unk_14[v0], &v2, &v3); + SpriteActor_GetSpritePositionXY(v1->unk_14[v0], &v2, &v3); } if (v1->unk_04 >= Unk_ov12_0223A09E[v0][0]) { @@ -373,17 +373,17 @@ static void ov12_0222AC70 (SysTask * param0, void * param1) } for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - sub_0200D324(v1->unk_14[v0]->unk_00); + SpriteActor_UpdateObject(v1->unk_14[v0]->unk_00); } sub_0200C7EC(v1->unk_10); } -void ov12_0222AE68 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222AE68 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; UnkStruct_ov12_0222AC70 * v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v1 = Heap_AllocFromHeap(ov12_0221FDE4(param0), sizeof(UnkStruct_ov12_0222AC70)); @@ -416,18 +416,18 @@ void ov12_0222AE68 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa } for (v0 = 1; v0 < ov12_02220280(v1->unk_08, 0); v0++) { - v1->unk_14[v0] = sub_0200CE6C(v1->unk_0C, v1->unk_10, &v2); - sub_0200D4C4(v1->unk_14[v0], v3.unk_00, v3.unk_02); + v1->unk_14[v0] = SpriteActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); + SpriteActor_SetSpritePositionXY(v1->unk_14[v0], v3.unk_00, v3.unk_02); } - sub_0200D4C4(v1->unk_14[0], v3.unk_00, v3.unk_02); + SpriteActor_SetSpritePositionXY(v1->unk_14[0], v3.unk_00, v3.unk_02); } for (v0 = 0; v0 < ov12_02220280(v1->unk_08, 0); v0++) { v1->unk_01[v0] = 0; sub_0200D6A4(v1->unk_14[v0], 2); sub_0200D5DC(v1->unk_14[v0], 0, 32 - (v0 * 4)); - sub_0200D810(v1->unk_14[v0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); } ov12_022201CC(param0, ov12_0222AC70, v1, 0x1000); @@ -657,7 +657,7 @@ static void ov12_0222B4C8 (SysTask * param0, void * param1) if (ov12_02225C14(&v2->unk_28[v0]) == 0) { v1++; } else { - sub_0200D4C4(v2->unk_18[v0], v2->unk_28[v0].unk_00, v2->unk_28[v0].unk_02); + SpriteActor_SetSpritePositionXY(v2->unk_18[v0], v2->unk_28[v0].unk_00, v2->unk_28[v0].unk_02); } sub_0200D330(v2->unk_18[v0]); @@ -724,7 +724,7 @@ void ov12_0222B68C (UnkStruct_ov12_0221FCDC * param0) for (v1 = 0; v1 < 4; v1++) { v0->unk_18[v1] = ov12_022202C0(v0->unk_0C, v1); - sub_0200D810(v0->unk_18[v1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); } if (ov12_0223525C(v0->unk_0C, ov12_02220240(v0->unk_0C)) == 0x3) { @@ -1097,7 +1097,7 @@ static void ov12_0222BFF4 (SysTask * param0, void * param1) case 1: sub_0200D3F4(v0->unk_0C, 1); sub_0200D3F4(v0->unk_10, 1); - sub_0200D810(v0->unk_10, GX_OAM_MODE_OBJWND); + SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_OBJWND); v0->unk_00++; break; case 2: @@ -1208,8 +1208,8 @@ static void ov12_0222C1A4 (SysTask * param0, void * param1) s16 v5; s16 v6; - sub_0200D550(v2->unk_18[v0].unk_04, &v5, &v6); - sub_0200D4C4(v2->unk_18[v0].unk_04, v5, v2->unk_02); + SpriteActor_GetSpritePositionXY(v2->unk_18[v0].unk_04, &v5, &v6); + SpriteActor_SetSpritePositionXY(v2->unk_18[v0].unk_04, v5, v2->unk_02); sub_0200D6E8(v2->unk_18[v0].unk_04, 1.0f * v2->unk_08, 1.0f); } v2->unk_18[v0].unk_00 = 0; @@ -1224,7 +1224,7 @@ static void ov12_0222C1A4 (SysTask * param0, void * param1) break; case 2: for (v0 = 0; v0 < 3; v0++) { - sub_0200D810(v2->unk_18[v0].unk_04, GX_OAM_MODE_NORMAL); + SpriteActor_SetOAMMode(v2->unk_18[v0].unk_04, GX_OAM_MODE_NORMAL); ov12_02225EF0(&v2->unk_18[v0].unk_08, 5, 100, 5, 100, 100, 5); } @@ -1286,7 +1286,7 @@ void ov12_0222C3C0 (UnkStruct_ov12_0221FCDC * param0) v0->unk_18[v1].unk_04 = ov12_022202C0(v0->unk_10, v1); sub_0200D6A4(v0->unk_18[v1].unk_04, 2); - sub_0200D810(v0->unk_18[v1].unk_04, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18[v1].unk_04, GX_OAM_MODE_XLU); sub_0200D474(v0->unk_18[v1].unk_04, v1 + 1); } } @@ -1431,7 +1431,7 @@ static void ov12_0222C678 (SysTask * param0, void * param1) ov12_02226138(&v0->unk_1C); ov12_02226454(&v0->unk_64); - sub_0200D4C4(v0->unk_18, v0->unk_40.unk_00, v0->unk_40.unk_02); + SpriteActor_SetSpritePositionXY(v0->unk_18, v0->unk_40.unk_00, v0->unk_40.unk_02); sub_0200D330(v0->unk_18); sub_0200C7EC(v0->unk_10); break; @@ -1476,7 +1476,7 @@ void ov12_0222C6D4 (UnkStruct_ov12_0221FCDC * param0) ov12_022357BC(v0->unk_0C, (1 << ov12_022233EC(param0, 2)) | GX_BLEND_PLANEMASK_BD | (1 << ov12_022233EC(param0, 1)) | GX_WND_PLANEMASK_BG0, 0xffffffff, 0xffffffff); ov12_02226424(&v0->unk_64, 31, 0, 0, 31, (20 - 5)); - sub_0200D810(v0->unk_18, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18, GX_OAM_MODE_XLU); ov12_022201E8(v0->unk_0C, ov12_0222C678, v0); } @@ -1685,8 +1685,8 @@ static void ov12_0222CACC (SysTask * param0, void * param1) if (ov12_02226138(&v1->unk_40[0]) == 0) { v1->unk_00.unk_00++; } else { - sub_0200D4C4(v1->unk_38[0], +v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); - sub_0200D4C4(v1->unk_38[1], -v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); + SpriteActor_SetSpritePositionXY(v1->unk_38[0], +v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); + SpriteActor_SetSpritePositionXY(v1->unk_38[1], -v1->unk_28[1].unk_00 + v1->unk_40[0].unk_00, v1->unk_28[1].unk_02 + v1->unk_40[0].unk_02); sub_0200D330(v1->unk_38[0]); sub_0200D330(v1->unk_38[1]); } @@ -1738,7 +1738,7 @@ static void ov12_0222CBFC (SysTask * param0, void * param1) sub_0200C7EC(v1->unk_10.unk_10); } -void ov12_0222CC54 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222CC54 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; int v1; @@ -1805,7 +1805,7 @@ static void ov12_0222CDF0 (SysTask * param0, void * param1) ov12_02225FA4(&v0->unk_9C, &v1, &v2); sub_0200D6E8(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - sub_0200D4C4(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); + SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); if (v0->unk_0C < v0->unk_10) { v0->unk_0C++; @@ -1833,7 +1833,7 @@ static void ov12_0222CDF0 (SysTask * param0, void * param1) ov12_02225FA4(&v0->unk_9C, &v4, &v5); sub_0200D6E8(v0->unk_40, v4, v5); v6 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - sub_0200D4C4(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v6); + SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v6); if (v0->unk_0C > v0->unk_0E) { v0->unk_0C--; @@ -1913,9 +1913,9 @@ void ov12_0222CFA0 (UnkStruct_ov12_0221FCDC * param0) v0->unk_12 = +1; } - sub_0200D4C4(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02); + SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02); sub_0200D6A4(v0->unk_40, 2); - sub_0200D810(v0->unk_40, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_40, GX_OAM_MODE_XLU); { f32 v1, v2; @@ -1928,7 +1928,7 @@ void ov12_0222CFA0 (UnkStruct_ov12_0221FCDC * param0) sub_0200D6E8(v0->unk_40, v1, v2); v3 = ov12_02225FD4(v0->unk_14.unk_02, 16, v0->unk_9C.unk_04[4]); - sub_0200D4C4(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); + SpriteActor_SetSpritePositionXY(v0->unk_40, v0->unk_14.unk_00, v0->unk_14.unk_02 + v3); } ov12_022201E8(v0->unk_18.unk_04, ov12_0222CDF0, v0); @@ -1978,7 +1978,7 @@ static void ov12_0222D128 (SysTask * param0, void * param1) { s16 v3, v4; - sub_0200D550(v1->unk_30[0].unk_00, &v3, &v4); + SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v3, &v4); if (v4 <= ((40 - 16 + 20 + 10) + 50)) { sub_0200D5DC(v1->unk_30[0].unk_00, 0, 2); @@ -1992,7 +1992,7 @@ static void ov12_0222D128 (SysTask * param0, void * param1) { s16 v5, v6; - sub_0200D550(v1->unk_30[0].unk_00, &v5, &v6); + SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v5, &v6); if (v6 <= (((40 - 16 + 20 + 10) + 50))) { sub_0200D5DC(v1->unk_30[0].unk_00, 0, 2); @@ -2027,8 +2027,8 @@ static void ov12_0222D128 (SysTask * param0, void * param1) { s16 v7, v8, v9, v10; - sub_0200D550(v1->unk_30[0].unk_00, &v7, &v8); - sub_0200D550(v1->unk_30[1].unk_00, &v9, &v10); + SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v7, &v8); + SpriteActor_GetSpritePositionXY(v1->unk_30[1].unk_00, &v9, &v10); ov12_02226728(v7, v8, v9, v10, &v1->unk_C8, &v1->unk_CA); ov12_02226744(v7, v8, v1->unk_C8, v1->unk_CA, &v1->unk_2C); @@ -2050,8 +2050,8 @@ static void ov12_0222D128 (SysTask * param0, void * param1) {+1, -1}, }; - sub_0200D550(v1->unk_30[0].unk_00, &v11, &v12); - sub_0200D550(v1->unk_30[1].unk_00, &v13, &v14); + SpriteActor_GetSpritePositionXY(v1->unk_30[0].unk_00, &v11, &v12); + SpriteActor_GetSpritePositionXY(v1->unk_30[1].unk_00, &v13, &v14); ov12_02225C98(&v1->unk_30[0].unk_04[0], &v1->unk_30[0].unk_04[1], v11, v13, v12, v14, 10, v1->unk_2C * v15[v1->unk_0C][0]); ov12_02225C98(&v1->unk_30[1].unk_04[0], &v1->unk_30[1].unk_04[1], v13, v11, v14, v12, 10, v1->unk_2C * v15[v1->unk_0C][1]); @@ -2113,7 +2113,7 @@ static void ov12_0222D128 (SysTask * param0, void * param1) s16 v18, v19; for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - sub_0200D550(v1->unk_30[v0].unk_00, &v18, &v19); + SpriteActor_GetSpritePositionXY(v1->unk_30[v0].unk_00, &v18, &v19); if (v19 < 80) { sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10)); @@ -2138,11 +2138,11 @@ static void ov12_0222D128 (SysTask * param0, void * param1) sub_0200C7EC(v1->unk_18); } -void ov12_0222D56C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222D56C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; UnkStruct_ov12_0222D128 * v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v1 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_0222D128)); @@ -2165,21 +2165,21 @@ void ov12_0222D56C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { for (v0 = 1; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - v1->unk_30[v0].unk_00 = sub_0200CE6C(v1->unk_14, v1->unk_18, &v2); + v1->unk_30[v0].unk_00 = SpriteActor_LoadResources(v1->unk_14, v1->unk_18, &v2); } } for (v0 = 0; v0 < ov12_02220280(v1->unk_10, 0); v0++) { - sub_0200D810(v1->unk_30[v0].unk_00, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v1->unk_30[v0].unk_00, GX_OAM_MODE_XLU); sub_0200D460(v1->unk_30[v0].unk_00, ov12_0222339C(v1->unk_10) + 1); } if (ov12_0221FDD4(param0) == 1) { - sub_0200D4C4(v1->unk_30[0].unk_00, 180 - 20, (40 - 16 + 20 + 10)); - sub_0200D4C4(v1->unk_30[1].unk_00, 100 - 20, (25 - 16 + 20 + 10)); + SpriteActor_SetSpritePositionXY(v1->unk_30[0].unk_00, 180 - 20, (40 - 16 + 20 + 10)); + SpriteActor_SetSpritePositionXY(v1->unk_30[1].unk_00, 100 - 20, (25 - 16 + 20 + 10)); } else { - sub_0200D4C4(v1->unk_30[0].unk_00, 100, (40 - 16 + 20 + 10)); - sub_0200D4C4(v1->unk_30[1].unk_00, 180, (25 - 16 + 20 + 10)); + SpriteActor_SetSpritePositionXY(v1->unk_30[0].unk_00, 100, (40 - 16 + 20 + 10)); + SpriteActor_SetSpritePositionXY(v1->unk_30[1].unk_00, 180, (25 - 16 + 20 + 10)); } ov12_022201E8(v1->unk_10, ov12_0222D128, v1); diff --git a/src/overlay012/ov12_0222D6B0.c b/src/overlay012/ov12_0222D6B0.c index 6d3f070a93..2a0e5342e4 100644 --- a/src/overlay012/ov12_0222D6B0.c +++ b/src/overlay012/ov12_0222D6B0.c @@ -14,7 +14,7 @@ #include "overlay012/struct_ov12_02226454.h" #include "overlay012/struct_ov12_02235350.h" #include "overlay012/struct_ov12_0223595C.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200762C.h" #include "unk_0200C6E4.h" @@ -34,8 +34,8 @@ typedef struct { u8 unk_06; u8 unk_07; UnkStruct_ov12_0221FCDC * unk_08; - CellTransferStateData * unk_0C; - AnimationResourceCollection * unk_10; + SpriteRenderer * unk_0C; + SpriteGfxHandler * unk_10; CellActorData * unk_14[3]; UnkStruct_ov12_02225F6C unk_20; } UnkStruct_ov12_0222D6B0; @@ -48,8 +48,8 @@ typedef struct { u8 unk_09; u8 unk_0A; UnkStruct_ov12_0221FCDC * unk_0C; - CellTransferStateData * unk_10; - AnimationResourceCollection * unk_14; + SpriteRenderer * unk_10; + SpriteGfxHandler * unk_14; CellActorData * unk_18[6]; int unk_30; CellActorData * unk_34; @@ -60,8 +60,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; u8 unk_0C; u8 unk_0D; u8 unk_0E; @@ -79,8 +79,8 @@ typedef struct { u8 unk_03; u8 unk_04; UnkStruct_ov12_0221FCDC * unk_08; - CellTransferStateData * unk_0C; - AnimationResourceCollection * unk_10; + SpriteRenderer * unk_0C; + SpriteGfxHandler * unk_10; UnkStruct_ov12_0222DC98 unk_14[20]; int unk_514[20]; } UnkStruct_ov12_0222DE24; @@ -139,7 +139,7 @@ static void ov12_0222D6B0 (SysTask * param0, void * param1) for (v0 = 0; v0 < v1->unk_05; v0++) { { s16 v2, v3; - sub_0200D550(v1->unk_14[v0], &v2, &v3); + SpriteActor_GetSpritePositionXY(v1->unk_14[v0], &v2, &v3); } if (v1->unk_04 >= Unk_ov12_0223A144[v0][0]) { @@ -182,17 +182,17 @@ static void ov12_0222D6B0 (SysTask * param0, void * param1) } for (v0 = 0; v0 < v1->unk_05; v0++) { - sub_0200D324(v1->unk_14[v0]->unk_00); + SpriteActor_UpdateObject(v1->unk_14[v0]->unk_00); } sub_0200C7EC(v1->unk_10); } -void ov12_0222D7C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222D7C0 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; UnkStruct_ov12_0222D6B0 * v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v1 = Heap_AllocFromHeap(ov12_0221FDE4(param0), sizeof(UnkStruct_ov12_0222D6B0)); @@ -216,7 +216,7 @@ void ov12_0222D7C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { for (v0 = 1; v0 < v1->unk_05; v0++) { - v1->unk_14[v0] = sub_0200CE6C(v1->unk_0C, v1->unk_10, &v2); + v1->unk_14[v0] = SpriteActor_LoadResources(v1->unk_0C, v1->unk_10, &v2); } } @@ -227,7 +227,7 @@ void ov12_0222D7C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D364(v1->unk_14[0], 1); } - sub_0200D4C4(v1->unk_14[0], 128, 80); + SpriteActor_SetSpritePositionXY(v1->unk_14[0], 128, 80); } else { if ((ov12_0223525C(param0, ov12_02220248(param0)) == 0x4) && (ov12_0223525C(param0, ov12_02220240(param0)) == 0x4)) { sub_0200D364(v1->unk_14[0], 1); @@ -235,13 +235,13 @@ void ov12_0222D7C0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D364(v1->unk_14[0], 0); } - sub_0200D4C4(v1->unk_14[0], 128, 80); + SpriteActor_SetSpritePositionXY(v1->unk_14[0], 128, 80); } for (v0 = 0; v0 < v1->unk_05; v0++) { v1->unk_01[v0] = 0; sub_0200D6A4(v1->unk_14[v0], 2); - sub_0200D810(v1->unk_14[v0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v1->unk_14[v0], GX_OAM_MODE_XLU); if (ov12_0221FDD4(v1->unk_08) == 1) { sub_0200D6E8(v1->unk_14[v0], -1.0f, 1.0f); @@ -334,10 +334,10 @@ static void ov12_0222D934 (SysTask * param0, void * param1) { s16 v3, v4; - sub_0200D550(v2->unk_34, &v3, &v4); + SpriteActor_GetSpritePositionXY(v2->unk_34, &v3, &v4); ov12_02225BC8(&v2->unk_3C, v3, Unk_ov12_0223A17A[v2->unk_30][0].unk_00, v4, Unk_ov12_0223A17A[v2->unk_30][0].unk_02, Unk_ov12_0223A140[v2->unk_30]); - sub_0200D550(v2->unk_38, &v3, &v4); + SpriteActor_GetSpritePositionXY(v2->unk_38, &v3, &v4); ov12_02225BC8(&v2->unk_60, v3, Unk_ov12_0223A17A[v2->unk_30][1].unk_00, v4, Unk_ov12_0223A17A[v2->unk_30][1].unk_02, Unk_ov12_0223A140[v2->unk_30]); } v2->unk_30++; @@ -402,18 +402,18 @@ static void ov12_0222D934 (SysTask * param0, void * param1) if ((v2->unk_00 < 3) && (v1 == 0)) { for (v0 = 0; v0 < v2->unk_08; v0++) { - sub_0200D324(v2->unk_18[v0]->unk_00); + SpriteActor_UpdateObject(v2->unk_18[v0]->unk_00); } } sub_0200C7EC(v2->unk_14); } -void ov12_0222DB60 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222DB60 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; UnkStruct_ov12_0222D934 * v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v1 = Heap_AllocFromHeap(ov12_0221FDE4(param0), sizeof(UnkStruct_ov12_0222D934)); @@ -439,7 +439,7 @@ void ov12_0222DB60 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { for (v0 = 1; v0 < v1->unk_08; v0++) { - v1->unk_18[v0] = sub_0200CE6C(v1->unk_10, v1->unk_14, &v2); + v1->unk_18[v0] = SpriteActor_LoadResources(v1->unk_10, v1->unk_14, &v2); } } @@ -454,8 +454,8 @@ void ov12_0222DB60 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa for (v0 = 0; v0 < v1->unk_08; v0++) { sub_0200D390(v1->unk_18[v0], 1); - sub_0200D4C4(v1->unk_18[v0], Unk_ov12_0223A162[v0].unk_00, Unk_ov12_0223A162[v0].unk_02); - sub_0200D810(v1->unk_18[v0], GX_OAM_MODE_XLU); + SpriteActor_SetSpritePositionXY(v1->unk_18[v0], Unk_ov12_0223A162[v0].unk_00, Unk_ov12_0223A162[v0].unk_02); + SpriteActor_SetOAMMode(v1->unk_18[v0], GX_OAM_MODE_XLU); } sub_0200D3F4(v1->unk_18[1], 0); @@ -535,7 +535,7 @@ static void ov12_0222DC98 (SysTask * param0, void * param1) v2 = 10 + (LCRNG_Next() % 10); - sub_0200D550(v0->unk_10, &v1.unk_00, &v1.unk_02); + SpriteActor_GetSpritePositionXY(v0->unk_10, &v1.unk_00, &v1.unk_02); ov12_02225BC8(&v0->unk_14, v1.unk_00, Unk_ov12_0223A14A[v0->unk_0F].unk_00, v1.unk_02, Unk_ov12_0223A14A[v0->unk_0F].unk_02, v2); v0->unk_0C++; } @@ -632,12 +632,12 @@ static const s16 Unk_ov12_0223A19A[][4] = { {0x50, 0x92, 0x32, 0x35} }; -void ov12_0222DEFC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222DEFC (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { int v0; int v1; UnkStruct_ov12_0222DE24 * v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; v2 = Heap_AllocFromHeap(ov12_0221FDE4(param0), sizeof(UnkStruct_ov12_0222DE24)); GF_ASSERT(v2 != NULL); @@ -663,7 +663,7 @@ void ov12_0222DEFC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa for (v1 = 0; v1 < v2->unk_02; v1++) { if (v1 != 0) { - v2->unk_14[v1].unk_10 = sub_0200CE6C(v2->unk_0C, v2->unk_10, &v3); + v2->unk_14[v1].unk_10 = SpriteActor_LoadResources(v2->unk_0C, v2->unk_10, &v3); } v6 = v2->unk_14[v1].unk_10; @@ -681,7 +681,7 @@ void ov12_0222DEFC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v4 = Unk_ov12_0223A19A[v0][1] + (LCRNG_Next() % Unk_ov12_0223A19A[v0][3]); v5 = Unk_ov12_0223A19A[v0][0] + (LCRNG_Next() % Unk_ov12_0223A19A[v0][2]); - sub_0200D4C4(v6, v4, v5); + SpriteActor_SetSpritePositionXY(v6, v4, v5); sub_0200D6A4(v6, 2); sub_0200D6E8(v6, v2->unk_14[v1].unk_38, v2->unk_14[v1].unk_38); sub_0200D3F4(v6, 0); @@ -764,14 +764,14 @@ void ov12_0222E1A8 (UnkStruct_ov12_0221FCDC * param0) ov12_0223595C(param0, &v0->unk_04); v0->unk_20 = ov12_022202C0(v0->unk_04.unk_04, 0); - sub_0200D810(v0->unk_20, GX_OAM_MODE_OBJWND); + SpriteActor_SetOAMMode(v0->unk_20, GX_OAM_MODE_OBJWND); GX_SetVisibleWnd(GX_WNDMASK_OW); G2_SetWndOutsidePlane(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ, 0); G2_SetWndOBJInsidePlane(GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG2 | GX_WND_PLANEMASK_OBJ, 0); v0->unk_24 = ov12_022202C0(v0->unk_04.unk_04, 1); - sub_0200D810(v0->unk_24, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_24, GX_OAM_MODE_XLU); ov12_02226424(&v0->unk_2C, 16, 2, 2, 16, 16); ov12_02222590(v0->unk_04.unk_04, 2); @@ -828,7 +828,7 @@ static void ov12_0222E25C (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222E2F8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222E2F8 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222E25C * v0 = NULL; @@ -839,7 +839,7 @@ void ov12_0222E2F8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { int v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v2 = ov12_0222329C(v0->unk_00.unk_04); @@ -848,7 +848,7 @@ void ov12_0222E2F8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa for (v1 = 1; v1 < 4; v1++) { v0->unk_1E[v1] = 0; - v0->unk_28[v1] = sub_0200CE6C(v0->unk_00.unk_08, v0->unk_00.unk_10, &v2); + v0->unk_28[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v2); } sub_0200D7D4(v0->unk_28[0], 1); @@ -887,10 +887,10 @@ static void ov12_0222E390 (SysTask * param0, void * param1) if (v0->unk_22[0] == 110) { ov12_02235780(v0->unk_00.unk_04, 0xffffffff, 0xffffffff); - sub_0200D810(v0->unk_2C[0], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[1], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[2], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[3], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); v0->unk_54 = 15; v0->unk_58 = 0; @@ -924,10 +924,10 @@ static void ov12_0222E390 (SysTask * param0, void * param1) if (v0->unk_22[0] == 110) { ov12_02235780(v0->unk_00.unk_04, 0xffffffff, 0xffffffff); - sub_0200D810(v0->unk_2C[0], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[1], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[2], GX_OAM_MODE_XLU); - sub_0200D810(v0->unk_2C[3], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[2], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_2C[3], GX_OAM_MODE_XLU); v0->unk_54 = 15; v0->unk_58 = 0; @@ -967,7 +967,7 @@ static void ov12_0222E390 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222E61C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222E61C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222E390 * v0 = NULL; @@ -979,7 +979,7 @@ void ov12_0222E61C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { int v1; s16 v2, v3; - UnkStruct_ov104_0223F9E0 v4; + SpriteTemplate v4; v4 = ov12_0222329C(v0->unk_00.unk_04); @@ -988,7 +988,7 @@ void ov12_0222E61C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa for (v1 = 1; v1 < 4; v1++) { v0->unk_22[v1] = (LCRNG_Next() % 4) + (v1 * 5); - v0->unk_2C[v1] = sub_0200CE6C(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); + v0->unk_2C[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); } sub_0200D7D4(v0->unk_2C[1], 1); @@ -1013,7 +1013,7 @@ void ov12_0222E61C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa } for (v1 = 0; v1 < 4; v1++) { - sub_0200D4C4(v0->unk_2C[v1], v5, v6); + SpriteActor_SetSpritePositionXY(v0->unk_2C[v1], v5, v6); } } diff --git a/src/overlay012/ov12_0222E91C.c b/src/overlay012/ov12_0222E91C.c index d0b625a09d..d59cce5ed8 100644 --- a/src/overlay012/ov12_0222E91C.c +++ b/src/overlay012/ov12_0222E91C.c @@ -14,7 +14,7 @@ #include "overlay012/struct_ov12_0223595C.h" #include "overlay012/struct_ov12_02235998.h" #include "overlay012/struct_ov12_022380DC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_0200762C.h" @@ -178,14 +178,14 @@ void ov12_0222EAA0 (UnkStruct_ov12_0221FCDC * param0) v2 = sub_0201FAB4(sub_02021F9C(v1->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); sub_02003B08(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); - sub_0200D810(v1, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); v1 = v0->unk_30; sub_0200D460(v1, ov12_0222339C(v0->unk_00.unk_04) + 1); v2 = sub_0201FAB4(sub_02021F9C(v1->unk_00), NNS_G2D_VRAM_TYPE_2DMAIN); sub_02003B08(ov12_0222332C(v0->unk_00.unk_04), v4, v3, ov12_0221FDE4(v0->unk_00.unk_04), 2, 0x20, v2 * 16, 196, 196, 196); - sub_0200D810(v1, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v1, GX_OAM_MODE_XLU); } ov12_022201E8(v0->unk_00.unk_04, ov12_0222E91C, v0); @@ -228,7 +228,7 @@ static void ov12_0222EC18 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_00.unk_10); } -void ov12_0222EC90 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222EC90 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222EC18 * v0 = NULL; @@ -242,13 +242,13 @@ void ov12_0222EC90 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa { s16 v2, v3; - UnkStruct_ov104_0223F9E0 v4; + SpriteTemplate v4; v4 = ov12_0222329C(v0->unk_00.unk_04); v0->unk_30[0] = param3; for (v1 = 1; v1 < 8; v1++) { - v0->unk_30[v1] = sub_0200CE6C(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); + v0->unk_30[v1] = SpriteActor_LoadResources(v0->unk_00.unk_08, v0->unk_00.unk_10, &v4); if (v1 % 2) { sub_0200D7D4(v0->unk_30[v1], 1); @@ -286,7 +286,7 @@ void ov12_0222EC90 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v11 % 2) { if (v13 == 0) { if (v12 < 8) { - sub_0200D4C4(v0->unk_30[v12], v0->unk_50.unk_00, v0->unk_50.unk_02); + SpriteActor_SetSpritePositionXY(v0->unk_30[v12], v0->unk_50.unk_00, v0->unk_50.unk_02); v12++; } } else { @@ -416,8 +416,8 @@ void ov12_0222EFB0 (UnkStruct_ov12_0221FCDC * param0) v0->unk_36 = +1; } - sub_0200D550(v0->unk_1C[1], &v2, &v3); - sub_0200D4C4(v0->unk_1C[0], v2 + v4, v3); + SpriteActor_GetSpritePositionXY(v0->unk_1C[1], &v2, &v3); + SpriteActor_SetSpritePositionXY(v0->unk_1C[0], v2 + v4, v3); sub_0200D6A4(v0->unk_1C[0], 2); sub_0200D6E8(v0->unk_1C[0], v0->unk_2C * v0->unk_36, v0->unk_30); } @@ -444,7 +444,7 @@ void ov12_0222EFB0 (UnkStruct_ov12_0221FCDC * param0) v9 = ov12_02235254(v0->unk_00.unk_04, v8); ov12_02235350(v9, ov12_0221FDD4(v0->unk_00.unk_04), &v11); - sub_0200D550(v0->unk_1C[0], &v12.unk_00, &v12.unk_02); + SpriteActor_GetSpritePositionXY(v0->unk_1C[0], &v12.unk_00, &v12.unk_02); { int v13; @@ -463,7 +463,7 @@ void ov12_0222EFB0 (UnkStruct_ov12_0221FCDC * param0) v7 = LoadPokemonSpriteYOffset(ov12_022232D0(v0->unk_00.unk_04, v8), ov12_022232C4(v0->unk_00.unk_04, v8), v13, ov12_022232E0(v0->unk_00.unk_04, v8), ov12_022232EC(v0->unk_00.unk_04, v8)); } - sub_0200D4C4(v0->unk_1C[0], v12.unk_00, v11.unk_02 + v7); + SpriteActor_SetSpritePositionXY(v0->unk_1C[0], v12.unk_00, v11.unk_02 + v7); } sub_0200D3F4(v0->unk_1C[0], 1); diff --git a/src/overlay012/ov12_0222F700.c b/src/overlay012/ov12_0222F700.c index a6d6d78ca1..d16e526b03 100644 --- a/src/overlay012/ov12_0222F700.c +++ b/src/overlay012/ov12_0222F700.c @@ -17,7 +17,7 @@ #include "overlay012/struct_ov12_02225F6C.h" #include "overlay012/struct_ov12_02226274.h" #include "overlay012/struct_ov12_02226454.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_0200762C.h" @@ -34,7 +34,7 @@ typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; Sprite * unk_08; UnkStruct_ov12_02225F6C unk_0C; CellActorData * unk_30[2]; @@ -68,8 +68,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; UnkStruct_ov12_0222FAFC unk_0C; UnkStruct_ov12_0222FAFC unk_58[2]; int unk_EC; @@ -80,7 +80,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; int unk_08; int unk_0C; UnkStruct_ov12_02225F6C unk_10; @@ -109,7 +109,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; int unk_08; int unk_0C; CellActorData * unk_10; @@ -137,7 +137,7 @@ typedef struct { int unk_0C; Sprite * unk_10; UnkStruct_ov12_0222660C * unk_14; - PaletteSys * unk_18; + PaletteData * unk_18; UnkStruct_ov12_02226454 unk_1C; int unk_44; CellActorData * unk_48; @@ -145,8 +145,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; CellActorData * unk_10; UnkStruct_ov12_02225F6C unk_14; @@ -167,8 +167,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; int unk_14; @@ -182,8 +182,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; s16 unk_14; @@ -200,7 +200,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; int unk_08; int unk_0C; Sprite * unk_10; @@ -214,8 +214,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; UnkStruct_ov12_02225F6C unk_14; @@ -231,8 +231,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; CellActorData * unk_14; @@ -246,8 +246,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; Sprite * unk_14[4]; @@ -288,8 +288,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; CellActorData * unk_14; @@ -330,8 +330,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; int unk_14; @@ -347,8 +347,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; UnkStruct_ov12_02225F6C unk_14; @@ -362,7 +362,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; int unk_08; int unk_0C; int unk_10; @@ -377,15 +377,15 @@ typedef struct { int unk_94; int unk_98; UnkStruct_ov12_02226454 unk_9C; - PaletteSys * unk_C4; + PaletteData * unk_C4; BOOL unk_C8; BOOL unk_CC; } UnkStruct_ov12_02232D38; typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; Sprite * unk_10; UnkStruct_ov12_02225F6C unk_14; @@ -398,8 +398,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; int unk_14; @@ -412,8 +412,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; int unk_14; @@ -448,8 +448,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; CellActorData * unk_10; UnkStruct_ov12_02226454 unk_14; @@ -475,7 +475,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - AnimationResourceCollection * unk_04; + SpriteGfxHandler * unk_04; UnkStruct_ov12_02225F6C unk_08; CellActorData * unk_2C; } UnkStruct_ov12_02234290; @@ -558,7 +558,7 @@ void ov12_0222F770 (UnkStruct_ov12_0221FCDC * param0) v0->unk_30[v1] = ov12_022202C0(v0->unk_00, v1); sub_0200D474(v0->unk_30[v1], 100); sub_0200D460(v0->unk_30[v1], 1); - sub_0200D810(v0->unk_30[v1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_30[v1], GX_OAM_MODE_XLU); } ov12_022261C4(&v0->unk_38, &v3, ov12_02225AE0, v0->unk_E8, v0->unk_EA - v0->unk_EC, 2, 2, 0, v0->unk_30[0], v0->unk_30[1], NULL, NULL); @@ -671,9 +671,9 @@ void ov12_0222F9E4 (UnkStruct_ov12_0221FCDC * param0) ov12_022201E8(v0->unk_00, ov12_0222F888, v0); } -static void ov12_0222FAFC (UnkStruct_ov12_0222FAFC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, const UnkStruct_ov104_0223F9E0 * param3, const UnkStruct_ov12_0222FAFC * param4) +static void ov12_0222FAFC (UnkStruct_ov12_0222FAFC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, const SpriteTemplate * param3, const UnkStruct_ov12_0222FAFC * param4) { - param0->unk_00 = sub_0200CE6C(param1, param2, param3); + param0->unk_00 = SpriteActor_LoadResources(param1, param2, param3); param0->unk_04 = param4->unk_04; param0->unk_28 = param4->unk_28; param0->unk_3C = param4->unk_3C; @@ -709,7 +709,7 @@ static BOOL ov12_0222FB84 (UnkStruct_ov12_0222FAFC * param0) if (ov12_02225AE0(¶m0->unk_04)) { ov12_02225E0C(¶m0->unk_28); param0->unk_04.unk_04[5] = param0->unk_3C + param0->unk_28.unk_00; - sub_0200D4C4(param0->unk_00, param0->unk_3E + param0->unk_04.unk_00, param0->unk_40 + param0->unk_04.unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_00, param0->unk_3E + param0->unk_04.unk_00, param0->unk_40 + param0->unk_04.unk_02); } else { if (param0->unk_44 < 1) { if (param0->unk_44 == 0) { @@ -746,7 +746,7 @@ static void ov12_0222FC44 (SysTask * param0, void * param1) G2_ChangeBlendAlpha((v0->unk_F8 / 10), 31 - (v0->unk_F8 / 10)); if (v0->unk_F8 >= 310) { - sub_0200D810(v0->unk_0C.unk_00, GX_OAM_MODE_NORMAL); + SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_NORMAL); v0->unk_EC++; } @@ -787,7 +787,7 @@ static void ov12_0222FC44 (SysTask * param0, void * param1) sub_0200D330(v0->unk_0C.unk_00); if (sub_02021FD0(v0->unk_0C.unk_00->unk_00) == 0) { - sub_0200D810(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); v0->unk_EC++; } break; @@ -814,10 +814,10 @@ static void ov12_0222FC44 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_0222FE30 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_0222FE30 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0222FC44 * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; int v3; int v4; @@ -846,13 +846,13 @@ void ov12_0222FE30 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v0->unk_0C.unk_3E = ov12_022258E0(param0, v3, 0); v0->unk_0C.unk_40 = ov12_022258E0(param0, v3, 1); - sub_0200D4C4(v0->unk_0C.unk_00, v0->unk_0C.unk_3E, v0->unk_0C.unk_40); + SpriteActor_SetSpritePositionXY(v0->unk_0C.unk_00, v0->unk_0C.unk_3E, v0->unk_0C.unk_40); sub_0200D474(v0->unk_0C.unk_00, 100); sub_0200D460(v0->unk_0C.unk_00, 1); v1 = ov12_0222329C(v0->unk_00); - v1.unk_00 = v0->unk_0C.unk_3E; - v1.unk_02 = v0->unk_0C.unk_40; + v1.x = v0->unk_0C.unk_3E; + v1.y = v0->unk_0C.unk_40; for (v2 = 0; v2 < 2; v2++) { ov12_0222FAFC(&v0->unk_58[v2], v0->unk_04, v0->unk_08, &v1, &v0->unk_0C); @@ -861,10 +861,10 @@ void ov12_0222FE30 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v0->unk_F8 = 0; ov12_02235780(v0->unk_00, 0, 31); - sub_0200D810(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_0C.unk_00, GX_OAM_MODE_XLU); for (v2 = 0; v2 < 2; v2++) { - sub_0200D810(v0->unk_58[v2].unk_00, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_58[v2].unk_00, GX_OAM_MODE_XLU); } ov12_022201E8(v0->unk_00, ov12_0222FC44, v0); @@ -876,7 +876,7 @@ static void ov12_0222FF80 (UnkStruct_ov12_0222FF80 * param0) sub_02007DEC(param0->unk_5C, 0, param0->unk_60 + param0->unk_10.unk_00); sub_02007DEC(param0->unk_5C, 1, param0->unk_62 + param0->unk_10.unk_02); - sub_0200D4C4(param0->unk_58, param0->unk_60 + param0->unk_10.unk_00, param0->unk_62 + param0->unk_10.unk_02 - param0->unk_66); + SpriteActor_SetSpritePositionXY(param0->unk_58, param0->unk_60 + param0->unk_10.unk_00, param0->unk_62 + param0->unk_10.unk_02 - param0->unk_66); ov12_02225FA4(¶m0->unk_34, &v0, &v1); v0 += (f32)(param0->unk_64 * (0.10f)); @@ -941,7 +941,7 @@ void ov12_022300C4 (UnkStruct_ov12_0221FCDC * param0) ov12_02226108(&v0->unk_10, 2, 0, 1, 6); v0->unk_58 = ov12_022202C0(v0->unk_00, 0); - sub_0200D810(v0->unk_58, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_58, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_58, 2); sub_0200D474(v0->unk_58, 100); sub_0200D460(v0->unk_58, 1); @@ -1188,7 +1188,7 @@ static void ov12_02230600 (SysTask * param0, void * param1) sub_02007DEC(v0->unk_08, 6, 0); } - sub_0200D4C4(v0->unk_0C, v0->unk_38, v0->unk_3A - v0->unk_3C); + SpriteActor_SetSpritePositionXY(v0->unk_0C, v0->unk_38, v0->unk_3A - v0->unk_3C); } v0->unk_04++; @@ -1217,7 +1217,7 @@ void ov12_02230754 (UnkStruct_ov12_0221FCDC * param0) ov12_02225E68(&v0->unk_14, 14, 10, 10, 8); ov12_02225D78(&v0->unk_38, 0, 16, 8); - sub_0200D810(v0->unk_10, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); ov12_02235780(v0->unk_00, 0, 31); sub_0200D6A4(v0->unk_10, 2); @@ -1453,7 +1453,7 @@ static void ov12_02230BE0 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02230CEC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02230CEC (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02230BE0 * v0; int v1; @@ -1483,7 +1483,7 @@ void ov12_02230CEC (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D6A4(v0->unk_10, 2); sub_0200D6E8(v0->unk_10, 1, 1); - sub_0200D4C4(v0->unk_10, v3, v4); + SpriteActor_SetSpritePositionXY(v0->unk_10, v3, v4); sub_0200D5DC(v0->unk_10, 40 * v1, 0); sub_0200D474(v0->unk_10, 100); sub_0200D460(v0->unk_10, 1); @@ -1519,8 +1519,8 @@ static void ov12_02230E24 (UnkStruct_ov12_02230E24 * param0, CellActorData * par param0->unk_34 = 10; param0->unk_28 = param4; - sub_0200D4C4(param0->unk_00, param2, param3); - sub_0200D4C4(param0->unk_00, param2, param3); + SpriteActor_SetSpritePositionXY(param0->unk_00, param2, param3); + SpriteActor_SetSpritePositionXY(param0->unk_00, param2, param3); sub_0200D6A4(param0->unk_00, 2); sub_0200D474(param0->unk_00, 100); sub_0200D460(param0->unk_00, 1); @@ -1624,14 +1624,14 @@ static void ov12_02230F3C (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02231010 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02231010 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02230F3C * v0; int v1; int v2; int v3; int v4; - UnkStruct_ov104_0223F9E0 v5; + SpriteTemplate v5; v0 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_02230F3C)); v0->unk_00 = param0; @@ -1654,7 +1654,7 @@ void ov12_02231010 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v1 == 0) { ov12_02230E24(&v0->unk_44[v1], param3, v0->unk_1C, v3, v4); } else { - ov12_02230E24(&v0->unk_44[v1], sub_0200CE6C(param1, param2, &v5), v0->unk_1C, v3, v4); + ov12_02230E24(&v0->unk_44[v1], SpriteActor_LoadResources(param1, param2, &v5), v0->unk_1C, v3, v4); } v3 -= 10; @@ -1730,7 +1730,7 @@ static void ov12_022310D4 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_022312A4 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_022312A4 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_022310D4 * v0; @@ -1815,7 +1815,7 @@ void ov12_02231444 (UnkStruct_ov12_0221FCDC * param0) v0->unk_1A -= -8; v0->unk_14 = ov12_022202C0(v0->unk_00, 0); - sub_0200D810(v0->unk_14, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); sub_02007DEC(v0->unk_10, 6, 1); ov12_022263A4(&v0->unk_1C, 2, 16); @@ -1912,7 +1912,7 @@ static void ov12_02231608 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02231650 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02231650 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02231508 * v0; int v1; @@ -1939,7 +1939,7 @@ void ov12_02231650 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D390(v0->unk_3C, 1); sub_0200D6A4(v0->unk_3C, 2); - sub_0200D810(v0->unk_3C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_3C, GX_OAM_MODE_XLU); sub_0200D474(v0->unk_3C, 100); sub_0200D460(v0->unk_3C, 1); @@ -2013,7 +2013,7 @@ static void ov12_0223181C (SysTask * param0, void * param1) } else { v0->unk_0C++; - sub_0200D810(v0->unk_14, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); ov12_02226424( &v0->unk_3C, 16, 0, 0, 16, 16); @@ -2046,7 +2046,7 @@ static void ov12_0223181C (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02231950 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02231950 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02231760 * v0; @@ -2060,7 +2060,7 @@ void ov12_02231950 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D474(v0->unk_14, 100); sub_0200D460(v0->unk_14, 1); - sub_0200D550(v0->unk_14, &v0->unk_64, &v0->unk_66); + SpriteActor_GetSpritePositionXY(v0->unk_14, &v0->unk_64, &v0->unk_66); ov12_022201E8(v0->unk_00, ov12_0223181C, v0); } @@ -2180,7 +2180,7 @@ static void ov12_02231A38 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02231C1C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02231C1C (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_022319AC * v0; int v1; @@ -2200,13 +2200,13 @@ void ov12_02231C1C (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D474(v0->unk_24, 100); sub_0200D460(v0->unk_24, 1); - sub_0200D550(v0->unk_24, &v0->unk_4C, &v0->unk_4E); + SpriteActor_GetSpritePositionXY(v0->unk_24, &v0->unk_4C, &v0->unk_4E); v0->unk_4C -= 80 / 2; v0->unk_4E -= 80 / 2; - sub_0200D4C4(v0->unk_24, v0->unk_4C, v0->unk_4E); - sub_0200D810(v0->unk_24, GX_OAM_MODE_XLU); + SpriteActor_SetSpritePositionXY(v0->unk_24, v0->unk_4C, v0->unk_4E); + SpriteActor_SetOAMMode(v0->unk_24, GX_OAM_MODE_XLU); v0->unk_54 = -16; @@ -2559,7 +2559,7 @@ static void ov12_0223223C (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02232378 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02232378 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02232084 * v0; Sprite * v1; @@ -2574,7 +2574,7 @@ void ov12_02232378 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D474(v0->unk_14, 100); sub_0200D460(v0->unk_14, 1); sub_0200D6A4(v0->unk_14, 2); - sub_0200D810(v0->unk_14, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_14, GX_OAM_MODE_XLU); sub_0200D3CC(v0->unk_14, 4); v0->unk_6C = 3; @@ -2869,10 +2869,10 @@ static void ov12_022328B8 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_022329E0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_022329E0 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02232720 * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; s16 v3; s16 v4; @@ -2898,7 +2898,7 @@ void ov12_022329E0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v2 == 0) { v0->unk_48[v2] = param3; } else { - v0->unk_48[v2] = sub_0200CE6C(param1, param2, &v1); + v0->unk_48[v2] = SpriteActor_LoadResources(param1, param2, &v1); } sub_0200D3F4(v0->unk_48[v2], 0); @@ -2914,7 +2914,7 @@ void ov12_022329E0 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa } v6 = v4 - v6; - sub_0200D4C4(v0->unk_48[v2], v5, v6); + SpriteActor_SetSpritePositionXY(v0->unk_48[v2], v5, v6); if (v2 < 2) { v0->unk_78[v2] = 8; @@ -2968,7 +2968,7 @@ static void ov12_02232B40 (SysTask * param0, void * param1) break; case 4: if (ov12_02225C14(&v0->unk_60)) { - sub_0200D4C4(v0->unk_5C, v0->unk_88, v0->unk_60.unk_02); + SpriteActor_SetSpritePositionXY(v0->unk_5C, v0->unk_88, v0->unk_60.unk_02); } else { v0->unk_0C++; } @@ -2983,7 +2983,7 @@ static void ov12_02232B40 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02232CA8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02232CA8 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02232B40 * v0; s16 v1, v2; @@ -3002,7 +3002,7 @@ void ov12_02232CA8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa sub_0200D474(v0->unk_5C, 100); sub_0200D460(v0->unk_5C, 1); - sub_0200D4C4(v0->unk_5C, v0->unk_88, v0->unk_8A); + SpriteActor_SetSpritePositionXY(v0->unk_5C, v0->unk_88, v0->unk_8A); ov12_022201E8(v0->unk_00, ov12_02232B40, v0); } @@ -3109,7 +3109,7 @@ static void ov12_02232F30 (UnkStruct_ov12_02232D38 * param0) f32 v2, v3; int v4; - sub_0200D550(param0->unk_1C, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_1C, &v0, &v1); ov12_02225BC8(¶m0->unk_70, v0, v0, v1 - 64, v1, 8); ov12_02225EF0(¶m0->unk_28, 2, 10, 20, 10, 10, 8); @@ -3252,18 +3252,18 @@ void ov12_02233178 (UnkStruct_ov12_0221FCDC * param0) sub_0200D474(v0->unk_18, 100); sub_0200D460(v0->unk_18, 1); - sub_0200D4C4(v0->unk_18, v2, v3); + SpriteActor_SetSpritePositionXY(v0->unk_18, v2, v3); sub_0200D3F4(v0->unk_18, 0); - sub_0200D810(v0->unk_18, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_18, 2); v0->unk_1C = ov12_022202C0(v0->unk_00, 1); sub_0200D474(v0->unk_1C, 100); sub_0200D460(v0->unk_1C, 1); - sub_0200D4C4(v0->unk_1C, v4, v5); + SpriteActor_SetSpritePositionXY(v0->unk_1C, v4, v5); sub_0200D3F4(v0->unk_1C, 0); - sub_0200D810(v0->unk_1C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_1C, GX_OAM_MODE_XLU); sub_0200D6A4(v0->unk_1C, 2); sub_0200D7E0(v0->unk_1C, 0, 80 / 2); @@ -3332,11 +3332,11 @@ static void ov12_02233394 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02233454 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02233454 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_022332E8 * v0; int v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v0 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_022332E8)); @@ -3355,13 +3355,13 @@ void ov12_02233454 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v0->unk_3C[v1] = param3; sub_0200D364(v0->unk_3C[v1], 1); } else { - v0->unk_3C[v1] = sub_0200CE6C(v0->unk_04, v0->unk_08, &v2); - sub_0200D810(v0->unk_3C[v1], GX_OAM_MODE_XLU); + v0->unk_3C[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v2); + SpriteActor_SetOAMMode(v0->unk_3C[v1], GX_OAM_MODE_XLU); } sub_0200D474(v0->unk_3C[v1], 100); sub_0200D460(v0->unk_3C[v1], 1); - sub_0200D4C4(v0->unk_3C[v1], v0->unk_38, v0->unk_3A); + SpriteActor_SetSpritePositionXY(v0->unk_3C[v1], v0->unk_38, v0->unk_3A); sub_0200D3F4(v0->unk_3C[v1], 0); sub_0200D6A4(v0->unk_3C[v1], 2); } @@ -3395,7 +3395,7 @@ static void ov12_02233574 (UnkStruct_ov12_0223351C * param0) v2 = param0->unk_30[v0].unk_04[1] * 5; v1 = FX_Mul(FX_SinIdx(v2), (FX32_ONE * 10) * param0->unk_14) >> FX32_SHIFT; - sub_0200D4C4(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132 + v1); + SpriteActor_SetSpritePositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132 + v1); if ((param0->unk_30[v0].unk_04[1] >= ((90 * 0xffff) / 360)) && (param0->unk_30[v0].unk_04[1] <= ((269 * 0xffff) / 360))) { sub_0200D460(param0->unk_18[v0], 1); @@ -3455,12 +3455,12 @@ static void ov12_02233644 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02233734 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02233734 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_0223351C * v0; int v1; Sprite * v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; v0 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_0223351C)); @@ -3479,11 +3479,11 @@ void ov12_02233734 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = sub_0200CE6C(v0->unk_04, v0->unk_08, &v3); + v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v3); } sub_0200D474(v0->unk_18[v1], 100); - sub_0200D810(v0->unk_18[v1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); sub_0200D390(v0->unk_18[v1], 1); } @@ -3495,7 +3495,7 @@ static void ov12_022337E0 (CellActorData * param0, UnkStruct_ov12_02225F6C * par { s16 v0, v1; - sub_0200D550(param0, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0 + (0 * param2), v0 + (256 * param2), v1 + (0 * param3), v1 + (-128 * param3), 59); sub_0200D3F4(param0, 1); } @@ -3509,12 +3509,12 @@ static BOOL ov12_02233834 (CellActorData * param0, UnkStruct_ov12_02225F6C * par u16 v5; if (ov12_02225C50(param1, param0)) { - sub_0200D550(param0, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0, &v0, &v1); v5 = v0 * (((2 * 0xffff) / 360)); v2 = FX_Mul(FX_SinIdx(v5), (FX32_ONE * 14)) >> FX32_SHIFT; - sub_0200D4C4(param0, v0, v1 + v2); + SpriteActor_SetSpritePositionXY(param0, v0, v1 + v2); v3 = FX_Mul(FX_SinIdx(v5), (FX32_CONST(0.17f))); v3 *= -1; @@ -3573,13 +3573,13 @@ static void ov12_02233988 (SysTask * param0, void * param1) } } -void ov12_022339C4 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_022339C4 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02233900 * v0; int v1; s16 v2, v3; Sprite * v4; - UnkStruct_ov104_0223F9E0 v5; + SpriteTemplate v5; v0 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_02233900)); @@ -3596,14 +3596,14 @@ void ov12_022339C4 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = sub_0200CE6C(v0->unk_04, v0->unk_08, &v5); + v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v5); } sub_0200D474(v0->unk_18[v1], 100); sub_0200D460(v0->unk_18[v1], 1); sub_0200D6A4(v0->unk_18[v1], 2); sub_0200D3F4(v0->unk_18[v1], 0); - sub_0200D4C4(v0->unk_18[v1], v2, v3); + SpriteActor_SetSpritePositionXY(v0->unk_18[v1], v2, v3); sub_0200D364(v0->unk_18[v1], v1 % 3); } @@ -3858,7 +3858,7 @@ static void ov12_02233F4C (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02234008 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02234008 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02233F4C * v0; @@ -3870,7 +3870,7 @@ void ov12_02234008 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v0->unk_10 = param3; sub_0200D390(v0->unk_10, 1); - sub_0200D810(v0->unk_10, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); ov12_022201E8(v0->unk_00, ov12_02233F4C, v0); } @@ -3999,7 +3999,7 @@ void ov12_022342C4 (UnkStruct_ov12_0221FCDC * param0) v4 += 64 * v2; v5 += -16 * v3; - sub_0200D4C4(v0->unk_2C, v4, v5); + SpriteActor_SetSpritePositionXY(v0->unk_2C, v4, v5); ov12_02225BC8(&v0->unk_08, v4, v4 + (48 * v2), v5, v5 + (-16 * v3), 6); ov12_022201E8(v0->unk_00, ov12_02234290, v0); diff --git a/src/overlay012/ov12_022346A4.c b/src/overlay012/ov12_022346A4.c index 7232a20d05..ed4c39ab64 100644 --- a/src/overlay012/ov12_022346A4.c +++ b/src/overlay012/ov12_022346A4.c @@ -10,7 +10,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "overlay012/struct_ov12_02225F6C.h" #include "overlay012/struct_ov12_02226454.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200762C.h" #include "unk_0200C6E4.h" @@ -24,7 +24,7 @@ typedef struct { UnkStruct_ov12_0221FCDC * unk_00; int unk_04; int unk_08; - AnimationResourceCollection * unk_0C; + SpriteGfxHandler * unk_0C; int unk_10; CellActorData * unk_14[2]; UnkStruct_ov12_02225F6C unk_1C[2]; @@ -35,7 +35,7 @@ typedef struct { UnkStruct_ov12_0221FCDC * unk_00; int unk_04; int unk_08; - AnimationResourceCollection * unk_0C; + SpriteGfxHandler * unk_0C; CellActorData * unk_10; UnkStruct_ov12_02226454 unk_14; } UnkStruct_ov12_022348C8; @@ -43,7 +43,7 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; int unk_04; - AnimationResourceCollection * unk_08; + SpriteGfxHandler * unk_08; CellActorData * unk_0C[6]; int unk_24[6]; int unk_3C[6]; @@ -51,8 +51,8 @@ typedef struct { typedef struct { UnkStruct_ov12_0221FCDC * unk_00; - CellTransferStateData * unk_04; - AnimationResourceCollection * unk_08; + SpriteRenderer * unk_04; + SpriteGfxHandler * unk_08; int unk_0C; int unk_10; int unk_14; @@ -72,9 +72,9 @@ static BOOL ov12_02234B34(CellActorData * param0, int * param1, int * param2); static void ov12_02234AE0(CellActorData * param0, int * param1, int * param2, int param3, int param4); static void ov12_02234CA8(SysTask * param0, void * param1); -void ov12_022346A4 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_022346A4 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; UnkStruct_ov12_022346A4 * v1; int v2; int v3; @@ -88,15 +88,15 @@ void ov12_022346A4 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v1->unk_10 = ov12_02225964(param0, v3); v0 = ov12_0222329C(v1->unk_00); - v0.unk_00 = ov12_022258E0(param0, v3, 0); - v0.unk_02 = ov12_022258E0(param0, v3, 1); + v0.x = ov12_022258E0(param0, v3, 0); + v0.y = ov12_022258E0(param0, v3, 1); for (v2 = 0; v2 < 2; v2++) { if (v2 == 0) { v1->unk_14[v2] = param3; - sub_0200D4C4(v1->unk_14[v2], v0.unk_00, v0.unk_02); + SpriteActor_SetSpritePositionXY(v1->unk_14[v2], v0.x, v0.y); } else { - v1->unk_14[v2] = sub_0200CE6C(param1, param2, &v0); + v1->unk_14[v2] = SpriteActor_LoadResources(param1, param2, &v0); } sub_0200D3F4(v1->unk_14[v2], 0); @@ -159,7 +159,7 @@ static void ov12_0223483C (CellActorData * param0, UnkStruct_ov12_02225F6C * par sub_0200D6A4(param0, 2); sub_0200D3F4(param0, 1); - sub_0200D550(param0, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0, &v0, &v1); ov12_02225BC8(param1, v0, v0 + (16 * param3), v1, v1 + -32, 32); ov12_02225E68(param2, 2, 10, 10, 32); @@ -180,7 +180,7 @@ static BOOL ov12_0223489C (CellActorData * param0, UnkStruct_ov12_02225F6C * par return 1; } -void ov12_022348C8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_022348C8 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_022348C8 * v0; int v1; @@ -192,7 +192,7 @@ void ov12_022348C8 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v0->unk_10 = param3; sub_0200D3F4(v0->unk_10, 0); - sub_0200D810(v0->unk_10, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_10, GX_OAM_MODE_XLU); sub_0200D474(v0->unk_10, 100); sub_0200D460(v0->unk_10, 1); @@ -248,9 +248,9 @@ static void ov12_02234918 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_0C); } -void ov12_02234A10 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02234A10 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; UnkStruct_ov12_02234A10 * v1; int v2; int v3; @@ -265,15 +265,15 @@ void ov12_02234A10 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa v4 = ov12_02225964(param0, v2); v0 = ov12_0222329C(v1->unk_00); - v0.unk_00 = ov12_022258E0(param0, v2, 0); - v0.unk_02 = ov12_022258E0(param0, v2, 1); + v0.x = ov12_022258E0(param0, v2, 0); + v0.y = ov12_022258E0(param0, v2, 1); for (v3 = 6 - 1; v3 >= 0; v3--) { if (v3 == 6 - 1) { v1->unk_0C[v3] = param3; - sub_0200D4C4(param3, v0.unk_00, v0.unk_02); + SpriteActor_SetSpritePositionXY(param3, v0.x, v0.y); } else { - v1->unk_0C[v3] = sub_0200CE6C(param1, param2, &v0); + v1->unk_0C[v3] = SpriteActor_LoadResources(param1, param2, &v0); } sub_0200D474(v1->unk_0C[v3], 100); @@ -295,12 +295,12 @@ static void ov12_02234AE0 (CellActorData * param0, int * param1, int * param2, i *param2 = param3 * 2; *param1 = 16; - sub_0200D550(param0, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0, &v0, &v1); v0 += (40 + (-12 * param3)) * param4; v1 += 40; - sub_0200D4C4(param0, v0, v1); + SpriteActor_SetSpritePositionXY(param0, v0, v1); } static BOOL ov12_02234B34 (CellActorData * param0, int * param1, int * param2) @@ -374,7 +374,7 @@ static void ov12_02234C30 (UnkStruct_ov12_02234BD8 * param0) for (v0 = 0; v0 < 6; v0++) { ov12_02225AE0(¶m0->unk_30[v0]); - sub_0200D4C4(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132); + SpriteActor_SetSpritePositionXY(param0->unk_18[v0], param0->unk_130 + param0->unk_30[v0].unk_00, param0->unk_132); if ((param0->unk_30[v0].unk_04[1] >= ((90 * 0xffff) / 360)) && (param0->unk_30[v0].unk_04[1] <= ((269 * 0xffff) / 360))) { sub_0200D460(param0->unk_18[v0], 1); @@ -435,12 +435,12 @@ static void ov12_02234CA8 (SysTask * param0, void * param1) sub_0200C7EC(v0->unk_08); } -void ov12_02234D98 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, CellActorData * param3) +void ov12_02234D98 (UnkStruct_ov12_0221FCDC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, CellActorData * param3) { UnkStruct_ov12_02234BD8 * v0; int v1; Sprite * v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; v0 = ov12_02235E50((param0), sizeof(UnkStruct_ov12_02234BD8)); @@ -459,11 +459,11 @@ void ov12_02234D98 (UnkStruct_ov12_0221FCDC * param0, CellTransferStateData * pa if (v1 == 0) { v0->unk_18[v1] = param3; } else { - v0->unk_18[v1] = sub_0200CE6C(v0->unk_04, v0->unk_08, &v3); + v0->unk_18[v1] = SpriteActor_LoadResources(v0->unk_04, v0->unk_08, &v3); } sub_0200D474(v0->unk_18[v1], 100); - sub_0200D810(v0->unk_18[v1], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0->unk_18[v1], GX_OAM_MODE_XLU); sub_0200D390(v0->unk_18[v1], 1); } diff --git a/src/overlay012/ov12_02234E44.c b/src/overlay012/ov12_02234E44.c index 4dc6c2bcef..da422ce9c5 100644 --- a/src/overlay012/ov12_02234E44.c +++ b/src/overlay012/ov12_02234E44.c @@ -202,7 +202,7 @@ static void ov12_0223507C (UnkStruct_ov12_0221FCDC * param0, UnkStruct_ov12_0223 G2_SetWndOutsidePlane((GX_WND_PLANEMASK_BG0 | GX_WND_PLANEMASK_BG1 | GX_WND_PLANEMASK_BG3 | GX_WND_PLANEMASK_OBJ), 1); GX_SetVisibleWnd(GX_WNDMASK_OW); - sub_0200D810(v0->unk_38, GX_OAM_MODE_OBJWND); + SpriteActor_SetOAMMode(v0->unk_38, GX_OAM_MODE_OBJWND); } v0->unk_00.unk_10 = 0; diff --git a/src/overlay012/ov12_02235254.c b/src/overlay012/ov12_02235254.c index 2bafdcfd42..b9bc78d6c8 100644 --- a/src/overlay012/ov12_02235254.c +++ b/src/overlay012/ov12_02235254.c @@ -746,7 +746,7 @@ void ov12_02235918 (Sprite * param0, UnkStruct_ov12_02235350 * param1) void ov12_02235950 (CellActorData * param0, UnkStruct_ov12_02235350 * param1) { - sub_0200D550(param0, &(param1->unk_00), &(param1->unk_02)); + SpriteActor_GetSpritePositionXY(param0, &(param1->unk_00), &(param1->unk_02)); } void ov12_0223595C (UnkStruct_ov12_0221FCDC * param0, UnkStruct_ov12_0223595C * param1) diff --git a/src/overlay012/ov12_02235E94.c b/src/overlay012/ov12_02235E94.c index bfdcf867f4..4ac6354f91 100644 --- a/src/overlay012/ov12_02235E94.c +++ b/src/overlay012/ov12_02235E94.c @@ -17,7 +17,7 @@ #include "overlay012/struct_ov12_02236030.h" #include "overlay012/struct_ov12_02236690.h" #include "overlay012/struct_ov12_02237728.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "spl.h" @@ -101,7 +101,7 @@ typedef struct BallRotation { s8 unk_22; BOOL unk_24; BOOL unk_28; - AnimationResourceCollection * unk_2C; + SpriteGfxHandler * unk_2C; CellActorData * unk_30; UnkStruct_ov12_02225D50 unk_34; UnkStruct_ov12_02225F6C unk_48[2]; @@ -1116,7 +1116,7 @@ static BOOL ov12_02236918 (BallRotation * param0) v0.unk_0C = 0xFF; v0.unk_10 = 0; - sub_0200D550(param0->unk_30, &v0.unk_00, &v0.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); param0->unk_D8 = ov12_02223764(param0->unk_90.battleSys, param0->unk_90.heapID); param0->unk_D0 = ov12_02236690(&v0); @@ -1166,7 +1166,7 @@ static BOOL ov12_022369FC (BallRotation * param0) switch (param0->unk_0C) { case 0: - sub_0200D550(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); param0->unk_B8.unk_04 = 60; param0->unk_B8.unk_06 = 180; param0->unk_B8.unk_08 = 10; @@ -1261,7 +1261,7 @@ static BOOL ov12_02236B20 (BallRotation * param0) { s16 v0, v1; - sub_0200D550(param0->unk_30, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_30, &v0, &v1); ov12_02225BC8(¶m0->unk_48[0], v0, v0, v1, v1 + 32, 32 / 3); param0->unk_08++; @@ -1473,7 +1473,7 @@ static BOOL ov12_02236D18 (BallRotation * param0) v1.unk_0C = ov12_02235FB4(v1.unk_04); v1.unk_10 = 0; - sub_0200D550(param0->unk_30, &v1.unk_00, &v1.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, &v1.unk_00, &v1.unk_02); param0->unk_D0 = ov12_02236690(&v1); } param0->unk_08++; @@ -1545,7 +1545,7 @@ static BOOL ov12_02236E7C (BallRotation * param0) { switch (param0->unk_08) { case 0: - sub_0200D810(param0->unk_30, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_30, GX_OAM_MODE_XLU); param0->unk_08++; case 1: if (param0->unk_20 > 0) { @@ -1876,7 +1876,7 @@ static BOOL ov12_02237474 (BallRotation * param0) v0.unk_0C = 0xFF; v0.unk_10 = 1; - sub_0200D550(param0->unk_30, &v0.unk_00, &v0.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, &v0.unk_00, &v0.unk_02); param0->unk_D0 = ov12_02236690(&v0); } param0->unk_08++; @@ -1971,7 +1971,7 @@ static BOOL ov12_02237694 (BallRotation * param0) if (param0->unk_30 != NULL) { s16 v0, v1; - sub_0200D550(param0->unk_30, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_30, &v0, &v1); param0->unk_B8.unk_00 = v0; param0->unk_B8.unk_02 = v1; @@ -2099,7 +2099,7 @@ void ov12_0223786C (BallRotation * param0, int param1) param0->unk_10 = 0; param0->unk_1C = 1; - sub_0200D550(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); } int ov12_02237890 (BallRotation * param0) @@ -2111,7 +2111,7 @@ int ov12_02237890 (BallRotation * param0) static void ov12_022378A0 (BallRotation * param0) { - sub_0200D550(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); switch (param0->unk_90.type) { case 0: @@ -2120,7 +2120,7 @@ static void ov12_022378A0 (BallRotation * param0) case 3: case 4: case 5: - sub_0200D550(param0->unk_30, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); + SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); param0->unk_B8.unk_10 = 0; param0->unk_B8.unk_08 = 12; return; @@ -2130,7 +2130,7 @@ static void ov12_022378A0 (BallRotation * param0) param0->unk_B8.unk_06 += 32; break; case 7: - sub_0200D550(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); + SpriteActor_GetSpritePositionXY(param0->unk_30, ¶m0->unk_B8.unk_00, ¶m0->unk_B8.unk_02); ov12_02225864(1, 4, ¶m0->unk_B8.unk_04, ¶m0->unk_B8.unk_06); param0->unk_B8.unk_10 = 48; param0->unk_B8.unk_06 += 32; @@ -2305,10 +2305,10 @@ static void ov12_02237C54 (BallRotation * param0) v6 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param0->unk_90.heapID); - sub_0200CC3C(param0->unk_90.cellActorSys, param0->unk_2C, v6, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param0->unk_90.target + 6000); - sub_0200CDC4(param0->unk_90.paletteSys, 2, param0->unk_90.cellActorSys, param0->unk_2C, v6, v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param0->unk_90.target + 6000); - sub_0200CE24(param0->unk_90.cellActorSys, param0->unk_2C, v6, v2, 1, param0->unk_90.target + 6000); - sub_0200CE54(param0->unk_90.cellActorSys, param0->unk_2C, v6, v3, 1, param0->unk_90.target + 6000); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param0->unk_90.target + 6000); + SpriteRenderer_LoadPalette(param0->unk_90.paletteSys, 2, param0->unk_90.cellActorSys, param0->unk_2C, v6, v1, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param0->unk_90.target + 6000); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v2, 1, param0->unk_90.target + 6000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_90.cellActorSys, param0->unk_2C, v6, v3, 1, param0->unk_90.target + 6000); NARC_dtor(v6); } } @@ -2316,24 +2316,24 @@ static void ov12_02237C54 (BallRotation * param0) static void ov12_02237D8C (BallRotation * param0) { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; - ov12_02237B14(param0, &v1.unk_00, &v1.unk_02); + ov12_02237B14(param0, &v1.x, &v1.y); - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 0; - v1.unk_0C = 0; - v1.unk_10 = 1; - v1.unk_2C = param0->unk_90.bgPrio; - v1.unk_30 = 0; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 0; + v1.plttIdx = 0; + v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v1.bgPriority = param0->unk_90.bgPrio; + v1.transferToVRAM = FALSE; for (v0 = 0; v0 < 6; v0++) { - v1.unk_14[v0] = param0->unk_90.target + 6000; + v1.resources[v0] = param0->unk_90.target + 6000; } - param0->unk_30 = sub_0200CE6C(param0->unk_90.cellActorSys, param0->unk_2C, &v1); + param0->unk_30 = SpriteActor_LoadResources(param0->unk_90.cellActorSys, param0->unk_2C, &v1); sub_0200D3F4(param0->unk_30, 1); sub_0200D6A4(param0->unk_30, 2); @@ -2351,7 +2351,7 @@ void ov12_02237E0C (BallRotation * param0, int param1) void ov12_02237E18 (BallRotation * param0, s16 param1, s16 param2) { - sub_0200D4C4(param0->unk_30, param1, param2); + SpriteActor_SetSpritePositionXY(param0->unk_30, param1, param2); } void ov12_02237E24 (BallRotation * param0, u16 param1) diff --git a/src/overlay013/ov13_02224500.c b/src/overlay013/ov13_02224500.c index 2b5328d9b8..d38376ac09 100644 --- a/src/overlay013/ov13_02224500.c +++ b/src/overlay013/ov13_02224500.c @@ -9,7 +9,7 @@ #include "struct_defs/struct_020F1DB8.h" #include "overlay013/struct_ov13_022213F0.h" #include "overlay013/struct_ov13_02221ED0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "narc.h" @@ -238,7 +238,7 @@ void ov13_02224500 (UnkStruct_ov13_022213F0 * param0) static void ov13_0222453C (UnkStruct_ov13_022213F0 * param0) { UnkStruct_ov104_02241308 v0 = {18, 6, 6, 6, 0, 0}; - CellTransferStateData * v1 = ov16_0223E010(param0->unk_00->unk_08); + SpriteRenderer * v1 = ov16_0223E010(param0->unk_00->unk_08); param0->unk_1FB0 = sub_0200C704(v1); @@ -248,22 +248,22 @@ static void ov13_0222453C (UnkStruct_ov13_022213F0 * param0) static void ov13_02224588 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; NARC * v2; v2 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, param0->unk_00->unk_0C); v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200CDC4(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); - sub_0200CE24(v0, param0->unk_1FB0, v2, PokeIcon32KCellsFileIndex(), 0, 45063); - sub_0200CE54(v0, param0->unk_1FB0, v2, PokeIcon32KAnimationFileIndex(), 0, 45063); + SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 45063); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v2, PokeIcon32KCellsFileIndex(), 0, 45063); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v2, PokeIcon32KAnimationFileIndex(), 0, 45063); for (v1 = 0; v1 < 6; v1++) { if (param0->unk_04[v1].unk_04 != 0) { - sub_0200CC3C(v0, param0->unk_1FB0, v2, Pokemon_IconSpriteIndex(param0->unk_04[v1].unk_00), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v2, Pokemon_IconSpriteIndex(param0->unk_04[v1].unk_00), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); } else { - sub_0200CC3C(v0, param0->unk_1FB0, v2, PokeIconSpriteIndex(0, 0, 0), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v2, PokeIconSpriteIndex(0, 0, 0), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45063 + v1); } } @@ -272,21 +272,21 @@ static void ov13_02224588 (UnkStruct_ov13_022213F0 * param0) static void ov13_02224670 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0 = ov16_0223E010(param0->unk_00->unk_08); + SpriteRenderer * v0 = ov16_0223E010(param0->unk_00->unk_08); NARC * v1; v1 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PST_GRA, param0->unk_00->unk_0C); - sub_0200CDC4(param0->unk_1E4, 3, v0, param0->unk_1FB0, v1, sub_0208E9E4(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45064); - sub_0200CE24(v0, param0->unk_1FB0, v1, sub_0208E9E8(), 0, 45064); - sub_0200CE54(v0, param0->unk_1FB0, v1, sub_0208E9EC(), 0, 45064); - sub_0200CC3C(v0, param0->unk_1FB0, v1, sub_0208E9E0(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45069); + SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v1, sub_0208E9E4(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45064); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v1, sub_0208E9E8(), 0, 45064); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v1, sub_0208E9EC(), 0, 45064); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v1, sub_0208E9E0(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45069); NARC_dtor(v1); } static void ov13_02224720 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; v0 = ov16_0223E010(param0->unk_00->unk_08); @@ -303,23 +303,23 @@ static void ov13_02224720 (UnkStruct_ov13_022213F0 * param0) static void ov13_02224798 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; NARC * v2; v2 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, param0->unk_00->unk_0C); v0 = ov16_0223E010(param0->unk_00->unk_08); - sub_0200CDC4(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45066); - sub_0200CE24(v0, param0->unk_1FB0, v2, sub_02081938(), 0, 45066); - sub_0200CE54(v0, param0->unk_1FB0, v2, sub_0208193C(), 0, 45066); - sub_0200CC3C(v0, param0->unk_1FB0, v2, sub_02081930(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45078); + SpriteRenderer_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, v2, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45066); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_02081938(), 0, 45066); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_0208193C(), 0, 45066); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_1FB0, v2, sub_02081930(), 0, NNS_G2D_VRAM_TYPE_2DSUB, 45078); NARC_dtor(v2); } static void ov13_02224848 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0 = ov16_0223E010(param0->unk_00->unk_08); + SpriteRenderer * v0 = ov16_0223E010(param0->unk_00->unk_08); sub_0200CD7C(param0->unk_1E4, 3, v0, param0->unk_1FB0, 72, 27, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 45067); sub_0200CE0C(v0, param0->unk_1FB0, 72, 25, 0, 45067); @@ -329,26 +329,26 @@ static void ov13_02224848 (UnkStruct_ov13_022213F0 * param0) static CellActorData * ov13_022248D8 (UnkStruct_ov13_022213F0 * param0, u32 param1) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; + SpriteTemplate v0; + SpriteRenderer * v1; v1 = ov16_0223E010(param0->unk_00->unk_08); - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = Unk_ov13_02229514[param1][4]; - v0.unk_0C = 0; - v0.unk_10 = NNS_G2D_VRAM_TYPE_2DSUB; - v0.unk_14[0] = Unk_ov13_02229514[param1][0]; - v0.unk_14[1] = Unk_ov13_02229514[param1][1]; - v0.unk_14[2] = Unk_ov13_02229514[param1][2]; - v0.unk_14[3] = Unk_ov13_02229514[param1][3]; - v0.unk_2C = 1; - v0.unk_30 = 0; + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = Unk_ov13_02229514[param1][4]; + v0.plttIdx = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v0.resources[0] = Unk_ov13_02229514[param1][0]; + v0.resources[1] = Unk_ov13_02229514[param1][1]; + v0.resources[2] = Unk_ov13_02229514[param1][2]; + v0.resources[3] = Unk_ov13_02229514[param1][3]; + v0.bgPriority = 1; + v0.transferToVRAM = FALSE; - return sub_0200CE6C(v1, param0->unk_1FB0, &v0); + return SpriteActor_LoadResources(v1, param0->unk_1FB0, &v0); } static void ov13_02224948 (UnkStruct_ov13_022213F0 * param0) @@ -364,7 +364,7 @@ static void ov13_02224948 (UnkStruct_ov13_022213F0 * param0) void ov13_02224970 (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; v0 = ov16_0223E010(param0->unk_00->unk_08); @@ -380,7 +380,7 @@ void ov13_02224970 (UnkStruct_ov13_022213F0 * param0) static void ov13_022249AC (CellActorData * param0, const int param1, const int param2) { sub_0200D3F4(param0, 1); - sub_0200D4C4(param0, param1, param2); + SpriteActor_SetSpritePositionXY(param0, param1, param2); } static void ov13_022249CC (UnkStruct_ov13_022213F0 * param0) @@ -398,7 +398,7 @@ static void ov13_022249CC (UnkStruct_ov13_022213F0 * param0) static void ov13_02224A0C (UnkStruct_ov13_022213F0 * param0, CellActorData * param1, u32 param2, u8 param3) { - CellTransferStateData * v0 = ov16_0223E010(param0->unk_00->unk_08); + SpriteRenderer * v0 = ov16_0223E010(param0->unk_00->unk_08); sub_0200D948(v0, param0->unk_1FB0, sub_0207C944(), sub_0207C908(param3), 1, param2); sub_0200D41C(param1, sub_0207C92C(param3) + 4); @@ -406,7 +406,7 @@ static void ov13_02224A0C (UnkStruct_ov13_022213F0 * param0, CellActorData * par static void ov13_02224A5C (UnkStruct_ov13_022213F0 * param0, CellActorData * param1, u32 param2) { - CellTransferStateData * v0 = ov16_0223E010(param0->unk_00->unk_08); + SpriteRenderer * v0 = ov16_0223E010(param0->unk_00->unk_08); sub_0200D948(v0, param0->unk_1FB0, sub_0207CAC0(), sub_0207CA90(param2), 1, 45077); sub_0200D41C(param1, sub_0207CAA8(param2) + 4); @@ -794,7 +794,7 @@ static void ov13_02225420 (UnkStruct_ov13_022213F0 * param0) static void ov13_0222554C (UnkStruct_ov13_022213F0 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; UnkStruct_ov16_0226DC24 * v1; v0 = ov16_0223E010(param0->unk_00->unk_08); diff --git a/src/overlay013/ov13_02227BDC.c b/src/overlay013/ov13_02227BDC.c index 2feb0bd969..09d1cdd873 100644 --- a/src/overlay013/ov13_02227BDC.c +++ b/src/overlay013/ov13_02227BDC.c @@ -9,7 +9,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_020F1DB8.h" #include "overlay013/struct_ov13_02227244.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "unk_02002F38.h" @@ -79,7 +79,7 @@ void ov13_02227BDC (UnkStruct_ov13_02227244 * param0) static void ov13_02227C08 (UnkStruct_ov13_02227244 * param0) { UnkStruct_ov104_02241308 v0 = {8, 8, 3, 3, 0, 0}; - CellTransferStateData * v1 = ov16_0223E010(param0->unk_00->unk_00); + SpriteRenderer * v1 = ov16_0223E010(param0->unk_00->unk_00); param0->unk_30C = sub_0200C704(v1); @@ -89,7 +89,7 @@ static void ov13_02227C08 (UnkStruct_ov13_02227244 * param0) static void ov13_02227C54 (UnkStruct_ov13_02227244 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; NARC * v2; @@ -97,18 +97,18 @@ static void ov13_02227C54 (UnkStruct_ov13_02227244 * param0) v0 = ov16_0223E010(param0->unk_00->unk_00); for (v1 = 0; v1 < 6; v1++) { - sub_0200CC3C(v0, param0->unk_30C, v2, Item_FileID(1, 1), 0, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); - sub_0200CDC4(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_FileID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, param0->unk_30C, v2, Item_FileID(1, 1), 0, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); + SpriteRenderer_LoadPalette(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_FileID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1); } - sub_0200CE24(v0, param0->unk_30C, v2, Item_IconNCERFile(), 0, 46263); - sub_0200CE54(v0, param0->unk_30C, v2, Item_IconNANRFile(), 0, 46263); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, param0->unk_30C, v2, Item_IconNCERFile(), 0, 46263); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, param0->unk_30C, v2, Item_IconNANRFile(), 0, 46263); NARC_dtor(v2); } static void ov13_02227D10 (UnkStruct_ov13_02227244 * param0, u16 param1, u32 param2) { - CellTransferStateData * v0 = ov16_0223E010(param0->unk_00->unk_00); + SpriteRenderer * v0 = ov16_0223E010(param0->unk_00->unk_00); sub_0200D948(v0, param0->unk_30C, 16, Item_FileID(param1, 1), 0, param2); } @@ -119,26 +119,26 @@ static void ov13_02227D48 (UnkStruct_ov13_02227244 * param0, u16 param1, u16 par static CellActorData * ov13_02227D78 (UnkStruct_ov13_02227244 * param0, u32 param1) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; + SpriteTemplate v0; + SpriteRenderer * v1; v1 = ov16_0223E010(param0->unk_00->unk_00); - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = Unk_ov13_02229CBC[param1][4]; - v0.unk_0C = 0; - v0.unk_10 = NNS_G2D_VRAM_TYPE_2DSUB; - v0.unk_14[0] = Unk_ov13_02229CBC[param1][0]; - v0.unk_14[1] = Unk_ov13_02229CBC[param1][1]; - v0.unk_14[2] = Unk_ov13_02229CBC[param1][2]; - v0.unk_14[3] = Unk_ov13_02229CBC[param1][3]; - v0.unk_2C = 1; - v0.unk_30 = 0; - - return sub_0200CE6C(v1, param0->unk_30C, &v0); + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = Unk_ov13_02229CBC[param1][4]; + v0.plttIdx = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v0.resources[0] = Unk_ov13_02229CBC[param1][0]; + v0.resources[1] = Unk_ov13_02229CBC[param1][1]; + v0.resources[2] = Unk_ov13_02229CBC[param1][2]; + v0.resources[3] = Unk_ov13_02229CBC[param1][3]; + v0.bgPriority = 1; + v0.transferToVRAM = FALSE; + + return SpriteActor_LoadResources(v1, param0->unk_30C, &v0); } static void ov13_02227DE8 (UnkStruct_ov13_02227244 * param0) @@ -152,7 +152,7 @@ static void ov13_02227DE8 (UnkStruct_ov13_02227244 * param0) void ov13_02227E08 (UnkStruct_ov13_02227244 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; u32 v1; v0 = ov16_0223E010(param0->unk_00->unk_00); @@ -169,7 +169,7 @@ void ov13_02227E08 (UnkStruct_ov13_02227244 * param0) static void ov13_02227E48 (CellActorData * param0, const int param1, const int param2) { sub_0200D3F4(param0, 1); - sub_0200D4C4(param0, param1, param2); + SpriteActor_SetSpritePositionXY(param0, param1, param2); } void ov13_02227E68 (UnkStruct_ov13_02227244 * param0, u32 param1) @@ -235,7 +235,7 @@ static void ov13_02227F38 (UnkStruct_ov13_02227244 * param0) static void ov13_02227F7C (UnkStruct_ov13_02227244 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; UnkStruct_ov16_0226DC24 * v1; v0 = ov16_0223E010(param0->unk_00->unk_00); @@ -308,7 +308,7 @@ void ov13_02228050 (UnkStruct_ov13_02227244 * param0) static void ov13_02228070 (UnkStruct_ov13_02227244 * param0) { - CellTransferStateData * v0; + SpriteRenderer * v0; UnkStruct_ov16_0226DEEC * v1; v0 = ov16_0223E010(param0->unk_00->unk_00); diff --git a/src/overlay016/battle_script.c b/src/overlay016/battle_script.c index a1e9e7c045..dcbebc01fc 100644 --- a/src/overlay016/battle_script.c +++ b/src/overlay016/battle_script.c @@ -47,7 +47,7 @@ #include "overlay012/struct_ov12_02237728.h" #include "overlay016/struct_ov16_0225BFFC_t.h" #include "overlay021/struct_ov21_021E8E0C.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "core_sys.h" #include "flags.h" @@ -10136,7 +10136,7 @@ static void BattleScript_GetExpTask(SysTask *task, void *inData) case SEQ_GET_EXP_LEVEL_UP_SUMMARY_INIT: { BGL *bgl = BattleSystem_BGL(data->battleSys); Window *window = BattleSystem_Window(data->battleSys, 1); - PaletteSys *paletteSys = BattleSystem_PaletteSys(data->battleSys); + PaletteData *paletteSys = BattleSystem_PaletteSys(data->battleSys); G2_SetBG0Priority(1 + 1); // this is the background + 1; could do with a constant BGL_SetPriority(1, 1); @@ -10559,7 +10559,7 @@ static void BattleScript_CatchMonTask (SysTask * param0, void * param1) int v1; BattleScriptTaskData * v2 = param1; Pokemon * v3; - PaletteSys * v4; + PaletteData * v4; UnkStruct_02007768 * v5; MessageLoader * v6; @@ -12184,7 +12184,7 @@ static int BattleMessage_TrainerNameTag(BattleSystem *battleSys, BattleContext * return BattleScript_Battler(battleSys, battleCtx, battlerIn); } -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226E6C4 = { +static const SpriteTemplate Unk_ov16_0226E6C4 = { 0x80, 0x0, 0x0, @@ -12197,7 +12197,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226E6C4 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226E6F8 = { +static const SpriteTemplate Unk_ov16_0226E6F8 = { 0x98, 0x18, 0x0, @@ -12212,10 +12212,10 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226E6F8 = { static void BattleScript_LoadPartyLevelUpIcon (BattleSystem * param0, BattleScriptTaskData * param1, Pokemon * param2) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteTemplate v0; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; MessageLoader * v4; UnkStruct_0200B358 * v5; Strbuf* v6, * v7; @@ -12239,7 +12239,7 @@ static void BattleScript_LoadPartyLevelUpIcon (BattleSystem * param0, BattleScri sub_0200CE0C(v1, v2, 27, 257, 1, 20013); sub_0200CE3C(v1, v2, 27, 258, 1, 20013); - param1->cellActorData[0] = sub_0200CE6C(v1, v2, &Unk_ov16_0226E6C4); + param1->cellActorData[0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_0226E6C4); sub_0200D330(param1->cellActorData[0]); sub_0200D888(v1, v2, 19, Pokemon_IconSpriteIndex(param2), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20022); @@ -12247,7 +12247,7 @@ static void BattleScript_LoadPartyLevelUpIcon (BattleSystem * param0, BattleScri sub_0200CE0C(v1, v2, 19, PokeIcon64KCellsFileIndex(), 0, 20014); sub_0200CE3C(v1, v2, 19, PokeIcon64KAnimationFileIndex(), 0, 20014); - param1->cellActorData[1] = sub_0200CE6C(v1, v2, &Unk_ov16_0226E6F8); + param1->cellActorData[1] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_0226E6F8); sub_02021F24(param1->cellActorData[1]->unk_00, Pokemon_IconPaletteIndex(param2)); sub_0200D330(param1->cellActorData[1]); @@ -12301,7 +12301,7 @@ static void BattleScript_LoadPartyLevelUpIcon (BattleSystem * param0, BattleScri static void BattleScript_FreePartyLevelUpIcon (BattleSystem * param0, BattleScriptTaskData * param1) { - AnimationResourceCollection * v0; + SpriteGfxHandler * v0; v0 = ov16_0223E018(param0); @@ -12309,14 +12309,14 @@ static void BattleScript_FreePartyLevelUpIcon (BattleSystem * param0, BattleScri sub_0200D0F4(param1->cellActorData[1]); sub_02012870(param1->fontOAM); sub_0201EE28(¶m1->spriteMgrAlloc); - sub_0200D070(v0, 20021); - sub_0200D080(v0, 20016); - sub_0200D090(v0, 20013); - sub_0200D0A0(v0, 20013); - sub_0200D070(v0, 20022); - sub_0200D080(v0, 20017); - sub_0200D090(v0, 20014); - sub_0200D0A0(v0, 20014); + SpriteGfxHandler_UnloadCharObjById(v0, 20021); + SpriteGfxHandler_UnloadPlttObjById(v0, 20016); + SpriteGfxHandler_UnloadCellObjById(v0, 20013); + SpriteGfxHandler_UnloadAnimObjById(v0, 20013); + SpriteGfxHandler_UnloadCharObjById(v0, 20022); + SpriteGfxHandler_UnloadPlttObjById(v0, 20017); + SpriteGfxHandler_UnloadCellObjById(v0, 20014); + SpriteGfxHandler_UnloadAnimObjById(v0, 20014); sub_020127BC(param1->tmpPtr[0]); } diff --git a/src/overlay016/ov16_0223DF00.c b/src/overlay016/ov16_0223DF00.c index 298e02431d..8842fbd7e8 100644 --- a/src/overlay016/ov16_0223DF00.c +++ b/src/overlay016/ov16_0223DF00.c @@ -90,15 +90,15 @@ int BattleSystem_PartyCount(BattleSystem *battleSys, int battler); Pokemon* BattleSystem_PartyPokemon(BattleSystem *battleSys, int battler, int slot); UnkStruct_02007768 * ov16_0223E000(BattleSystem * param0); UnkStruct_ov12_0221FCDC * ov16_0223E008(BattleSystem * param0); -CellTransferStateData * ov16_0223E010(BattleSystem * param0); -AnimationResourceCollection * ov16_0223E018(BattleSystem * param0); +SpriteRenderer * ov16_0223E010(BattleSystem * param0); +SpriteGfxHandler * ov16_0223E018(BattleSystem * param0); UnkStruct_ov16_02268520 * ov16_0223E020(BattleSystem * param0, int param1); UnkStruct_ov16_02268A14 * ov16_0223E02C(BattleSystem * param0); UnkStruct_0200C440 * ov16_0223E04C(BattleSystem * param0); UnkStruct_0200C440 * ov16_0223E054(BattleSystem * param0); MessageLoader * BattleSystem_MessageLoader(BattleSystem * param0); MessageLoader * ov16_0223E060(BattleSystem * param0); -PaletteSys * BattleSystem_PaletteSys(BattleSystem * param0); +PaletteData * BattleSystem_PaletteSys(BattleSystem * param0); UnkStruct_02026324 * ov16_0223E068(BattleSystem * param0); u8 * ov16_0223E06C(BattleSystem * param0); u8 * ov16_0223E074(BattleSystem * param0); @@ -208,7 +208,7 @@ u32 BattleSystem_CalcMoneyPenalty(Party *party, TrainerInfo *trainerInfo); void BattleSystem_DexFlagSeen(BattleSystem * param0, int param1); void ov16_0223F9A0(BattleSystem * param0, int param1); BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species); -void ov16_0223F9F0(void); +void Battle_SetDefaultBlend(void); u8 ov16_0223F9FC(BattleSystem * param0, int param1, int param2, int param3, int param4); u8 BattleMessage_Print(BattleSystem * param0, MessageLoader * param1, BattleMessage * param2, int param3); u8 BattleMessage_PrintToWindow(BattleSystem * param0, Window * param1, MessageLoader * param2, BattleMessage * param3, int param4, int param5, int param6, int param7, int param8); @@ -311,12 +311,12 @@ UnkStruct_ov12_0221FCDC * ov16_0223E008 (BattleSystem * param0) return param0->unk_8C; } -CellTransferStateData * ov16_0223E010 (BattleSystem * param0) +SpriteRenderer * ov16_0223E010 (BattleSystem * param0) { return param0->unk_90; } -AnimationResourceCollection * ov16_0223E018 (BattleSystem * param0) +SpriteGfxHandler * ov16_0223E018 (BattleSystem * param0) { return param0->unk_94; } @@ -361,7 +361,7 @@ MessageLoader * ov16_0223E060 (BattleSystem * param0) return param0->unk_10; } -PaletteSys * BattleSystem_PaletteSys (BattleSystem * param0) +PaletteData * BattleSystem_PaletteSys (BattleSystem * param0) { return param0->unk_28; } @@ -1725,7 +1725,7 @@ BOOL BattleSystem_CaughtSpecies(BattleSystem *battleSys, int species) return Pokedex_CaughtSpecies(battleSys->pokedex, species); } -void ov16_0223F9F0 (void) +void Battle_SetDefaultBlend (void) { G2_BlendNone(); } diff --git a/src/overlay016/ov16_0225BFFC.c b/src/overlay016/ov16_0225BFFC.c index cc86faa2d5..91b3628d32 100644 --- a/src/overlay016/ov16_0225BFFC.c +++ b/src/overlay016/ov16_0225BFFC.c @@ -81,7 +81,7 @@ #include "overlay016/ov16_0226485C.h" #include "overlay016/ov16_02266F1C.h" #include "overlay016/ov16_0226871C.h" -#include "overlay016/ov16_0226D094.h" +#include "battle/party_gauge.h" typedef void (* UnkFuncPtr_ov16_0226F068)(BattleSystem *, BattlerData *); @@ -834,26 +834,26 @@ static void ov16_0225C8A4 (BattleSystem * param0, BattlerData * param1) static void ov16_0225C8E0 (BattleSystem * param0, BattlerData * param1) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; v0 = ov16_0223E010(param0); v1 = ov16_0223E018(param0); v2 = BattleSystem_PaletteSys(param0); - ov16_0226D094(v0, v1, v2); + PartyGauge_LoadGraphics(v0, v1, v2); ClearCommand(param0, param1->battler, 52); ZeroDataBuffer(param1); } static void ov16_0225C91C (BattleSystem * param0, BattlerData * param1) { - AnimationResourceCollection * v0; + SpriteGfxHandler * v0; v0 = ov16_0223E018(param0); - ov16_0226D12C(v0); + PartyGauge_FreeGraphics(v0); ClearCommand(param0, param1->battler, 53); ZeroDataBuffer(param1); } diff --git a/src/overlay016/ov16_0225CBB8.c b/src/overlay016/ov16_0225CBB8.c index 8efd78408b..5f5fffaa55 100644 --- a/src/overlay016/ov16_0225CBB8.c +++ b/src/overlay016/ov16_0225CBB8.c @@ -154,7 +154,7 @@ #include "overlay016/ov16_0226485C.h" #include "overlay016/ov16_02266F1C.h" #include "overlay016/ov16_0226871C.h" -#include "overlay016/ov16_0226D094.h" +#include "battle/party_gauge.h" void ov16_0225CBB8(BattleSystem * param0, BattlerData * param1); void ov16_0225CBDC(BattleSystem * param0, BattlerData * param1, UnkStruct_ov16_0225C168 * param2); @@ -345,11 +345,11 @@ void ov16_0225CBDC (BattleSystem * param0, BattlerData * param1, UnkStruct_ov16_ if (param1->battlerType & 0x1) { v4->unk_13 = 2; v4->unk_0C = ov16_0223E020(param0, 1); - sub_0200D4C4(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); + SpriteActor_SetSpritePositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); } else { v4->unk_13 = 0; v4->unk_0C = ov16_0223E020(param0, 0); - sub_0200D4C4(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); + SpriteActor_SetSpritePositionXY(v4->unk_0C->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); } if (param2->unk_01_2) { @@ -576,11 +576,11 @@ void ov16_0225D228 (BattleSystem * param0, BattlerData * param1, UnkStruct_ov16_ if (param1->battlerType & 0x1) { v1->unk_0F = 2; v1->unk_04 = ov16_0223E020(param0, 1); - sub_0200D4C4(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); + SpriteActor_SetSpritePositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (8 * 11)); } else { v1->unk_0F = 0; v1->unk_04 = ov16_0223E020(param0, 0); - sub_0200D4C4(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); + SpriteActor_SetSpritePositionXY(v1->unk_04->unk_00, Unk_ov12_0223B0B8[param1->battlerType & 1][0], (128 + 8)); } if ((BattleSystem_BattleType(param0) & 0x8) || ((BattleSystem_BattleType(param0) & 0x10) && (param1->battlerType & 0x1))) { @@ -1587,17 +1587,17 @@ static void ov16_0225E4E8 (SysTask * param0, void * param1) v0->unk_12++; case 2: if (v0->unk_13 == 2) { - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { if (v2 < (24 * 8)) { sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); } else { - sub_0200D4C4(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); if (v0->unk_1C == 1) { sub_02007DEC(v0->unk_08, 0, v2); @@ -1627,24 +1627,24 @@ static void ov16_0225E4E8 (SysTask * param0, void * param1) } if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { - sub_0200D4C4(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } sub_020086FC(v0->unk_08, 8, 0, 0, 0x0); v0->unk_12++; } } else { - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 0) || (v0->unk_1C == 2)) { if (v2 > 64) { sub_0200D5DC(v0->unk_0C->unk_00, -8, 0); } else { - sub_0200D4C4(v0->unk_0C->unk_00, 64, (128 + 8)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); } } - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); if (v0->unk_1C == 0) { sub_02007DEC(v0->unk_08, 0, v2); @@ -1670,7 +1670,7 @@ static void ov16_0225E4E8 (SysTask * param0, void * param1) } if ((v0->unk_1C == 0) || (v0->unk_1C == 2)) { - sub_0200D4C4(v0->unk_0C->unk_00, 64, (128 + 8)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, 64, (128 + 8)); } v0->unk_12++; @@ -1726,17 +1726,17 @@ static void ov16_0225E894 (SysTask * param0, void * param1) v0->unk_12++; case 2: - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); if ((v0->unk_1C == 1) || (v0->unk_1C == 3)) { if (v2 < (24 * 8)) { sub_0200D5DC(v0->unk_0C->unk_00, 8, 0); } else { - sub_0200D4C4(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); } } - sub_0200D550(v0->unk_0C->unk_00, &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_0C->unk_00, &v2, &v3); sub_02008274(v0->unk_08, 1, 8 / 2); if (sub_020080C0(v0->unk_08, 1) >= v0->unk_14) { @@ -1753,7 +1753,7 @@ static void ov16_0225E894 (SysTask * param0, void * param1) Pokemon_PlayDelayedCry(BattleSystem_ChatotVoice(v0->unk_00, v0->unk_11), v0->unk_18, v0->unk_16, v0->unk_2C, 117, 127, NULL, 5, v4); } - sub_0200D4C4(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_0C->unk_00, (24 * 8), (8 * 11)); sub_020086FC(v0->unk_08, 8, 0, 0, 0x0); v0->unk_12++; @@ -2407,22 +2407,22 @@ static void ov16_0225FA70 (SysTask * param0, void * param1) v0->unk_0E = 2; case 2: - sub_0200D550(v0->unk_04->unk_00, &v1, &v2); - sub_0200D550(v0->unk_08, &v3, &v4); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); if (v0->unk_0F == 2) { if ((v0->unk_14 == 1) || (v0->unk_14 == 3)) { if (v1 < (24 * 8)) { sub_0200D5DC(v0->unk_04->unk_00, 8, 0); } else { - sub_0200D4C4(v0->unk_04->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); } } - sub_0200D550(v0->unk_04->unk_00, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 1) || ((v0->unk_14 == 3) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x4 | 0x1) | 0x2))))) { - sub_0200D4C4(v0->unk_08, v1, v4); + SpriteActor_SetSpritePositionXY(v0->unk_08, v1, v4); } else if (v0->unk_14 == 3) { v1 = v3 - v1; v1 -= 24; @@ -2435,13 +2435,13 @@ static void ov16_0225FA70 (SysTask * param0, void * param1) sub_0200D5DC(v0->unk_08, v1, 0); } - sub_0200D550(v0->unk_08, &v3, &v4); + SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); if (v3 >= v0->unk_10) { - sub_0200D4C4(v0->unk_08, v0->unk_10, v4); + SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_10, v4); if ((v0->unk_14 == 1) || (v0->unk_14 == 3)) { - sub_0200D4C4(v0->unk_04->unk_00, (24 * 8), (8 * 11)); + SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, (24 * 8), (8 * 11)); } if (sub_0200D358(v0->unk_08) > 1) { @@ -2458,14 +2458,14 @@ static void ov16_0225FA70 (SysTask * param0, void * param1) if (v1 > 64) { sub_0200D5DC(v0->unk_04->unk_00, -8, 0); } else { - sub_0200D4C4(v0->unk_04->unk_00, 64, (128 + 8)); + SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, 64, (128 + 8)); } } - sub_0200D550(v0->unk_04->unk_00, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_00, &v1, &v2); if ((v0->unk_14 == 0) || ((v0->unk_14 == 2) && ((v5 == (0x2 | 0x1)) || (v5 == ((0x2 | 0x1) | 0x80)) || (v5 == ((0x2 | 0x1) | 0x10)) || (v5 == ((0x4 | 0x1) | 0x2))))) { - sub_0200D4C4(v0->unk_08, v1, v4); + SpriteActor_SetSpritePositionXY(v0->unk_08, v1, v4); } else if (v0->unk_14 == 2) { v1 = v1 - v3; v1 -= 24; @@ -2478,13 +2478,13 @@ static void ov16_0225FA70 (SysTask * param0, void * param1) sub_0200D5DC(v0->unk_08, -v1, 0); } - sub_0200D550(v0->unk_08, &v3, &v4); + SpriteActor_GetSpritePositionXY(v0->unk_08, &v3, &v4); if (v3 <= v0->unk_10) { - sub_0200D4C4(v0->unk_08, v0->unk_10, v4); + SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_10, v4); if ((v0->unk_14 == 0) || (v0->unk_14 == 2)) { - sub_0200D4C4(v0->unk_04->unk_00, 64, (128 + 8)); + SpriteActor_SetSpritePositionXY(v0->unk_04->unk_00, 64, (128 + 8)); } v0->unk_0E = 4; @@ -2654,7 +2654,7 @@ static void ov16_0225FD5C (SysTask * param0, void * param1) case 1: if (v0->unk_0B == 2) { sub_0200D5DC(v0->unk_04->unk_18, 5, 0); - sub_0200D550(v0->unk_04->unk_18, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); if ((v1 >= (256 - 48) - 48) && (ov12_02237890(v0->unk_04->unk_84) != 0)) { ov12_02237E0C(v0->unk_04->unk_84, 1); @@ -2673,16 +2673,16 @@ static void ov16_0225FD5C (SysTask * param0, void * param1) } } else if (v1 >= (256 + 40)) { { - AnimationResourceCollection * v8; + SpriteGfxHandler * v8; v8 = ov16_0223E018(v0->unk_00); sub_0200D0F4(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; - sub_0200D070(v8, 20015 + v0->unk_04->battlerType); - sub_0200D080(v8, 20010 + v0->unk_04->battlerType); - sub_0200D090(v8, 20007 + v0->unk_04->battlerType); - sub_0200D0A0(v8, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCharObjById(v8, 20015 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadPlttObjById(v8, 20010 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCellObjById(v8, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadAnimObjById(v8, 20007 + v0->unk_04->battlerType); } v0->unk_0A = 6; } @@ -2695,7 +2695,7 @@ static void ov16_0225FD5C (SysTask * param0, void * param1) break; case 2: sub_0200D5DC(v0->unk_04->unk_18, -5, 0); - sub_0200D550(v0->unk_04->unk_18, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); if (v0->unk_04->unk_84) { v3 = sub_0200D3E0(v0->unk_04->unk_18); @@ -2726,23 +2726,23 @@ static void ov16_0225FD5C (SysTask * param0, void * param1) if (v1 <= -40) { { - AnimationResourceCollection * v10; + SpriteGfxHandler * v10; v10 = ov16_0223E018(v0->unk_00); sub_0200D0F4(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; - sub_0200D070(v10, 20015 + v0->unk_04->battlerType); - sub_0200D080(v10, 20010 + v0->unk_04->battlerType); - sub_0200D090(v10, 20007 + v0->unk_04->battlerType); - sub_0200D0A0(v10, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCharObjById(v10, 20015 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadPlttObjById(v10, 20010 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCellObjById(v10, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadAnimObjById(v10, 20007 + v0->unk_04->battlerType); } v0->unk_0A = 6; } break; case 3: - sub_0200D550(v0->unk_04->unk_18, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); v3 = sub_0200D3E0(v0->unk_04->unk_18); if (v3 == 4) { @@ -2801,14 +2801,14 @@ static void ov16_02260284 (SysTask * param0, void * param1) case 0: if (v0->unk_0B == 2) { sub_0200D5DC(v0->unk_04->unk_18, 5, 0); - sub_0200D550(v0->unk_04->unk_18, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); if (v1 >= (256 + 40)) { v0->unk_0A++; } } else { sub_0200D5DC(v0->unk_04->unk_18, -5, 0); - sub_0200D550(v0->unk_04->unk_18, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04->unk_18, &v1, &v2); if (v1 <= -40) { v0->unk_0A++; @@ -2817,16 +2817,16 @@ static void ov16_02260284 (SysTask * param0, void * param1) break; case 1: { - AnimationResourceCollection * v3; + SpriteGfxHandler * v3; v3 = ov16_0223E018(v0->unk_00); sub_0200D0F4(v0->unk_04->unk_18); v0->unk_04->unk_18 = NULL; - sub_0200D070(v3, 20015 + v0->unk_04->battlerType); - sub_0200D080(v3, 20010 + v0->unk_04->battlerType); - sub_0200D090(v3, 20007 + v0->unk_04->battlerType); - sub_0200D0A0(v3, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCharObjById(v3, 20015 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadPlttObjById(v3, 20010 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadCellObjById(v3, 20007 + v0->unk_04->battlerType); + SpriteGfxHandler_UnloadAnimObjById(v3, 20007 + v0->unk_04->battlerType); } ClearCommand(v0->unk_00, v0->unk_09, v0->unk_08); Heap_FreeToHeap(param1); @@ -2842,7 +2842,7 @@ static void ov16_02260384 (SysTask * param0, void * param1) switch (v0->unk_0A) { case 0: - sub_0200D550(v0->unk_04, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); if (v0->unk_0B == 0) { v1 += 5; @@ -2860,7 +2860,7 @@ static void ov16_02260384 (SysTask * param0, void * param1) } } - sub_0200D4C4(v0->unk_04, v1, v2); + SpriteActor_SetSpritePositionXY(v0->unk_04, v1, v2); break; case 1: ClearCommand(v0->unk_00, v0->unk_09, v0->unk_08); @@ -3641,7 +3641,7 @@ static void ov16_0226110C (SysTask * param0, void * param1) static void ov16_022611DC (SysTask * param0, void * param1) { UnkStruct_ov16_0225D794 * v0 = (UnkStruct_ov16_0225D794 *)param1; - PaletteSys * v1; + PaletteData * v1; v1 = BattleSystem_PaletteSys(v0->unk_00); @@ -4245,7 +4245,7 @@ static void ov16_02261DE0 (SysTask * param0, void * param1) static void ov16_02261E8C (SysTask * param0, void * param1) { UnkStruct_ov16_0225D840 * v0 = (UnkStruct_ov16_0225D840 *)param1; - PaletteSys * v1; + PaletteData * v1; v1 = BattleSystem_PaletteSys(v0->unk_00); @@ -4980,7 +4980,7 @@ static void ov16_02262A9C (SysTask * param0, void * param1) static void ov16_02262D28 (SysTask * param0, void * param1) { UnkStruct_ov16_0225DC7C * v0 = (UnkStruct_ov16_0225DC7C *)param1; - PaletteSys * v1; + PaletteData * v1; UnkStruct_02007768 * v2; v1 = BattleSystem_PaletteSys(v0->unk_00); @@ -5187,7 +5187,7 @@ static void ov16_02263014 (SysTask * param0, void * param1) { UnkStruct_ov16_0225CBB8 * v0 = (UnkStruct_ov16_0225CBB8 *)param1; BGL * v1; - PaletteSys * v2; + PaletteData * v2; int v3; int v4; @@ -5316,7 +5316,7 @@ static void ov16_02263014 (SysTask * param0, void * param1) static void ov16_022633A4 (SysTask * param0, void * param1) { UnkStruct_ov16_0225E0BC * v0 = (UnkStruct_ov16_0225E0BC *)param1; - PaletteSys * v1; + PaletteData * v1; v1 = BattleSystem_PaletteSys(v0->unk_00); @@ -5443,13 +5443,13 @@ static void ShowPartyGaugeTask (SysTask * param0, void * param1) } } - v3 = ov16_0226D194(v0->status, v1, v4, v5, ov16_0223E010(v0->battleSys), ov16_0223E018(v0->battleSys)); + v3 = PartyGauge_Show(v0->status, v1, v4, v5, ov16_0223E010(v0->battleSys), ov16_0223E018(v0->battleSys)); ov16_0223E040(v0->battleSys, v1, v3); } v0->state++; break; case 1: - if (ov16_0226D1FC(ov16_0223E034(v0->battleSys, v1)) == 1) { + if (PartyGauge_ShowIsDone(ov16_0223E034(v0->battleSys, v1)) == 1) { v0->state++; } break; @@ -5487,12 +5487,12 @@ static void HidePartyGaugeTask (SysTask * param0, void * param1) v4 = HIDE_PARTY_GAUGE_MID_BATTLE; } - ov16_0226D220(v2, v3, v4); + PartyGauge_Hide(v2, v3, v4); v0->state++; break; case 1: - if (ov16_0226D258(v2) == 1) { - ov16_0226D27C(v2); + if (PartyGauge_HideIsDone(v2) == 1) { + PartyGauge_Free(v2); ov16_0223E040(v0->battleSys, v1, NULL); v0->state++; } @@ -6215,9 +6215,9 @@ static void ov16_02264360 (BattleSystem * param0, BattlerData * param1, BattleMe static CellActorData * ov16_022643B8 (BattleSystem * param0, int param1, int param2, int param3, s16 param4, s16 param5) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; CellActorData * v3; int v4; diff --git a/src/overlay016/ov16_02266F1C.c b/src/overlay016/ov16_02266F1C.c index 7494799d7b..88ebd04909 100644 --- a/src/overlay016/ov16_02266F1C.c +++ b/src/overlay016/ov16_02266F1C.c @@ -19,7 +19,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_0205AA50.h" #include "overlay016/struct_ov16_022674C4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "narc.h" @@ -67,11 +67,11 @@ static void ov16_02267C58(UnkStruct_ov16_022674C4 * param0); static void ov16_02267CA8(UnkStruct_ov16_022674C4 * param0, int param1); static void ov16_02267CE8(UnkStruct_ov16_022674C4 * param0, u32 param1); static void ov16_02267DC4(UnkStruct_ov16_022674C4 * param0, u32 param1); -static void ov16_02266FE4(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, PaletteSys * param3, int param4); +static void ov16_02266FE4(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, PaletteData * param3, int param4); static void ov16_02267244(UnkStruct_ov16_022674C4 * param0); static void ov16_0226728C(UnkStruct_ov16_022674C4 * param0); -static const UnkStruct_ov104_0223F9E0 * ov16_022682B0(u8 param0); -static const UnkStruct_ov104_0223F9E0 * ov16_02268314(u8 param0); +static const SpriteTemplate * ov16_022682B0(u8 param0); +static const SpriteTemplate * ov16_02268314(u8 param0); static void ov16_0226774C(SysTask * param0, void * param1); static void ov16_02268380(SysTask * param0, void * param1); void ov16_02268470(UnkStruct_ov16_022674C4 * param0); @@ -303,7 +303,7 @@ static const UnkStruct_ov16_0226F64C Unk_ov16_0226F3D4[] = { {0x0, 0x0} }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F5B0 = { +static const SpriteTemplate Unk_ov16_0226F5B0 = { 0xC0, 0x74, 0x0, @@ -316,7 +316,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F5B0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F5E4 = { +static const SpriteTemplate Unk_ov16_0226F5E4 = { 0x3A, 0x24, 0x0, @@ -329,7 +329,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F5E4 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F4AC = { +static const SpriteTemplate Unk_ov16_0226F4AC = { 0xC0, 0x67, 0x0, @@ -342,7 +342,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F4AC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F4E0 = { +static const SpriteTemplate Unk_ov16_0226F4E0 = { 0x40, 0x10, 0x0, @@ -355,7 +355,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F4E0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F548 = { +static const SpriteTemplate Unk_ov16_0226F548 = { 0xC6, 0x84, 0x0, @@ -368,7 +368,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F548 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F618 = { +static const SpriteTemplate Unk_ov16_0226F618 = { 0x3A, 0x2D, 0x0, @@ -381,7 +381,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F618 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F514 = { +static const SpriteTemplate Unk_ov16_0226F514 = { 0x0, 0x0, 0x0, @@ -394,7 +394,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F514 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F57C = { +static const SpriteTemplate Unk_ov16_0226F57C = { 0xC0, 0x74, 0x0, @@ -409,46 +409,46 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0226F57C = { #include "overlay016/rodata_ov16_0226F6AC.h" -void ov16_02266F1C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, PaletteSys * param3, int param4) +void ov16_02266F1C (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, PaletteData * param3, int param4) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; v0 = ov16_022682B0(param4); - sub_0200CC3C(param0, param1, param2, v0->unk_14[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->unk_14[0]); - sub_0200CDC4(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); - sub_0200CE24(param0, param1, param2, v0->unk_14[2], 1, v0->unk_14[2]); - sub_0200CE54(param0, param1, param2, v0->unk_14[3], 1, v0->unk_14[3]); - sub_0200CDC4(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20007); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, v0->resources[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[0]); + SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, v0->resources[2], 1, v0->resources[2]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, v0->resources[3], 1, v0->resources[3]); + SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20007); if ((param4 == 6) || (param4 == 7)) { - sub_0200CDC4(param3, 2, param0, param1, param2, 81, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20008); + SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, 81, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20008); } } -static void ov16_02266FE4 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, PaletteSys * param3, int param4) +static void ov16_02266FE4 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, PaletteData * param3, int param4) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; v0 = ov16_02268314(param4); if (v0 != NULL) { - sub_0200CC3C(param0, param1, param2, v0->unk_14[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->unk_14[0]); - sub_0200CDC4(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); - sub_0200CE24(param0, param1, param2, v0->unk_14[2], 1, v0->unk_14[2]); - sub_0200CE54(param0, param1, param2, v0->unk_14[3], 1, v0->unk_14[3]); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, v0->resources[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[0]); + SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, 71, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20006); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, v0->resources[2], 1, v0->resources[2]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, v0->resources[3], 1, v0->resources[3]); } } -CellActorData * ov16_02267060 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2) +CellActorData * ov16_02267060 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; CellActorData * v1; v0 = ov16_022682B0(param2); - v1 = sub_0200CE6C(param0, param1, v0); + v1 = SpriteActor_LoadResources(param0, param1, v0); - sub_0200D324(v1->unk_00); + SpriteActor_UpdateObject(v1->unk_00); return v1; } @@ -592,24 +592,24 @@ static void ov16_02267244 (UnkStruct_ov16_022674C4 * param0) void ov16_02267258 (UnkStruct_ov16_022674C4 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - const UnkStruct_ov104_0223F9E0 * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + const SpriteTemplate * v2; v2 = ov16_022682B0(param0->unk_25); v0 = ov16_0223E010(param0->unk_0C); v1 = ov16_0223E018(param0->unk_0C); - sub_0200D070(v1, v2->unk_14[0]); - sub_0200D090(v1, v2->unk_14[2]); - sub_0200D0A0(v1, v2->unk_14[3]); + SpriteGfxHandler_UnloadCharObjById(v1, v2->resources[0]); + SpriteGfxHandler_UnloadCellObjById(v1, v2->resources[2]); + SpriteGfxHandler_UnloadAnimObjById(v1, v2->resources[3]); } static void ov16_0226728C (UnkStruct_ov16_022674C4 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - const UnkStruct_ov104_0223F9E0 * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + const SpriteTemplate * v2; v2 = ov16_02268314(param0->unk_25); @@ -620,17 +620,17 @@ static void ov16_0226728C (UnkStruct_ov16_022674C4 * param0) v0 = ov16_0223E010(param0->unk_0C); v1 = ov16_0223E018(param0->unk_0C); - sub_0200D070(v1, v2->unk_14[0]); - sub_0200D090(v1, v2->unk_14[2]); - sub_0200D0A0(v1, v2->unk_14[3]); + SpriteGfxHandler_UnloadCharObjById(v1, v2->resources[0]); + SpriteGfxHandler_UnloadCellObjById(v1, v2->resources[2]); + SpriteGfxHandler_UnloadAnimObjById(v1, v2->resources[3]); } void ov16_022672C4 (UnkStruct_ov16_022674C4 * param0) { - const UnkStruct_ov104_0223F9E0 * v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + const SpriteTemplate * v0; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; NARC * v4; v4 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, 5); @@ -645,7 +645,7 @@ void ov16_022672C4 (UnkStruct_ov16_022674C4 * param0) ov16_02266FE4(v1, v2, v4, v3, param0->unk_25); if (param0->unk_08 != NULL) { - sub_0200D494(param0->unk_08->unk_00, v0->unk_00 - Unk_ov16_0226F334[param0->unk_25], v0->unk_02 + 0); + sub_0200D494(param0->unk_08->unk_00, v0->x - Unk_ov16_0226F334[param0->unk_25], v0->y + 0); } NARC_dtor(v4); @@ -793,7 +793,7 @@ void ov16_022675AC (UnkStruct_ov16_022674C4 * param0) { if (param0->unk_08 != NULL) { sub_02021CC8(param0->unk_08->unk_00, 0); - sub_02021E50(param0->unk_08->unk_00, 0); + SpriteActor_SetAnimFrame(param0->unk_08->unk_00, 0); ov16_022675F8(param0, 0); } @@ -836,15 +836,15 @@ void ov16_02267620 (UnkStruct_ov16_022674C4 * param0, int param1) void ov16_0226763C (UnkStruct_ov16_022674C4 * param0, int param1, int param2) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; GF_ASSERT(param0->unk_04 != NULL); v0 = ov16_022682B0(param0->unk_25); - sub_0200D494(param0->unk_04->unk_00, v0->unk_00 + param1, v0->unk_02 + param2); + sub_0200D494(param0->unk_04->unk_00, v0->x + param1, v0->y + param2); if (param0->unk_08 != NULL) { - sub_0200D494(param0->unk_08->unk_00, v0->unk_00 + param1 - Unk_ov16_0226F334[param0->unk_25], v0->unk_02 + param2 + 0); + sub_0200D494(param0->unk_08->unk_00, v0->x + param1 - Unk_ov16_0226F334[param0->unk_25], v0->y + param2 + 0); } } @@ -880,13 +880,13 @@ static void ov16_0226774C (SysTask * param0, void * param1) { UnkStruct_ov16_022674C4 * v0 = param1; s16 v1, v2; - const UnkStruct_ov104_0223F9E0 * v3; + const SpriteTemplate * v3; int v4; v4 = 0; v3 = ov16_022682B0(v0->unk_25); - sub_0200D550(v0->unk_04, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); switch (v0->unk_25) { case 0: @@ -897,15 +897,15 @@ static void ov16_0226774C (SysTask * param0, void * param1) if (v0->unk_4F_0 == 0) { v1 -= 24; - if (v1 < v3->unk_00) { - v1 = v3->unk_00; + if (v1 < v3->x) { + v1 = v3->x; v4++; } } else { v1 += 24; - if (v1 > v3->unk_00 + 160) { - v1 = v3->unk_00 + 160; + if (v1 > v3->x + 160) { + v1 = v3->x + 160; v4++; } } @@ -914,25 +914,25 @@ static void ov16_0226774C (SysTask * param0, void * param1) if (v0->unk_4F_0 == 0) { v1 += 24; - if (v1 > v3->unk_00) { - v1 = v3->unk_00; + if (v1 > v3->x) { + v1 = v3->x; v4++; } } else { v1 -= 24; - if (v1 < v3->unk_00 - 24) { - v1 = v3->unk_00 - 24; + if (v1 < v3->x - 24) { + v1 = v3->x - 24; v4++; } } break; } - sub_0200D4C4(v0->unk_04, v1, v2); + SpriteActor_SetSpritePositionXY(v0->unk_04, v1, v2); if (v0->unk_08 != NULL) { - sub_0200D4C4(v0->unk_08, v1 - Unk_ov16_0226F334[v0->unk_25], v2 + 0); + SpriteActor_SetSpritePositionXY(v0->unk_08, v1 - Unk_ov16_0226F334[v0->unk_25], v2 + 0); } if (v4 > 0) { @@ -1537,9 +1537,9 @@ u8 ov16_0226825C (int param0, u32 param1) return 0; } -static const UnkStruct_ov104_0223F9E0 * ov16_022682B0 (u8 param0) +static const SpriteTemplate * ov16_022682B0 (u8 param0) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; switch (param0) { case 0: @@ -1572,9 +1572,9 @@ static const UnkStruct_ov104_0223F9E0 * ov16_022682B0 (u8 param0) return v0; } -static const UnkStruct_ov104_0223F9E0 * ov16_02268314 (u8 param0) +static const SpriteTemplate * ov16_02268314 (u8 param0) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; switch (param0) { case 0: @@ -1614,9 +1614,9 @@ void ov16_0226834C (UnkStruct_ov16_022674C4 * param0, u8 * param1) static void ov16_02268380 (SysTask * param0, void * param1) { UnkStruct_ov16_0226834C * v0 = param1; - AnimationResourceCollection * v1; + SpriteGfxHandler * v1; int v2; - PaletteSys * v3; + PaletteData * v3; v1 = ov16_0223E018(v0->unk_00->unk_0C); v3 = BattleSystem_PaletteSys(v0->unk_00->unk_0C); diff --git a/src/overlay016/ov16_02268520.c b/src/overlay016/ov16_02268520.c index a3f81c6394..dfffd9e24a 100644 --- a/src/overlay016/ov16_02268520.c +++ b/src/overlay016/ov16_02268520.c @@ -8,7 +8,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "overlay016/struct_ov16_02268520.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "narc.h" @@ -16,7 +16,7 @@ #include "overlay016/ov16_0223DF00.h" #include "overlay016/ov16_02268520.h" -static const UnkStruct_ov104_0223F9E0 Unk_ov16_022700CC[] = { +static const SpriteTemplate Unk_ov16_022700CC[] = { { 0x150, 0x88, @@ -174,9 +174,9 @@ __attribute__((aligned(4))) static const u16 Unk_ov16_02270134[][3] = { void ov16_02268520 (UnkStruct_ov16_02268520 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - const UnkStruct_ov104_0223F9E0 * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + const SpriteTemplate * v2; int v3, v4, v5, v6, v7, v8; int v9; NARC * v10; @@ -203,26 +203,26 @@ void ov16_02268520 (UnkStruct_ov16_02268520 * param0) v8 = 20006; } - sub_0200CC3C(v0, v1, v10, v3, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); - sub_0200CDC4(BattleSystem_PaletteSys(param0->unk_04), 2, v0, v1, v10, Unk_ov16_02270134[param0->unk_09][v9], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20009); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v10, v3, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadPalette(BattleSystem_PaletteSys(param0->unk_04), 2, v0, v1, v10, Unk_ov16_02270134[param0->unk_09][v9], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20009); PaletteSys_LoadPalette(BattleSystem_PaletteSys(param0->unk_04), 27, Unk_ov16_02270134[param0->unk_09][v9], 5, 0, 0x20, 0x7 * 0x10); - sub_0200CE24(v0, v1, v10, v5, 1, v6); - sub_0200CE54(v0, v1, v10, v7, 1, v8); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v10, v5, 1, v6); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v10, v7, 1, v8); NARC_dtor(v10); } void ov16_0226862C (UnkStruct_ov16_02268520 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - const UnkStruct_ov104_0223F9E0 * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + const SpriteTemplate * v2; v0 = ov16_0223E010(param0->unk_04); v1 = ov16_0223E018(param0->unk_04); v2 = &Unk_ov16_022700CC[param0->unk_08]; - param0->unk_00 = sub_0200CE6C(v0, v1, v2); - sub_0200D324(param0->unk_00->unk_00); + param0->unk_00 = SpriteActor_LoadResources(v0, v1, v2); + SpriteActor_UpdateObject(param0->unk_00->unk_00); } void ov16_02268660 (UnkStruct_ov16_02268520 * param0) @@ -237,7 +237,7 @@ void ov16_02268660 (UnkStruct_ov16_02268520 * param0) void ov16_02268674 (UnkStruct_ov16_02268520 * param0) { - AnimationResourceCollection * v0; + SpriteGfxHandler * v0; int v1, v2, v3; v0 = ov16_0223E018(param0->unk_04); @@ -252,10 +252,10 @@ void ov16_02268674 (UnkStruct_ov16_02268520 * param0) v3 = 20006; } - sub_0200D070(v0, v1); - sub_0200D080(v0, 20009); - sub_0200D090(v0, v2); - sub_0200D0A0(v0, v3); + SpriteGfxHandler_UnloadCharObjById(v0, v1); + SpriteGfxHandler_UnloadPlttObjById(v0, 20009); + SpriteGfxHandler_UnloadCellObjById(v0, v2); + SpriteGfxHandler_UnloadAnimObjById(v0, v3); } void ov16_022686BC (UnkStruct_ov16_02268520 * param0, int param1) diff --git a/src/overlay016/ov16_0226871C.c b/src/overlay016/ov16_0226871C.c index c202f97016..b519bddff4 100644 --- a/src/overlay016/ov16_0226871C.c +++ b/src/overlay016/ov16_0226871C.c @@ -37,7 +37,7 @@ #include "overlay016/struct_ov16_0226AC98.h" #include "overlay016/struct_ov16_0226C378.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002328.h" #include "unk_02002B7C.h" @@ -830,7 +830,7 @@ static const UnkStruct_ov16_02270670 Unk_ov16_02270670[] = { } }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270414 = { +static const SpriteTemplate Unk_ov16_02270414 = { 0xC, 0xD, 0x0, @@ -843,7 +843,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270414 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270448 = { +static const SpriteTemplate Unk_ov16_02270448 = { 0xF6, 0x9, 0x0, @@ -856,7 +856,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270448 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_0227047C = { +static const SpriteTemplate Unk_ov16_0227047C = { 0x0, 0x0, 0x0, @@ -869,7 +869,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_0227047C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov16_022704B0 = { +static const SpriteTemplate Unk_ov16_022704B0 = { 0x0, 0x0, 0x0, @@ -1063,7 +1063,7 @@ void ov16_022687A0 (BGL * param0) void * ov16_022687C8 (NARC * param0, NARC * param1, BattleSystem * param2, int param3, UnkStruct_0209C370 * param4) { UnkStruct_ov16_02268A14 * v0; - PaletteSys * v1; + PaletteData * v1; int v2; v0 = ov16_0226871C(); @@ -1212,9 +1212,9 @@ void ov16_02268A14 (UnkStruct_ov16_02268A14 * param0) void ov16_02268A88 (UnkStruct_ov16_02268A14 * param0) { BGL * v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; int v4; v1 = ov16_0223E010(param0->unk_00); @@ -1250,8 +1250,8 @@ void ov16_02268A88 (UnkStruct_ov16_02268A14 * param0) void ov16_02268B8C (UnkStruct_ov16_02268A14 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; v1 = ov16_0223E010(param0->unk_00); v2 = ov16_0223E018(param0->unk_00); @@ -1274,8 +1274,8 @@ void ov16_02268C04 (NARC * param0, NARC * param1, UnkStruct_ov16_02268A14 * para const UnkStruct_ov16_02270670 * v0, * v1; int v2; BGL * v3; - CellTransferStateData * v4; - AnimationResourceCollection * v5; + SpriteRenderer * v4; + SpriteGfxHandler * v5; if (param5 != NULL) { MI_CpuCopy8(param5, ¶m2->unk_1A, sizeof(UnkStruct_ov16_02268A14_sub2)); @@ -1325,7 +1325,7 @@ void ov16_02268C04 (NARC * param0, NARC * param1, UnkStruct_ov16_02268A14 * para } } - sub_0200CDC4(BattleSystem_PaletteSys(param2->unk_00), 3, v4, v5, param1, 72, 0, 7, NNS_G2D_VRAM_TYPE_2DSUB, 20023); + SpriteRenderer_LoadPalette(BattleSystem_PaletteSys(param2->unk_00), 3, v4, v5, param1, 72, 0, 7, NNS_G2D_VRAM_TYPE_2DSUB, 20023); param2->unk_66B = param3; G2S_SetBlendAlpha((GX_BLEND_PLANEMASK_BG1), (GX_BLEND_BGALL), 8, 12); @@ -1341,28 +1341,28 @@ void ov16_02268C04 (NARC * param0, NARC * param1, UnkStruct_ov16_02268A14 * para void ov16_02268D40 (NARC * param0, UnkStruct_ov16_02268A14 * param1) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; GF_ASSERT(param1->unk_5BC[0] == NULL && param1->unk_5D4[0] == NULL); v1 = ov16_0223E010(param1->unk_00); v2 = ov16_0223E018(param1->unk_00); - sub_0200CC3C(v1, v2, param0, 208, 1, NNS_G2D_VRAM_TYPE_2DSUB, 20023); - sub_0200CE24(v1, v2, param0, 207, 1, 20015); - sub_0200CE54(v1, v2, param0, 209, 1, 20015); + SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, param0, 208, 1, NNS_G2D_VRAM_TYPE_2DSUB, 20023); + SpriteRenderer_LoadCellResObjFromOpenNarc(v1, v2, param0, 207, 1, 20015); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v1, v2, param0, 209, 1, 20015); - sub_0200CC3C(v1, v2, param0, 205, 1, NNS_G2D_VRAM_TYPE_2DSUB, 20024); - sub_0200CE24(v1, v2, param0, 204, 1, 20016); - sub_0200CE54(v1, v2, param0, 206, 1, 20016); + SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, param0, 205, 1, NNS_G2D_VRAM_TYPE_2DSUB, 20024); + SpriteRenderer_LoadCellResObjFromOpenNarc(v1, v2, param0, 204, 1, 20016); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v1, v2, param0, 206, 1, 20016); for (v0 = 0; v0 < 6; v0++) { - param1->unk_5BC[v0] = sub_0200CE6C(v1, v2, &Unk_ov16_02270414); + param1->unk_5BC[v0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_02270414); sub_0200D4D0(param1->unk_5BC[v0]->unk_00, 12 + 19 * v0, 13, ((192 + 80) << FX32_SHIFT)); sub_0200D6A4(param1->unk_5BC[v0], 1); - param1->unk_5D4[v0] = sub_0200CE6C(v1, v2, &Unk_ov16_02270448); + param1->unk_5D4[v0] = SpriteActor_LoadResources(v1, v2, &Unk_ov16_02270448); sub_0200D4D0(param1->unk_5D4[v0]->unk_00, 246 + -12 * v0, 9, ((192 + 80) << FX32_SHIFT)); } @@ -1372,7 +1372,7 @@ void ov16_02268D40 (NARC * param0, UnkStruct_ov16_02268A14 * param1) param1->unk_08 = SysTask_Start(ov16_02268FCC, param1, 1300); { - PaletteSys * v3; + PaletteData * v3; v3 = BattleSystem_PaletteSys(param1->unk_00); ov16_0226DB7C(v1, v2, v3, 5, 20411, 20035, 20405, 20394); @@ -1383,21 +1383,21 @@ void ov16_02268D40 (NARC * param0, UnkStruct_ov16_02268A14 * param1) static void ov16_02268F00 (UnkStruct_ov16_02268A14 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; GF_ASSERT(param0->unk_5BC[0] != NULL && param0->unk_5D4[0] != NULL); v1 = ov16_0223E010(param0->unk_00); v2 = ov16_0223E018(param0->unk_00); - sub_0200D070(v2, 20023); - sub_0200D090(v2, 20015); - sub_0200D0A0(v2, 20015); - sub_0200D070(v2, 20024); - sub_0200D090(v2, 20016); - sub_0200D0A0(v2, 20016); - sub_0200D080(v2, 20023); + SpriteGfxHandler_UnloadCharObjById(v2, 20023); + SpriteGfxHandler_UnloadCellObjById(v2, 20015); + SpriteGfxHandler_UnloadAnimObjById(v2, 20015); + SpriteGfxHandler_UnloadCharObjById(v2, 20024); + SpriteGfxHandler_UnloadCellObjById(v2, 20016); + SpriteGfxHandler_UnloadAnimObjById(v2, 20016); + SpriteGfxHandler_UnloadPlttObjById(v2, 20023); for (v0 = 0; v0 < 6; v0++) { sub_0200D0F4(param0->unk_5BC[v0]); @@ -1516,13 +1516,13 @@ void ov16_02269168 (UnkStruct_ov16_02268A14 * param0, u8 param1[], u8 param2[]) for (v0 = 0; v0 < 6; v0++) { v1 = ov16_0226A934(param1[v0]); - sub_02021D6C(param0->unk_5BC[v0]->unk_00, v1); - sub_0200D324(param0->unk_5BC[v0]->unk_00); + SpriteActor_SetSpriteAnimActive(param0->unk_5BC[v0]->unk_00, v1); + SpriteActor_UpdateObject(param0->unk_5BC[v0]->unk_00); v1 = ov16_0226A934(param2[v0]); - sub_02021D6C(param0->unk_5D4[v0]->unk_00, v1); - sub_0200D324(param0->unk_5D4[v0]->unk_00); + SpriteActor_SetSpriteAnimActive(param0->unk_5D4[v0]->unk_00, v1); + SpriteActor_UpdateObject(param0->unk_5D4[v0]->unk_00); } } @@ -1533,12 +1533,12 @@ void ov16_022691BC (UnkStruct_ov16_02268A14 * param0) GF_ASSERT(param0->unk_5BC[0] != NULL && param0->unk_5D4[0] != NULL); for (v0 = 0; v0 < 6; v0++) { - sub_0200D3EC(param0->unk_5BC[v0]->unk_00, 1); + SpriteActor_DrawSprite(param0->unk_5BC[v0]->unk_00, 1); } if (BattleSystem_BattleType(param0->unk_00) & 0x1) { for (v0 = 0; v0 < 6; v0++) { - sub_0200D3EC(param0->unk_5D4[v0]->unk_00, 1); + SpriteActor_DrawSprite(param0->unk_5D4[v0]->unk_00, 1); } } } @@ -1550,8 +1550,8 @@ void ov16_02269218 (UnkStruct_ov16_02268A14 * param0) GF_ASSERT(param0->unk_5BC[0] != NULL && param0->unk_5D4[0] != NULL); for (v0 = 0; v0 < 6; v0++) { - sub_0200D3EC(param0->unk_5BC[v0]->unk_00, 0); - sub_0200D3EC(param0->unk_5D4[v0]->unk_00, 0); + SpriteActor_DrawSprite(param0->unk_5BC[v0]->unk_00, 0); + SpriteActor_DrawSprite(param0->unk_5D4[v0]->unk_00, 0); } } @@ -2439,10 +2439,10 @@ static int ov16_0226A634 (UnkStruct_ov16_02268A14 * param0, int param1, int para static void ov16_0226A698 (UnkStruct_ov16_02268A14 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; + SpriteRenderer * v0; + SpriteGfxHandler * v1; int v2, v3, v4; - PaletteSys * v5; + PaletteData * v5; v0 = ov16_0223E010(param0->unk_00); v1 = ov16_0223E018(param0->unk_00); @@ -2455,16 +2455,16 @@ static void ov16_0226A698 (UnkStruct_ov16_02268A14 * param0) static void ov16_0226A718 (UnkStruct_ov16_02268A14 * param0) { - AnimationResourceCollection * v0; + SpriteGfxHandler * v0; v0 = ov16_0223E018(param0->unk_00); - sub_0200D070(v0, 20036); - sub_0200D070(v0, 20037); - sub_0200D070(v0, 20038); - sub_0200D090(v0, 20021); - sub_0200D0A0(v0, 20021); - sub_0200D080(v0, 20022); + SpriteGfxHandler_UnloadCharObjById(v0, 20036); + SpriteGfxHandler_UnloadCharObjById(v0, 20037); + SpriteGfxHandler_UnloadCharObjById(v0, 20038); + SpriteGfxHandler_UnloadCellObjById(v0, 20021); + SpriteGfxHandler_UnloadAnimObjById(v0, 20021); + SpriteGfxHandler_UnloadPlttObjById(v0, 20022); } static void ov16_0226A768 (UnkStruct_ov16_02268A14 * param0) @@ -2486,10 +2486,10 @@ static void ov16_0226A768 (UnkStruct_ov16_02268A14 * param0) static CellActorData * ov16_0226A7A4 (UnkStruct_ov16_02268A14 * param0, Pokemon * param1, int param2, int param3, int param4, int param5) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; + SpriteRenderer * v0; + SpriteGfxHandler * v1; u32 v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; CellActorData * v4; int v5; @@ -2525,12 +2525,12 @@ static CellActorData * ov16_0226A7A4 (UnkStruct_ov16_02268A14 * param0, Pokemon sub_0200CBDC(v0, v1, 19, Pokemon_IconSpriteIndex(param1), 0, NNS_G2D_VRAM_TYPE_2DSUB, v2); v3 = Unk_ov16_022704B0; - v3.unk_14[0] = v2; - v3.unk_00 = Unk_ov16_02270304[v5][0]; - v3.unk_02 = Unk_ov16_02270304[v5][1]; - v4 = sub_0200CE6C(v0, v1, &v3); + v3.resources[0] = v2; + v3.x = Unk_ov16_02270304[v5][0]; + v3.y = Unk_ov16_02270304[v5][1]; + v4 = SpriteActor_LoadResources(v0, v1, &v3); - sub_0200D500(v4, v3.unk_00, v3.unk_02, ((192 + 80) << FX32_SHIFT)); + sub_0200D500(v4, v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); sub_02021F24(v4->unk_00, Pokemon_IconPaletteIndex(param1)); { @@ -2620,7 +2620,7 @@ static void ov16_0226A98C (UnkStruct_ov16_02268A14 * param0, UnkStruct_ov16_0226 int v3; FontOAM * v4; BGL * v5; - AnimationResourceCollection * v6; + SpriteGfxHandler * v6; int v7, v8; GF_ASSERT(param1->unk_00 == NULL); @@ -2866,9 +2866,9 @@ static void ov16_0226AEA0 (UnkStruct_ov16_02268A14 * param0, const Strbuf *param static void ov16_0226AF0C (UnkStruct_ov16_02268A14 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + SpriteTemplate v3; UnkStruct_ov16_02260C00 * v4; int v5; int v6; @@ -2885,13 +2885,13 @@ static void ov16_0226AF0C (UnkStruct_ov16_02268A14 * param0) if (v4->unk_00[v0] != 0) { v5 = MoveTable_LoadParam(v4->unk_00[v0], MOVEATTRIBUTE_TYPE); - v3.unk_14[0] = 20025 + v0; - v3.unk_00 = Unk_ov16_022702B4[v0][0]; - v3.unk_02 = Unk_ov16_022702B4[v0][1]; + v3.resources[0] = 20025 + v0; + v3.x = Unk_ov16_022702B4[v0][0]; + v3.y = Unk_ov16_022702B4[v0][1]; param0->unk_5EC[v0] = sub_0207CA58(v1, v2, v5, &v3); - sub_0200D500(param0->unk_5EC[v0], v3.unk_00, v3.unk_02, ((192 + 80) << FX32_SHIFT)); + sub_0200D500(param0->unk_5EC[v0], v3.x, v3.y, ((192 + 80) << FX32_SHIFT)); { void * v8; @@ -2909,8 +2909,8 @@ static void ov16_0226AF0C (UnkStruct_ov16_02268A14 * param0) static void ov16_0226AFF4 (UnkStruct_ov16_02268A14 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; v1 = ov16_0223E010(param0->unk_00); v2 = ov16_0223E018(param0->unk_00); @@ -2926,8 +2926,8 @@ static void ov16_0226AFF4 (UnkStruct_ov16_02268A14 * param0) static void ov16_0226B028 (UnkStruct_ov16_02268A14 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; v1 = ov16_0223E010(param0->unk_00); v2 = ov16_0223E018(param0->unk_00); @@ -2948,7 +2948,7 @@ static void ov16_0226B06C (UnkStruct_ov16_02268A14 * param0, int param1, int par static void ov16_0226B088 (UnkStruct_ov16_02268A14 * param0, int param1) { - PaletteSys * v0; + PaletteData * v0; int v1; v0 = BattleSystem_PaletteSys(param0->unk_00); @@ -2961,7 +2961,7 @@ static void ov16_0226B088 (UnkStruct_ov16_02268A14 * param0, int param1) static void ov16_0226B0DC (UnkStruct_ov16_02268A14 * param0, int param1) { - PaletteSys * v0; + PaletteData * v0; int v1; const u8 v2[] = {6, 0xc, 0xd, 5}; BGL * v3; @@ -3117,7 +3117,7 @@ static void inline_ov16_0226B318_1 (SysTask * param0, void * param1) UnkStruct_ov16_02268A14 * v0 = param1; UnkStruct_ov16_02268A14_sub4 * v1; BGL * v2; - PaletteSys * v3; + PaletteData * v3; int v4, v5; v1 = &v0->unk_6A0; @@ -3159,7 +3159,7 @@ static void inline_ov16_0226B314_1 (SysTask * param0, void * param1) UnkStruct_ov16_02268A14 * v0 = param1; UnkStruct_ov16_02268A14_sub4 * v1; BGL * v2; - PaletteSys * v3; + PaletteData * v3; int v4, v5; u8 v6[4]; @@ -3717,7 +3717,7 @@ static void ov16_0226BCE4 (SysTask * param0, void * param1) UnkStruct_ov16_02268A14 * v0 = param1; int v1; u16 v2; - PaletteSys * v3; + PaletteData * v3; s16 v4; v3 = BattleSystem_PaletteSys(v0->unk_00); @@ -3748,7 +3748,7 @@ static void ov16_0226BCE4 (SysTask * param0, void * param1) static void ov16_0226BD74 (SysTask * param0, void * param1) { UnkStruct_ov16_02268A14 * v0 = param1; - PaletteSys * v1; + PaletteData * v1; u16 * v2; int v3; int v4, v5; @@ -4493,9 +4493,9 @@ static int(*const Unk_ov16_0227020C[])(UnkStruct_ov16_02268A14 *) = { static int ov16_0226CD18 (UnkStruct_ov16_02268A14 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; int v3; v0 = ov16_0223E010(param0->unk_00); @@ -4588,7 +4588,7 @@ static int ov16_0226CE34 (UnkStruct_ov16_02268A14 * param0) void ov16_0226CEB0 (UnkStruct_ov16_02268A14 * param0, int param1) { BGL * v0 = BattleSystem_BGL(param0->unk_00); - PaletteSys * v1 = BattleSystem_PaletteSys(param0->unk_00); + PaletteData * v1 = BattleSystem_PaletteSys(param0->unk_00); GF_ASSERT(param0->unk_66B == 18); diff --git a/src/overlay016/ov16_0226D094.c b/src/overlay016/ov16_0226D094.c deleted file mode 100644 index b65c232d2c..0000000000 --- a/src/overlay016/ov16_0226D094.c +++ /dev/null @@ -1,709 +0,0 @@ -#include "enums.h" - -#include -#include - -#include "assert.h" - -#include "struct_decls/struct_02002F38_decl.h" -#include "struct_decls/struct_02006C24_decl.h" -#include "struct_decls/struct_0200C6E4_decl.h" -#include "struct_decls/struct_0200C704_decl.h" -#include "struct_decls/sys_task.h" - -#include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" - -#include "unk_02005474.h" -#include "narc.h" -#include "unk_0200C6E4.h" -#include "unk_0200D9E8.h" -#include "heap.h" -#include "unk_020218BC.h" -#include "overlay016/ov16_0223DF00.h" -#include "overlay016/ov16_0226D094.h" - -typedef struct { - CellActorData *cells; - SysTask *task; - enum HideArrowType hideType; - enum PartyGaugeSide side; - enum PartyGaugePosition position; - s32 x; - s16 alpha; - u8 state; - u8 delay; -} PartyGaugeArrow; - -typedef struct { - CellActorData *cells; - SysTask *task; - enum PartyGaugeSide side; - enum PartyGaugePosition position; - enum HidePartyGaugeType hideType; - s8 *pokeballCount; - s16 *arrowAlpha; - s32 xStart; - s32 xEnd; - s32 xOverflow; - s16 delay; - u16 sdatID; - u8 state; - u8 ballSlot; - u8 flipAnimation; - u8 startDelay; -} PartyGaugePokeballs; - -typedef struct PartyGauge { - PartyGaugeArrow arrow; - PartyGaugePokeballs pokeballs[MAX_PARTY_SIZE]; - s8 pokeballCount; -} PartyGauge; - -static void ov16_0226D2A0(PartyGaugeArrow * param0, enum PartyGaugeSide param1, enum PartyGaugePosition param2, CellTransferStateData * param3, AnimationResourceCollection * param4); -static void ov16_0226D3F8(PartyGaugeArrow * param0, enum HideArrowType param1); -static void ov16_0226D540(PartyGaugePokeballs * param0, s8 * param1, enum PartyGaugeSide param2, enum ShowPartyGaugeType param3, enum PartyGaugePosition param4, int param5, int param6, CellTransferStateData * param7, AnimationResourceCollection * param8); -static void ov16_0226D938(PartyGaugePokeballs * param0, int param1, enum HidePartyGaugeType param2, s16 * param3); -static void ov16_0226D34C(SysTask * param0, void * param1); -static void ov16_0226D434(SysTask * param0, void * param1); -static void ov16_0226D654(SysTask * param0, void * param1); -static void ov16_0226D854(SysTask * param0, void * param1); -static void ov16_0226D99C(SysTask * param0, void * param1); -static void ov16_0226DAAC(SysTask * param0, void * param1); -static int ov16_0226DB04(int param0, enum PartyGaugeSide param1); -static int ov16_0226DB44(int param0); -static PartyGauge * ov16_0226D160(void); -static void ov16_0226D17C(PartyGauge * param0); - -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270A3C = { - 0x0, - 0x0, - 0x0, - 0x0, - 0xA, - 0x0, - NNS_G2D_VRAM_TYPE_2DMAIN, - {0x4FBD, 0x4E45, 0x4FB7, 0x4FAC, 0xFFFFFFFF, 0xFFFFFFFF}, - 0x0, - 0x0 -}; - -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270A70 = { - 0x0, - 0x0, - 0x0, - 0x0, - 0x8, - 0x0, - NNS_G2D_VRAM_TYPE_2DMAIN, - {0x4FBD, 0x4E45, 0x4FB7, 0x4FAC, 0xFFFFFFFF, 0xFFFFFFFF}, - 0x0, - 0x0 -}; - -__attribute__((aligned(4))) static const u16 Unk_ov16_02270A2C[] = { - 0x54, - 0x78, - 0x78 -}; - -__attribute__((aligned(4))) static const u16 Unk_ov16_02270A24[] = { - 0x14, - 0x38, - 0x38 -}; - -__attribute__((aligned(4))) static const u16 Unk_ov16_02270A34[] = { - 0x4E, - 0x72, - 0x72 -}; - -__attribute__((aligned(4))) static const u16 Unk_ov16_02270A1C[] = { - 0xE, - 0x32, - 0x32 -}; - -void ov16_0226D094 (CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2) -{ - NARC * v0; - - v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, 5); - - sub_0200CDC4(param2, 2, param0, param1, v0, 110, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20037); - sub_0200CC3C(param0, param1, v0, 340, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 20413); - sub_0200CE24(param0, param1, v0, 341, 1, 20407); - sub_0200CE54(param0, param1, v0, 342, 1, 20396); - NARC_dtor(v0); -} - -void ov16_0226D12C (AnimationResourceCollection * param0) -{ - sub_0200D070(param0, 20413); - sub_0200D080(param0, 20037); - sub_0200D090(param0, 20407); - sub_0200D0A0(param0, 20396); -} - -static PartyGauge * ov16_0226D160 (void) -{ - PartyGauge * v0; - - v0 = Heap_AllocFromHeap(5, sizeof(PartyGauge)); - MI_CpuClear8(v0, sizeof(PartyGauge)); - return v0; -} - -static void ov16_0226D17C (PartyGauge * param0) -{ - GF_ASSERT(param0->arrow.task == NULL); - Heap_FreeToHeap(param0); -} - -PartyGauge * ov16_0226D194 (u8 param0[], enum PartyGaugeSide param1, enum ShowPartyGaugeType param2, enum PartyGaugePosition param3, CellTransferStateData * param4, AnimationResourceCollection * param5) -{ - PartyGauge * v0; - int v1, v2; - - v0 = ov16_0226D160(); - ov16_0226D2A0(&v0->arrow, param1, param3, param4, param5); - - for (v1 = 0; v1 < 6; v1++) { - v2 = ov16_0226DB04(param0[v1], param1); - ov16_0226D540(&v0->pokeballs[v1], &v0->pokeballCount, param1, param2, param3, v1, v2, param4, param5); - } - - return v0; -} - -BOOL ov16_0226D1FC (PartyGauge * param0) -{ - int v0; - - if (param0->arrow.task == NULL) { - for (v0 = 0; v0 < 6; v0++) { - if (param0->pokeballs[v0].task != NULL) { - break; - } - } - - if (v0 == 6) { - return 1; - } - } - - return 0; -} - -void ov16_0226D220 (PartyGauge * param0, enum HideArrowType param1, enum HidePartyGaugeType param2) -{ - int v0; - - GF_ASSERT(param0 != NULL); - - ov16_0226D3F8(¶m0->arrow, param1); - - for (v0 = 0; v0 < 6; v0++) { - ov16_0226D938(¶m0->pokeballs[v0], v0, param2, ¶m0->arrow.alpha); - } -} - -BOOL ov16_0226D258 (PartyGauge * param0) -{ - int v0; - - if (param0->arrow.task == NULL) { - for (v0 = 0; v0 < 6; v0++) { - if (param0->pokeballs[v0].task != NULL) { - break; - } - } - - if (v0 == 6) { - return 1; - } - } - - return 0; -} - -void ov16_0226D27C (PartyGauge * param0) -{ - int v0; - - sub_0200D0F4(param0->arrow.cells); - - for (v0 = 0; v0 < 6; v0++) { - sub_0200D0F4(param0->pokeballs[v0].cells); - } - - ov16_0226D17C(param0); -} - -static void ov16_0226D2A0 (PartyGaugeArrow * param0, enum PartyGaugeSide param1, enum PartyGaugePosition param2, CellTransferStateData * param3, AnimationResourceCollection * param4) -{ - GF_ASSERT(param0->cells == NULL && param0->task == NULL); - - MI_CpuClear8(param0, sizeof(PartyGaugeArrow)); - - param0->cells = sub_0200CE6C(param3, param4, &Unk_ov16_02270A3C); - - if (param1 == PARTY_GAUGE_OURS) { - sub_0200D4C4(param0->cells, (256 + 96), Unk_ov16_02270A2C[param2]); - sub_02021D6C(param0->cells->unk_00, 8); - } else { - sub_0200D4C4(param0->cells, -96, Unk_ov16_02270A24[param2]); - sub_02021D6C(param0->cells->unk_00, 7); - } - - sub_0200D324(param0->cells->unk_00); - - param0->side = param1; - param0->position = param2; - param0->state = 0; - param0->task = SysTask_Start(ov16_0226D34C, param0, 500); - - Sound_PlayEffect(1809); -} - -static void ov16_0226D34C (SysTask * param0, void * param1) -{ - PartyGaugeArrow * v0 = param1; - - switch (v0->state) { - case 0: - { - s16 v1, v2; - - sub_0200D550(v0->cells, &v1, &v2); - v0->x = v1 << 8; - } - v0->state++; - - case 1: - if (v0->side == PARTY_GAUGE_OURS) { - v0->x -= 0x1200; - - if (v0->x <= (256 - 32) << 8) { - v0->x = (256 - 32) << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->x >> 8, Unk_ov16_02270A2C[v0->position]); - } else { - v0->x += 0x1200; - - if (v0->x >= 32 << 8) { - v0->x = 32 << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->x >> 8, Unk_ov16_02270A24[v0->position]); - } - break; - default: - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static void ov16_0226D3F8 (PartyGaugeArrow * param0, enum HideArrowType param1) -{ - GF_ASSERT(param0->cells != NULL && param0->task == NULL); - - param0->state = 0; - param0->hideType = param1; - - if (param1 == HIDE_ARROW_FADE_AND_SCROLL) { - param0->delay = 4; - } else { - param0->delay = 0; - } - - param0->task = SysTask_Start(ov16_0226D434, param0, 500); -} - -static void ov16_0226D434 (SysTask * param0, void * param1) -{ - PartyGaugeArrow * v0 = param1; - - switch (v0->state) { - case 0: - { - s16 v1, v2; - - sub_0200D550(v0->cells, &v1, &v2); - v0->x = v1 << 8; - } - - sub_0200D810(v0->cells, GX_OAM_MODE_XLU); - - v0->alpha = 16 << 8; - G2_SetBlendAlpha(GX_BLEND_PLANEMASK_NONE, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD, (v0->alpha >> 8), 16 - (v0->alpha >> 8)); - v0->state++; - case 1: - if (v0->delay > 0) { - v0->delay--; - break; - } - - v0->state++; - case 2: - if (v0->hideType == HIDE_ARROW_FADE_AND_SCROLL) { - if (v0->side == PARTY_GAUGE_OURS) { - v0->x -= 0x400; - sub_0200D4C4(v0->cells, v0->x >> 8, Unk_ov16_02270A2C[v0->position]); - } else { - v0->x += 0x400; - sub_0200D4C4(v0->cells, v0->x >> 8, Unk_ov16_02270A24[v0->position]); - } - } - - v0->alpha -= 0x100; - - if (v0->alpha <= 0) { - v0->alpha = 0; - sub_0200D3EC(v0->cells->unk_00, 0); - v0->state++; - } - - G2_ChangeBlendAlpha(v0->alpha >> 8, 16 - (v0->alpha >> 8)); - break; - default: - ov16_0223F9F0(); - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static void ov16_0226D540 (PartyGaugePokeballs * param0, s8 * param1, enum PartyGaugeSide param2, enum ShowPartyGaugeType param3, enum PartyGaugePosition param4, int param5, int param6, CellTransferStateData * param7, AnimationResourceCollection * param8) -{ - GF_ASSERT(param0->cells == NULL && param0->task == NULL); - - MI_CpuClear8(param0, sizeof(PartyGaugePokeballs)); - param0->cells = sub_0200CE6C(param7, param8, &Unk_ov16_02270A70); - - if (param2 == PARTY_GAUGE_OURS) { - sub_0200D4C4(param0->cells, (256 + 20), Unk_ov16_02270A34[param4]); - } else { - sub_0200D4C4(param0->cells, -20, Unk_ov16_02270A1C[param4]); - } - - sub_02021D6C(param0->cells->unk_00, param6); - sub_0200D324(param0->cells->unk_00); - - param0->side = param2; - param0->ballSlot = param5; - param0->position = param4; - param0->flipAnimation = ov16_0226DB44(param6); - param0->pokeballCount = param1; - param0->sdatID = ((param6 == 6) ? 1811 : 1810); - - if (param2 == PARTY_GAUGE_OURS) { - param0->xEnd = (256 - 128 + 20 + 14) + param5 * 16; - param0->xOverflow = (256 - 128 + 20 + 14) + param5 * 15 - 6; - } else { - param0->xEnd = (128 - 20 - 14) - param5 * 16; - param0->xOverflow = (128 - 20 - 14) - param5 * 15 + 6; - } - - param0->state = 0; - - if (param3 == SHOW_PARTY_GAUGE_BATTLE_START) { - param0->delay = 3 * param5 + 5; - param0->task = SysTask_Start(ov16_0226D654, param0, (500 + 1)); - } else { - param0->delay = 0; - param0->task = SysTask_Start(ov16_0226D854, param0, (500 + 1)); - } -} - -static void ov16_0226D654 (SysTask * param0, void * param1) -{ - PartyGaugePokeballs * v0 = param1; - - switch (v0->state) { - case 0: - { - s16 v1, v2; - - sub_0200D550(v0->cells, &v1, &v2); - v0->xStart = v1 << 8; - } - v0->state++; - case 1: - if (v0->delay > 0) { - v0->delay--; - break; - } - case 2: - if (v0->side == PARTY_GAUGE_OURS) { - v0->xStart -= 0x1200; - - if (v0->xStart <= v0->xOverflow << 8) { - v0->xStart = v0->xOverflow << 8; - Sound_PlayEffect(v0->sdatID); - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A34[v0->position]); - } else { - v0->xStart += 0x1200; - - if (v0->xStart >= v0->xOverflow << 8) { - v0->xStart = v0->xOverflow << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A1C[v0->position]); - } - - sub_0200D324(v0->cells->unk_00); - break; - case 3: - - (*(v0->pokeballCount))++; - v0->state++; - - case 4: - if (*(v0->pokeballCount) != 6) { - sub_0200D324(v0->cells->unk_00); - break; - } - - if (v0->side == PARTY_GAUGE_OURS) { - sub_02021E50(v0->cells->unk_00, 1); - } else { - sub_02021E50(v0->cells->unk_00, 1); - } - - v0->delay = 0; - v0->state++; - case 5: - v0->delay++; - - if (v0->delay < 0) { - break; - } - - sub_02021D6C(v0->cells->unk_00, v0->flipAnimation); - v0->delay = 0; - v0->state++; - case 6: - if (v0->side == PARTY_GAUGE_OURS) { - v0->xStart += 0x600; - - if (v0->xStart >= v0->xEnd << 8) { - v0->xStart = v0->xEnd << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A34[v0->position]); - } else { - v0->xStart -= 0x600; - - if (v0->xStart <= v0->xEnd << 8) { - v0->xStart = v0->xEnd << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A1C[v0->position]); - } - - sub_0200D324(v0->cells->unk_00); - break; - default: - sub_02021E50(v0->cells->unk_00, 0); - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static void ov16_0226D854 (SysTask * param0, void * param1) -{ - PartyGaugePokeballs * v0 = param1; - - switch (v0->state) { - case 0: - { - s16 v1, v2; - - sub_0200D550(v0->cells, &v1, &v2); - v0->xStart = v1 << 8; - } - sub_02021E50(v0->cells->unk_00, 0); - v0->state++; - case 1: - if (v0->delay > 0) { - v0->delay--; - break; - } - case 2: - if (v0->side == PARTY_GAUGE_OURS) { - v0->xStart -= 0x1200; - - if (v0->xStart <= v0->xEnd << 8) { - v0->xStart = v0->xEnd << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A34[v0->position]); - } else { - v0->xStart += 0x1200; - - if (v0->xStart >= v0->xEnd << 8) { - v0->xStart = v0->xEnd << 8; - v0->state++; - } - - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A1C[v0->position]); - } - break; - default: - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static void ov16_0226D938 (PartyGaugePokeballs * param0, int param1, enum HidePartyGaugeType param2, s16 * param3) -{ - GF_ASSERT(param0->cells != NULL && param0->task == NULL); - - param0->state = 0; - - if (param2 == HIDE_PARTY_GAUGE_BATTLE_START) { - param0->arrowAlpha = param3; - param0->delay = 3 * param1; - param0->startDelay = 4; - param0->task = SysTask_Start(ov16_0226D99C, param0, (500 + 1)); - } else { - param0->arrowAlpha = param3; - param0->delay = 0; - param0->startDelay = 0; - param0->task = SysTask_Start(ov16_0226DAAC, param0, (500 + 1)); - } -} - -static void ov16_0226D99C (SysTask * param0, void * param1) -{ - PartyGaugePokeballs * v0 = param1; - - if ((*(v0->arrowAlpha)) == 0) { - v0->state = 100; - } - - switch (v0->state) { - case 0: - { - s16 v1, v2; - - sub_0200D550(v0->cells, &v1, &v2); - v0->xStart = v1 << 8; - } - sub_0200D810(v0->cells, GX_OAM_MODE_XLU); - v0->state++; - case 1: - if (v0->startDelay > 0) { - v0->startDelay--; - break; - } - - if (v0->delay > 0) { - v0->delay--; - break; - } - case 2: - if (v0->side == PARTY_GAUGE_OURS) { - v0->xStart -= 0xc00; - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A34[v0->position]); - } else { - v0->xStart += 0xc00; - sub_0200D4C4(v0->cells, v0->xStart >> 8, Unk_ov16_02270A1C[v0->position]); - } - - if ((v0->xStart < -16 * 0x100) || (v0->xStart > ((256 + 16) << 8))) { - v0->state++; - } - - sub_0200D324(v0->cells->unk_00); - break; - case 100: - default: - sub_0200D3EC(v0->cells->unk_00, 0); - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static void ov16_0226DAAC (SysTask * param0, void * param1) -{ - PartyGaugePokeballs * v0 = param1; - - if ((*(v0->arrowAlpha)) == 0) { - v0->state = 100; - } - - switch (v0->state) { - case 0: - sub_0200D810(v0->cells, GX_OAM_MODE_XLU); - v0->state++; - case 1: - break; - case 100: - default: - sub_0200D3EC(v0->cells->unk_00, 0); - SysTask_Done(param0); - v0->task = NULL; - return; - } -} - -static int ov16_0226DB04 (int param0, enum PartyGaugeSide param1) -{ - int v0; - - switch (param0) { - case 0: - default: - v0 = 6; - break; - case 1: - v0 = (param1 == PARTY_GAUGE_OURS) ? 3 : 0; - break; - case 2: - v0 = (param1 == PARTY_GAUGE_OURS) ? 5 : 2; - break; - case 3: - v0 = (param1 == PARTY_GAUGE_OURS) ? 4 : 1; - break; - } - - return v0; -} - -static int ov16_0226DB44 (int param0) -{ - switch (param0) { - case 6: - default: - return param0; - case 3: - return 0; - case 0: - return 3; - case 5: - return 2; - case 2: - return 5; - case 4: - return 1; - case 1: - return 4; - } -} diff --git a/src/overlay016/ov16_0226DB7C.c b/src/overlay016/ov16_0226DB7C.c index c7758d2676..597248493c 100644 --- a/src/overlay016/ov16_0226DB7C.c +++ b/src/overlay016/ov16_0226DB7C.c @@ -8,7 +8,7 @@ #include "struct_decls/sys_task.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "narc.h" #include "unk_0200C6E4.h" @@ -22,14 +22,14 @@ typedef struct UnkStruct_ov16_0226DC24_t { } UnkStruct_ov16_0226DC24; static void ov16_0226DE10(SysTask * param0, void * param1); -void ov16_0226DB7C(CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, u32 param4, u32 param5, u32 param6, u32 param7); -void ov16_0226DBFC(AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4); -UnkStruct_ov16_0226DC24 * ov16_0226DC24(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); +void ov16_0226DB7C(SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, u32 param4, u32 param5, u32 param6, u32 param7); +void ov16_0226DBFC(SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4); +UnkStruct_ov16_0226DC24 * ov16_0226DC24(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); void ov16_0226DCA8(UnkStruct_ov16_0226DC24 * param0); void ov16_0226DD7C(UnkStruct_ov16_0226DC24 * param0, int param1, int param2, int param3, int param4); void ov16_0226DDE8(UnkStruct_ov16_0226DC24 * param0); -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270AA4 = { +static const SpriteTemplate Unk_ov16_02270AA4 = { 0x0, 0x0, 0x0, @@ -42,46 +42,46 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270AA4 = { 0x0 }; -void ov16_0226DB7C (CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, u32 param4, u32 param5, u32 param6, u32 param7) +void ov16_0226DB7C (SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, u32 param4, u32 param5, u32 param6, u32 param7) { NARC * v0; v0 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param3); - sub_0200CDC4(param2, 3, param0, param1, v0, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); - sub_0200CC3C(param0, param1, v0, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); - sub_0200CE24(param0, param1, v0, 251, 1, param6); - sub_0200CE54(param0, param1, v0, 252, 1, param7); + SpriteRenderer_LoadPalette(param2, 3, param0, param1, v0, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, v0, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, v0, 251, 1, param6); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, v0, 252, 1, param7); NARC_dtor(v0); } -void ov16_0226DBFC (AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4) +void ov16_0226DBFC (SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4) { - sub_0200D070(param0, param1); - sub_0200D080(param0, param2); - sub_0200D090(param0, param3); - sub_0200D0A0(param0, param4); + SpriteGfxHandler_UnloadCharObjById(param0, param1); + SpriteGfxHandler_UnloadPlttObjById(param0, param2); + SpriteGfxHandler_UnloadCellObjById(param0, param3); + SpriteGfxHandler_UnloadAnimObjById(param0, param4); } -UnkStruct_ov16_0226DC24 * ov16_0226DC24 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) +UnkStruct_ov16_0226DC24 * ov16_0226DC24 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) { UnkStruct_ov16_0226DC24 * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; v1 = Unk_ov16_02270AA4; - v1.unk_14[0] = param3; - v1.unk_14[1] = param4; - v1.unk_14[2] = param5; - v1.unk_14[3] = param6; - v1.unk_08 = param7; - v1.unk_2C = param8; + v1.resources[0] = param3; + v1.resources[1] = param4; + v1.resources[2] = param5; + v1.resources[3] = param6; + v1.priority = param7; + v1.bgPriority = param8; v0 = Heap_AllocFromHeap(param2, sizeof(UnkStruct_ov16_0226DC24)); MI_CpuClear8(v0, sizeof(UnkStruct_ov16_0226DC24)); for (v2 = 0; v2 < 5; v2++) { - v0->unk_00[v2] = sub_0200CE6C(param0, param1, &v1); + v0->unk_00[v2] = SpriteActor_LoadResources(param0, param1, &v1); sub_0200D3F4(v0->unk_00[v2], 0); } diff --git a/src/overlay016/ov16_0226DE44.c b/src/overlay016/ov16_0226DE44.c index 349ac1dd56..ae66135702 100644 --- a/src/overlay016/ov16_0226DE44.c +++ b/src/overlay016/ov16_0226DE44.c @@ -8,7 +8,7 @@ #include "struct_decls/sys_task.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "narc.h" #include "unk_0200C6E4.h" @@ -32,16 +32,16 @@ typedef struct UnkStruct_ov16_0226DEEC_t { u8 unk_1E; } UnkStruct_ov16_0226DEEC; -void ov16_0226DE44(CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, PaletteSys * param3, u32 param4, u32 param5, u32 param6, u32 param7); -void ov16_0226DEC4(AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4); -UnkStruct_ov16_0226DEEC * ov16_0226DEEC(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); +void ov16_0226DE44(SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, PaletteData * param3, u32 param4, u32 param5, u32 param6, u32 param7); +void ov16_0226DEC4(SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4); +UnkStruct_ov16_0226DEEC * ov16_0226DEEC(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); void ov16_0226DF68(UnkStruct_ov16_0226DEEC * param0); void ov16_0226DFB0(UnkStruct_ov16_0226DEEC * param0, int param1, int param2); void ov16_0226DFBC(UnkStruct_ov16_0226DEEC * param0); static void ov16_0226DFD8(SysTask * param0, void * param1); static void ov16_0226E13C(UnkStruct_ov16_0226DEEC * param0); -static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270AD8 = { +static const SpriteTemplate Unk_ov16_02270AD8 = { 0x0, 0x0, 0x0, @@ -54,43 +54,43 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov16_02270AD8 = { 0x0 }; -void ov16_0226DE44 (CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, PaletteSys * param3, u32 param4, u32 param5, u32 param6, u32 param7) +void ov16_0226DE44 (SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, PaletteData * param3, u32 param4, u32 param5, u32 param6, u32 param7) { NARC * v0 = NARC_ctor(NARC_INDEX_GRAPHIC__EV_POKESELECT, param2); - sub_0200CDC4(param3, 3, param0, param1, v0, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); - sub_0200CC3C(param0, param1, v0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB, param4); - sub_0200CE24(param0, param1, v0, 12, 0, param6); - sub_0200CE54(param0, param1, v0, 13, 0, param7); + SpriteRenderer_LoadPalette(param3, 3, param0, param1, v0, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param5); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, v0, 10, 0, NNS_G2D_VRAM_TYPE_2DSUB, param4); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, v0, 12, 0, param6); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, v0, 13, 0, param7); NARC_dtor(v0); } -void ov16_0226DEC4 (AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4) +void ov16_0226DEC4 (SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4) { - sub_0200D070(param0, param1); - sub_0200D080(param0, param2); - sub_0200D090(param0, param3); - sub_0200D0A0(param0, param4); + SpriteGfxHandler_UnloadCharObjById(param0, param1); + SpriteGfxHandler_UnloadPlttObjById(param0, param2); + SpriteGfxHandler_UnloadCellObjById(param0, param3); + SpriteGfxHandler_UnloadAnimObjById(param0, param4); } -UnkStruct_ov16_0226DEEC * ov16_0226DEEC (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) +UnkStruct_ov16_0226DEEC * ov16_0226DEEC (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) { UnkStruct_ov16_0226DEEC * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov16_02270AD8; - v1.unk_14[0] = param3; - v1.unk_14[1] = param4; - v1.unk_14[2] = param5; - v1.unk_14[3] = param6; - v1.unk_08 = param7; - v1.unk_2C = param8; + v1.resources[0] = param3; + v1.resources[1] = param4; + v1.resources[2] = param5; + v1.resources[3] = param6; + v1.priority = param7; + v1.bgPriority = param8; v0 = Heap_AllocFromHeap(param2, sizeof(UnkStruct_ov16_0226DEEC)); MI_CpuClear8(v0, sizeof(UnkStruct_ov16_0226DEEC)); - v0->unk_00 = sub_0200CE6C(param0, param1, &v1); + v0->unk_00 = SpriteActor_LoadResources(param0, param1, &v1); sub_0200D3F4(v0->unk_00, 0); v0->unk_14 = (192 << FX32_SHIFT); diff --git a/src/overlay016/party_gauge.c b/src/overlay016/party_gauge.c new file mode 100644 index 0000000000..769ea09261 --- /dev/null +++ b/src/overlay016/party_gauge.c @@ -0,0 +1,811 @@ +#include "enums.h" + +#include +#include + +#include "assert.h" + +#include "constants/heap.h" +#include "constants/palette.h" +#include "constants/sdat.h" + +#include "struct_decls/struct_02002F38_decl.h" +#include "struct_decls/struct_02006C24_decl.h" +#include "struct_decls/struct_0200C6E4_decl.h" +#include "struct_decls/struct_0200C704_decl.h" +#include "struct_decls/sys_task.h" + +#include "struct_defs/battle_io.h" +#include "struct_defs/struct_0200D0F4.h" +#include "struct_defs/sprite_template.h" + +#include "unk_02005474.h" +#include "narc.h" +#include "unk_0200C6E4.h" +#include "unk_0200D9E8.h" +#include "heap.h" +#include "unk_020218BC.h" +#include "overlay016/ov16_0223DF00.h" +#include "battle/party_gauge.h" + +typedef struct { + CellActorData *cells; + SysTask *task; + enum HideArrowType hideType; + enum PartyGaugeSide side; + enum PartyGaugePosition position; + s32 x; + s16 alpha; + u8 state; + u8 delay; +} PartyGaugeArrow; + +typedef struct { + CellActorData *cells; + SysTask *task; + enum PartyGaugeSide side; + enum PartyGaugePosition position; + enum HidePartyGaugeType hideType; + s8 *pokeballCount; + s16 *arrowAlpha; + s32 xStart; + s32 xEnd; + s32 xOverflow; + s16 delay; + u16 sdatID; + u8 state; + u8 ballSlot; + u8 flipAnimation; + u8 startDelay; +} PartyGaugePokeballs; + +typedef struct PartyGauge { + PartyGaugeArrow arrow; + PartyGaugePokeballs pokeballs[MAX_PARTY_SIZE]; + s8 pokeballCount; +} PartyGauge; + +enum PartyGaugeAnimIndex { + PGANM_POKEBALL_HEALTHY_THEIRS = 0, + PGANM_POKEBALL_STATUSED_THEIRS, + PGANM_POKEBALL_FAINTED_THEIRS, + PGANM_POKEBALL_HEALTHY_OURS, + PGANM_POKEBALL_STATUSED_OURS, + PGANM_POKEBALL_FAINTED_OURS, + PGANM_POKEBALL_EMPTY_SLOT, + PGANM_ARROW_THEIRS, + PGANM_ARROW_OURS, +}; + +static void ShowArrow(PartyGaugeArrow *arrow, enum PartyGaugeSide side, enum PartyGaugePosition pos, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); +static void HideArrow(PartyGaugeArrow *arrow, enum HideArrowType type); +static void ShowPokeballs(PartyGaugePokeballs *pokeballs, s8 *numBalls, enum PartyGaugeSide side, enum ShowPartyGaugeType type, enum PartyGaugePosition pos, int slot, int frame, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler); +static void HidePokeballs(PartyGaugePokeballs *pokeballs, int slot, enum HidePartyGaugeType type, s16 *arrowAlpha); +static void ShowArrowTask(SysTask *task, void *data); +static void HideArrowTask(SysTask *task, void *data); +static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data); +static void ShowPokeballsMidBattleTask(SysTask *task, void *data); +static void HidePokeballsStartOfBattleTask(SysTask *task, void *data); +static void HidePokeballsMidBattleTask(SysTask *task, void *data); +static int PokeballsAnimationFrame(enum PartyGaugeBallStatus status, enum PartyGaugeSide side); +static int FlippedAnimationFrame(int frame); +static PartyGauge* NewPartyGauge(void); +static void FreePartyGauge(PartyGauge *partyGauge); + +// TODO: enum? +#define PARTY_GAUGE_PLTT_RES_ID 20037 +#define PARTY_GAUGE_CHAR_RES_ID 20413 +#define PARTY_GAUGE_CELL_RES_ID 20407 +#define PARTY_GAUGE_ANIM_RES_ID 20396 + +static const SpriteTemplate sArrowTemplate = { + .x = 0, + .y = 0, + .z = 0, + .animIdx = 0, + .priority = 10, + .plttIdx = 0, + .vramType = NNS_G2D_VRAM_TYPE_2DMAIN, + .resources = { + PARTY_GAUGE_CHAR_RES_ID, + PARTY_GAUGE_PLTT_RES_ID, + PARTY_GAUGE_CELL_RES_ID, + PARTY_GAUGE_ANIM_RES_ID, + SPRITE_RESOURCE_NONE, + SPRITE_RESOURCE_NONE, + }, + .bgPriority = 0, + .transferToVRAM = FALSE, +}; + +static const SpriteTemplate sPokeballTemplate = { + .x = 0, + .y = 0, + .z = 0, + .animIdx = 0, + .priority = 8, + .plttIdx = 0, + .vramType = NNS_G2D_VRAM_TYPE_2DMAIN, + .resources = { + PARTY_GAUGE_CHAR_RES_ID, + PARTY_GAUGE_PLTT_RES_ID, + PARTY_GAUGE_CELL_RES_ID, + PARTY_GAUGE_ANIM_RES_ID, + SPRITE_RESOURCE_NONE, + SPRITE_RESOURCE_NONE, + }, + .bgPriority = 0, + .transferToVRAM = FALSE, +}; + +#define ARROW_TASK_PRIORITY 500 +#define POKEBALL_TASK_PRIORITY (ARROW_TASK_PRIORITY + 1) + +#define SCREEN_EDGE_RIGHT 256 +#define SCREEN_EDGE_LEFT 0 + +#define ARROW_X_START_OURS (SCREEN_EDGE_RIGHT + 96) // 96 pixels off-screem +#define ARROW_X_START_THEIRS (SCREEN_EDGE_LEFT - 96) // 96 pixels off-screen +#define ARROW_X_END_OURS (SCREEN_EDGE_RIGHT - 32) +#define ARROW_X_END_THEIRS (SCREEN_EDGE_LEFT + 32) +#define ARROW_Y_POS_OURS 120 +#define ARROW_Y_POS_THEIRS 56 + +#define POKEBALL_X_START_OURS (SCREEN_EDGE_RIGHT + 20) +#define POKEBALL_X_START_THEIRS (SCREEN_EDGE_LEFT - 20) +#define POKEBALL_X_END_OURS (SCREEN_EDGE_RIGHT - 128 + 34) +#define POKEBALL_X_END_THEIRS (SCREEN_EDGE_LEFT + 128 - 34) +#define POKEBALL_Y_POS_OURS (ARROW_Y_POS_OURS - 6) +#define POKEBALL_Y_POS_THEIRS (ARROW_Y_POS_THEIRS - 6) + +#define POKEBALL_SPACING 16 +#define POKEBALL_OVERFLOW_SPACING 15 +#define POKEBALL_OVERFLOW_LEN 6 + +#define ARROW_IN_SPEED (18 << 8) +#define ARROW_OUT_SPEED (4 << 8) +#define ARROW_FADE_SPEED (1 << 8) + +#define POKEBALL_IN_SPEED (18 << 8) +#define POKEBALL_IN_SPEED_SLOW (6 << 8) +#define POKEBALL_OUT_SPEED (12 << 8) + +#define POKEBALL_SLOT_SHOW_DELAY 3 +#define POKEBALL_FLAT_SHOW_DELAY 5 + +#define HIGH_LOW_Y_POS_DIFF 36 + +__attribute__((aligned(4))) static const u16 sArrowYPosOurs[] = { + [PARTY_GAUGE_POSITION_HIGH] = ARROW_Y_POS_OURS - HIGH_LOW_Y_POS_DIFF, + [PARTY_GAUGE_POSITION_MIDDLE] = ARROW_Y_POS_OURS, + [PARTY_GAUGE_POSITION_LOW] = ARROW_Y_POS_OURS +}; + +__attribute__((aligned(4))) static const u16 sArrowYPosTheirs[] = { + [PARTY_GAUGE_POSITION_HIGH] = ARROW_Y_POS_THEIRS - HIGH_LOW_Y_POS_DIFF, + [PARTY_GAUGE_POSITION_MIDDLE] = ARROW_Y_POS_THEIRS, + [PARTY_GAUGE_POSITION_LOW] = ARROW_Y_POS_THEIRS +}; + +__attribute__((aligned(4))) static const u16 sPokeballYPosOurs[] = { + [PARTY_GAUGE_POSITION_HIGH] = POKEBALL_Y_POS_OURS - HIGH_LOW_Y_POS_DIFF, + [PARTY_GAUGE_POSITION_MIDDLE] = POKEBALL_Y_POS_OURS, + [PARTY_GAUGE_POSITION_LOW] = POKEBALL_Y_POS_OURS +}; + +__attribute__((aligned(4))) static const u16 sPokeballYPosTheirs[] = { + [PARTY_GAUGE_POSITION_HIGH] = POKEBALL_Y_POS_THEIRS - HIGH_LOW_Y_POS_DIFF, + [PARTY_GAUGE_POSITION_MIDDLE] = POKEBALL_Y_POS_THEIRS, + [PARTY_GAUGE_POSITION_LOW] = POKEBALL_Y_POS_THEIRS +}; + +// TODO: naix? +#define PARTY_GAUGE_NCLR 110 +#define PARTY_GAUGE_NCGR_BIN 340 +#define PARTY_GAUGE_NCER_BIN 341 +#define PARTY_GAUGE_NANR_BIN 342 + +void PartyGauge_LoadGraphics(SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler, PaletteData *palette) +{ + NARC *narc = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, HEAP_ID_BATTLE); + + SpriteRenderer_LoadPalette(palette, PLTTBUF_MAIN_OBJ, renderer, gfxHandler, narc, PARTY_GAUGE_NCLR, FALSE, 1, NNS_G2D_VRAM_TYPE_2DMAIN, PARTY_GAUGE_PLTT_RES_ID); + SpriteRenderer_LoadCharResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NCGR_BIN, TRUE, NNS_G2D_VRAM_TYPE_2DMAIN, PARTY_GAUGE_CHAR_RES_ID); + SpriteRenderer_LoadCellResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NCER_BIN, TRUE, PARTY_GAUGE_CELL_RES_ID); + SpriteRenderer_LoadAnimResObjFromOpenNarc(renderer, gfxHandler, narc, PARTY_GAUGE_NANR_BIN, TRUE, PARTY_GAUGE_ANIM_RES_ID); + + NARC_dtor(narc); +} + +void PartyGauge_FreeGraphics(SpriteGfxHandler *gfxHandler) +{ + SpriteGfxHandler_UnloadCharObjById(gfxHandler, PARTY_GAUGE_CHAR_RES_ID); + SpriteGfxHandler_UnloadPlttObjById(gfxHandler, PARTY_GAUGE_PLTT_RES_ID); + SpriteGfxHandler_UnloadCellObjById(gfxHandler, PARTY_GAUGE_CELL_RES_ID); + SpriteGfxHandler_UnloadAnimObjById(gfxHandler, PARTY_GAUGE_ANIM_RES_ID); +} + +static PartyGauge* NewPartyGauge() +{ + PartyGauge *gauge = Heap_AllocFromHeap(HEAP_ID_BATTLE, sizeof(PartyGauge)); + MI_CpuClear8(gauge, sizeof(PartyGauge)); + return gauge; +} + +static void FreePartyGauge(PartyGauge *gauge) +{ + GF_ASSERT(gauge->arrow.task == NULL); + Heap_FreeToHeap(gauge); +} + +PartyGauge* PartyGauge_Show(u8 ballStatus[], enum PartyGaugeSide side, enum ShowPartyGaugeType showType, enum PartyGaugePosition pos, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler) +{ + PartyGauge *gauge = NewPartyGauge(); + ShowArrow(&gauge->arrow, side, pos, renderer, gfxHandler); + + for (int slot = 0; slot < MAX_PARTY_SIZE; slot++) { + int frame = PokeballsAnimationFrame(ballStatus[slot], side); + ShowPokeballs(&gauge->pokeballs[slot], &gauge->pokeballCount, side, showType, pos, slot, frame, renderer, gfxHandler); + } + + return gauge; +} + +BOOL PartyGauge_ShowIsDone(PartyGauge *gauge) +{ + int i; + if (gauge->arrow.task == NULL) { + for (i = 0; i < MAX_PARTY_SIZE; i++) { + if (gauge->pokeballs[i].task != NULL) { + break; + } + } + + if (i == MAX_PARTY_SIZE) { + return TRUE; + } + } + + return FALSE; +} + +void PartyGauge_Hide(PartyGauge *gauge, enum HideArrowType hideArrowType, enum HidePartyGaugeType hideGaugeType) +{ + GF_ASSERT(gauge != NULL); + + HideArrow(&gauge->arrow, hideArrowType); + for (int i = 0; i < MAX_PARTY_SIZE; i++) { + HidePokeballs(&gauge->pokeballs[i], i, hideGaugeType, &gauge->arrow.alpha); + } +} + +BOOL PartyGauge_HideIsDone(PartyGauge *gauge) +{ + int i; + if (gauge->arrow.task == NULL) { + for (i = 0; i < MAX_PARTY_SIZE; i++) { + if (gauge->pokeballs[i].task != NULL) { + break; + } + } + + if (i == MAX_PARTY_SIZE) { + return TRUE; + } + } + + return FALSE; +} + +void PartyGauge_Free(PartyGauge *gauge) +{ + sub_0200D0F4(gauge->arrow.cells); + + for (int i = 0; i < MAX_PARTY_SIZE; i++) { + sub_0200D0F4(gauge->pokeballs[i].cells); + } + + FreePartyGauge(gauge); +} + +enum ShowArrowState { + SHOW_ARROW_INIT = 0, + SHOW_ARROW_DRAW, + SHOW_ARROW_DONE, +}; + +static void ShowArrow(PartyGaugeArrow *arrow, enum PartyGaugeSide side, enum PartyGaugePosition pos, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler) +{ + GF_ASSERT(arrow->cells == NULL && arrow->task == NULL); + + MI_CpuClear8(arrow, sizeof(PartyGaugeArrow)); + arrow->cells = SpriteActor_LoadResources(renderer, gfxHandler, &sArrowTemplate); + + if (side == PARTY_GAUGE_OURS) { + SpriteActor_SetSpritePositionXY(arrow->cells, ARROW_X_START_OURS, sArrowYPosOurs[pos]); + SpriteActor_SetSpriteAnimActive(arrow->cells->unk_00, PGANM_ARROW_OURS); + } else { + SpriteActor_SetSpritePositionXY(arrow->cells, ARROW_X_START_THEIRS, sArrowYPosTheirs[pos]); + SpriteActor_SetSpriteAnimActive(arrow->cells->unk_00, PGANM_ARROW_THEIRS); + } + + SpriteActor_UpdateObject(arrow->cells->unk_00); + + arrow->side = side; + arrow->position = pos; + arrow->state = SHOW_ARROW_INIT; + arrow->task = SysTask_Start(ShowArrowTask, arrow, ARROW_TASK_PRIORITY); + + Sound_PlayEffect(SEQ_PARTY_GAUGE_ARROW_IN); +} + +static void ShowArrowTask(SysTask *task, void *data) +{ + PartyGaugeArrow *arrow = data; + + switch (arrow->state) { + case SHOW_ARROW_INIT: + s16 x, y; + + SpriteActor_GetSpritePositionXY(arrow->cells, &x, &y); + arrow->x = x << 8; + arrow->state++; + // fall-through + case SHOW_ARROW_DRAW: + if (arrow->side == PARTY_GAUGE_OURS) { + arrow->x -= ARROW_IN_SPEED; + if (arrow->x <= ARROW_X_END_OURS << 8) { + arrow->x = ARROW_X_END_OURS << 8; + arrow->state++; + } + + SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); + } else { + arrow->x += ARROW_IN_SPEED; + if (arrow->x >= ARROW_X_END_THEIRS << 8) { + arrow->x = ARROW_X_END_THEIRS << 8; + arrow->state++; + } + + SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); + } + break; + + default: + SysTask_Done(task); + arrow->task = NULL; + } +} + +enum HideArrowState { + HIDE_ARROW_INIT = 0, + HIDE_ARROW_DELAY, + HIDE_ARROW_FADE, + HIDE_ARROW_DONE, +}; + +static void HideArrow(PartyGaugeArrow *arrow, enum HideArrowType type) +{ + GF_ASSERT(arrow->cells != NULL && arrow->task == NULL); + + arrow->state = HIDE_ARROW_INIT; + arrow->hideType = type; + + if (type == HIDE_ARROW_FADE_AND_SCROLL) { + arrow->delay = 4; + } else { + arrow->delay = 0; + } + + arrow->task = SysTask_Start(HideArrowTask, arrow, ARROW_TASK_PRIORITY); +} + +static void HideArrowTask(SysTask *task, void *data) +{ + PartyGaugeArrow *arrow = data; + + switch (arrow->state) { + case HIDE_ARROW_INIT: + s16 x, y; + + SpriteActor_GetSpritePositionXY(arrow->cells, &x, &y); + arrow->x = x << 8; + + SpriteActor_SetOAMMode(arrow->cells, GX_OAM_MODE_XLU); + arrow->alpha = 16 << 8; + + G2_SetBlendAlpha(GX_BLEND_PLANEMASK_NONE, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2 | GX_BLEND_PLANEMASK_BG3 | GX_BLEND_PLANEMASK_OBJ | GX_BLEND_PLANEMASK_BD, + (arrow->alpha >> 8), 16 - (arrow->alpha >> 8)); + arrow->state++; + // fall-through + case HIDE_ARROW_DELAY: + if (arrow->delay > 0) { + arrow->delay--; + break; + } + + arrow->state++; + // fall-through + case HIDE_ARROW_FADE: + if (arrow->hideType == HIDE_ARROW_FADE_AND_SCROLL) { + if (arrow->side == PARTY_GAUGE_OURS) { + arrow->x -= ARROW_OUT_SPEED; + SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosOurs[arrow->position]); + } else { + arrow->x += ARROW_OUT_SPEED; + SpriteActor_SetSpritePositionXY(arrow->cells, arrow->x >> 8, sArrowYPosTheirs[arrow->position]); + } + } + + arrow->alpha -= ARROW_FADE_SPEED; + + if (arrow->alpha <= 0) { + arrow->alpha = 0; + SpriteActor_DrawSprite(arrow->cells->unk_00, 0); + arrow->state++; + } + + G2_ChangeBlendAlpha(arrow->alpha >> 8, 16 - (arrow->alpha >> 8)); + break; + + default: + Battle_SetDefaultBlend(); + SysTask_Done(task); + arrow->task = NULL; + } +} + +enum { + SHOW_POKEBALLS_INIT = 0, + SHOW_POKEBALLS_DELAY, + SHOW_POKEBALLS_DRAW, + SHOW_POKEBALLS_INCREMENT, + SHOW_POKEBALLS_SET_FRAME, + SHOW_POKEBALLS_ANIMATE, + SHOW_POKEBALLS_SCROLL, + SHOW_POKEBALLS_DONE, +}; + +static void ShowPokeballs(PartyGaugePokeballs *pokeballs, s8 *numBalls, enum PartyGaugeSide side, enum ShowPartyGaugeType type, enum PartyGaugePosition pos, int slot, int frame, SpriteRenderer *renderer, SpriteGfxHandler *gfxHandler) +{ + GF_ASSERT(pokeballs->cells == NULL && pokeballs->task == NULL); + + MI_CpuClear8(pokeballs, sizeof(PartyGaugePokeballs)); + pokeballs->cells = SpriteActor_LoadResources(renderer, gfxHandler, &sPokeballTemplate); + + if (side == PARTY_GAUGE_OURS) { + SpriteActor_SetSpritePositionXY(pokeballs->cells, POKEBALL_X_START_OURS, sPokeballYPosOurs[pos]); + } else { + SpriteActor_SetSpritePositionXY(pokeballs->cells, POKEBALL_X_START_THEIRS, sPokeballYPosTheirs[pos]); + } + + SpriteActor_SetSpriteAnimActive(pokeballs->cells->unk_00, frame); + SpriteActor_UpdateObject(pokeballs->cells->unk_00); + + pokeballs->side = side; + pokeballs->ballSlot = slot; + pokeballs->position = pos; + pokeballs->flipAnimation = FlippedAnimationFrame(frame); + pokeballs->pokeballCount = numBalls; + pokeballs->sdatID = frame == PGANM_POKEBALL_EMPTY_SLOT ? SEQ_PARTY_GAUGE_BALL_EMPTY : SEQ_PARTY_GAUGE_BALL_IN; + + if (side == PARTY_GAUGE_OURS) { + pokeballs->xEnd = POKEBALL_X_END_OURS + slot * POKEBALL_SPACING; + pokeballs->xOverflow = POKEBALL_X_END_OURS + slot * POKEBALL_OVERFLOW_SPACING - POKEBALL_OVERFLOW_LEN; + } else { + pokeballs->xEnd = POKEBALL_X_END_THEIRS - slot * POKEBALL_SPACING; + pokeballs->xOverflow = POKEBALL_X_END_THEIRS - slot * POKEBALL_OVERFLOW_SPACING + POKEBALL_OVERFLOW_LEN; + } + + pokeballs->state = SHOW_POKEBALLS_INIT; + + if (type == SHOW_PARTY_GAUGE_BATTLE_START) { + // At the start of the battle, Poke Balls scroll behind the arrow and roll across the screen + pokeballs->delay = POKEBALL_SLOT_SHOW_DELAY * slot + POKEBALL_FLAT_SHOW_DELAY; + pokeballs->task = SysTask_Start(ShowPokeballsStartOfBattleTask, pokeballs, POKEBALL_TASK_PRIORITY); + } else { + // Mid-battle, the Poke Balls scroll in alongside the arrow, and they do not roll across the screen + pokeballs->delay = 0; + pokeballs->task = SysTask_Start(ShowPokeballsMidBattleTask, pokeballs, POKEBALL_TASK_PRIORITY); + } +} + +static void ShowPokeballsStartOfBattleTask(SysTask *task, void *data) +{ + PartyGaugePokeballs * pokeballs = data; + + switch (pokeballs->state) { + case SHOW_POKEBALLS_INIT: + s16 x, y; + SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + pokeballs->xStart = x << 8; + + pokeballs->state++; + // fall-through + case SHOW_POKEBALLS_DELAY: + if (pokeballs->delay > 0) { + pokeballs->delay--; + break; + } + // fall-through + case SHOW_POKEBALLS_DRAW: + if (pokeballs->side == PARTY_GAUGE_OURS) { + pokeballs->xStart -= POKEBALL_IN_SPEED; + + if (pokeballs->xStart <= pokeballs->xOverflow << 8) { + pokeballs->xStart = pokeballs->xOverflow << 8; + Sound_PlayEffect(pokeballs->sdatID); + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + } else { + pokeballs->xStart += POKEBALL_IN_SPEED; + + if (pokeballs->xStart >= pokeballs->xOverflow << 8) { + pokeballs->xStart = pokeballs->xOverflow << 8; + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + } + + SpriteActor_UpdateObject(pokeballs->cells->unk_00); + break; + + case SHOW_POKEBALLS_INCREMENT: + (*(pokeballs->pokeballCount))++; + pokeballs->state++; + // fall-through + case SHOW_POKEBALLS_SET_FRAME: + if (*(pokeballs->pokeballCount) != 6) { + SpriteActor_UpdateObject(pokeballs->cells->unk_00); + break; + } + + if (pokeballs->side == PARTY_GAUGE_OURS) { + SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 1); + } else { + SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 1); + } + + pokeballs->delay = 0; + pokeballs->state++; + // fall-through + case SHOW_POKEBALLS_ANIMATE: + pokeballs->delay++; + + if (pokeballs->delay < 0) { + break; + } + + SpriteActor_SetSpriteAnimActive(pokeballs->cells->unk_00, pokeballs->flipAnimation); + pokeballs->delay = 0; + pokeballs->state++; + // fall-through + case SHOW_POKEBALLS_SCROLL: + if (pokeballs->side == PARTY_GAUGE_OURS) { + pokeballs->xStart += POKEBALL_IN_SPEED_SLOW; // need more dissection on what exactly this is for + + if (pokeballs->xStart >= pokeballs->xEnd << 8) { + pokeballs->xStart = pokeballs->xEnd << 8; + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + } else { + pokeballs->xStart -= POKEBALL_IN_SPEED_SLOW; + + if (pokeballs->xStart <= pokeballs->xEnd << 8) { + pokeballs->xStart = pokeballs->xEnd << 8; + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + } + + SpriteActor_UpdateObject(pokeballs->cells->unk_00); + break; + + default: + SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 0); + SysTask_Done(task); + pokeballs->task = NULL; + } +} + +static void ShowPokeballsMidBattleTask(SysTask *task, void *data) +{ + PartyGaugePokeballs *pokeballs = data; + + switch (pokeballs->state) { + case SHOW_POKEBALLS_INIT: + s16 x, y; + SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + pokeballs->xStart = x << 8; + + SpriteActor_SetAnimFrame(pokeballs->cells->unk_00, 0); + pokeballs->state++; + // fall-through + case SHOW_POKEBALLS_DELAY: + if (pokeballs->delay > 0) { + pokeballs->delay--; + break; + } + // fall-through + case SHOW_POKEBALLS_DRAW: + if (pokeballs->side == PARTY_GAUGE_OURS) { + pokeballs->xStart -= POKEBALL_IN_SPEED; + + if (pokeballs->xStart <= pokeballs->xEnd << 8) { + pokeballs->xStart = pokeballs->xEnd << 8; + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + } else { + pokeballs->xStart += POKEBALL_IN_SPEED; + + if (pokeballs->xStart >= pokeballs->xEnd << 8) { + pokeballs->xStart = pokeballs->xEnd << 8; + pokeballs->state++; + } + + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + } + break; + + default: + SysTask_Done(task); + pokeballs->task = NULL; + } +} + +static void HidePokeballs(PartyGaugePokeballs *pokeballs, int slot, enum HidePartyGaugeType type, s16 *arrowAlpha) +{ + GF_ASSERT(pokeballs->cells != NULL && pokeballs->task == NULL); + + pokeballs->state = 0; + + if (type == HIDE_PARTY_GAUGE_BATTLE_START) { + pokeballs->arrowAlpha = arrowAlpha; + pokeballs->delay = 3 * slot; + pokeballs->startDelay = 4; + pokeballs->task = SysTask_Start(HidePokeballsStartOfBattleTask, pokeballs, POKEBALL_TASK_PRIORITY); + } else { + pokeballs->arrowAlpha = arrowAlpha; + pokeballs->delay = 0; + pokeballs->startDelay = 0; + pokeballs->task = SysTask_Start(HidePokeballsMidBattleTask, pokeballs, POKEBALL_TASK_PRIORITY); + } +} + +enum { + HIDE_POKEBALLS_INIT = 0, + HIDE_POKEBALLS_DELAY, + HIDE_POKEBALLS_FADE, + HIDE_POKEBALLS_DONE, + + HIDE_POKEBALLS_BREAK = 100, +}; + +static void HidePokeballsStartOfBattleTask(SysTask *task, void *data) +{ + PartyGaugePokeballs * pokeballs = data; + + if (*(pokeballs->arrowAlpha) == 0) { + pokeballs->state = HIDE_POKEBALLS_BREAK; + } + + switch (pokeballs->state) { + case HIDE_POKEBALLS_INIT: + s16 x, y; + + SpriteActor_GetSpritePositionXY(pokeballs->cells, &x, &y); + pokeballs->xStart = x << 8; + + SpriteActor_SetOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); + pokeballs->state++; + // fall-through + case HIDE_POKEBALLS_DELAY: + if (pokeballs->startDelay > 0) { + pokeballs->startDelay--; + break; + } + + if (pokeballs->delay > 0) { + pokeballs->delay--; + break; + } + // fall-through + case HIDE_POKEBALLS_FADE: + if (pokeballs->side == PARTY_GAUGE_OURS) { + pokeballs->xStart -= POKEBALL_OUT_SPEED; + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosOurs[pokeballs->position]); + } else { + pokeballs->xStart += POKEBALL_OUT_SPEED; + SpriteActor_SetSpritePositionXY(pokeballs->cells, pokeballs->xStart >> 8, sPokeballYPosTheirs[pokeballs->position]); + } + + // Need some more documentation on this one + if (pokeballs->xStart < -16 * 0x100 || pokeballs->xStart > ((256 + 16) << 8)) { + pokeballs->state++; + } + + SpriteActor_UpdateObject(pokeballs->cells->unk_00); + break; + + case HIDE_POKEBALLS_BREAK: + default: + SpriteActor_DrawSprite(pokeballs->cells->unk_00, 0); + SysTask_Done(task); + pokeballs->task = NULL; + } +} + +static void HidePokeballsMidBattleTask(SysTask *task, void *data) +{ + PartyGaugePokeballs *pokeballs = data; + + if (*(pokeballs->arrowAlpha) == 0) { + pokeballs->state = HIDE_POKEBALLS_BREAK; + } + + switch (pokeballs->state) { + case HIDE_POKEBALLS_INIT: + SpriteActor_SetOAMMode(pokeballs->cells, GX_OAM_MODE_XLU); + pokeballs->state++; + // fall-through + case HIDE_POKEBALLS_DELAY: + // let the pokeballs fade out alongside the arrow + break; + + case HIDE_POKEBALLS_BREAK: + default: + SpriteActor_DrawSprite(pokeballs->cells->unk_00, 0); + SysTask_Done(task); + pokeballs->task = NULL; + } +} + +static int PokeballsAnimationFrame(enum PartyGaugeBallStatus status, enum PartyGaugeSide side) +{ + switch (status) { + case BALL_STATUS_NO_MON: + default: + return PGANM_POKEBALL_EMPTY_SLOT; + + case BALL_STATUS_MON_ALIVE: + return (side == PARTY_GAUGE_OURS) ? PGANM_POKEBALL_HEALTHY_OURS : PGANM_POKEBALL_HEALTHY_THEIRS; + + case BALL_STATUS_MON_FAINTED: + return (side == PARTY_GAUGE_OURS) ? PGANM_POKEBALL_FAINTED_OURS : PGANM_POKEBALL_FAINTED_THEIRS; + + case BALL_STATUS_HAS_STATUS_CONDITION: + return (side == PARTY_GAUGE_OURS) ? PGANM_POKEBALL_STATUSED_OURS : PGANM_POKEBALL_STATUSED_THEIRS; + } +} + +static int FlippedAnimationFrame(int frame) +{ + switch (frame) { + case PGANM_POKEBALL_EMPTY_SLOT: + default: + return frame; + + case PGANM_POKEBALL_HEALTHY_OURS: + return PGANM_POKEBALL_HEALTHY_THEIRS; + case PGANM_POKEBALL_HEALTHY_THEIRS: + return PGANM_POKEBALL_HEALTHY_OURS; + + case PGANM_POKEBALL_FAINTED_OURS: + return PGANM_POKEBALL_FAINTED_THEIRS; + case PGANM_POKEBALL_FAINTED_THEIRS: + return PGANM_POKEBALL_FAINTED_OURS; + + case PGANM_POKEBALL_STATUSED_OURS: + return PGANM_POKEBALL_STATUSED_THEIRS; + case PGANM_POKEBALL_STATUSED_THEIRS: + return PGANM_POKEBALL_STATUSED_OURS; + } +} diff --git a/src/overlay017/ov17_0223B140.c b/src/overlay017/ov17_0223B140.c index 96b7548ffe..5691c100dd 100644 --- a/src/overlay017/ov17_0223B140.c +++ b/src/overlay017/ov17_0223B140.c @@ -563,8 +563,8 @@ static void ov17_0223B8C4 (UnkStruct_ov17_02246F24 * param0) static void ov17_0223B8F8 (UnkStruct_ov17_02246F24 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 0, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); - sub_0200CDC4(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 0, 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 2, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); ov17_02243040(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); ov17_02242FA4(param0); @@ -584,8 +584,8 @@ static void ov17_0223B9A4 (UnkStruct_ov17_02246F24 * param0) ov17_022430F8(¶m0->unk_0C); ov17_0224308C(param0->unk_0C.unk_1C); - sub_0200D080(param0->unk_0C.unk_1C, 33001); - sub_0200D080(param0->unk_0C.unk_1C, 33005); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_0C.unk_1C, 33001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_0C.unk_1C, 33005); ov17_02241A64(¶m0->unk_0C); ov17_02241A00(param0->unk_0C.unk_1C); @@ -598,8 +598,8 @@ static void ov17_0223B9A4 (UnkStruct_ov17_02246F24 * param0) static void ov17_0223BA10 (UnkStruct_ov17_02246F24 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 4, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 33007); - sub_0200CDC4(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33008); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 4, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 33007); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_50, 3, param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1, 9, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33008); ov17_0224131C(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); ov17_02241270(param0->unk_0C.unk_18, param0->unk_0C.unk_1C, param1); @@ -624,7 +624,7 @@ static void ov17_0223BA10 (UnkStruct_ov17_02246F24 * param0, NARC * param1) static void ov17_0223BAD0 (UnkStruct_ov17_02246F24 * param0) { - sub_0200D080(param0->unk_0C.unk_1C, 33007); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_0C.unk_1C, 33007); ov17_022413B4(param0->unk_0C.unk_1C); ov17_022412F0(param0->unk_0C.unk_1C); diff --git a/src/overlay017/ov17_0223CB1C.c b/src/overlay017/ov17_0223CB1C.c index d9bfe9c50e..e0f6abfc48 100644 --- a/src/overlay017/ov17_0223CB1C.c +++ b/src/overlay017/ov17_0223CB1C.c @@ -564,7 +564,7 @@ static void ov17_0223D390 (UnkStruct_ov17_02247A48 * param0) static void ov17_0223D3B8 (UnkStruct_ov17_02247A48 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_0C.unk_44, 2, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1, 7, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPalette(param0->unk_0C.unk_44, 2, param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1, 7, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_0224774C(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param1); ov17_0223F560(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, param0->unk_0C.unk_44, 33001, -1, 33001, 33001); @@ -577,7 +577,7 @@ static void ov17_0223D434 (UnkStruct_ov17_02247A48 * param0) ov17_0223F6C4(¶m0->unk_0C.unk_A8); ov17_0223F5E8(param0->unk_0C.unk_20, 33001, -1, 33001, 33001); - sub_0200D080(param0->unk_0C.unk_20, 33001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_0C.unk_20, 33001); } static void ov17_0223D468 (UnkStruct_ov17_02247A48 * param0, NARC * param1) @@ -587,7 +587,7 @@ static void ov17_0223D468 (UnkStruct_ov17_02247A48 * param0, NARC * param1) static void ov17_0223D498 (UnkStruct_ov17_02247A48 * param0) { - sub_0200D080(param0->unk_0C.unk_20, 33002); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_0C.unk_20, 33002); } static void ov17_0223D4A8 (UnkStruct_ov17_02247A48 * param0, NARC * param1) diff --git a/src/overlay017/ov17_0223DAD0.c b/src/overlay017/ov17_0223DAD0.c index 110f003908..ea375d6840 100644 --- a/src/overlay017/ov17_0223DAD0.c +++ b/src/overlay017/ov17_0223DAD0.c @@ -729,7 +729,7 @@ static void ov17_0223E458 (UnkStruct_ov17_0224DF54 * param0) static void ov17_0223E4B0 (UnkStruct_ov17_0224DF54 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_14.unk_90, 2, param0->unk_14.unk_58, param0->unk_14.unk_5C, param1, 6, 0, 8, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPalette(param0->unk_14.unk_90, 2, param0->unk_14.unk_58, param0->unk_14.unk_5C, param1, 6, 0, 8, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_0224A20C(param0->unk_14.unk_58, param0->unk_14.unk_5C); ov17_0224A390(param0->unk_14.unk_58, param0->unk_14.unk_5C, param1); @@ -769,7 +769,7 @@ static void ov17_0223E588 (UnkStruct_ov17_0224DF54 * param0) ov17_0224AFF8(param0->unk_14.unk_5C); ov17_0224B058(param0); - sub_0200D080(param0->unk_14.unk_5C, 33001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_5C, 33001); } static void ov17_0223E60C (UnkStruct_ov17_0224DF54 * param0, NARC * param1) diff --git a/src/overlay017/ov17_0223F118.c b/src/overlay017/ov17_0223F118.c index 16b75ced25..5dd2859a75 100644 --- a/src/overlay017/ov17_0223F118.c +++ b/src/overlay017/ov17_0223F118.c @@ -21,7 +21,7 @@ #include "overlay017/struct_ov17_0223F2E4.h" #include "overlay017/struct_ov17_0223F6E8.h" #include "overlay017/struct_ov17_0223F744.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02005474.h" @@ -49,7 +49,7 @@ static void ov17_0223F6E8(SysTask * param0, void * param1); static void ov17_0223F15C(void); static void ov17_0223F774(SysTask * param0, void * param1); -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022531FC = { +static const SpriteTemplate Unk_ov17_022531FC = { 0x0, 0x0, 0x0, @@ -111,7 +111,7 @@ void ov17_0223F1E0 (GenericPointerData * param0) sub_020242C4(param0); } -void ov17_0223F1E8 (int param0, BGL * param1, AnimationResourceCollection * param2, UnkStruct_02012744 * param3, UnkStruct_ov17_0223F2E4 * param4, const Strbuf *param5, int param6, u32 param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14) +void ov17_0223F1E8 (int param0, BGL * param1, SpriteGfxHandler * param2, UnkStruct_02012744 * param3, UnkStruct_ov17_0223F2E4 * param4, const Strbuf *param5, int param6, u32 param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14) { UnkStruct_020127E8 v0; Window v1; @@ -314,7 +314,7 @@ void ov17_0223F374 (UnkStruct_02095C48 * param0) } } -void ov17_0223F560 (CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, int param4, int param5, int param6) +void ov17_0223F560 (SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, int param4, int param5, int param6) { if (param3 != -1) { sub_0200CBDC(param0, param1, 46, 73, 1, NNS_G2D_VRAM_TYPE_2DMAIN, param3); @@ -333,49 +333,49 @@ void ov17_0223F560 (CellTransferStateData * param0, AnimationResourceCollection } } -void ov17_0223F5E8 (AnimationResourceCollection * param0, int param1, int param2, int param3, int param4) +void ov17_0223F5E8 (SpriteGfxHandler * param0, int param1, int param2, int param3, int param4) { if (param1 != -1) { - sub_0200D070(param0, param1); + SpriteGfxHandler_UnloadCharObjById(param0, param1); } if (param2 != -1) { - sub_0200D080(param0, param2); + SpriteGfxHandler_UnloadPlttObjById(param0, param2); } if (param3 != -1) { - sub_0200D090(param0, param3); + SpriteGfxHandler_UnloadCellObjById(param0, param3); } if (param4 != -1) { - sub_0200D0A0(param0, param4); + SpriteGfxHandler_UnloadAnimObjById(param0, param4); } } -void ov17_0223F630 (UnkStruct_ov17_0223F6E8 * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, u32 param10) +void ov17_0223F630 (UnkStruct_ov17_0223F6E8 * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, u32 param10) { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; GF_ASSERT(NELEMS(Unk_ov17_022531CC) == 6); v1 = Unk_ov17_022531FC; - v1.unk_14[0] = param3; - v1.unk_14[1] = param4; - v1.unk_14[2] = param5; - v1.unk_14[3] = param6; - v1.unk_0C = param7; - v1.unk_08 = param8; - v1.unk_2C = param9; + v1.resources[0] = param3; + v1.resources[1] = param4; + v1.resources[2] = param5; + v1.resources[3] = param6; + v1.plttIdx = param7; + v1.priority = param8; + v1.bgPriority = param9; for (v0 = 0; v0 < 6; v0++) { - param0->unk_00[v0] = sub_0200CE6C(param1, param2, &v1); + param0->unk_00[v0] = SpriteActor_LoadResources(param1, param2, &v1); - sub_0200D4C4(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_00, Unk_ov17_022531CC[v0].unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_00, Unk_ov17_022531CC[v0].unk_02); sub_0200D364(param0->unk_00[v0], Unk_ov17_022531CC[v0].unk_06); sub_0200D6A4(param0->unk_00[v0], 1); - sub_0200D324(param0->unk_00[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_00[v0]->unk_00); } param0->unk_18 = SysTask_Start(ov17_0223F6E8, param0, param10); @@ -403,7 +403,7 @@ static void ov17_0223F6E8 (SysTask * param0, void * param1) } } -UnkStruct_ov17_0223F744 * ov17_0223F70C (int param0, PaletteSys * param1, const u16 * param2, int param3, int param4, u32 param5) +UnkStruct_ov17_0223F744 * ov17_0223F70C (int param0, PaletteData * param1, const u16 * param2, int param3, int param4, u32 param5) { UnkStruct_ov17_0223F744 * v0; diff --git a/src/overlay017/ov17_0223F7E4.c b/src/overlay017/ov17_0223F7E4.c index 06c6bd8581..7348513094 100644 --- a/src/overlay017/ov17_0223F7E4.c +++ b/src/overlay017/ov17_0223F7E4.c @@ -25,7 +25,7 @@ #include "overlay017/struct_ov17_0223F88C.h" #include "overlay017/struct_ov17_022472F8.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02002F38.h" @@ -473,7 +473,7 @@ static const UnkStruct_ov17_02253558 Unk_ov17_02253558[] = { } }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253354 = { +static const SpriteTemplate Unk_ov17_02253354 = { 0x0, 0x0, 0x0, @@ -597,7 +597,7 @@ void * ov17_0223F88C (UnkStruct_02095C48 * param0, UnkStruct_ov17_0223F88C * par { u16 * v5; - PaletteSys * v6; + PaletteData * v6; int v7; v6 = v0->unk_04->unk_50; @@ -641,8 +641,8 @@ void ov17_0223F9C4 (UnkStruct_ov17_0223F7E4 * param0, int param1, int param2, vo const UnkStruct_ov17_02253558 * v0, * v1; int v2; BGL * v3; - CellTransferStateData * v4; - AnimationResourceCollection * v5; + SpriteRenderer * v4; + SpriteGfxHandler * v5; param0->unk_0C = param3; @@ -960,7 +960,7 @@ static void ov17_02240138 (UnkStruct_ov17_0223F7E4 * param0, UnkStruct_ov17_0224 int v3; FontOAM * v4; BGL * v5; - AnimationResourceCollection * v6; + SpriteGfxHandler * v6; int v7, v8; GF_ASSERT(param1->unk_00 == NULL); @@ -1057,9 +1057,9 @@ static void ov17_022402A8 (UnkStruct_ov17_0223F7E4 * param0) static void ov17_022402E8 (UnkStruct_ov17_0223F7E4 * param0, u16 param1[]) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - UnkStruct_ov104_0223F9E0 v3; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + SpriteTemplate v3; int v4; v1 = param0->unk_04->unk_18; @@ -1072,12 +1072,12 @@ static void ov17_022402E8 (UnkStruct_ov17_0223F7E4 * param0, u16 param1[]) if (param1[v0] != 0) { v4 = param0->unk_18C.unk_130[v0]; - v3.unk_14[0] = 33014 + v0; - v3.unk_00 = Unk_ov17_02253298[v0][0]; - v3.unk_02 = Unk_ov17_02253298[v0][1]; + v3.resources[0] = 33014 + v0; + v3.x = Unk_ov17_02253298[v0][0]; + v3.y = Unk_ov17_02253298[v0][1]; param0->unk_118[v0] = ov17_0224F154(v1, v2, v4, &v3); - sub_0200D500(param0->unk_118[v0], v3.unk_00, v3.unk_02, (((192 + 80) << FX32_SHIFT))); + sub_0200D500(param0->unk_118[v0], v3.x, v3.y, (((192 + 80) << FX32_SHIFT))); } } } @@ -1085,8 +1085,8 @@ static void ov17_022402E8 (UnkStruct_ov17_0223F7E4 * param0, u16 param1[]) static void ov17_02240388 (UnkStruct_ov17_0223F7E4 * param0) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; + SpriteRenderer * v1; + SpriteGfxHandler * v2; v1 = param0->unk_04->unk_18; v2 = param0->unk_04->unk_1C; @@ -1389,7 +1389,7 @@ static void ov17_02240950 (SysTask * param0, void * param1) { UnkStruct_ov17_0223F7E4 * v0 = param1; UnkStruct_ov17_02240950 * v1; - PaletteSys * v2; + PaletteData * v2; int v3, v4; v1 = &v0->unk_2EC; diff --git a/src/overlay017/ov17_02241270.c b/src/overlay017/ov17_02241270.c index 6d2b7124fc..870064fe0a 100644 --- a/src/overlay017/ov17_02241270.c +++ b/src/overlay017/ov17_02241270.c @@ -6,12 +6,12 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "overlay017/ov17_02241270.h" -static const UnkStruct_ov104_0223F9E0 Unk_ov17_0225364C = { +static const SpriteTemplate Unk_ov17_0225364C = { 0x28, 0x60, 0x0, @@ -24,7 +24,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_0225364C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253618 = { +static const SpriteTemplate Unk_ov17_02253618 = { 0x0, 0x0, 0x0, @@ -37,7 +37,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253618 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253680 = { +static const SpriteTemplate Unk_ov17_02253680 = { 0x0, 0x0, 0x0, @@ -50,29 +50,29 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253680 = { 0x0 }; -void ov17_02241270 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_02241270 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 42, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33019); - sub_0200CE24(param0, param1, param2, 43, 1, 33014); - sub_0200CE54(param0, param1, param2, 44, 1, 33014); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 42, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33019); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 43, 1, 33014); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 44, 1, 33014); } -CellActorData * ov17_022412C0 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2) +CellActorData * ov17_022412C0 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2) { CellActorData * v0; - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_0225364C); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_0225364C); sub_0200D500(v0, (5 * 8) + (11 * 8) * param2, (0xc * 8) + 0 * param2, (((192 + 80) << FX32_SHIFT))); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); return v0; } -void ov17_022412F0 (AnimationResourceCollection * param0) +void ov17_022412F0 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33019); - sub_0200D090(param0, 33014); - sub_0200D0A0(param0, 33014); + SpriteGfxHandler_UnloadCharObjById(param0, 33019); + SpriteGfxHandler_UnloadCellObjById(param0, 33014); + SpriteGfxHandler_UnloadAnimObjById(param0, 33014); } void ov17_02241314 (CellActorData * param0) @@ -80,25 +80,25 @@ void ov17_02241314 (CellActorData * param0) sub_0200D0F4(param0); } -void ov17_0224131C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224131C (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 45, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33018); - sub_0200CE24(param0, param1, param2, 46, 1, 33013); - sub_0200CE54(param0, param1, param2, 47, 1, 33013); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 45, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33018); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 46, 1, 33013); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 47, 1, 33013); } -CellActorData * ov17_0224136C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4) +CellActorData * ov17_0224136C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4) { CellActorData * v0; if (param4 >= 0) { - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_02253618); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253618); } else { - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_02253680); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253680); } sub_0200D500(v0, param2, param3, (((192 + 80) << FX32_SHIFT))); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -108,9 +108,9 @@ void ov17_022413AC (CellActorData * param0) sub_0200D0F4(param0); } -void ov17_022413B4 (AnimationResourceCollection * param0) +void ov17_022413B4 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33018); - sub_0200D090(param0, 33013); - sub_0200D0A0(param0, 33013); + SpriteGfxHandler_UnloadCharObjById(param0, 33018); + SpriteGfxHandler_UnloadCellObjById(param0, 33013); + SpriteGfxHandler_UnloadAnimObjById(param0, 33013); } diff --git a/src/overlay017/ov17_022413D8.c b/src/overlay017/ov17_022413D8.c index 5b51b0fd63..6d569d0f78 100644 --- a/src/overlay017/ov17_022413D8.c +++ b/src/overlay017/ov17_022413D8.c @@ -26,7 +26,7 @@ #include "overlay017/struct_ov17_02246F24.h" #include "overlay017/struct_ov17_022472F8.h" #include "overlay017/struct_ov17_022538F0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_020041CC.h" @@ -181,7 +181,7 @@ static void ov17_022436A4(SysTask * param0, void * param1); static void ov17_02243750(SysTask * param0, void * param1); static void ov17_022414C0(SysTask * param0, void * param1); -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022538BC = { +static const SpriteTemplate Unk_ov17_022538BC = { 0x60, 0x28, 0x0, @@ -194,7 +194,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_022538BC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253820 = { +static const SpriteTemplate Unk_ov17_02253820 = { 0x60, 0x20, 0x0, @@ -207,7 +207,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253820 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253854 = { +static const SpriteTemplate Unk_ov17_02253854 = { 0x0, 0x0, 0x0, @@ -220,7 +220,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253854 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253888 = { +static const SpriteTemplate Unk_ov17_02253888 = { 0x0, 0x0, 0x0, @@ -233,7 +233,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253888 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022537EC = { +static const SpriteTemplate Unk_ov17_022537EC = { 0x0, 0x0, 0x0, @@ -246,7 +246,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_022537EC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_0225371C = { +static const SpriteTemplate Unk_ov17_0225371C = { 0x0, 0x0, 0x0, @@ -259,7 +259,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_0225371C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253750 = { +static const SpriteTemplate Unk_ov17_02253750 = { 0x0, 0x0, 0x0, @@ -272,7 +272,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253750 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253784 = { +static const SpriteTemplate Unk_ov17_02253784 = { 0x0, 0x0, 0x0, @@ -285,7 +285,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02253784 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022537B8 = { +static const SpriteTemplate Unk_ov17_022537B8 = { 0x0, 0x0, 0x0, @@ -386,7 +386,7 @@ __attribute__((aligned(4))) const u8 Unk_ov17_022536B4[] = { void include_unk_ov17_02253784 () { - s16 dummy = Unk_ov17_02253784.unk_00; + s16 dummy = Unk_ov17_02253784.x; } void ov17_022413D8 (void) @@ -547,10 +547,10 @@ void ov17_022416E4 (UnkStruct_ov17_0223F88C * param0) param0->unk_98.unk_00 = NULL; } -static CellActorData * ov17_02241720 (PaletteSys * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, const UnkStruct_020954F0 * param3, int param4, NARC * param5) +static CellActorData * ov17_02241720 (PaletteData * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, const UnkStruct_020954F0 * param3, int param4, NARC * param5) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; u32 v2, v3, v4, v5; switch (param4) { @@ -574,35 +574,35 @@ static CellActorData * ov17_02241720 (PaletteSys * param0, CellTransferStateData break; } - sub_0200CC3C(param1, param2, param5, v2, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33001 + param4); - sub_0200CDC4(param0, 2, param1, param2, param5, v3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + param4); - sub_0200CE24(param1, param2, param5, v4, 1, 33001 + param4); - sub_0200CE54(param1, param2, param5, v5, 1, 33001 + param4); + SpriteRenderer_LoadCharResObjFromOpenNarc(param1, param2, param5, v2, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33001 + param4); + SpriteRenderer_LoadPalette(param0, 2, param1, param2, param5, v3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + param4); + SpriteRenderer_LoadCellResObjFromOpenNarc(param1, param2, param5, v4, 1, 33001 + param4); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param1, param2, param5, v5, 1, 33001 + param4); v1 = Unk_ov17_022538BC; - v1.unk_14[0] = 33001 + param4; - v1.unk_14[1] = 33002 + param4; - v1.unk_14[2] = 33001 + param4; - v1.unk_14[3] = 33001 + param4; - v1.unk_00 = (8 * 12) + (4 * 8) * param4; - v1.unk_02 = (8 * 5) + 0 * param4; + v1.resources[0] = 33001 + param4; + v1.resources[1] = 33002 + param4; + v1.resources[2] = 33001 + param4; + v1.resources[3] = 33001 + param4; + v1.x = (8 * 12) + (4 * 8) * param4; + v1.y = (8 * 5) + 0 * param4; - v0 = sub_0200CE6C(param1, param2, &v1); - sub_0200D324(v0->unk_00); + v0 = SpriteActor_LoadResources(param1, param2, &v1); + SpriteActor_UpdateObject(v0->unk_00); return v0; } -static void ov17_02241814 (AnimationResourceCollection * param0, CellActorData * param1, int param2) +static void ov17_02241814 (SpriteGfxHandler * param0, CellActorData * param1, int param2) { sub_0200D0F4(param1); - sub_0200D070(param0, 33001 + param2); - sub_0200D080(param0, 33002 + param2); - sub_0200D090(param0, 33001 + param2); - sub_0200D0A0(param0, 33001 + param2); + SpriteGfxHandler_UnloadCharObjById(param0, 33001 + param2); + SpriteGfxHandler_UnloadPlttObjById(param0, 33002 + param2); + SpriteGfxHandler_UnloadCellObjById(param0, 33001 + param2); + SpriteGfxHandler_UnloadAnimObjById(param0, 33001 + param2); } -static void ov17_02241854 (PaletteSys * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, NARC * param3) +static void ov17_02241854 (PaletteData * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, NARC * param3) { u32 v0, v1, v2; @@ -610,26 +610,26 @@ static void ov17_02241854 (PaletteSys * param0, CellTransferStateData * param1, v1 = 40; v2 = 41; - sub_0200CC3C(param1, param2, param3, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); - sub_0200CE24(param1, param2, param3, v1, 1, 33004); - sub_0200CE54(param1, param2, param3, v2, 1, 33004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param1, param2, param3, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); + SpriteRenderer_LoadCellResObjFromOpenNarc(param1, param2, param3, v1, 1, 33004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param1, param2, param3, v2, 1, 33004); } -static CellActorData * ov17_022418A4 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2) +static CellActorData * ov17_022418A4 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; const int v2[] = { 2, 4, 5, }; v1 = Unk_ov17_02253820; - v1.unk_00 = ((8 * 12)) + ((4 * 8)) * param2; - v1.unk_02 = (8 * 4) + 0 * param2; - v1.unk_0C = v2[param2]; + v1.x = ((8 * 12)) + ((4 * 8)) * param2; + v1.y = (8 * 4) + 0 * param2; + v1.plttIdx = v2[param2]; - v0 = sub_0200CE6C(param0, param1, &v1); - sub_0200D324(v0->unk_00); + v0 = SpriteActor_LoadResources(param0, param1, &v1); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -639,11 +639,11 @@ static void ov17_02241900 (CellActorData * param0) sub_0200D0F4(param0); } -static void ov17_02241908 (AnimationResourceCollection * param0) +static void ov17_02241908 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33004); - sub_0200D090(param0, 33004); - sub_0200D0A0(param0, 33004); + SpriteGfxHandler_UnloadCharObjById(param0, 33004); + SpriteGfxHandler_UnloadCellObjById(param0, 33004); + SpriteGfxHandler_UnloadAnimObjById(param0, 33004); } void ov17_02241928 (UnkStruct_ov17_0223F88C * param0, UnkStruct_02095C48 * param1, NARC * param2) @@ -670,7 +670,7 @@ void ov17_0224197C (UnkStruct_ov17_0223F88C * param0) ov17_02241908(param0->unk_1C); } -void ov17_022419AC (PaletteSys * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, NARC * param3) +void ov17_022419AC (PaletteData * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, NARC * param3) { u32 v0, v1, v2; @@ -678,28 +678,28 @@ void ov17_022419AC (PaletteSys * param0, CellTransferStateData * param1, Animati v1 = 13; v2 = 12; - sub_0200CC3C(param1, param2, param3, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33013); - sub_0200CE24(param1, param2, param3, v1, 1, 33011); - sub_0200CE54(param1, param2, param3, v2, 1, 33011); + SpriteRenderer_LoadCharResObjFromOpenNarc(param1, param2, param3, v0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33013); + SpriteRenderer_LoadCellResObjFromOpenNarc(param1, param2, param3, v1, 1, 33011); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param1, param2, param3, v2, 1, 33011); } -void ov17_02241A00 (AnimationResourceCollection * param0) +void ov17_02241A00 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33013); - sub_0200D090(param0, 33011); - sub_0200D0A0(param0, 33011); + SpriteGfxHandler_UnloadCharObjById(param0, 33013); + SpriteGfxHandler_UnloadCellObjById(param0, 33011); + SpriteGfxHandler_UnloadAnimObjById(param0, 33011); } void ov17_02241A24 (UnkStruct_ov17_0223F88C * param0) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov17_022537B8; - v0 = sub_0200CE6C(param0->unk_18, param0->unk_1C, &v1); + v0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v1); sub_0200D3F4(v0, 0); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); param0->unk_17C = v0; } @@ -716,7 +716,7 @@ void ov17_02241A8C (UnkStruct_ov17_0223F88C * param0, int param1, int param2) { GF_ASSERT(param0->unk_17C != NULL); - sub_0200D4C4(param0->unk_17C, Unk_ov17_022536E4[param1].unk_00, Unk_ov17_022536E4[param1].unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_17C, Unk_ov17_022536E4[param1].unk_00, Unk_ov17_022536E4[param1].unk_02); sub_0200D364(param0->unk_17C, param2); sub_0200D3F4(param0->unk_17C, 1); @@ -755,7 +755,7 @@ void ov17_02241B3C (UnkStruct_ov17_02246F24 * param0, int param1, int param2, u8 v0->unk_00 = param0; v0->unk_08 = param1; - sub_0200D550(param0->unk_0C.unk_A8[param1], &v0->unk_0C, &v0->unk_0E); + SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_A8[param1], &v0->unk_0C, &v0->unk_0E); switch (param2) { case 0: @@ -830,7 +830,7 @@ static void ov17_02241C2C (SysTask * param0, void * param1) return; } - sub_0200D4C4(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); + SpriteActor_SetSpritePositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); } static void ov17_02241CF0 (SysTask * param0, void * param1) @@ -858,7 +858,7 @@ static void ov17_02241CF0 (SysTask * param0, void * param1) } } - sub_0200D4C4(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); + SpriteActor_SetSpritePositionXY(v0->unk_00->unk_0C.unk_A8[v0->unk_08], v0->unk_10 / 0x100, v0->unk_14 / 0x100); break; default: *(v0->unk_04) = 1; @@ -872,38 +872,38 @@ void ov17_02241D94 (UnkStruct_ov17_0223F88C * param0, int param1, NARC * param2) { GF_ASSERT(param0->unk_C0 == NULL); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param2, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); - sub_0200CE24(param0->unk_18, param0->unk_1C, param2, 19, 1, 33005); - sub_0200CE54(param0->unk_18, param0->unk_1C, param2, 18, 1, 33005); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param2, 20, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param2, 19, 1, 33005); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param2, 18, 1, 33005); - param0->unk_C0 = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov17_02253854); + param0->unk_C0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253854); - sub_0200D324(param0->unk_C0->unk_00); - sub_0200D4C4(param0->unk_C0, ((8 * 12)) + ((4 * 8)) * param1, (7 * 8)); + SpriteActor_UpdateObject(param0->unk_C0->unk_00); + SpriteActor_SetSpritePositionXY(param0->unk_C0, ((8 * 12)) + ((4 * 8)) * param1, (7 * 8)); } void ov17_02241E24 (UnkStruct_ov17_0223F88C * param0) { - sub_0200D070(param0->unk_1C, 33005); - sub_0200D090(param0->unk_1C, 33005); - sub_0200D0A0(param0->unk_1C, 33005); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 33005); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 33005); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 33005); sub_0200D0F4(param0->unk_C0); param0->unk_C0 = NULL; } -void ov17_02241E58 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_02241E58 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 17, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); - sub_0200CE24(param0, param1, param2, 16, 1, 33006); - sub_0200CE54(param0, param1, param2, 15, 1, 33006); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 17, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 16, 1, 33006); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 15, 1, 33006); } -void ov17_02241EA4 (AnimationResourceCollection * param0) +void ov17_02241EA4 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33006); - sub_0200D090(param0, 33006); - sub_0200D0A0(param0, 33006); + SpriteGfxHandler_UnloadCharObjById(param0, 33006); + SpriteGfxHandler_UnloadCellObjById(param0, 33006); + SpriteGfxHandler_UnloadAnimObjById(param0, 33006); } static inline void inline_ov17_02241EC4 (UnkStruct_ov17_0223F88C * param0, int param1, int param2) @@ -932,14 +932,14 @@ void ov17_02241EF0 (UnkStruct_ov17_0223F88C * param0) } } -static CellActorData * ov17_02241F08 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3) +static CellActorData * ov17_02241F08 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3) { CellActorData * v0; - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_02253888); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_02253888); - sub_0200D324(v0->unk_00); - sub_0200D4C4(v0, param2, param3); + SpriteActor_UpdateObject(v0->unk_00); + SpriteActor_SetSpritePositionXY(v0, param2, param3); return v0; } @@ -1031,24 +1031,24 @@ static void ov17_0224207C (SysTask * param0, void * param1) } } -void ov17_02242154 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_02242154 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 26, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); - sub_0200CE24(param0, param1, param2, 25, 1, 33008); - sub_0200CE54(param0, param1, param2, 24, 1, 33008); - sub_0200CC3C(param0, param1, param2, 29, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); - sub_0200CE24(param0, param1, param2, 28, 1, 33007); - sub_0200CE54(param0, param1, param2, 27, 1, 33007); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 26, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 25, 1, 33008); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 24, 1, 33008); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 29, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 28, 1, 33007); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 27, 1, 33007); } -void ov17_022421E0 (AnimationResourceCollection * param0) +void ov17_022421E0 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33008); - sub_0200D090(param0, 33008); - sub_0200D0A0(param0, 33008); - sub_0200D070(param0, 33007); - sub_0200D090(param0, 33007); - sub_0200D0A0(param0, 33007); + SpriteGfxHandler_UnloadCharObjById(param0, 33008); + SpriteGfxHandler_UnloadCellObjById(param0, 33008); + SpriteGfxHandler_UnloadAnimObjById(param0, 33008); + SpriteGfxHandler_UnloadCharObjById(param0, 33007); + SpriteGfxHandler_UnloadCellObjById(param0, 33007); + SpriteGfxHandler_UnloadAnimObjById(param0, 33007); } static inline void inline_ov17_0224221C (UnkStruct_ov17_0223F88C * param0, int param1, int param2) @@ -1077,26 +1077,26 @@ void ov17_02242248 (UnkStruct_ov17_0223F88C * param0) } } -static CellActorData * ov17_02242260 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3) +static CellActorData * ov17_02242260 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3) { CellActorData * v0; - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_022537EC); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_022537EC); - sub_0200D324(v0->unk_00); - sub_0200D4C4(v0, param2, param3); + SpriteActor_UpdateObject(v0->unk_00); + SpriteActor_SetSpritePositionXY(v0, param2, param3); return v0; } -static CellActorData * ov17_0224228C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3) +static CellActorData * ov17_0224228C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3) { CellActorData * v0; - v0 = sub_0200CE6C(param0, param1, &Unk_ov17_0225371C); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov17_0225371C); - sub_0200D324(v0->unk_00); - sub_0200D4C4(v0, param2, param3); + SpriteActor_UpdateObject(v0->unk_00); + SpriteActor_SetSpritePositionXY(v0, param2, param3); return v0; } @@ -1164,7 +1164,7 @@ static void ov17_022422B8 (SysTask * param0, void * param1) } sub_0200D7C0(v0->unk_04, 0x2000); - sub_0200D4C4(v0->unk_04, v0->unk_10 / 0x100, v0->unk_14 / 0x100); + SpriteActor_SetSpritePositionXY(v0->unk_04, v0->unk_10 / 0x100, v0->unk_14 / 0x100); } BOOL ov17_022424A8 (UnkStruct_ov17_0223F88C * param0, int param1) @@ -1235,13 +1235,13 @@ static void ov17_0224262C (UnkStruct_ov17_02246F24 * param0, GXOamMode param1, i for (v0 = 0; v0 < 4; v0++) { for (v1 = 0; v1 < 6; v1++) { if (param0->unk_0C.unk_C4[v0][v1] != NULL) { - sub_0200D810(param0->unk_0C.unk_C4[v0][v1], param1); + SpriteActor_SetOAMMode(param0->unk_0C.unk_C4[v0][v1], param1); sub_0200D3F4(param0->unk_0C.unk_C4[v0][v1], v2); } } if (param0->unk_0C.unk_160[v0] != NULL) { - sub_0200D810(param0->unk_0C.unk_160[v0], param1); + SpriteActor_SetOAMMode(param0->unk_0C.unk_160[v0], param1); sub_0200D3F4(param0->unk_0C.unk_160[v0], v2); } @@ -1629,29 +1629,29 @@ void ov17_02242FE8 (UnkStruct_ov17_02246F24 * param0) } } -void ov17_02243040 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_02243040 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 23, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33009); - sub_0200CE24(param0, param1, param2, 22, 1, 33009); - sub_0200CE54(param0, param1, param2, 21, 1, 33009); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 23, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33009); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 22, 1, 33009); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 21, 1, 33009); } -void ov17_0224308C (AnimationResourceCollection * param0) +void ov17_0224308C (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33009); - sub_0200D090(param0, 33009); - sub_0200D0A0(param0, 33009); + SpriteGfxHandler_UnloadCharObjById(param0, 33009); + SpriteGfxHandler_UnloadCellObjById(param0, 33009); + SpriteGfxHandler_UnloadAnimObjById(param0, 33009); } void ov17_022430AC (UnkStruct_ov17_0223F88C * param0, int param1, int param2) { if (param0->unk_160[param1] == NULL) { - param0->unk_160[param1] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov17_02253750); + param0->unk_160[param1] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov17_02253750); } sub_0200D364(param0->unk_160[param1], param2); - sub_0200D4C4(param0->unk_160[param1], (8 * 8), (5 * 8 + 2) + param1 * (6 * 8)); - sub_0200D324(param0->unk_160[param1]->unk_00); + SpriteActor_SetSpritePositionXY(param0->unk_160[param1], (8 * 8), (5 * 8 + 2) + param1 * (6 * 8)); + SpriteActor_UpdateObject(param0->unk_160[param1]->unk_00); } void ov17_022430F8 (UnkStruct_ov17_0223F88C * param0) @@ -1841,7 +1841,7 @@ void ov17_0224331C (UnkStruct_ov17_02246F24 * param0, int param1, int param2, u8 } if (*param3 == 0) { - sub_0200D550(param0->unk_0C.unk_C4[param1][v7], &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_C4[param1][v7], &v3, &v4); v8 = sub_0208C0A4( MATH_IAbs(v3 - v1), MATH_IAbs(v4 - v2)) * 0x100; @@ -1869,7 +1869,7 @@ void ov17_0224331C (UnkStruct_ov17_02246F24 * param0, int param1, int param2, u8 v0->unk_23 = v3; v0->unk_24 = v4; - sub_0200D550(param0->unk_0C.unk_C4[param1][v7], &v5, &v6); + SpriteActor_GetSpritePositionXY(param0->unk_0C.unk_C4[param1][v7], &v5, &v6); v0->unk_1C = (MATH_IAbs(v3 - v5) << 8) / (3 * (*param3)); v0->unk_18 = v5 << 8; @@ -1894,9 +1894,9 @@ static void ov17_022434E0 (SysTask * param0, void * param1) v0->unk_20++; } - sub_0200D550(v0->unk_08, &v4, &v5); + SpriteActor_GetSpritePositionXY(v0->unk_08, &v4, &v5); v4 = v0->unk_18 >> 8; - sub_0200D4C4(v0->unk_08, v4, v5); + SpriteActor_SetSpritePositionXY(v0->unk_08, v4, v5); break; case 1: v0->unk_1E += v0->unk_14; @@ -1919,7 +1919,7 @@ static void ov17_022434E0 (SysTask * param0, void * param1) v3 = v0->unk_10 / 0x100; v1 = FX_Mul(sub_0201D1D4(v0->unk_1E / 100), v3 << FX32_SHIFT) / FX32_ONE; v2 = FX_Mul(sub_0201D15C(v0->unk_1E / 100), v3 << FX32_SHIFT) / FX32_ONE; - sub_0200D4C4(v0->unk_08, v0->unk_21 + v1, v0->unk_22 + v2); + SpriteActor_SetSpritePositionXY(v0->unk_08, v0->unk_21 + v1, v0->unk_22 + v2); break; default: sub_0200D3F4(v0->unk_08, 0); @@ -2012,7 +2012,7 @@ static void ov17_02243750 (SysTask * param0, void * param1) break; } - sub_0200D550(v0->unk_04, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); v2 += (6 << FX32_SHIFT) >> FX32_SHIFT; v0->unk_1C = v1 << 8; @@ -2031,12 +2031,12 @@ static void ov17_02243750 (SysTask * param0, void * param1) v4 = FX_Mul(sub_0201D1D4(v0->unk_0C / 100), (6 << FX32_SHIFT)) / FX32_ONE; v0->unk_20 += 0x80; - sub_0200D4C4(v0->unk_04, (v0->unk_1C >> 8) + v3, (v0->unk_20 >> 8) + v4); + SpriteActor_SetSpritePositionXY(v0->unk_04, (v0->unk_1C >> 8) + v3, (v0->unk_20 >> 8) + v4); v0->unk_24++; if (v0->unk_24 > 80) { v0->unk_24 = 0; - sub_0200D550(v0->unk_04, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); v0->unk_1C = v1 << 8; v0->unk_20 = v2 << 8; { @@ -2065,7 +2065,7 @@ static void ov17_02243750 (SysTask * param0, void * param1) v0->unk_0E++; } - sub_0200D4C4(v0->unk_04, v0->unk_1C >> 8, v0->unk_20 >> 8); + SpriteActor_SetSpritePositionXY(v0->unk_04, v0->unk_1C >> 8, v0->unk_20 >> 8); break; default: sub_0200D3F4(v0->unk_04, 0); diff --git a/src/overlay017/ov17_022476F8.c b/src/overlay017/ov17_022476F8.c index 40203fe33f..86c050b51d 100644 --- a/src/overlay017/ov17_022476F8.c +++ b/src/overlay017/ov17_022476F8.c @@ -14,7 +14,7 @@ #include "overlay017/struct_ov17_0224792C.h" #include "overlay017/struct_ov17_02247A48.h" #include "overlay017/struct_ov17_0225442C.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02005474.h" #include "unk_0200762C.h" @@ -41,7 +41,7 @@ typedef struct { u16 unk_16; } UnkStruct_ov17_022477B8; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022543F8 = { +static const SpriteTemplate Unk_ov17_022543F8 = { 0x0, 0x0, 0x0, @@ -98,18 +98,18 @@ void ov17_02247734 (UnkStruct_ov17_022476F8 * param0) } } -void ov17_0224774C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224774C (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 67, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33002); - sub_0200CE24(param0, param1, param2, 68, 1, 33002); - sub_0200CE54(param0, param1, param2, 69, 1, 33002); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 67, 1, NNS_G2D_VRAM_TYPE_2DSUB, 33002); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 68, 1, 33002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 69, 1, 33002); } -void ov17_02247798 (AnimationResourceCollection * param0) +void ov17_02247798 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33002); - sub_0200D090(param0, 33002); - sub_0200D0A0(param0, 33002); + SpriteGfxHandler_UnloadCharObjById(param0, 33002); + SpriteGfxHandler_UnloadCellObjById(param0, 33002); + SpriteGfxHandler_UnloadAnimObjById(param0, 33002); } void ov17_022477B8 (UnkStruct_ov17_02247A48 * param0, int param1, int param2, fx32 param3, int param4) @@ -119,14 +119,14 @@ void ov17_022477B8 (UnkStruct_ov17_02247A48 * param0, int param1, int param2, fx v0 = Heap_AllocFromHeap(22, sizeof(UnkStruct_ov17_022477B8)); MI_CpuClear8(v0, sizeof(UnkStruct_ov17_022477B8)); - v0->unk_04 = sub_0200CE6C(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, &Unk_ov17_022543F8); + v0->unk_04 = SpriteActor_LoadResources(param0->unk_0C.unk_1C, param0->unk_0C.unk_20, &Unk_ov17_022543F8); sub_0200D500(v0->unk_04, param1, param2, (256 * FX32_ONE)); if (param4 == 1) { sub_0200D364(v0->unk_04, 1); } - sub_0200D324(v0->unk_04->unk_00); + SpriteActor_UpdateObject(v0->unk_04->unk_00); v0->unk_08 = param1 << 8; v0->unk_0C = param2 << 8; diff --git a/src/overlay017/ov17_022492DC.c b/src/overlay017/ov17_022492DC.c index e8f3b055bb..bb1cc5c463 100644 --- a/src/overlay017/ov17_022492DC.c +++ b/src/overlay017/ov17_022492DC.c @@ -417,8 +417,8 @@ void ov17_02249640 (UnkStruct_ov17_022492DC * param0, int param1, int param2, vo const UnkStruct_ov17_02254578 * v0, * v1; int v2; BGL * v3; - CellTransferStateData * v4; - AnimationResourceCollection * v5; + SpriteRenderer * v4; + SpriteGfxHandler * v5; param0->unk_08 = param3; @@ -688,7 +688,7 @@ static void ov17_02249BC4 (UnkStruct_ov17_022492DC * param0, UnkStruct_ov17_0224 int v3; FontOAM * v4; BGL * v5; - AnimationResourceCollection * v6; + SpriteGfxHandler * v6; int v7, v8; GF_ASSERT(param1->unk_00 == NULL); @@ -759,7 +759,7 @@ static void ov17_02249CD0 (UnkStruct_ov17_022492DC * param0) static void ov17_02249CFC (UnkStruct_ov17_022492DC * param0, int param1) { - AnimationResourceCollection * v0; + SpriteGfxHandler * v0; int v1; int v2, v3; diff --git a/src/overlay017/ov17_0224A0FC.c b/src/overlay017/ov17_0224A0FC.c index 8711263bf1..e835a4e74f 100644 --- a/src/overlay017/ov17_0224A0FC.c +++ b/src/overlay017/ov17_0224A0FC.c @@ -35,7 +35,7 @@ #include "overlay017/struct_ov17_02253084.h" #include "overlay017/struct_ov17_0225470C.h" #include "overlay022/struct_ov22_0225AF8C.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "spl.h" @@ -157,7 +157,7 @@ __attribute__((aligned(4))) static const u8 Unk_ov17_022549BC[] = { 0xB8 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254760 = { +static const SpriteTemplate Unk_ov17_02254760 = { 0x0, 0x0, 0x0, @@ -170,7 +170,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254760 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254794 = { +static const SpriteTemplate Unk_ov17_02254794 = { 0x0, 0x0, 0x0, @@ -183,7 +183,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254794 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022547C8 = { +static const SpriteTemplate Unk_ov17_022547C8 = { 0x0, 0x0, 0x0, @@ -196,7 +196,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_022547C8 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_022547FC = { +static const SpriteTemplate Unk_ov17_022547FC = { 0x0, 0x90, 0x0, @@ -209,7 +209,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_022547FC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254830 = { +static const SpriteTemplate Unk_ov17_02254830 = { 0x0, 0x0, 0x0, @@ -222,7 +222,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254830 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254864 = { +static const SpriteTemplate Unk_ov17_02254864 = { 0x0, 0x0, 0x0, @@ -235,7 +235,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254864 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_0225472C = { +static const SpriteTemplate Unk_ov17_0225472C = { 0x0, 0x0, 0x0, @@ -390,12 +390,12 @@ void ov17_0224A1EC (UnkStruct_ov17_0224A1EC * param0) } } -void ov17_0224A20C (CellTransferStateData * param0, AnimationResourceCollection * param1) +void ov17_0224A20C (SpriteRenderer * param0, SpriteGfxHandler * param1) { return; } -void ov17_0224A210 (AnimationResourceCollection * param0) +void ov17_0224A210 (SpriteGfxHandler * param0) { return; } @@ -508,77 +508,77 @@ void ov17_0224A368 (UnkStruct_ov17_0224A1EC * param0, int param1, int param2, in ov17_0224A214(param0, v0, param3); } -void ov17_0224A390 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224A390 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 58, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); - sub_0200CC3C(param0, param1, param2, 59, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); - sub_0200CC3C(param0, param1, param2, 60, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); - sub_0200CC3C(param0, param1, param2, 61, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); - sub_0200CE24(param0, param1, param2, 62, 1, 33003); - sub_0200CE54(param0, param1, param2, 63, 1, 33003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 58, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 59, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 60, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33005); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 61, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 62, 1, 33003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 63, 1, 33003); } -void ov17_0224A428 (AnimationResourceCollection * param0) +void ov17_0224A428 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33003); - sub_0200D070(param0, 33004); - sub_0200D070(param0, 33005); - sub_0200D070(param0, 33006); - sub_0200D090(param0, 33003); - sub_0200D0A0(param0, 33003); + SpriteGfxHandler_UnloadCharObjById(param0, 33003); + SpriteGfxHandler_UnloadCharObjById(param0, 33004); + SpriteGfxHandler_UnloadCharObjById(param0, 33005); + SpriteGfxHandler_UnloadCharObjById(param0, 33006); + SpriteGfxHandler_UnloadCellObjById(param0, 33003); + SpriteGfxHandler_UnloadAnimObjById(param0, 33003); } -static int ov17_0224A46C (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, int param3, int param4, int param5, int param6, int param7) +static int ov17_0224A46C (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, int param3, int param4, int param5, int param6, int param7) { CellActorData * v0; int v1; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; v2 = Unk_ov17_02254760; if (param3 == 2) { - v2.unk_08 += 10; + v2.priority += 10; } else { switch (param7) { case 0: default: break; case 1: - v2.unk_08 += 3; + v2.priority += 3; break; case 2: - v2.unk_08 += 2; + v2.priority += 2; break; case 3: - v2.unk_08 += 1; + v2.priority += 1; break; } } switch (param4) { case 3: - v2.unk_14[0] = 33004; - v2.unk_0C = 2; + v2.resources[0] = 33004; + v2.plttIdx = 2; break; case 4: - v2.unk_14[0] = 33006; - v2.unk_0C = 6; + v2.resources[0] = 33006; + v2.plttIdx = 6; break; case 1: - v2.unk_14[0] = 33005; - v2.unk_0C = 7; + v2.resources[0] = 33005; + v2.plttIdx = 7; break; case 2: default: - v2.unk_14[0] = 33003; - v2.unk_0C = 2; + v2.resources[0] = 33003; + v2.plttIdx = 2; break; } - v0 = sub_0200CE6C(param1, param2, &v2); + v0 = SpriteActor_LoadResources(param1, param2, &v2); sub_0200D364(v0, param3); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); sub_0200D500(v0, param5, param6, (256 * FX32_ONE)); sub_0200D390(v0, 1); @@ -605,27 +605,27 @@ void ov17_0224A580 (UnkStruct_ov17_0224A1EC * param0) } } -void ov17_0224A5A8 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224A5A8 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 55, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); - sub_0200CE24(param0, param1, param2, 56, 1, 33004); - sub_0200CE54(param0, param1, param2, 57, 1, 33004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 55, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 56, 1, 33004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 57, 1, 33004); } -void ov17_0224A5F8 (AnimationResourceCollection * param0) +void ov17_0224A5F8 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33007); - sub_0200D090(param0, 33004); - sub_0200D0A0(param0, 33004); + SpriteGfxHandler_UnloadCharObjById(param0, 33007); + SpriteGfxHandler_UnloadCellObjById(param0, 33004); + SpriteGfxHandler_UnloadAnimObjById(param0, 33004); } -void ov17_0224A61C (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2) +void ov17_0224A61C (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2) { CellActorData * v0; int v1; for (v1 = 0; v1 < 3; v1++) { - param0->unk_960[v1] = sub_0200CE6C(param1, param2, &Unk_ov17_02254794); + param0->unk_960[v1] = SpriteActor_LoadResources(param1, param2, &Unk_ov17_02254794); sub_0200D3F4(param0->unk_960[v1], 0); } } @@ -676,7 +676,7 @@ void ov17_0224A7B8 (UnkStruct_ov17_0224A1EC * param0) } } -void ov17_0224A7E0 (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2, int param3, int param4, u8 param5) +void ov17_0224A7E0 (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2, int param3, int param4, u8 param5) { CellActorData * v0; int v1, v2, v3, v4; @@ -699,7 +699,7 @@ void ov17_0224A7E0 (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * pa sub_0200D364(v5->unk_00, param3); sub_0200D500(v5->unk_00, v2, v3, (256 * FX32_ONE)); - sub_0200D324(v5->unk_00->unk_00); + SpriteActor_UpdateObject(v5->unk_00->unk_00); sub_0200D3F4(v5->unk_00, 1); for (v1 = 0; v1 < 3; v1++) { @@ -762,26 +762,26 @@ void ov17_0224A95C (UnkStruct_ov17_0224A1EC * param0) } } -void ov17_0224A984 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224A984 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 64, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); - sub_0200CE24(param0, param1, param2, 65, 1, 33005); - sub_0200CE54(param0, param1, param2, 66, 1, 33005); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 64, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 65, 1, 33005); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 66, 1, 33005); } -void ov17_0224A9D4 (AnimationResourceCollection * param0) +void ov17_0224A9D4 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33008); - sub_0200D090(param0, 33005); - sub_0200D0A0(param0, 33005); + SpriteGfxHandler_UnloadCharObjById(param0, 33008); + SpriteGfxHandler_UnloadCellObjById(param0, 33005); + SpriteGfxHandler_UnloadAnimObjById(param0, 33005); } -void ov17_0224A9F8 (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2) +void ov17_0224A9F8 (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2) { CellActorData * v0; - v0 = sub_0200CE6C(param1, param2, &Unk_ov17_022547C8); - sub_0200D324(v0->unk_00); + v0 = SpriteActor_LoadResources(param1, param2, &Unk_ov17_022547C8); + SpriteActor_UpdateObject(v0->unk_00); param0->unk_1E8 = v0; } @@ -818,27 +818,27 @@ static void ov17_0224AA68 (SysTask * param0, void * param1) sub_0200D500(v0->unk_14.unk_1E8, v1, v2 - 8 * 5, (256 * FX32_ONE)); } -void ov17_0224AA94 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224AA94 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 90, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33010); - sub_0200CE24(param0, param1, param2, 89, 1, 33007); - sub_0200CE54(param0, param1, param2, 88, 1, 33007); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 90, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33010); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 89, 1, 33007); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 88, 1, 33007); } -void ov17_0224AAE4 (AnimationResourceCollection * param0) +void ov17_0224AAE4 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33010); - sub_0200D090(param0, 33007); - sub_0200D0A0(param0, 33007); + SpriteGfxHandler_UnloadCharObjById(param0, 33010); + SpriteGfxHandler_UnloadCellObjById(param0, 33007); + SpriteGfxHandler_UnloadAnimObjById(param0, 33007); } -void ov17_0224AB08 (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2) +void ov17_0224AB08 (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2) { int v0; for (v0 = 0; v0 < 4; v0++) { - param0->unk_200[v0].unk_04 = sub_0200CE6C(param1, param2, &Unk_ov17_02254830); - sub_0200D324(param0->unk_200[v0].unk_04->unk_00); + param0->unk_200[v0].unk_04 = SpriteActor_LoadResources(param1, param2, &Unk_ov17_02254830); + SpriteActor_UpdateObject(param0->unk_200[v0].unk_04->unk_00); sub_0200D6A4(param0->unk_200[v0].unk_04, 1); param0->unk_200[v0].unk_13 = v0; param0->unk_200[v0].unk_0C = ¶m0->unk_04[v0]; @@ -907,21 +907,21 @@ void ov17_0224AC78 (UnkStruct_ov17_0224ABFC * param0, int param1, int param2) param0->unk_12 = param2; } -void ov17_0224AC80 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224AC80 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 93, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33011); - sub_0200CE24(param0, param1, param2, 92, 1, 33008); - sub_0200CE54(param0, param1, param2, 91, 1, 33008); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 93, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33011); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 92, 1, 33008); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 91, 1, 33008); } -void ov17_0224ACD0 (AnimationResourceCollection * param0) +void ov17_0224ACD0 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33011); - sub_0200D090(param0, 33008); - sub_0200D0A0(param0, 33008); + SpriteGfxHandler_UnloadCharObjById(param0, 33011); + SpriteGfxHandler_UnloadCellObjById(param0, 33008); + SpriteGfxHandler_UnloadAnimObjById(param0, 33008); } -void ov17_0224ACF4 (UnkStruct_ov17_0224A1EC * param0, CellTransferStateData * param1, AnimationResourceCollection * param2) +void ov17_0224ACF4 (UnkStruct_ov17_0224A1EC * param0, SpriteRenderer * param1, SpriteGfxHandler * param2) { return; } @@ -931,18 +931,18 @@ void ov17_0224ACF8 (UnkStruct_ov17_0224A1EC * param0) return; } -void ov17_0224ACFC (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224ACFC (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 96, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33012); - sub_0200CE24(param0, param1, param2, 95, 1, 33009); - sub_0200CE54(param0, param1, param2, 94, 1, 33009); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 96, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33012); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 95, 1, 33009); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 94, 1, 33009); } -void ov17_0224AD4C (AnimationResourceCollection * param0) +void ov17_0224AD4C (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33012); - sub_0200D090(param0, 33009); - sub_0200D0A0(param0, 33009); + SpriteGfxHandler_UnloadCharObjById(param0, 33012); + SpriteGfxHandler_UnloadCellObjById(param0, 33009); + SpriteGfxHandler_UnloadAnimObjById(param0, 33009); } BOOL ov17_0224AD70 (UnkStruct_ov17_0224DF54 * param0, int param1, int param2) @@ -966,7 +966,7 @@ BOOL ov17_0224AD70 (UnkStruct_ov17_0224DF54 * param0, int param1, int param2) return 0; } - v0 = sub_0200CE6C(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_02254864); + v0 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_02254864); if (v0 == NULL) { return 0; @@ -978,7 +978,7 @@ BOOL ov17_0224AD70 (UnkStruct_ov17_0224DF54 * param0, int param1, int param2) sub_0200D364(v0, param2); sub_0200D500(v0, v5, v6, (256 * FX32_ONE)); sub_02021CC8(v0->unk_00, 1); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); v1 = sub_02094E98(param0->unk_00); v2 = 0x500; @@ -1065,18 +1065,18 @@ static void ov17_0224AF3C (UnkStruct_ov17_0224DF54 * param0, int param1, int par } } -void ov17_0224AFA8 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224AFA8 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 99, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33013); - sub_0200CE24(param0, param1, param2, 98, 1, 33010); - sub_0200CE54(param0, param1, param2, 97, 1, 33010); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 99, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33013); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 98, 1, 33010); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 97, 1, 33010); } -void ov17_0224AFF8 (AnimationResourceCollection * param0) +void ov17_0224AFF8 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33013); - sub_0200D090(param0, 33010); - sub_0200D0A0(param0, 33010); + SpriteGfxHandler_UnloadCharObjById(param0, 33013); + SpriteGfxHandler_UnloadCellObjById(param0, 33010); + SpriteGfxHandler_UnloadAnimObjById(param0, 33010); } BOOL ov17_0224B01C (UnkStruct_ov17_0224DF54 * param0) @@ -1085,10 +1085,10 @@ BOOL ov17_0224B01C (UnkStruct_ov17_0224DF54 * param0) UnkStruct_ov17_0224B058 * v1; v1 = ¶m0->unk_14.unk_910; - v0 = sub_0200CE6C(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_0225472C); + v0 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_0225472C); sub_0200D500(v0, -1, (0x16 * 8), (256 * FX32_ONE)); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); sub_0200D3F4(v0, 0); v1->unk_04 = v0; @@ -1968,21 +1968,21 @@ int ov17_0224C300 (UnkStruct_ov17_0224DF54 * param0) return Message_Printing(param0->unk_14.unk_A18); } -void ov17_0224C310 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2) +void ov17_0224C310 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2) { - sub_0200CC3C(param0, param1, param2, 76, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33009); - sub_0200CE24(param0, param1, param2, 77, 1, 33006); - sub_0200CE54(param0, param1, param2, 78, 1, 33006); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, 76, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33009); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, 77, 1, 33006); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, 78, 1, 33006); } -void ov17_0224C360 (AnimationResourceCollection * param0) +void ov17_0224C360 (SpriteGfxHandler * param0) { - sub_0200D070(param0, 33009); - sub_0200D090(param0, 33006); - sub_0200D0A0(param0, 33006); + SpriteGfxHandler_UnloadCharObjById(param0, 33009); + SpriteGfxHandler_UnloadCellObjById(param0, 33006); + SpriteGfxHandler_UnloadAnimObjById(param0, 33006); } -void ov17_0224C384 (UnkStruct_ov17_0224DF54 * param0, CellTransferStateData * param1, AnimationResourceCollection * param2) +void ov17_0224C384 (UnkStruct_ov17_0224DF54 * param0, SpriteRenderer * param1, SpriteGfxHandler * param2) { UnkStruct_ov17_0224C384 * v0; @@ -1994,9 +1994,9 @@ void ov17_0224C384 (UnkStruct_ov17_0224DF54 * param0, CellTransferStateData * pa param0->unk_14.unk_1FC = v0; v0->unk_08 = param0; - v0->unk_04 = sub_0200CE6C(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_022547FC); + v0->unk_04 = SpriteActor_LoadResources(param0->unk_14.unk_58, param0->unk_14.unk_5C, &Unk_ov17_022547FC); - sub_0200D324(v0->unk_04->unk_00); + SpriteActor_UpdateObject(v0->unk_04->unk_00); sub_0200D3F4(v0->unk_04, 0); v0->unk_00 = SysTask_Start(ov17_0224C414, v0, ((30000 + 10000) + 15)); @@ -2025,7 +2025,7 @@ static void ov17_0224C414 (SysTask * param0, void * param1) break; } - sub_0200D324(v0->unk_04->unk_00); + SpriteActor_UpdateObject(v0->unk_04->unk_00); } void ov17_0224C434 (UnkStruct_ov17_0224B058 * param0, u32 param1, u32 param2, int param3) diff --git a/src/overlay017/ov17_0224F080.c b/src/overlay017/ov17_0224F080.c index 60ecb3a7df..a9fcde5f82 100644 --- a/src/overlay017/ov17_0224F080.c +++ b/src/overlay017/ov17_0224F080.c @@ -5,7 +5,7 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "overlay017/ov17_0224F080.h" @@ -53,36 +53,36 @@ u32 ov17_0224F0B8 (void) return 46; } -void ov17_0224F0BC (CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) +void ov17_0224F0BC (SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { sub_0200CBDC(param0, param1, ov17_0224F0B8(), ov17_0224F080(param3), 1, param2, param4); } -void ov17_0224F0F0 (CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, u32 param3) +void ov17_0224F0F0 (SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, u32 param3) { sub_0200CE0C(param0, param1, ov17_0224F0B8(), ov17_0224F098(), 1, param2); sub_0200CE3C(param0, param1, ov17_0224F0B8(), ov17_0224F09C(), 1, param3); } -void ov17_0224F138 (AnimationResourceCollection * param0, u32 param1) +void ov17_0224F138 (SpriteGfxHandler * param0, u32 param1) { - sub_0200D070(param0, param1); + SpriteGfxHandler_UnloadCharObjById(param0, param1); } -void ov17_0224F140 (AnimationResourceCollection * param0, u32 param1, u32 param2) +void ov17_0224F140 (SpriteGfxHandler * param0, u32 param1, u32 param2) { - sub_0200D090(param0, param1); - sub_0200D0A0(param0, param2); + SpriteGfxHandler_UnloadCellObjById(param0, param1); + SpriteGfxHandler_UnloadAnimObjById(param0, param2); } -CellActorData * ov17_0224F154 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, const UnkStruct_ov104_0223F9E0 * param3) +CellActorData * ov17_0224F154 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, const SpriteTemplate * param3) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = *param3; - v1.unk_0C = ov17_0224F0A0(param2); - v0 = sub_0200CE6C(param0, param1, &v1); + v1.plttIdx = ov17_0224F0A0(param2); + v0 = SpriteActor_LoadResources(param0, param1, &v1); return v0; } diff --git a/src/overlay017/ov17_02250744.c b/src/overlay017/ov17_02250744.c index 2f8568e077..3c30749b6b 100644 --- a/src/overlay017/ov17_02250744.c +++ b/src/overlay017/ov17_02250744.c @@ -15,7 +15,7 @@ #include "overlay017/struct_ov17_022507C4.h" #include "overlay017/struct_ov17_022508E4.h" #include "overlay017/struct_ov17_02254C0C.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_02005474.h" @@ -132,7 +132,7 @@ static const UnkStruct_ov17_02254C0C Unk_ov17_02254C0C[] = { {0x5, 0x0} }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C5C = { +static const SpriteTemplate Unk_ov17_02254C5C = { 0x0, 0x0, 0x0, @@ -145,7 +145,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C5C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C28 = { +static const SpriteTemplate Unk_ov17_02254C28 = { 0x0, 0x0, 0x0, @@ -158,7 +158,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C28 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C90 = { +static const SpriteTemplate Unk_ov17_02254C90 = { 0x0, 0x0, 0x0, @@ -171,7 +171,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254C90 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254CC4 = { +static const SpriteTemplate Unk_ov17_02254CC4 = { 0x0, 0x0, 0x0, @@ -380,7 +380,7 @@ void ov17_02250D28 (UnkStruct_ov17_0224FCA0 * param0) v0 = NARC_ctor(NARC_INDEX_CONTEST__GRAPHIC__CONTEST_OBJ, 24); - sub_0200CDC4(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v0, 10, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); + SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v0, 10, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 33001); ov17_02250F68(param0, v0); ov17_02250DB0(param0); @@ -401,23 +401,23 @@ void ov17_02250D8C (UnkStruct_ov17_0224FCA0 * param0) void ov17_02250DB0 (UnkStruct_ov17_0224FCA0 * param0) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; int v1, v2; NARC * v3; v3 = NARC_ctor(NARC_INDEX_POKETOOL__ICONGRA__PL_POKE_ICON, 24); - sub_0200CDC4(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); - sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KCellsFileIndex(), 0, 33002); - sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KAnimationFileIndex(), 0, 33002); + SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIconPalettesFileIndex(), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 33003); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KCellsFileIndex(), 0, 33002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, v3, PokeIcon64KAnimationFileIndex(), 0, 33002); v0 = Unk_ov17_02254C5C; for (v2 = 0; v2 < 4; v2++) { sub_0200D888(param0->unk_10.unk_18, param0->unk_10.unk_1C, 19, Pokemon_IconSpriteIndex(param0->unk_00->unk_00.unk_00[v2]), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 33002 + v2); - v0.unk_14[0] = 33002 + v2; - param0->unk_10.unk_128[v2] = sub_0200CE6C(param0->unk_10.unk_18, param0->unk_10.unk_1C, &v0); + v0.resources[0] = 33002 + v2; + param0->unk_10.unk_128[v2] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &v0); sub_0200D364(param0->unk_10.unk_128[v2], 1); sub_02021F24(param0->unk_10.unk_128[v2]->unk_00, Pokemon_IconPaletteIndex(param0->unk_00->unk_00.unk_00[v2])); @@ -426,7 +426,7 @@ void ov17_02250DB0 (UnkStruct_ov17_0224FCA0 * param0) for (v2 = 0; v2 < 4; v2++) { v1 = param0->unk_39A.unk_30[v2]; - sub_0200D4C4(param0->unk_10.unk_128[v1], Unk_ov17_02254BD4[v2].unk_00, Unk_ov17_02254BD4[v2].unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_10.unk_128[v1], Unk_ov17_02254BD4[v2].unk_00, Unk_ov17_02254BD4[v2].unk_02); } param0->unk_10.unk_124 = SysTask_Start(ov17_02250F4C, param0, (50000 + 1000)); @@ -438,12 +438,12 @@ void ov17_02250EFC (UnkStruct_ov17_0224FCA0 * param0) { int v0; - sub_0200D090(param0->unk_10.unk_1C, 33002); - sub_0200D0A0(param0->unk_10.unk_1C, 33002); - sub_0200D080(param0->unk_10.unk_1C, 33003); + SpriteGfxHandler_UnloadCellObjById(param0->unk_10.unk_1C, 33002); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_10.unk_1C, 33002); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_10.unk_1C, 33003); for (v0 = 0; v0 < 4; v0++) { - sub_0200D070(param0->unk_10.unk_1C, 33002 + v0); + SpriteGfxHandler_UnloadCharObjById(param0->unk_10.unk_1C, 33002 + v0); sub_0200D0F4(param0->unk_10.unk_128[v0]); } @@ -462,16 +462,16 @@ static void ov17_02250F4C (SysTask * param0, void * param1) void ov17_02250F68 (UnkStruct_ov17_0224FCA0 * param0, NARC * param1) { - sub_0200CC3C(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 102, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); - sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 101, 1, 33004); - sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 100, 1, 33004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 102, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33007); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 101, 1, 33004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 100, 1, 33004); } void ov17_02250FBC (UnkStruct_ov17_0224FCA0 * param0) { - sub_0200D070(param0->unk_10.unk_1C, 33007); - sub_0200D090(param0->unk_10.unk_1C, 33004); - sub_0200D0A0(param0->unk_10.unk_1C, 33004); + SpriteGfxHandler_UnloadCharObjById(param0->unk_10.unk_1C, 33007); + SpriteGfxHandler_UnloadCellObjById(param0->unk_10.unk_1C, 33004); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_10.unk_1C, 33004); } void ov17_02250FE4 (UnkStruct_ov17_0224FCA0 * param0) @@ -526,7 +526,7 @@ static void ov17_02251070 (UnkStruct_ov17_0224FCA0 * param0) MI_CpuClear8(v1, sizeof(UnkStruct_ov17_02251070)); v1->unk_00 = param0; - v1->unk_04 = sub_0200CE6C(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C28); + v1->unk_04 = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C28); v2 = (sub_02094E98(param0->unk_00) & 0xff) + 20; v3 = -16 + (sub_02094E98(param0->unk_00) % (96 - 32 - 16)); @@ -534,7 +534,7 @@ static void ov17_02251070 (UnkStruct_ov17_0224FCA0 * param0) v1->unk_08 = v2 * 0x100; v1->unk_0C = v3 * 0x100; - sub_0200D4C4(v1->unk_04, v2, v3); + SpriteActor_SetSpritePositionXY(v1->unk_04, v2, v3); v1->unk_14 = (sub_02094E98(param0->unk_00) % 0x200) + 0x60; v1->unk_18 = (sub_02094E98(param0->unk_00) % 0x300) + 0x100; @@ -569,37 +569,37 @@ static void ov17_02251140 (SysTask * param0, void * param1) v0->unk_08 -= v0->unk_14; v0->unk_0C += 0x280; - sub_0200D4C4(v0->unk_04, (v0->unk_08 / 0x100) + v0->unk_10, v0->unk_0C / 0x100); + SpriteActor_SetSpritePositionXY(v0->unk_04, (v0->unk_08 / 0x100) + v0->unk_10, v0->unk_0C / 0x100); sub_0200D330(v0->unk_04); } void ov17_0225122C (UnkStruct_ov17_0224FCA0 * param0, NARC * param1) { - sub_0200CC3C(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 84, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); - sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 83, 1, 33003); - sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 82, 1, 33003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 84, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33006); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 83, 1, 33003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 82, 1, 33003); { int v0, v1; for (v0 = 0; v0 < 4; v0++) { - param0->unk_10.unk_138[v0] = sub_0200CE6C(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C90); + param0->unk_10.unk_138[v0] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254C90); sub_0200D330(param0->unk_10.unk_138[v0]); sub_0200D3F4(param0->unk_10.unk_138[v0], 0); } for (v0 = 0; v0 < 4; v0++) { v1 = param0->unk_39A.unk_30[v0]; - sub_0200D4C4(param0->unk_10.unk_138[v1], Unk_ov17_02254BE4[v0].unk_00, Unk_ov17_02254BE4[v0].unk_02); + SpriteActor_SetSpritePositionXY(param0->unk_10.unk_138[v1], Unk_ov17_02254BE4[v0].unk_00, Unk_ov17_02254BE4[v0].unk_02); } } } void ov17_022512E0 (UnkStruct_ov17_0224FCA0 * param0) { - sub_0200D070(param0->unk_10.unk_1C, 33006); - sub_0200D090(param0->unk_10.unk_1C, 33003); - sub_0200D0A0(param0->unk_10.unk_1C, 33003); + SpriteGfxHandler_UnloadCharObjById(param0->unk_10.unk_1C, 33006); + SpriteGfxHandler_UnloadCellObjById(param0->unk_10.unk_1C, 33003); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_10.unk_1C, 33003); { int v0; @@ -619,18 +619,18 @@ void ov17_0225131C (UnkStruct_ov17_0224FCA0 * param0, int param1, int param2) void ov17_02251344 (UnkStruct_ov17_0224FCA0 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); - sub_0200CC3C(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 87, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); - sub_0200CE24(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 86, 1, 33005); - sub_0200CE54(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 85, 1, 33005); + SpriteRenderer_LoadPalette(param0->unk_10.unk_C0, 2, param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 87, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 33008); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 86, 1, 33005); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_10.unk_18, param0->unk_10.unk_1C, param1, 85, 1, 33005); } void ov17_022513C0 (UnkStruct_ov17_0224FCA0 * param0) { - sub_0200D080(param0->unk_10.unk_1C, 33004); - sub_0200D070(param0->unk_10.unk_1C, 33008); - sub_0200D090(param0->unk_10.unk_1C, 33005); - sub_0200D0A0(param0->unk_10.unk_1C, 33005); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_10.unk_1C, 33004); + SpriteGfxHandler_UnloadCharObjById(param0->unk_10.unk_1C, 33008); + SpriteGfxHandler_UnloadCellObjById(param0->unk_10.unk_1C, 33005); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_10.unk_1C, 33005); } void ov17_022513F4 (UnkStruct_ov17_0224FCA0 * param0, int param1, int param2, int param3, int param4) @@ -673,7 +673,7 @@ void ov17_022513F4 (UnkStruct_ov17_0224FCA0 * param0, int param1, int param2, in for (v6 = 0; v6 < v5; v6++) { if (v1[v6] == NULL) { - v1[v6] = sub_0200CE6C(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254CC4); + v1[v6] = SpriteActor_LoadResources(param0->unk_10.unk_18, param0->unk_10.unk_1C, &Unk_ov17_02254CC4); } } @@ -689,7 +689,7 @@ void ov17_022513F4 (UnkStruct_ov17_0224FCA0 * param0, int param1, int param2, in } for (v6 = 0; v6 < v5; v6++) { - sub_0200D4C4(v1[v6], v3 + v6 * 16, v4); + SpriteActor_SetSpritePositionXY(v1[v6], v3 + v6 * 16, v4); sub_0200D330(v1[v6]); } } diff --git a/src/overlay017/ov17_02252AB0.c b/src/overlay017/ov17_02252AB0.c index c5b35582fe..857ac7daec 100644 --- a/src/overlay017/ov17_02252AB0.c +++ b/src/overlay017/ov17_02252AB0.c @@ -7,7 +7,7 @@ #include "struct_decls/sys_task.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "unk_0200D9E8.h" @@ -20,13 +20,13 @@ typedef struct UnkStruct_ov17_02252B48_t { } UnkStruct_ov17_02252B48; static void ov17_02252CB8(SysTask * param0, void * param1); -void ov17_02252AB0(CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, u32 param3, u32 param4, u32 param5, u32 param6); -void ov17_02252B20(AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4); -UnkStruct_ov17_02252B48 * ov17_02252B48(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); +void ov17_02252AB0(SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, u32 param3, u32 param4, u32 param5, u32 param6); +void ov17_02252B20(SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4); +UnkStruct_ov17_02252B48 * ov17_02252B48(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); void ov17_02252BCC(UnkStruct_ov17_02252B48 * param0); void ov17_02252C9C(UnkStruct_ov17_02252B48 * param0); -static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254D9C = { +static const SpriteTemplate Unk_ov17_02254D9C = { 0x0, 0x0, 0x0, @@ -39,7 +39,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov17_02254D9C = { 0x0 }; -void ov17_02252AB0 (CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, u32 param3, u32 param4, u32 param5, u32 param6) +void ov17_02252AB0 (SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, u32 param3, u32 param4, u32 param5, u32 param6) { sub_0200CD7C(param2, 3, param0, param1, 27, 80, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, param4); sub_0200CBDC(param0, param1, 27, 250, 1, NNS_G2D_VRAM_TYPE_2DSUB, param3); @@ -47,33 +47,33 @@ void ov17_02252AB0 (CellTransferStateData * param0, AnimationResourceCollection sub_0200CE3C(param0, param1, 27, 252, 1, param6); } -void ov17_02252B20 (AnimationResourceCollection * param0, u32 param1, u32 param2, u32 param3, u32 param4) +void ov17_02252B20 (SpriteGfxHandler * param0, u32 param1, u32 param2, u32 param3, u32 param4) { - sub_0200D070(param0, param1); - sub_0200D080(param0, param2); - sub_0200D090(param0, param3); - sub_0200D0A0(param0, param4); + SpriteGfxHandler_UnloadCharObjById(param0, param1); + SpriteGfxHandler_UnloadPlttObjById(param0, param2); + SpriteGfxHandler_UnloadCellObjById(param0, param3); + SpriteGfxHandler_UnloadAnimObjById(param0, param4); } -UnkStruct_ov17_02252B48 * ov17_02252B48 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) +UnkStruct_ov17_02252B48 * ov17_02252B48 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8) { UnkStruct_ov17_02252B48 * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; v1 = Unk_ov17_02254D9C; - v1.unk_14[0] = param3; - v1.unk_14[1] = param4; - v1.unk_14[2] = param5; - v1.unk_14[3] = param6; - v1.unk_08 = param7; - v1.unk_2C = param8; + v1.resources[0] = param3; + v1.resources[1] = param4; + v1.resources[2] = param5; + v1.resources[3] = param6; + v1.priority = param7; + v1.bgPriority = param8; v0 = Heap_AllocFromHeap(param2, sizeof(UnkStruct_ov17_02252B48)); MI_CpuClear8(v0, sizeof(UnkStruct_ov17_02252B48)); for (v2 = 0; v2 < 5; v2++) { - v0->unk_00[v2] = sub_0200CE6C(param0, param1, &v1); + v0->unk_00[v2] = SpriteActor_LoadResources(param0, param1, &v1); sub_0200D3F4(v0->unk_00[v2], 0); } diff --git a/src/overlay019/ov19_021D8B54.c b/src/overlay019/ov19_021D8B54.c index 807863a238..c9302b02c8 100644 --- a/src/overlay019/ov19_021D8B54.c +++ b/src/overlay019/ov19_021D8B54.c @@ -126,17 +126,17 @@ void ov19_021D8C1C (UnkStruct_ov19_021D8E00 * param0, NARC * param1) param0->unk_10 = ov19_021D785C(param0->unk_00, &v0, v4, 20, 43, NNS_G2D_VRAM_TYPE_2DMAIN); } - sub_02021D6C(param0->unk_08, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_08, 5); sub_02021E80(param0->unk_08, 2); v1 = ov19_021D5E10(param0->unk_790); if (v1 != 2) { - sub_02021D6C(param0->unk_0C, 6); - sub_02021D6C(param0->unk_10, 7); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_10, 7); } else { - sub_02021D6C(param0->unk_0C, 8); - sub_02021D6C(param0->unk_10, 9); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 8); + SpriteActor_SetSpriteAnimActive(param0->unk_10, 9); } if (v1 != 0) { @@ -145,11 +145,11 @@ void ov19_021D8C1C (UnkStruct_ov19_021D8E00 * param0, NARC * param1) if (v2 != 3) { if (ov19_021D5E38(param0->unk_790) == 1) { - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); ov19_021DA3CC(param0->unk_48, param0->unk_4C, (5 * 6)); param0->unk_78C = 0; } else { - sub_02021D6C(param0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 2); ov19_021D8E00(param0); param0->unk_78C = 1; } @@ -157,10 +157,10 @@ void ov19_021D8C1C (UnkStruct_ov19_021D8E00 * param0, NARC * param1) param0->unk_78D = 0; } else { if (ov19_021D5F7C(param0->unk_790) == 0) { - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); param0->unk_78D = 0; } else { - sub_02021D6C(param0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 2); param0->unk_78D = 1; } @@ -370,11 +370,11 @@ static void ov19_021D9088 (SysTask * param0, void * param1) } if (v0->unk_786 != 2) { - sub_02021D6C(v0->unk_0C, 6); - sub_02021D6C(v0->unk_10, 7); + SpriteActor_SetSpriteAnimActive(v0->unk_0C, 6); + SpriteActor_SetSpriteAnimActive(v0->unk_10, 7); } else { - sub_02021D6C(v0->unk_0C, 8); - sub_02021D6C(v0->unk_10, 9); + SpriteActor_SetSpriteAnimActive(v0->unk_0C, 8); + SpriteActor_SetSpriteAnimActive(v0->unk_10, 9); } SysTask_Done(param0); @@ -382,7 +382,7 @@ static void ov19_021D9088 (SysTask * param0, void * param1) void ov19_021D9230 (UnkStruct_ov19_021D8E00 * param0) { - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); param0->unk_780 = (12 << FX32_SHIFT) / 6; param0->unk_770 = (param0->unk_768 + 12); @@ -417,7 +417,7 @@ static void ov19_021D928C (SysTask * param0, void * param1) v1.y = v0->unk_770 << FX32_SHIFT; ov19_021D9E04(v0, &v1); - sub_02021D6C(v0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 2); ov19_021DA038(v0); v0->unk_787 = 6; @@ -479,7 +479,7 @@ static void ov19_021D93D0 (SysTask * param0, void * param1) v1.y = v0->unk_770 << FX32_SHIFT; ov19_021D9E04(v0, &v1); - sub_02021D6C(v0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 1); ov19_021DA1F8(v0); v0->unk_787 = 6; @@ -495,7 +495,7 @@ static void ov19_021D93D0 (SysTask * param0, void * param1) v1.y = v0->unk_768 << FX32_SHIFT; ov19_021D9E04(v0, &v1); - sub_02021D6C(v0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 0); v0->unk_784 = 255; v0->unk_78E = 1; @@ -509,7 +509,7 @@ void ov19_021D94B4 (UnkStruct_ov19_021D8E00 * param0) VecFx32 v0; GraphicElementData * v1; - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); param0->unk_788 = 0; @@ -526,7 +526,7 @@ void ov19_021D94B4 (UnkStruct_ov19_021D8E00 * param0) BOOL ov19_021D9530 (UnkStruct_ov19_021D8E00 * param0) { if (ov19_021D95E0(param0)) { - sub_02021D6C(param0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 2); ov19_021DA110(param0); return 1; } @@ -614,7 +614,7 @@ void ov19_021D9690 (UnkStruct_ov19_021D8E00 * param0) VecFx32 v0; if ((param0->unk_78C == 0) && (param0->unk_78D == 0)) { - sub_02021D6C(param0->unk_04, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 3); } v0 = *sub_02021D28(param0->unk_04); @@ -649,7 +649,7 @@ static void ov19_021D9718 (SysTask * param0, void * param1) v0->unk_787 = 2; if ((v0->unk_78C == 0) && (v0->unk_78D == 0)) { - sub_02021D6C(v0->unk_04, 4); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 4); } v0->unk_784++; @@ -693,7 +693,7 @@ BOOL ov19_021D9858 (UnkStruct_ov19_021D8E00 * param0) if (param0->unk_788 == 0) { if ((param0->unk_78C == 0) && (param0->unk_78D == 0)) { if (sub_02021E24(param0->unk_04) != 0) { - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); } } @@ -730,12 +730,12 @@ void ov19_021D9900 (UnkStruct_ov19_021D8E00 * param0) } ov19_021DA204(param0); - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); } void ov19_021D9938 (UnkStruct_ov19_021D8E00 * param0) { - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); ov19_021DA7B8(param0->unk_48, param0->unk_4C, 1); param0->unk_784 = 0; @@ -754,7 +754,7 @@ BOOL ov19_021D995C (UnkStruct_ov19_021D8E00 * param0) case 1: if (ov19_021D3B18(v0)) { if (ov19_021D3B20(v0)) { - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); ov19_021DA204(param0); return 1; } else { @@ -765,7 +765,7 @@ BOOL ov19_021D995C (UnkStruct_ov19_021D8E00 * param0) break; case 2: if (ov19_021DA7E0(param0->unk_48, param0->unk_4C)) { - sub_02021D6C(param0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 2); return 1; } @@ -838,7 +838,7 @@ void ov19_021D9AEC (UnkStruct_ov19_021D8E00 * param0) void ov19_021D9B10 (UnkStruct_ov19_021D8E00 * param0) { - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); } void ov19_021D9B1C (UnkStruct_ov19_021D8E00 * param0, VecFx32 * param1) @@ -867,13 +867,13 @@ static void ov19_021D9B78 (SysTask * param0, void * param1) switch (v0->unk_784) { case 0: - sub_02021D6C(v0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 1); ov19_021DE954(v0->unk_760); v0->unk_784++; break; case 1: if (ov19_021DE9A8(v0->unk_760)) { - sub_02021D6C(v0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 2); v0->unk_788 = 0; SysTask_Done(param0); } @@ -901,13 +901,13 @@ static void ov19_021D9C18 (SysTask * param0, void * param1) switch (v0->unk_784) { case 0: - sub_02021D6C(v0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 1); ov19_021DEA18(v0->unk_760); v0->unk_784++; break; case 1: if (ov19_021DEA64(v0->unk_760)) { - sub_02021D6C(v0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 0); v0->unk_788 = 0; SysTask_Done(param0); } @@ -934,13 +934,13 @@ static void ov19_021D9CB4 (SysTask * param0, void * param1) switch (v0->unk_784) { case 0: - sub_02021D6C(v0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 1); ov19_021DEA74(v0->unk_760); v0->unk_784++; break; case 1: if (ov19_021DEB08(v0->unk_760)) { - sub_02021D6C(v0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 2); v0->unk_788 = 0; SysTask_Done(param0); } @@ -950,14 +950,14 @@ static void ov19_021D9CB4 (SysTask * param0, void * param1) void ov19_021D9D10 (UnkStruct_ov19_021D8E00 * param0) { if (param0->unk_78D) { - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); } } void ov19_021D9D28 (UnkStruct_ov19_021D8E00 * param0) { if (param0->unk_78D) { - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); param0->unk_78D = 0; } } diff --git a/src/overlay019/ov19_021DA270.c b/src/overlay019/ov19_021DA270.c index b7e73aef68..88d8106763 100644 --- a/src/overlay019/ov19_021DA270.c +++ b/src/overlay019/ov19_021DA270.c @@ -282,7 +282,7 @@ void ov19_021DA7B8 (UnkStruct_ov19_021DA384 * param0, UnkStruct_ov19_021DCD18 * sub_02021CF8(param1->unk_00, 0); } - sub_02021D6C(param1->unk_00, param2); + SpriteActor_SetSpriteAnimActive(param1->unk_00, param2); } BOOL ov19_021DA7E0 (UnkStruct_ov19_021DA384 * param0, UnkStruct_ov19_021DCD18 * param1) diff --git a/src/overlay019/ov19_021DA814.c b/src/overlay019/ov19_021DA814.c index 2f1a276924..b01caf0229 100644 --- a/src/overlay019/ov19_021DA814.c +++ b/src/overlay019/ov19_021DA814.c @@ -61,13 +61,13 @@ void ov19_021DA8FC (UnkStruct_ov19_021DA8D8 * param0, int param1) { switch (param1) { case 0: - sub_02021D6C(param0->unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 0); break; case 1: - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); break; case 2: - sub_02021D6C(param0->unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 2); break; } } diff --git a/src/overlay019/ov19_021DCF88.c b/src/overlay019/ov19_021DCF88.c index 66e19428a8..928154b9e5 100644 --- a/src/overlay019/ov19_021DCF88.c +++ b/src/overlay019/ov19_021DCF88.c @@ -461,7 +461,7 @@ static void ov19_021DD224 (UnkStruct_ov19_021DCF88 * param0, NARC * param1) sub_02021D0C(param0->unk_30, 1); if (ov19_021D5E08(param0->unk_04) == 3) { - sub_02021D6C(param0->unk_30, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_30, 1); } } @@ -552,7 +552,7 @@ void ov19_021DD378 (UnkStruct_ov19_021DCF88 * param0) v2->unk_18 = Unk_ov19_021E0258[v0] >> FX32_SHIFT; if (v2->unk_08 != NULL) { - sub_02021D6C(v2->unk_08, 1); + SpriteActor_SetSpriteAnimActive(v2->unk_08, 1); } ov19_021DD344(param0, v1, v2); @@ -600,7 +600,7 @@ static void ov19_021DD46C (SysTask * param0, void * param1) G2S_ChangeBlendAlpha(v1->unk_D4[v0->unk_0E], v1->unk_E4[v0->unk_0E]); if (++(v0->unk_0E) >= 16) { - sub_02021D6C(v0->unk_08, 0); + SpriteActor_SetSpriteAnimActive(v0->unk_08, 0); ov19_021DD358(v1); } break; @@ -649,7 +649,7 @@ static void ov19_021DD544 (SysTask * param0, void * param1) G2S_ChangeBlendAlpha(v1->unk_D4[v0->unk_0E], v1->unk_E4[v0->unk_0E]); if (++(v0->unk_0E) >= 16) { - sub_02021D6C(v0->unk_08, 0); + SpriteActor_SetSpriteAnimActive(v0->unk_08, 0); ov19_021DD358(v1); } break; @@ -949,7 +949,7 @@ static void ov19_021DD9DC (UnkStruct_ov19_021DCF88 * param0) param0->unk_34[v3] = ov19_021D785C(param0->unk_0C, &v0, 240, 368, 48, NNS_G2D_VRAM_TYPE_2DSUB); GF_ASSERT(param0->unk_34[v3] != NULL); - sub_02021D6C(param0->unk_34[v3], ov19_021DD9B8(v3, v2)); + SpriteActor_SetSpriteAnimActive(param0->unk_34[v3], ov19_021DD9B8(v3, v2)); } param0->unk_80 = ov19_021D5EC0(param0->unk_04); @@ -1486,7 +1486,7 @@ void ov19_021DE2F4 (UnkStruct_ov19_021DCF88 * param0) u32 v1 = ov19_021D5EC8(param0->unk_04); for (v0 = 0; v0 < 8; v0++) { - sub_02021D6C(param0->unk_34[v0], ov19_021DD9B8(v0, v1)); + SpriteActor_SetSpriteAnimActive(param0->unk_34[v0], ov19_021DD9B8(v0, v1)); } } } diff --git a/src/overlay019/ov19_021DE3E8.c b/src/overlay019/ov19_021DE3E8.c index dfdac8885f..e9133e86c6 100644 --- a/src/overlay019/ov19_021DE3E8.c +++ b/src/overlay019/ov19_021DE3E8.c @@ -203,7 +203,7 @@ static void ov19_021DE59C (UnkStruct_ov19_021DE3E8 * param0) int v1 = ov19_021DE538(param0, 1); ov19_021DE718(param0, v1, v0); - sub_02021D6C(param0->unk_1C[v1], 6); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v1], 6); sub_02021CAC(param0->unk_1C[v1], 1); } } @@ -235,7 +235,7 @@ static void ov19_021DE5D4 (UnkStruct_ov19_021DE3E8 * param0) ov19_021D78AC(param0->unk_1C[v3], 2); sub_02021C50(param0->unk_1C[v3], &v1); - sub_02021D6C(param0->unk_1C[v3], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v3], 0); sub_02021CAC(param0->unk_1C[v3], 1); } } @@ -287,7 +287,7 @@ void ov19_021DE7A0 (UnkStruct_ov19_021DE3E8 * param0) if (v0 >= 0) { ov19_021DE57C(param0, v0, 2); - sub_02021D6C(param0->unk_1C[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 2); } v1 = ov19_021D5E74(param0->unk_08); @@ -297,7 +297,7 @@ void ov19_021DE7A0 (UnkStruct_ov19_021DE3E8 * param0) if (v0 >= 0) { ov19_021DE718(param0, v0, v1); - sub_02021D6C(param0->unk_1C[v0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 1); sub_02021CAC(param0->unk_1C[v0], 1); } } @@ -395,7 +395,7 @@ void ov19_021DE954 (UnkStruct_ov19_021DE3E8 * param0) v1.y += (8 << FX32_SHIFT); ov19_021DE57C(param0, v0, 3); - sub_02021D6C(param0->unk_1C[v0], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 3); ov19_021DE858(param0, v0, &v1, 2, 12); } } @@ -413,7 +413,7 @@ void ov19_021DE9B8 (UnkStruct_ov19_021DE3E8 * param0) if (v0 >= 0) { ov19_021DE57C(param0, v0, 2); - sub_02021D6C(param0->unk_1C[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 2); } } } @@ -446,7 +446,7 @@ void ov19_021DEA18 (UnkStruct_ov19_021DE3E8 * param0) ov19_021DE694(param0, &v1, &v2); ov19_021DE57C(param0, v0, 1); - sub_02021D6C(param0->unk_1C[v0], 4); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 4); ov19_021DE858(param0, v0, &v1, 3, 12); } } @@ -469,7 +469,7 @@ void ov19_021DEA74 (UnkStruct_ov19_021DE3E8 * param0) ov19_021DE694(param0, &v2, &v3); ov19_021DE57C(param0, v0, 1); - sub_02021D6C(param0->unk_1C[v0], 4); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 4); ov19_021DE858(param0, v0, &v2, 3, 12); ov19_021D9B1C(param0->unk_18, &v2); @@ -478,7 +478,7 @@ void ov19_021DEA74 (UnkStruct_ov19_021DE3E8 * param0) v2.y += (8 << FX32_SHIFT); ov19_021DE57C(param0, v1, 3); - sub_02021D6C(param0->unk_1C[v1], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v1], 3); ov19_021DE858(param0, v1, &v2, 2, 12); } } @@ -495,7 +495,7 @@ void ov19_021DEB18 (UnkStruct_ov19_021DE3E8 * param0) int v0 = ov19_021DE560(param0, 3); if (v0 >= 0) { - sub_02021D6C(param0->unk_1C[v0], 5); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 5); param0->unk_38 = v0; return; } @@ -503,7 +503,7 @@ void ov19_021DEB18 (UnkStruct_ov19_021DE3E8 * param0) v0 = ov19_021DE560(param0, 1); if (v0 >= 0) { - sub_02021D6C(param0->unk_1C[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v0], 2); param0->unk_38 = v0; return; } diff --git a/src/overlay019/ov19_021DEC04.c b/src/overlay019/ov19_021DEC04.c index 4ddc7e5009..3b7744849c 100644 --- a/src/overlay019/ov19_021DEC04.c +++ b/src/overlay019/ov19_021DEC04.c @@ -161,11 +161,11 @@ void ov19_021DEDDC (UnkStruct_ov19_021DEC04 * param0, BOOL param1) int v0 = ov19_021D5F9C(param0->unk_08); if (param1) { - sub_02021D6C(param0->unk_28[v0 ^ 1], 2); - sub_02021D6C(param0->unk_28[v0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_28[v0 ^ 1], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_28[v0], 0); } else { - sub_02021D6C(param0->unk_28[v0 ^ 1], 1); - sub_02021D6C(param0->unk_28[v0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_28[v0 ^ 1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_28[v0], 0); } ov19_021DEEFC(param0); @@ -607,11 +607,11 @@ static void ov19_021DF5D0 (UnkStruct_ov19_021DEC04 * param0, NARC * param1) param0->unk_28[v4] = ov19_021D785C(param0->unk_10, &v2, v0[v4].unk_00, v0[v4].unk_02, 0, NNS_G2D_VRAM_TYPE_2DSUB); sub_02021E90(param0->unk_28[v4], v4); - sub_02021D6C(param0->unk_28[v4], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_28[v4], 0); for (v5 = 0; v5 < 5; v5++) { param0->unk_34[v4][v5] = ov19_021D785C(param0->unk_10, &v2, 0, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB); - sub_02021D6C(param0->unk_34[v4][v5], 5 + v4); + SpriteActor_SetSpriteAnimActive(param0->unk_34[v4][v5], 5 + v4); sub_02021E90(param0->unk_34[v4][v5], v4); sub_02021CAC(param0->unk_34[v4][v5], 0); } @@ -619,7 +619,7 @@ static void ov19_021DF5D0 (UnkStruct_ov19_021DEC04 * param0, NARC * param1) sub_02021D0C(param0->unk_28[1], 1); param0->unk_30 = ov19_021D785C(param0->unk_10, &v2, 128, 176 + 384, 0, NNS_G2D_VRAM_TYPE_2DSUB); - sub_02021D6C(param0->unk_30, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_30, 3); sub_02021E90(param0->unk_30, 2); param0->unk_380 = SysTask_Start(ov19_021DF930, param0, 1); @@ -721,11 +721,11 @@ static void ov19_021DF930 (SysTask * param0, void * param1) if (sub_02021E24(v0->unk_30) == 3) { if (v1) { - sub_02021D6C(v0->unk_30, 4); + SpriteActor_SetSpriteAnimActive(v0->unk_30, 4); } } else { if (v1 == 0) { - sub_02021D6C(v0->unk_30, 3); + SpriteActor_SetSpriteAnimActive(v0->unk_30, 3); } } } diff --git a/src/overlay020/ov20_021D2EA4.c b/src/overlay020/ov20_021D2EA4.c index a44ffc91d6..bdb450509d 100644 --- a/src/overlay020/ov20_021D2EA4.c +++ b/src/overlay020/ov20_021D2EA4.c @@ -230,10 +230,10 @@ static void ov20_021D3184 (UnkStruct_ov20_021D30F8 * param0) ov20_021D375C(param0, 1); param0->unk_40 = ov20_021D2E50(param0->unk_00, &v0, 6, 24, 1, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_40, 13); + SpriteActor_SetSpriteAnimActive(param0->unk_40, 13); param0->unk_44 = ov20_021D2E50(param0->unk_00, &v0, 250, 24, 1, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_44, 12); + SpriteActor_SetSpriteAnimActive(param0->unk_44, 12); if (ov20_021D1F84(param0->unk_04) != 2) { sub_02021CAC(param0->unk_44, 0); @@ -494,8 +494,8 @@ void ov20_021D36D0 (UnkStruct_ov20_021D30F8 * param0) sub_02021CAC(param0->unk_40, 1); sub_02021CAC(param0->unk_44, 1); - sub_02021D6C(param0->unk_40, 13); - sub_02021D6C(param0->unk_44, 12); + SpriteActor_SetSpriteAnimActive(param0->unk_40, 13); + SpriteActor_SetSpriteAnimActive(param0->unk_44, 12); } } @@ -526,15 +526,15 @@ static void ov20_021D375C (UnkStruct_ov20_021D30F8 * param0, BOOL param1) { if (param0->unk_5C != 0) { if (param1) { - sub_02021D6C(param0->unk_3C, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 0); } else { - sub_02021D6C(param0->unk_3C, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 1); } } else { if (param1) { - sub_02021D6C(param0->unk_3C, 14); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 14); } else { - sub_02021D6C(param0->unk_3C, 15); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 15); } } } diff --git a/src/overlay020/ov20_021D3864.c b/src/overlay020/ov20_021D3864.c index afc1eeecd7..82f287e38a 100644 --- a/src/overlay020/ov20_021D3864.c +++ b/src/overlay020/ov20_021D3864.c @@ -103,18 +103,18 @@ static void ov20_021D3980 (UnkStruct_ov20_021D3980 * param0) ov20_021D2E0C(param0->unk_00, &v0, 0, 3); param0->unk_0C = ov20_021D2E50(param0->unk_00, &v0, 64, 56, 5, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_0C, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 2); sub_02021CAC(param0->unk_0C, 0); } void ov20_021D39BC (UnkStruct_ov20_021D3980 * param0) { - sub_02021D6C(param0->unk_0C, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 3); } void ov20_021D39C8 (UnkStruct_ov20_021D3980 * param0) { - sub_02021D6C(param0->unk_0C, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 2); } void ov20_021D39D4 (UnkStruct_ov20_021D3980 * param0, BOOL param1) @@ -146,7 +146,7 @@ void ov20_021D39EC (UnkStruct_ov20_021D3980 * param0, int param1) } sub_02021C50(param0->unk_0C, &v0); - sub_02021D6C(param0->unk_0C, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 2); } void ov20_021D3A2C (UnkStruct_ov20_021D3980 * param0) diff --git a/src/overlay020/ov20_021D3A54.c b/src/overlay020/ov20_021D3A54.c index 30be2b48c9..27d5d49e4e 100644 --- a/src/overlay020/ov20_021D3A54.c +++ b/src/overlay020/ov20_021D3A54.c @@ -234,7 +234,7 @@ static void ov20_021D3E0C (UnkStruct_ov20_021D3E0C * param0) ov20_021D2E0C(param0->unk_00, &v0, 0, 1); param0->unk_5C = ov20_021D2E50(param0->unk_00, &v0, 48, 54, 2, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_5C, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_5C, 4); sub_02021CAC(param0->unk_5C, 0); } @@ -244,9 +244,9 @@ void ov20_021D3E48 (UnkStruct_ov20_021D3E0C * param0, BOOL param1) if (param1) { if (ov20_021D1F94(param0->unk_04) == 0) { - sub_02021D6C(param0->unk_5C, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_5C, 4); } else { - sub_02021D6C(param0->unk_5C, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_5C, 6); } } } @@ -283,7 +283,7 @@ void ov20_021D3E74 (UnkStruct_ov20_021D3E0C * param0, u32 param1) v0.y *= FX32_ONE; sub_02021C50(param0->unk_5C, &v0); - sub_02021D6C(param0->unk_5C, v2); + SpriteActor_SetSpriteAnimActive(param0->unk_5C, v2); } void ov20_021D3EF8 (UnkStruct_ov20_021D3E0C * param0) diff --git a/src/overlay020/ov20_021D40E8.c b/src/overlay020/ov20_021D40E8.c index 5bebe4ba1c..211a2cf3b4 100644 --- a/src/overlay020/ov20_021D40E8.c +++ b/src/overlay020/ov20_021D40E8.c @@ -120,15 +120,15 @@ static void ov20_021D4210 (UnkStruct_ov20_021D4210 * param0) ov20_021D2E0C(param0->unk_00, &v0, 0, 2); param0->unk_30 = ov20_021D2E50(param0->unk_00, &v0, 72, 56, 3, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_30, 8); + SpriteActor_SetSpriteAnimActive(param0->unk_30, 8); sub_02021CAC(param0->unk_30, 0); param0->unk_34 = ov20_021D2E50(param0->unk_00, &v0, 240, 64, 4, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_34, 11); + SpriteActor_SetSpriteAnimActive(param0->unk_34, 11); sub_02021CAC(param0->unk_34, 0); param0->unk_38 = ov20_021D2E50(param0->unk_00, &v0, 240, 144, 4, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_38, 10); + SpriteActor_SetSpriteAnimActive(param0->unk_38, 10); sub_02021CAC(param0->unk_38, 0); } @@ -240,7 +240,7 @@ void ov20_021D4480 (UnkStruct_ov20_021D4210 * param0, u32 param1) v0.z = 0; sub_02021C50(param0->unk_30, &v0); - sub_02021D6C(param0->unk_30, 8); + SpriteActor_SetSpriteAnimActive(param0->unk_30, 8); } void ov20_021D44BC (UnkStruct_ov20_021D4210 * param0, int param1) diff --git a/src/overlay020/ov20_021D4728.c b/src/overlay020/ov20_021D4728.c index a3e1dfc5da..54e2a9589f 100644 --- a/src/overlay020/ov20_021D4728.c +++ b/src/overlay020/ov20_021D4728.c @@ -312,11 +312,11 @@ static void ov20_021D4A24 (UnkStruct_ov20_021D4AD4 * param0, NARC * param1) ov20_021D4AF8(&(param0->unk_1C), param1, 22, 23); param0->unk_14 = ov20_021D4B40(param0, &v1, &v0, ¶m0->unk_1C, 192, 56, 0, 0); - sub_02021D6C(param0->unk_14, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_14, 0); sub_02021CAC(param0->unk_14, 0); param0->unk_18 = ov20_021D4B40(param0, &v1, &v0, ¶m0->unk_1C, 192, 136, 0, 0); - sub_02021D6C(param0->unk_18, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_18, 2); sub_02021CAC(param0->unk_18, 0); } @@ -475,20 +475,20 @@ void ov20_021D4DF4 (UnkStruct_ov20_021D4AD4 * param0, int param1, int param2) case 0: switch (param2) { case 1: - sub_02021D6C(param0->unk_14, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_14, 1); break; case 0: - sub_02021D6C(param0->unk_14, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_14, 0); break; } break; case 1: switch (param2) { case 1: - sub_02021D6C(param0->unk_18, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_18, 3); break; case 0: - sub_02021D6C(param0->unk_18, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_18, 2); break; } break; diff --git a/src/overlay021/ov21_021D0D80.c b/src/overlay021/ov21_021D0D80.c index 16d2c46973..2e4fcc7e71 100644 --- a/src/overlay021/ov21_021D0D80.c +++ b/src/overlay021/ov21_021D0D80.c @@ -545,13 +545,13 @@ void ov21_021D144C (GraphicElementData * param0, int param1) { switch (param1) { case 0: - sub_02021E50(param0, 1); + SpriteActor_SetAnimFrame(param0, 1); break; case 2: - sub_02021E50(param0, 2); + SpriteActor_SetAnimFrame(param0, 2); break; case 1: - sub_02021E50(param0, 3); + SpriteActor_SetAnimFrame(param0, 3); break; case 3: case (3 + 1): diff --git a/src/overlay021/ov21_021D1FA4.c b/src/overlay021/ov21_021D1FA4.c index 62d6efe7f9..0f6c2b61a0 100644 --- a/src/overlay021/ov21_021D1FA4.c +++ b/src/overlay021/ov21_021D1FA4.c @@ -883,7 +883,7 @@ static void ov21_021D2C8C (UnkStruct_ov21_021D13FC * param0, int param1) param0->unk_1B0.unk_04 = sub_02021B90(&v1); sub_02021CAC(param0->unk_1B0.unk_04, 0); - sub_02021D6C(param0->unk_1B0.unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1B0.unk_04, 1); param0->unk_1B0.unk_08 = NULL; param0->unk_1B0.unk_28 = 0; @@ -930,7 +930,7 @@ void ov21_021D2D88 (UnkStruct_ov21_021D22F8 * param0, GraphicElementManager * pa param0->unk_04 = sub_02021B90(&v1); sub_02021CAC(param0->unk_04, 0); - sub_02021D6C(param0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 1); param0->unk_08 = NULL; param0->unk_28 = 0; @@ -1017,7 +1017,7 @@ static void ov21_021D2F5C (UnkStruct_ov21_021D13FC * param0, int param1) for (v2 = 0; v2 < 4; v2++) { v3->unk_00[v2] = sub_02021B90(&v1); - sub_02021D6C(v3->unk_00[v2], v2); + SpriteActor_SetSpriteAnimActive(v3->unk_00[v2], v2); } ov21_021D2584(v3, 0); diff --git a/src/overlay021/ov21_021D57B4.c b/src/overlay021/ov21_021D57B4.c index 3785d076f1..e39398b968 100644 --- a/src/overlay021/ov21_021D57B4.c +++ b/src/overlay021/ov21_021D57B4.c @@ -143,9 +143,9 @@ void ov21_021D59D8 (GraphicElementData * param0, int param1, int param2, int par sub_02021C50(param0, &v0); if (param5->unk_02) { - sub_02021D6C(param0, param7); + SpriteActor_SetSpriteAnimActive(param0, param7); } else { - sub_02021D6C(param0, param6); + SpriteActor_SetSpriteAnimActive(param0, param6); } } diff --git a/src/overlay021/ov21_021D5AEC.c b/src/overlay021/ov21_021D5AEC.c index 9c40729c4f..ea774653f4 100644 --- a/src/overlay021/ov21_021D5AEC.c +++ b/src/overlay021/ov21_021D5AEC.c @@ -845,20 +845,20 @@ static void ov21_021D6744 (UnkStruct_ov21_021D71A8 * param0, UnkStruct_ov21_021D for (v1 = 0; v1 < 9; v1++) { param0->unk_00[v1] = sub_02021B90(&v0); - sub_02021D6C(param0->unk_00[v1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v1], 0); } v0.unk_14 = 0; for (v1 = 0; v1 < 9; v1++) { param0->unk_50[v1] = sub_02021B90(&v0); - sub_02021D6C(param0->unk_50[v1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_50[v1], 1); } v0.unk_14 = 0; param0->unk_74 = sub_02021B90(&v0); - sub_02021D6C(param0->unk_74, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_74, 2); v0.unk_14 = 0; v0.unk_08.x = 56 << FX32_SHIFT; diff --git a/src/overlay021/ov21_021D76B0.c b/src/overlay021/ov21_021D76B0.c index 09f33a75c3..fd1b2a3bfb 100644 --- a/src/overlay021/ov21_021D76B0.c +++ b/src/overlay021/ov21_021D76B0.c @@ -613,7 +613,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_00[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[0], 2); if (param2->unk_1C->unk_04->unk_1740 == 1) { sub_02021CAC(param0->unk_00[0], 0); @@ -625,7 +625,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_00[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00[1], 0); if ((ov21_021D36A4(param2->unk_1C->unk_04, 1) == 0) || (param2->unk_1C->unk_04->unk_1740 == 1)) { sub_02021CAC(param0->unk_00[1], 0); @@ -637,7 +637,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_00[2] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[2], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00[2], 1); v1.unk_08.x = 124 << FX32_SHIFT; v1.unk_08.y = 64 << FX32_SHIFT; @@ -645,7 +645,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_18 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_18, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_18, 3); v1.unk_08.x = 124 << FX32_SHIFT; v1.unk_08.y = 146 << FX32_SHIFT; @@ -653,7 +653,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_1C = sub_02021B90(&v1); - sub_02021D6C(param0->unk_1C, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_1C, 4); v1.unk_08.x = 124 << FX32_SHIFT; v1.unk_08.y = 8 << FX32_SHIFT; @@ -661,7 +661,7 @@ static void ov21_021D7E80 (UnkStruct_ov21_021D7C64 * param0, UnkStruct_ov21_021D param0->unk_20 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_20, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 5); } static void ov21_021D7FEC (UnkStruct_ov21_021D7C64 * param0) diff --git a/src/overlay021/ov21_021D85B0.c b/src/overlay021/ov21_021D85B0.c index fdaa324706..08950bce3d 100644 --- a/src/overlay021/ov21_021D85B0.c +++ b/src/overlay021/ov21_021D85B0.c @@ -661,14 +661,14 @@ static void ov21_021D8D0C (UnkStruct_ov21_021D9320 * param0, UnkStruct_ov21_021D v1.unk_08.y = 164 << FX32_SHIFT; param0->unk_20 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_20, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 3); v1.unk_08.x = 128 << FX32_SHIFT; v1.unk_08.y = 96 << FX32_SHIFT; param0->unk_58 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_58, 17); + SpriteActor_SetSpriteAnimActive(param0->unk_58, 17); sub_02021CAC(param0->unk_58, 0); sub_02021CF8(param0->unk_58, 1); sub_02021E80(param0->unk_58, 0); @@ -992,46 +992,46 @@ static void ov21_021D924C (UnkStruct_ov21_021D9320 * param0, int param1) switch (param1) { case 1: - sub_02021D6C(param0->unk_20, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 3); break; case 2: - sub_02021D6C(param0->unk_20, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 4); break; case 3: - sub_02021D6C(param0->unk_20, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 5); break; case 4: - sub_02021D6C(param0->unk_20, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 6); break; case 5: - sub_02021D6C(param0->unk_20, 7); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 7); break; case 6: - sub_02021D6C(param0->unk_20, 8); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 8); break; case 7: - sub_02021D6C(param0->unk_20, 9); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 9); break; case 8: - sub_02021D6C(param0->unk_20, 10); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 10); break; case 9: - sub_02021D6C(param0->unk_20, 11); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 11); break; case 10: - sub_02021D6C(param0->unk_20, 12); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 12); break; case 11: - sub_02021D6C(param0->unk_20, 13); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 13); break; case 12: - sub_02021D6C(param0->unk_20, 14); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 14); break; case 13: - sub_02021D6C(param0->unk_20, 15); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 15); break; case 14: - sub_02021D6C(param0->unk_20, 16); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 16); break; default: break; diff --git a/src/overlay021/ov21_021D94BC.c b/src/overlay021/ov21_021D94BC.c index 5b2cd3b27e..48326eedc2 100644 --- a/src/overlay021/ov21_021D94BC.c +++ b/src/overlay021/ov21_021D94BC.c @@ -2451,16 +2451,16 @@ static void ov21_021DB858 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 switch (v0) { case 0: - sub_02021D6C(param0->unk_00[v0], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0], 3); break; case 1: case 2: case 3: case 4: - sub_02021D6C(param0->unk_00[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0], 2); break; case 5: - sub_02021D6C(param0->unk_00[v0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0], 1); break; } } @@ -2499,7 +2499,7 @@ static void ov21_021DB944 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.x = 48 + (v1 * (128 - 48)); param1->unk_08.x <<= FX32_SHIFT; param0->unk_30[(v0 * 2) + v1] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[(v0 * 2) + v1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_30[(v0 * 2) + v1], 0); } } } @@ -2516,7 +2516,7 @@ static void ov21_021DB9B4 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.x = 48 + (v1 * (128 - 48)); param1->unk_08.x <<= FX32_SHIFT; param0->unk_30[(v0 * 2) + v1] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[(v0 * 2) + v1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_30[(v0 * 2) + v1], 0); } } } @@ -2533,7 +2533,7 @@ static void ov21_021DBA24 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.x = 48 + (v1 * (128 - 48)); param1->unk_08.x <<= FX32_SHIFT; param0->unk_30[(v0 * 2) + v1] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[(v0 * 2) + v1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_30[(v0 * 2) + v1], 0); } } @@ -2543,7 +2543,7 @@ static void ov21_021DBA24 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.y = (param1->unk_08.y << FX32_SHIFT) + (192 << FX32_SHIFT); param0->unk_30[10] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[10], 5); + SpriteActor_SetSpriteAnimActive(param0->unk_30[10], 5); } static void ov21_021DBAB8 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223D9A8 * param1) @@ -2558,7 +2558,7 @@ static void ov21_021DBAB8 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.x = 48 + (v1 * (128 - 48)); param1->unk_08.x <<= FX32_SHIFT; param0->unk_30[(v0 * 2) + v1] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[(v0 * 2) + v1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_30[(v0 * 2) + v1], 0); } } @@ -2568,7 +2568,7 @@ static void ov21_021DBAB8 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.y = (param1->unk_08.y << FX32_SHIFT) + (192 << FX32_SHIFT); param0->unk_30[8] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[8], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_30[8], 0); param1->unk_08.y = 176; param1->unk_08.x = (48 - 24); @@ -2576,7 +2576,7 @@ static void ov21_021DBAB8 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.y = (param1->unk_08.y << FX32_SHIFT) + (192 << FX32_SHIFT); param0->unk_30[9] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[9], 4); + SpriteActor_SetSpriteAnimActive(param0->unk_30[9], 4); } static void ov21_021DBB74 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223D9A8 * param1) @@ -2592,7 +2592,7 @@ static void ov21_021DBB74 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov83_0223 param1->unk_08.x <<= FX32_SHIFT; param0->unk_30[(v0 * 3) + v1] = sub_02021B90(param1); - sub_02021D6C(param0->unk_30[(v0 * 3) + v1], 6); + SpriteActor_SetSpriteAnimActive(param0->unk_30[(v0 * 3) + v1], 6); } } } @@ -2623,46 +2623,46 @@ static void ov21_021DBBE4 (UnkStruct_ov21_021DC96C * param0, UnkStruct_ov21_021D switch ((v3 * 3) + v4) { case 0: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 0); break; case 1: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 5); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 5); break; case 2: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 10); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 10); break; case 3: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 1); break; case 4: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 6); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 6); break; case 5: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 11); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 11); break; case 6: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 2); break; case 7: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 9); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 9); break; case 8: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 12); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 12); break; case 9: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 3); break; case 10: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 8); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 8); break; case 11: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 13); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 13); break; case 12: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 4); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 4); break; case 13: - sub_02021D6C(param0->unk_A8[(v3 * 3) + v4], 7); + SpriteActor_SetSpriteAnimActive(param0->unk_A8[(v3 * 3) + v4], 7); break; case 14: sub_02021CAC(param0->unk_A8[(v3 * 3) + v4], 0); diff --git a/src/overlay021/ov21_021DC9BC.c b/src/overlay021/ov21_021DC9BC.c index 59fcf842a4..4cdf9abe89 100644 --- a/src/overlay021/ov21_021DC9BC.c +++ b/src/overlay021/ov21_021DC9BC.c @@ -592,7 +592,7 @@ static void ov21_021DD1A8 (UnkStruct_ov21_021DD420 * param0, UnkStruct_ov21_021D param0->unk_C8 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_C8, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_C8, 2); sub_020093B4(&v0, 108 + 6000, 14 + 6000, 106 + 6000, 107 + 6000, 0xffffffff, 0xffffffff, 0, 0, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.unk_00 = v2->unk_138; diff --git a/src/overlay021/ov21_021DDD2C.c b/src/overlay021/ov21_021DDD2C.c index 33a84e8185..6027913118 100644 --- a/src/overlay021/ov21_021DDD2C.c +++ b/src/overlay021/ov21_021DDD2C.c @@ -450,7 +450,7 @@ static void ov21_021DE258 (UnkStruct_ov21_021DDEC8 * param0, UnkStruct_ov21_021D param0->unk_00 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 0); } static void ov21_021DE2E0 (UnkStruct_ov21_021DDEC8 * param0) @@ -595,7 +595,7 @@ static void ov21_021DE49C (UnkStruct_ov21_021DDEC8 * param0, const UnkStruct_ov2 v0.y += (192 << FX32_SHIFT); sub_02021C50(param0->unk_00, &v0); - sub_02021D6C(param0->unk_00, ov21_021DCA28(param1->unk_00)); + SpriteActor_SetSpriteAnimActive(param0->unk_00, ov21_021DCA28(param1->unk_00)); } static void ov21_021DE4D4 (UnkStruct_ov21_021DDEC8 * param0, UnkStruct_ov21_021DDDF0 * param1, const UnkStruct_ov21_021DDDA4 * param2, int param3) diff --git a/src/overlay021/ov21_021DE668.c b/src/overlay021/ov21_021DE668.c index 41159d2546..c82ef6bb2c 100644 --- a/src/overlay021/ov21_021DE668.c +++ b/src/overlay021/ov21_021DE668.c @@ -658,13 +658,13 @@ static void ov21_021DF098 (UnkStruct_ov21_021DF374 * param0, UnkStruct_ov21_021D param0->unk_00[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[1], 0 + v4); + SpriteActor_SetSpriteAnimActive(param0->unk_00[1], 0 + v4); if (v4 != v5) { v1.unk_08.x = (220 * FX32_ONE); v1.unk_08.y = (72 * FX32_ONE); param0->unk_00[2] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[2], 0 + v5); + SpriteActor_SetSpriteAnimActive(param0->unk_00[2], 0 + v5); } else { param0->unk_00[2] = NULL; } @@ -765,7 +765,7 @@ static void ov21_021DF214 (UnkStruct_ov21_021DF374 * param0, UnkStruct_ov21_021D param0->unk_0C = sub_02021B90(&v1); - sub_02021D6C(param0->unk_0C, 0x11); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, 0x11); if (ov21_021D37CC(param2->unk_04) != 2) { v3 = 0; diff --git a/src/overlay021/ov21_021DF734.c b/src/overlay021/ov21_021DF734.c index c982b7d9d9..22808ae553 100644 --- a/src/overlay021/ov21_021DF734.c +++ b/src/overlay021/ov21_021DF734.c @@ -580,9 +580,9 @@ static void ov21_021DFE0C (UnkStruct_ov21_021DFFF8 * param0, UnkStruct_ov21_021D param0->unk_00[v5] = sub_02021B90(&v1); if ((v5 % 2) == 0) { - sub_02021D6C(param0->unk_00[v5], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v5], 0); } else { - sub_02021D6C(param0->unk_00[v5], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v5], 2); } } @@ -592,7 +592,7 @@ static void ov21_021DFE0C (UnkStruct_ov21_021DFFF8 * param0, UnkStruct_ov21_021D param0->unk_BC = sub_02021B90(&v1); - sub_02021D6C(param0->unk_BC, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_BC, 1); sub_02021CC8(param0->unk_BC, 1); sub_02021E80(param0->unk_BC, 0); diff --git a/src/overlay021/ov21_021E0C68.c b/src/overlay021/ov21_021E0C68.c index 41ade15c8a..32cbe0576c 100644 --- a/src/overlay021/ov21_021E0C68.c +++ b/src/overlay021/ov21_021E0C68.c @@ -543,7 +543,7 @@ static void ov21_021E136C (UnkStruct_ov21_021E14D4 * param0, UnkStruct_ov21_021E param0->unk_00 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00, 0x11); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 0x11); if (ov21_021D37CC(param2->unk_04) != 2) { v3 = 0; diff --git a/src/overlay021/ov21_021E1924.c b/src/overlay021/ov21_021E1924.c index 2c60614c53..f76e048dca 100644 --- a/src/overlay021/ov21_021E1924.c +++ b/src/overlay021/ov21_021E1924.c @@ -724,7 +724,7 @@ static void ov21_021E22C8 (UnkStruct_ov21_021E2588 * param0, UnkStruct_ov21_021E v1.unk_08.y += (192 << FX32_SHIFT); param0->unk_00[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00[0], 0); v1.unk_08.x = 128 << FX32_SHIFT; v1.unk_08.y = 76 << FX32_SHIFT; @@ -732,7 +732,7 @@ static void ov21_021E22C8 (UnkStruct_ov21_021E2588 * param0, UnkStruct_ov21_021E param0->unk_00[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_00[1], 0); sub_020093B4(&v0, 99 + 5000, 11 + 2100, 97 + 5000, 98 + 5000, 0xffffffff, 0xffffffff, 0, 2, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.unk_04 = &v0; @@ -743,7 +743,7 @@ static void ov21_021E22C8 (UnkStruct_ov21_021E2588 * param0, UnkStruct_ov21_021E v1.unk_08.x = Unk_ov21_021E9D80[v3]; param0->unk_00[v3 + 2] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[v3 + 2], Unk_ov21_021E9D98[v3]); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v3 + 2], Unk_ov21_021E9D98[v3]); } v1.unk_14 = 31 - 1; @@ -753,14 +753,14 @@ static void ov21_021E22C8 (UnkStruct_ov21_021E2588 * param0, UnkStruct_ov21_021E v1.unk_08.y += (192 << FX32_SHIFT); param0->unk_50[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_50[0], 13); + SpriteActor_SetSpriteAnimActive(param0->unk_50[0], 13); v1.unk_08.x = (128 + -32) << FX32_SHIFT; v1.unk_08.y = (76 + 2) << FX32_SHIFT; v1.unk_08.y += (192 << FX32_SHIFT); param0->unk_50[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_50[1], 12); + SpriteActor_SetSpriteAnimActive(param0->unk_50[1], 12); for (v3 = 1 + 1; v3 < 8; v3++) { param0->unk_50[v3] = NULL; @@ -1152,8 +1152,8 @@ static void ov21_021E29A4 (GraphicElementData * param0, int param1, int param2) v0 = Unk_ov21_021E9D98[param2 - 2]; if (param1 == 1) { - sub_02021D6C(param0, v0 + 1); + SpriteActor_SetSpriteAnimActive(param0, v0 + 1); } else { - sub_02021D6C(param0, v0); + SpriteActor_SetSpriteAnimActive(param0, v0); } } diff --git a/src/overlay021/ov21_021E29DC.c b/src/overlay021/ov21_021E29DC.c index ae9db7bb21..fea8254959 100644 --- a/src/overlay021/ov21_021E29DC.c +++ b/src/overlay021/ov21_021E29DC.c @@ -1315,7 +1315,7 @@ static void ov21_021E3AF0 (UnkStruct_ov21_021E3900 * param0, UnkStruct_ov21_021E } param0->unk_00[v3] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[v3], v3); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v3], v3); } } diff --git a/src/overlay021/ov21_021E3FFC.c b/src/overlay021/ov21_021E3FFC.c index 5bd122a1ee..1428e9626d 100644 --- a/src/overlay021/ov21_021E3FFC.c +++ b/src/overlay021/ov21_021E3FFC.c @@ -760,7 +760,7 @@ static void ov21_021E4B30 (UnkStruct_ov21_021E4B30 * param0, int param1) v1.y += -8 << FX32_SHIFT; - sub_02021D6C(param0->unk_00[v0].unk_00, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0].unk_00, 1); } v1.y = 96 << FX32_SHIFT; diff --git a/src/overlay021/ov21_021E4CA4.c b/src/overlay021/ov21_021E4CA4.c index 8801217187..aaeaf66b5f 100644 --- a/src/overlay021/ov21_021E4CA4.c +++ b/src/overlay021/ov21_021E4CA4.c @@ -864,10 +864,10 @@ static void ov21_021E5734 (UnkStruct_ov21_021E5004 * param0, UnkStruct_ov21_021E param0->unk_3C = sub_02021B90(&v1); - sub_02021D6C(param0->unk_3C, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 4); sub_02021CC8(param0->unk_3C, 1); sub_02021CE4(param0->unk_3C, (FX32_ONE * 2)); - sub_02021E50(param0->unk_3C, 8); + SpriteActor_SetAnimFrame(param0->unk_3C, 8); v1.unk_08.x = 51 << FX32_SHIFT; v1.unk_08.y = 157 << FX32_SHIFT; @@ -875,7 +875,7 @@ static void ov21_021E5734 (UnkStruct_ov21_021E5004 * param0, UnkStruct_ov21_021E param0->unk_00 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 1); sub_02021CF8(param0->unk_00, 1); v1.unk_08.x = 180 << FX32_SHIFT; @@ -884,10 +884,10 @@ static void ov21_021E5734 (UnkStruct_ov21_021E5004 * param0, UnkStruct_ov21_021E param0->unk_04 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_04, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 3); sub_02021CC8(param0->unk_04, 1); sub_02021CE4(param0->unk_04, (FX32_ONE * 2)); - sub_02021E50(param0->unk_04, 5); + SpriteActor_SetAnimFrame(param0->unk_04, 5); param0->unk_08.unk_00 = 3; param0->unk_08.unk_04 = 2; @@ -901,10 +901,10 @@ static void ov21_021E5734 (UnkStruct_ov21_021E5004 * param0, UnkStruct_ov21_021E param0->unk_20 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_20, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_20, 6); sub_02021CC8(param0->unk_20, 1); sub_02021CE4(param0->unk_20, (FX32_ONE * 2)); - sub_02021E50(param0->unk_20, 5); + SpriteActor_SetAnimFrame(param0->unk_20, 5); param0->unk_24.unk_00 = 6; param0->unk_24.unk_04 = 5; @@ -983,11 +983,11 @@ static void ov21_021E59B4 (UnkStruct_ov21_021E5004 * param0, const UnkStruct_ov2 v0 = sub_02021E74(param0->unk_3C); if (param1->unk_34 == 0) { - sub_02021D6C(param0->unk_3C, 4); - sub_02021E50(param0->unk_3C, 8 - v0); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 4); + SpriteActor_SetAnimFrame(param0->unk_3C, 8 - v0); } else { - sub_02021D6C(param0->unk_3C, 0); - sub_02021E50(param0->unk_3C, 8 - v0); + SpriteActor_SetSpriteAnimActive(param0->unk_3C, 0); + SpriteActor_SetAnimFrame(param0->unk_3C, 8 - v0); } param0->unk_40 = param1->unk_34; @@ -1188,7 +1188,7 @@ static void ov21_021E5C80 (GraphicElementData * param0, UnkStruct_ov21_021E5C80 break; case 2: if (v0 > param1->unk_14) { - sub_02021E50(param0, param1->unk_14); + SpriteActor_SetAnimFrame(param0, param1->unk_14); sub_02021CE4(param0, 0); } break; @@ -1225,10 +1225,10 @@ static void ov21_021E5CF8 (GraphicElementData * param0, UnkStruct_ov21_021E5C80 ov21_021E5D90(param0, param1, 1); } - sub_02021E50(param0, param1->unk_14 - 1); + SpriteActor_SetAnimFrame(param0, param1->unk_14 - 1); break; case 2: - sub_02021E50(param0, param1->unk_14); + SpriteActor_SetAnimFrame(param0, param1->unk_14); sub_02021CE4(param0, 0); break; case 3: @@ -1249,15 +1249,15 @@ static void ov21_021E5D90 (GraphicElementData * param0, UnkStruct_ov21_021E5C80 if (param2 == 1) { if (param1->unk_08 == param1->unk_00) { - sub_02021D6C(param0, param1->unk_04); + SpriteActor_SetSpriteAnimActive(param0, param1->unk_04); param1->unk_08 = param1->unk_04; - sub_02021E50(param0, param1->unk_10 - v0); + SpriteActor_SetAnimFrame(param0, param1->unk_10 - v0); } } else { if (param1->unk_08 == param1->unk_04) { - sub_02021D6C(param0, param1->unk_00); + SpriteActor_SetSpriteAnimActive(param0, param1->unk_00); param1->unk_08 = param1->unk_00; - sub_02021E50(param0, param1->unk_10 - v0); + SpriteActor_SetAnimFrame(param0, param1->unk_10 - v0); } } } diff --git a/src/overlay021/ov21_021E6014.c b/src/overlay021/ov21_021E6014.c index 19515ef9c6..9ccbc0959b 100644 --- a/src/overlay021/ov21_021E6014.c +++ b/src/overlay021/ov21_021E6014.c @@ -433,9 +433,9 @@ static void ov21_021E6518 (UnkStruct_ov21_021E6274 * param0, UnkStruct_ov21_021E param0->unk_10 = sub_02021B90(&v1); if (ov21_021D3920(param2->unk_04) == 0) { - sub_02021D6C(param0->unk_10, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_10, 5); } else { - sub_02021D6C(param0->unk_10, 6); + SpriteActor_SetSpriteAnimActive(param0->unk_10, 6); } ov21_021E6860(param0->unk_10, v4); diff --git a/src/overlay021/ov21_021E68F4.c b/src/overlay021/ov21_021E68F4.c index 35ab79c4ba..e4d8c4c000 100644 --- a/src/overlay021/ov21_021E68F4.c +++ b/src/overlay021/ov21_021E68F4.c @@ -584,7 +584,7 @@ static void ov21_021E700C (UnkStruct_ov21_021E6C60 * param0, UnkStruct_ov21_021E param0->unk_00[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00[0], 1); v1.unk_08.x = 188 << FX32_SHIFT; v1.unk_08.y = 120 << FX32_SHIFT; @@ -592,7 +592,7 @@ static void ov21_021E700C (UnkStruct_ov21_021E6C60 * param0, UnkStruct_ov21_021E param0->unk_00[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_00[1], 1); } static void ov21_021E70BC (UnkStruct_ov21_021E6C60 * param0) diff --git a/src/overlay021/ov21_021E737C.c b/src/overlay021/ov21_021E737C.c index dfc8b7bd5f..190a6e7606 100644 --- a/src/overlay021/ov21_021E737C.c +++ b/src/overlay021/ov21_021E737C.c @@ -650,9 +650,9 @@ static void ov21_021E7B34 (UnkStruct_ov21_021E7714 * param0, UnkStruct_ov21_021E param0->unk_00 = sub_02021B90(&v1); if (ov21_021D3920(param2->unk_00) == 0) { - sub_02021D6C(param0->unk_00, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 3); } else { - sub_02021D6C(param0->unk_00, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 4); } v1.unk_08.x = 128 << FX32_SHIFT; @@ -660,21 +660,21 @@ static void ov21_021E7B34 (UnkStruct_ov21_021E7714 * param0, UnkStruct_ov21_021E param0->unk_08 = sub_02021B90(&v1); - sub_02021D6C(param0->unk_08, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_08, 1); sub_02021E80(param0->unk_08, 1); v1.unk_08.x = 184 << FX32_SHIFT; v1.unk_08.y = (64 + 24) << FX32_SHIFT; param0->unk_0C[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_0C[0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_0C[0], 0); v1.unk_08.x = 72 << FX32_SHIFT; v1.unk_08.y = (64 + 24) << FX32_SHIFT; param0->unk_0C[1] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_0C[1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_0C[1], 0); sub_020093B4(&v0, sub_02009E08(param0->unk_14[0]), sub_02009E08(param0->unk_14[1]), sub_02009E08(param0->unk_14[2]), sub_02009E08(param0->unk_14[3]), 0xffffffff, 0xffffffff, 0, 3, v2->unk_13C[0], v2->unk_13C[1], v2->unk_13C[2], v2->unk_13C[3], NULL, NULL); v1.unk_00 = v2->unk_138; diff --git a/src/overlay021/ov21_021E8484.c b/src/overlay021/ov21_021E8484.c index f503ce2a78..6af764963f 100644 --- a/src/overlay021/ov21_021E8484.c +++ b/src/overlay021/ov21_021E8484.c @@ -556,7 +556,7 @@ static void ov21_021E8AA8 (UnkStruct_ov21_021E8794 * param0, UnkStruct_ov21_021E param0->unk_00[0] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_00[0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[0], 2); } static void ov21_021E8B34 (UnkStruct_ov21_021E8794 * param0) diff --git a/src/overlay021/ov21_021E8D48.c b/src/overlay021/ov21_021E8D48.c index 6ab690b8ed..8eda4cfdf2 100644 --- a/src/overlay021/ov21_021E8D48.c +++ b/src/overlay021/ov21_021E8D48.c @@ -82,7 +82,7 @@ typedef struct { typedef struct UnkStruct_ov21_021E8D48_t { BGL * unk_00; Window * unk_04; - PaletteSys * unk_08; + PaletteData * unk_08; Sprite * unk_0C; UnkStruct_0200C738 unk_10; GraphicElementManager * unk_19C; @@ -101,9 +101,9 @@ typedef struct UnkStruct_ov21_021E8D48_t { } UnkStruct_ov21_021E8D48; static void ov21_021E9828(SysTask * param0, void * param1); -static void ov21_021E98D8(PaletteSys * param0, Sprite * param1); -static void ov21_021E98F8(PaletteSys * param0, Sprite * param1, int param2, int param3, int param4, int param5, int param6); -static BOOL ov21_021E9948(PaletteSys * param0, Sprite * param1); +static void ov21_021E98D8(PaletteData * param0, Sprite * param1); +static void ov21_021E98F8(PaletteData * param0, Sprite * param1, int param2, int param3, int param4, int param5, int param6); +static BOOL ov21_021E9948(PaletteData * param0, Sprite * param1); static void ov21_021E8E0C(UnkStruct_ov21_021E8D48 * param0, const UnkStruct_ov21_021E8E0C * param1); static void ov21_021E900C(UnkStruct_ov21_021E8D48 * param0); static void ov21_021E90B0(BGL * param0, int param1); @@ -551,7 +551,7 @@ static void ov21_021E9504 (UnkStruct_ov21_021E95B0 * param0, GraphicElementManag param0->unk_00 = sub_02021B90(&v0); GF_ASSERT(param0->unk_00); - sub_02021D6C(param0->unk_00, 0x11); + SpriteActor_SetSpriteAnimActive(param0->unk_00, 0x11); } static void ov21_021E9554 (UnkStruct_ov21_021E95B0 * param0) @@ -620,13 +620,13 @@ static void ov21_021E95F8 (UnkStruct_ov21_021E968C * param0, GraphicElementManag param0->unk_00[0] = sub_02021B90(&v0); - sub_02021D6C(param0->unk_00[0], 0 + v2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[0], 0 + v2); if (v2 != v3) { v0.unk_08.x = (220 * FX32_ONE); v0.unk_08.y = (72 * FX32_ONE); param0->unk_00[1] = sub_02021B90(&v0); - sub_02021D6C(param0->unk_00[1], 0 + v3); + SpriteActor_SetSpriteAnimActive(param0->unk_00[1], 0 + v3); } else { param0->unk_00[1] = NULL; } @@ -725,20 +725,20 @@ static void ov21_021E9828 (SysTask * param0, void * param1) sub_020219F8(v0->unk_19C); } -static void ov21_021E98D8 (PaletteSys * param0, Sprite * param1) +static void ov21_021E98D8 (PaletteData * param0, Sprite * param1) { sub_02003070(param0, 0, 0, 32 * 0x10); sub_02003070(param0, 2, 0, (((16 - 2) * 16) * sizeof(u16))); } -static void ov21_021E98F8 (PaletteSys * param0, Sprite * param1, int param2, int param3, int param4, int param5, int param6) +static void ov21_021E98F8 (PaletteData * param0, Sprite * param1, int param2, int param3, int param4, int param5, int param6) { sub_020086FC(param1, param2, param4, param5, param6); sub_02003178(param0, 0x1 | 0x4, 0xffff, param5, param3, param4, param6); sub_02003858(param0, 0); } -static BOOL ov21_021E9948 (PaletteSys * param0, Sprite * param1) +static BOOL ov21_021E9948 (PaletteData * param0, Sprite * param1) { BOOL v0[2]; diff --git a/src/overlay022/ov22_02259C58.c b/src/overlay022/ov22_02259C58.c index b710098843..37e5db0627 100644 --- a/src/overlay022/ov22_02259C58.c +++ b/src/overlay022/ov22_02259C58.c @@ -153,17 +153,17 @@ static void ov22_02259D94 (UnkStruct_ov22_02259C58 * param0, void * param1) void ov22_02259D98 (UnkStruct_ov22_02259C58 * param0) { - sub_02021E50(param0->unk_00, 2); + SpriteActor_SetAnimFrame(param0->unk_00, 2); } void ov22_02259DA4 (UnkStruct_ov22_02259C58 * param0) { - sub_02021E50(param0->unk_00, 0); + SpriteActor_SetAnimFrame(param0->unk_00, 0); } void ov22_02259DB0 (UnkStruct_ov22_02259C58 * param0) { - sub_02021E50(param0->unk_00, 1); + SpriteActor_SetAnimFrame(param0->unk_00, 1); } void ov22_02259DBC (UnkStruct_ov22_02259D2C * param0, UnkStruct_ov22_0225A0E4 * param1) diff --git a/src/overlay022/ov22_0225A428.c b/src/overlay022/ov22_0225A428.c index 74b8e6d737..08b0aa9aa3 100644 --- a/src/overlay022/ov22_0225A428.c +++ b/src/overlay022/ov22_0225A428.c @@ -317,7 +317,7 @@ static void ov22_0225A914 (UnkStruct_ov22_0225A914 * param0, GraphicElementManag v1.unk_08.x *= FX32_ONE; param0->unk_10[(v2 * 10) + v3] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_10[(v2 * 10) + v3], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_10[(v2 * 10) + v3], 1); if (((v2 * 10) + v3) >= param3) { sub_02021CAC(param0->unk_10[(v2 * 10) + v3], 0); @@ -332,11 +332,11 @@ static void ov22_0225A9C8 (UnkStruct_ov22_0225A914 * param0, int param1) if (param0->unk_60 < param1) { for (v0 = param0->unk_60; v0 < param1; v0++) { - sub_02021D6C(param0->unk_10[v0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_10[v0], 0); } } else if (param0->unk_60 > param1) { for (v0 = param0->unk_60 - 1; v0 >= param1; v0--) { - sub_02021D6C(param0->unk_10[v0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_10[v0], 1); } } @@ -484,7 +484,7 @@ static void ov22_0225ACE4 (UnkStruct_ov22_0225AB54 * param0) v1 = v2 / v3; GF_ASSERT(v1 <= 10); - sub_02021D6C(param0->unk_10[v0], 0 + v1); + SpriteActor_SetSpriteAnimActive(param0->unk_10[v0], 0 + v1); v2 -= v1 * v3; v3 /= 10; diff --git a/src/overlay022/ov22_0225B660.c b/src/overlay022/ov22_0225B660.c index 0d98837762..90df4875ac 100644 --- a/src/overlay022/ov22_0225B660.c +++ b/src/overlay022/ov22_0225B660.c @@ -289,7 +289,7 @@ static void ov22_0225BB00 (UnkStruct_ov22_0225B85C * param0) GF_ASSERT(v8); v5 = sub_0200B358(13); - sub_02021D6C(param0->unk_1FC, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_1FC, 5); v0.x = 48 << FX32_SHIFT; v0.y = 144 << FX32_SHIFT; v0.z = 0; @@ -336,7 +336,7 @@ static void ov22_0225BC18 (UnkStruct_ov22_0225B85C * param0) int v8, v9; int v10; - sub_02021D6C(param0->unk_1FC, param0->unk_08); + SpriteActor_SetSpriteAnimActive(param0->unk_1FC, param0->unk_08); v0 = sub_0202A5D0(param0->unk_04); v1 = sub_0200B358(13); diff --git a/src/overlay023/ov23_0223E140.c b/src/overlay023/ov23_0223E140.c index a4b735aefe..99c2d2a03d 100644 --- a/src/overlay023/ov23_0223E140.c +++ b/src/overlay023/ov23_0223E140.c @@ -1268,19 +1268,19 @@ static void ov23_0223ED68 (int param0, int param1, BOOL param2, BOOL param3, BOO VecFx32 v3; if (param2) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[0], 0); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[0], 0); } else { - sub_02021D6C(Unk_ov23_02257740->unk_24C[0], 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[0], 1); } if (param3) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[3], 2); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[3], 2); Sound_PlayEffect(1700); } else if (param2) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[3], 3); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[3], 3); Sound_PlayEffect(1698); } else { - sub_02021D6C(Unk_ov23_02257740->unk_24C[3], 4); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[3], 4); Sound_PlayEffect(1699); } @@ -1294,7 +1294,7 @@ static void ov23_0223ED68 (int param0, int param1, BOOL param2, BOOL param3, BOO sub_02021C50(Unk_ov23_02257740->unk_24C[3], &v3); if (param4) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[4], 5); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[4], 5); sub_02021CC8(Unk_ov23_02257740->unk_24C[4], 1); sub_02021C50(Unk_ov23_02257740->unk_24C[4], &v3); } @@ -2013,7 +2013,7 @@ static void ov23_0223FDE0 (UnkStruct_ov23_0223EE80 * param0) v4.x = FX32_ONE * v1; v4.y = FX32_ONE * v2; - sub_02021D6C(Unk_ov23_02257740->unk_24C[5 + v3], 8 + v3); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[5 + v3], 8 + v3); sub_02021C50(Unk_ov23_02257740->unk_24C[5 + v3], &v4); } } @@ -2379,7 +2379,7 @@ static void ov23_022404F8 (BGL * param0, int param1, int param2, int param3) } if (2 == param3) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[2], 6); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[2], 6); sub_02021CC8(Unk_ov23_02257740->unk_24C[2], 1); v0.x = FX32_ONE * 232; @@ -2398,7 +2398,7 @@ static void ov23_022404F8 (BGL * param0, int param1, int param2, int param3) } if (2 == param3) { - sub_02021D6C(Unk_ov23_02257740->unk_24C[2], 7); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[2], 7); sub_02021CC8(Unk_ov23_02257740->unk_24C[2], 1); v0.x = FX32_ONE * 232; @@ -2435,7 +2435,7 @@ static void ov23_02240688 (BGL * param0) v4 = 6 - (v1 % 24) / 4; ov23_02240660(&v0); - sub_02021D6C(Unk_ov23_02257740->unk_24C[1], v4); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257740->unk_24C[1], v4); v1 = v1 + 8; v2 = ((26 * 8) - v1) / 8; diff --git a/src/overlay023/ov23_0224340C.c b/src/overlay023/ov23_0224340C.c index 34d1cfced1..ba41d02458 100644 --- a/src/overlay023/ov23_0224340C.c +++ b/src/overlay023/ov23_0224340C.c @@ -3336,9 +3336,9 @@ static void ov23_0224644C (int param0) Unk_ov23_02257764->unk_25C[v1] = sub_02021AA0(&v0); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 0); sub_02021CC8(Unk_ov23_02257764->unk_25C[v1], 0); - sub_02021E50(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetAnimFrame(Unk_ov23_02257764->unk_25C[v1], 0); sub_02021E80(Unk_ov23_02257764->unk_25C[v1], 1); } } @@ -3687,9 +3687,9 @@ static void ov23_02246D44 (UnkStruct_ov23_022468DC * param0) Unk_ov23_02257764->unk_25C[v1] = sub_02021AA0(&v0); sub_02021CF8(Unk_ov23_02257764->unk_25C[v1], 1); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], (param0->unk_08[v1] * 2)); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], (param0->unk_08[v1] * 2)); sub_02021CC8(Unk_ov23_02257764->unk_25C[v1], 1); - sub_02021E50(Unk_ov23_02257764->unk_25C[v1], v1 * 4); + SpriteActor_SetAnimFrame(Unk_ov23_02257764->unk_25C[v1], v1 * 4); sub_02021FE0(Unk_ov23_02257764->unk_25C[v1], GX_OAM_MODE_XLU); sub_02021E80(Unk_ov23_02257764->unk_25C[v1], 1); } @@ -3758,7 +3758,7 @@ static BOOL ov23_02246F20 (BGL * param0, UnkStruct_ov23_022468DC * param1) if ((Unk_ov23_022563E8[param1->unk_08[v0]] * FX32_ONE) > v11) { Sound_PlayEffect(1574); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v0], param1->unk_08[v0] * 2 + 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v0], param1->unk_08[v0] * 2 + 1); param1->unk_E4[v0] = 1; break; } @@ -3864,10 +3864,10 @@ static void ov23_022471D8 (UnkStruct_ov23_022471D8 * param0) Unk_ov23_02257764->unk_25C[v1] = sub_02021AA0(&v0); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 2); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 2); sub_02021CC8(Unk_ov23_02257764->unk_25C[v1], 1); sub_02021CAC(Unk_ov23_02257764->unk_25C[v1], 0); - sub_02021E50(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetAnimFrame(Unk_ov23_02257764->unk_25C[v1], 0); sub_02021F58(Unk_ov23_02257764->unk_25C[v1], 15 - v1); sub_02021E80(Unk_ov23_02257764->unk_25C[v1], 1); } @@ -3960,7 +3960,7 @@ static BOOL ov23_02247568 (BGL * param0, UnkStruct_ov23_022471D8 * param1) param1->unk_125 = 2; param1->unk_120 = 0; param1->unk_11C = 5; - sub_02021D6C(Unk_ov23_02257764->unk_25C[0], 0); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[0], 0); } break; case 2: @@ -4060,7 +4060,7 @@ static BOOL ov23_02247568 (BGL * param0, UnkStruct_ov23_022471D8 * param1) sub_0200A490(param1->unk_F8[0], param1->unk_F8[6]); for (v0 = 1; v0 < 9; v0++) { - sub_02021D6C(Unk_ov23_02257764->unk_25C[v0], 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v0], 1); v11.x = (70 + 12 * v0) * FX32_ONE; v11.y = (param1->unk_120 + 39 + v0 % 2) * FX32_ONE; @@ -4069,14 +4069,14 @@ static BOOL ov23_02247568 (BGL * param0, UnkStruct_ov23_022471D8 * param1) sub_02021CAC(Unk_ov23_02257764->unk_25C[v0], 1); } - sub_02021D6C(Unk_ov23_02257764->unk_25C[10], 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[10], 1); v11.x = 100 * FX32_ONE; v11.y = (param1->unk_120 + 21) * FX32_ONE; sub_02021C50(Unk_ov23_02257764->unk_25C[10], &v11); sub_02021CAC(Unk_ov23_02257764->unk_25C[10], 1); - sub_02021D6C(Unk_ov23_02257764->unk_25C[11], 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[11], 1); v11.x = 122 * FX32_ONE; v11.y = param1->unk_120 * FX32_ONE; @@ -4094,7 +4094,7 @@ static BOOL ov23_02247568 (BGL * param0, UnkStruct_ov23_022471D8 * param1) param1->unk_120 += 1; if (param1->unk_124 % 8) { - sub_02021D6C(Unk_ov23_02257764->unk_25C[0], 3 + param1->unk_124 / 8); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[0], 3 + param1->unk_124 / 8); } if (param1->unk_124 == 75) { @@ -4334,9 +4334,9 @@ static void ov23_02247E38 (UnkStruct_ov23_02247E38 * param0) Unk_ov23_02257764->unk_25C[v1] = sub_02021AA0(&v0); sub_02021CF8(Unk_ov23_02257764->unk_25C[v1], 2); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 0); sub_02021CC8(Unk_ov23_02257764->unk_25C[v1], 1); - sub_02021E50(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetAnimFrame(Unk_ov23_02257764->unk_25C[v1], 0); sub_02021E80(Unk_ov23_02257764->unk_25C[v1], 1); } } @@ -4795,15 +4795,15 @@ static void ov23_02248748 (UnkStruct_ov23_02248748 * param0) if (v1 == 0) { sub_02021CF8(Unk_ov23_02257764->unk_25C[v1], 2); - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 0); } else if (v1 < 9) { - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 1); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 1); } else { - sub_02021D6C(Unk_ov23_02257764->unk_25C[v1], 2); + SpriteActor_SetSpriteAnimActive(Unk_ov23_02257764->unk_25C[v1], 2); } sub_02021CC8(Unk_ov23_02257764->unk_25C[v1], 1); - sub_02021E50(Unk_ov23_02257764->unk_25C[v1], 0); + SpriteActor_SetAnimFrame(Unk_ov23_02257764->unk_25C[v1], 0); } } diff --git a/src/overlay023/ov23_02248F1C.c b/src/overlay023/ov23_02248F1C.c index 3ec0255cdb..adfdab4452 100644 --- a/src/overlay023/ov23_02248F1C.c +++ b/src/overlay023/ov23_02248F1C.c @@ -132,7 +132,7 @@ static void ov23_02248F1C (SysTask * param0, void * param1) sub_02021CAC(v0->unk_390[v2], 0); if (v2 == 0) { - sub_02021D6C(v0->unk_390[v2], 1); + SpriteActor_SetSpriteAnimActive(v0->unk_390[v2], 1); } } @@ -140,7 +140,7 @@ static void ov23_02248F1C (SysTask * param0, void * param1) v0->unk_3B0[v2] = sub_02021AA0(&v3); sub_02021CC8(v0->unk_3B0[v2], 1); sub_02021CAC(v0->unk_3B0[v2], 0); - sub_02021D6C(v0->unk_3B0[v2], 2); + SpriteActor_SetSpriteAnimActive(v0->unk_3B0[v2], 2); } } @@ -311,7 +311,7 @@ static void ov23_0224937C (int param0[][4], GraphicElementData * param1[]) if (param0[v0][2] != param0[v0][3]) { if (param0[v0][2] != 0) { - sub_02021D6C(param1[v0], param0[v0][2]); + SpriteActor_SetSpriteAnimActive(param1[v0], param0[v0][2]); sub_02021CAC(param1[v0], 1); } else { sub_02021CAC(param1[v0], 0); diff --git a/src/overlay023/ov23_0224F294.c b/src/overlay023/ov23_0224F294.c index 23aa4a07bd..101df9f6a2 100644 --- a/src/overlay023/ov23_0224F294.c +++ b/src/overlay023/ov23_0224F294.c @@ -24,7 +24,7 @@ #include "overlay023/struct_ov23_02250CD4.h" #include "overlay061/struct_ov61_0222C884.h" #include "overlay084/struct_ov84_02240FA8.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "unk_0200112C.h" @@ -157,7 +157,7 @@ static const UnkStruct_ov84_02240FA8 Unk_ov23_02256904 = { NULL }; -static const UnkStruct_ov104_0223F9E0 Unk_ov23_0225695C[] = { +static const SpriteTemplate Unk_ov23_0225695C[] = { { 0xCC, 0x14, @@ -211,11 +211,11 @@ static void ov23_0224F294 (UnkStruct_ov23_02250CD4 * param0, u8 * param1, u32 pa NARC_dtor(v2); for (v1 = 0; v1 < param2; v1++) { - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; v3 = Unk_ov23_0225695C[1]; - v3.unk_02 += 24 * v1; - v3.unk_06 = param1[v1] * 3; + v3.y += 24 * v1; + v3.animIdx = param1[v1] * 3; param0->unk_23C[1 + v1] = ov5_021D3584(¶m0->unk_74, &v3); @@ -264,7 +264,7 @@ static void ov23_0224F500 (GraphicElementData * param0, u16 param1, u16 param2) { u32 v0 = sub_02021E24(param0); - sub_02021D6C(param0, (v0 / 3) * 3 + param1); + SpriteActor_SetSpriteAnimActive(param0, (v0 / 3) * 3 + param1); sub_02021EC4(param0, param2); } diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index 9c2700a5ff..dcdd818151 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -441,7 +441,7 @@ static void ov56_02256704 (UnkStruct_ov56_02256468 * param0) param0->unk_1FC[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_1FC[v0], 1); - sub_02021D6C(param0->unk_1FC[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_1FC[v0], v0); } } } @@ -975,7 +975,7 @@ static void ov56_0225718C (UnkStruct_ov56_02256468 * param0, int param1) v1 = sub_02021E24(param0->unk_1FC[param1]); if ((v0 > 1) || (v1 != param1 + 4)) { - sub_02021D6C(param0->unk_1FC[param1], param1 + 4); + SpriteActor_SetSpriteAnimActive(param0->unk_1FC[param1], param1 + 4); } param0->unk_2F4[param1] = 1; @@ -998,7 +998,7 @@ static void ov56_022571D0 (UnkStruct_ov56_02256468 * param0) } else { if (sub_02021D3C(param0->unk_1FC[v0]) == 0) { sub_02021CC8(param0->unk_1FC[v0], 1); - sub_02021E50(param0->unk_1FC[v0], 1 + 1); + SpriteActor_SetAnimFrame(param0->unk_1FC[v0], 1 + 1); } } } diff --git a/src/overlay058/ov58_021D0D80.c b/src/overlay058/ov58_021D0D80.c index 7477c851e7..4eea375120 100644 --- a/src/overlay058/ov58_021D0D80.c +++ b/src/overlay058/ov58_021D0D80.c @@ -699,7 +699,7 @@ static void ov58_021D16D8 (UnkStruct_02095EAC * param0) param0->unk_23C[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_23C[v0], 1); - sub_02021D6C(param0->unk_23C[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_23C[v0], v0); sub_02021CAC(param0->unk_23C[v0], 0); } @@ -711,14 +711,14 @@ static void ov58_021D16D8 (UnkStruct_02095EAC * param0) param0->unk_2AC[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_2AC[v0], 1); - sub_02021D6C(param0->unk_2AC[v0], Unk_ov58_021D2EEC[v0][2]); + SpriteActor_SetSpriteAnimActive(param0->unk_2AC[v0], Unk_ov58_021D2EEC[v0][2]); if (v0 >= 8) { sub_02021E80(param0->unk_2AC[v0], 2); } } - sub_02021D6C(param0->unk_2AC[0], 6); + SpriteActor_SetSpriteAnimActive(param0->unk_2AC[0], 6); for (v0 = 0; v0 < 5; v0++) { v1.unk_08.x = FX32_ONE * 24; @@ -727,7 +727,7 @@ static void ov58_021D16D8 (UnkStruct_02095EAC * param0) param0->unk_274[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_274[v0], 1); - sub_02021D6C(param0->unk_274[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_274[v0], v0); sub_02021F58(param0->unk_274[v0], 1); sub_02021CAC(param0->unk_274[v0], 0); } @@ -871,9 +871,9 @@ static void ov58_021D1A80 (UnkStruct_02095EAC * param0) for (v3 = 0; v3 < 3; v3++) { if ((v0 - 9) == v3) { - sub_02021D6C(param0->unk_2AC[9 + v3], 29 + 2 * v3 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_2AC[9 + v3], 29 + 2 * v3 + 1); } else { - sub_02021D6C(param0->unk_2AC[9 + v3], 29 + 2 * v3); + SpriteActor_SetSpriteAnimActive(param0->unk_2AC[9 + v3], 29 + 2 * v3); } } @@ -914,9 +914,9 @@ static void ov58_021D1CAC (GraphicElementData ** param0, int param1) for (v0 = 0; v0 < 8; v0++) { if (v0 == param1) { - sub_02021D6C(param0[v0], Unk_ov58_021D2EEC[v0][2] + 1); + SpriteActor_SetSpriteAnimActive(param0[v0], Unk_ov58_021D2EEC[v0][2] + 1); } else { - sub_02021D6C(param0[v0], Unk_ov58_021D2EEC[v0][2]); + SpriteActor_SetSpriteAnimActive(param0[v0], Unk_ov58_021D2EEC[v0][2]); } } } @@ -924,9 +924,9 @@ static void ov58_021D1CAC (GraphicElementData ** param0, int param1) static void ov58_021D1CDC (GraphicElementData ** param0, BOOL param1) { if (param1 == 1) { - sub_02021D6C(param0[8], Unk_ov58_021D2EEC[8][2] + 1); + SpriteActor_SetSpriteAnimActive(param0[8], Unk_ov58_021D2EEC[8][2] + 1); } else { - sub_02021D6C(param0[8], Unk_ov58_021D2EEC[8][2]); + SpriteActor_SetSpriteAnimActive(param0[8], Unk_ov58_021D2EEC[8][2]); } } @@ -1784,7 +1784,7 @@ static int ov58_021D2B5C (UnkStruct_02095EAC * param0) if (param0->unk_945C) { ov58_021D2D10(param0); - sub_02021D6C(param0->unk_2AC[8], Unk_ov58_021D2EEC[8][2]); + SpriteActor_SetSpriteAnimActive(param0->unk_2AC[8], Unk_ov58_021D2EEC[8][2]); } return 2; diff --git a/src/overlay059/ov59_021D0D80.c b/src/overlay059/ov59_021D0D80.c index ae44f92506..859b1b4c27 100644 --- a/src/overlay059/ov59_021D0D80.c +++ b/src/overlay059/ov59_021D0D80.c @@ -672,7 +672,7 @@ static void ov59_021D1598 (UnkStruct_020961E8 * param0) param0->unk_28C[v0 + 1] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_28C[v0 + 1], 1); - sub_02021D6C(param0->unk_28C[v0 + 1], 27 + (v0 - 1) * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[v0 + 1], 27 + (v0 - 1) * 2); sub_02021CAC(param0->unk_28C[v0 + 1], 0); } @@ -1051,7 +1051,7 @@ void ov59_021D1D40 (UnkStruct_020961E8 * param0) { MessageLoader_GetStrbuf(param0->unk_28, 18, param0->unk_48); ov59_021D1784(¶m0->unk_36C, param0->unk_48, 0); - sub_02021D6C(param0->unk_28C[0], 37); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[0], 37); param0->unk_0C.unk_00 = 1; } @@ -1111,7 +1111,7 @@ static int ov59_021D1E0C (UnkStruct_020961E8 * param0, int param1) sub_020057A4(1624, 8); ov59_021D2628(param0, 13, 0); ov59_021D19B0(param0, 29); - sub_02021D6C(param0->unk_28C[0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[0], 0); param0->unk_0C.unk_00 = 0; param0->unk_3B4 = 0; @@ -1626,10 +1626,10 @@ static void ov59_021D26E8 (UnkStruct_020961E8 * param0) v2 = TrainerInfo_Appearance(param0->unk_3C8[v0][0]); if (sub_0203608C() == v0) { - sub_02021D6C(param0->unk_28C[v0 + 1], 38 + v3 * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[v0 + 1], 38 + v3 * 2); } else { ov59_021D2860(param0->unk_390, param0->unk_3A0, v0, v2, v3); - sub_02021D6C(param0->unk_28C[v0 + 1], 27 + v0 * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[v0 + 1], 27 + v0 * 2); } } sub_02021CAC(param0->unk_28C[v0 + 1], 1); @@ -1641,9 +1641,9 @@ static void ov59_021D26E8 (UnkStruct_020961E8 * param0) case 3: if (sub_0203608C() == v0) { int v4 = TrainerInfo_Gender(param0->unk_3C8[v0][0]); - sub_02021D6C(param0->unk_28C[v0 + 1], 38 + v4 * 2 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[v0 + 1], 38 + v4 * 2 + 1); } else { - sub_02021D6C(param0->unk_28C[v0 + 1], 27 + v0 * 2 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_28C[v0 + 1], 27 + v0 * 2 + 1); } param0->unk_3F0[v0] = 0; diff --git a/src/overlay062/ov62_0222F2C0.c b/src/overlay062/ov62_0222F2C0.c index 5f31385e3d..d10584cc1c 100644 --- a/src/overlay062/ov62_0222F2C0.c +++ b/src/overlay062/ov62_0222F2C0.c @@ -704,7 +704,7 @@ void ov62_0222FF7C (UnkStruct_0208C06C * param0) continue; } - sub_0200D550(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); param0->unk_534.unk_C8[v0].unk_10->val1.unk_00 = v2 - 16; param0->unk_534.unk_C8[v0].unk_10->val1.unk_01 = v2 + 16; @@ -719,7 +719,7 @@ void ov62_02230014 (UnkStruct_0208C06C * param0) s16 v1, v2; for (v0 = 0; v0 < 5; v0++) { - sub_0200D550(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_534.unk_C8[v0].unk_00, &v1, &v2); param0->unk_534.unk_C8[v0].unk_10->val1.unk_00 = 0; param0->unk_534.unk_C8[v0].unk_10->val1.unk_01 = 0; param0->unk_534.unk_C8[v0].unk_10->val1.unk_02 = 0; diff --git a/src/overlay062/ov62_022300D8.c b/src/overlay062/ov62_022300D8.c index 7a12cf4757..4200acb1e8 100644 --- a/src/overlay062/ov62_022300D8.c +++ b/src/overlay062/ov62_022300D8.c @@ -21,7 +21,7 @@ #include "overlay062/struct_ov62_02230C28.h" #include "overlay062/struct_ov62_0223118C.h" #include "overlay062/struct_ov62_022312B0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_02006E3C.h" @@ -50,9 +50,9 @@ void ov62_022300D8 (UnkStruct_0208C06C * param0) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; if (param0->unk_00 == 0) { sub_020070E8(v0, 67, v1, 1, 0, 0, 0, 102); @@ -81,9 +81,9 @@ void ov62_022302A8 (UnkStruct_0208C06C * param0, int param1, BOOL param2) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; int v5 = 2; if (param2) { @@ -98,9 +98,9 @@ void ov62_022302F0 (UnkStruct_0208C06C * param0, int param1) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; int v5 = 1; sub_020070E8(v0, 45, v1, param1, 0, 0, 0, 102); @@ -111,48 +111,48 @@ void ov62_02230330 (UnkStruct_0208C06C * param0) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; if (param0->unk_00 == 0) { - sub_0200CDC4(v4, 2, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - sub_0200CDC4(v4, 3, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } else { - sub_0200CDC4(v4, 2, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - sub_0200CDC4(v4, 3, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 51, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } - sub_0200CC3C(v2, v3, v0, 65, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - sub_0200CC3C(v2, v3, v0, 65, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10000); - sub_0200CE24(v2, v3, v0, 46, 0, 9999); - sub_0200CE54(v2, v3, v0, 47, 0, 9999); - sub_0200CE24(v2, v3, v0, 46, 0, 10000); - sub_0200CE54(v2, v3, v0, 47, 0, 10000); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 65, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 65, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 46, 0, 9999); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, 9999); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 46, 0, 10000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, 10000); } void ov62_02230464 (UnkStruct_0208C06C * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1 = param0->unk_14.unk_04; - AnimationResourceCollection * v2 = param0->unk_14.unk_08; - PaletteSys * v3 = param0->unk_14.unk_14; - - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 0; - v0.unk_10 = 1; - v0.unk_2C = 2; - v0.unk_30 = 0; - v0.unk_0C = 0; - v0.unk_14[0] = 9999; - v0.unk_14[1] = 9999; - v0.unk_14[2] = 9999; - v0.unk_14[3] = 9999; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; + SpriteTemplate v0; + SpriteRenderer * v1 = param0->unk_14.unk_04; + SpriteGfxHandler * v2 = param0->unk_14.unk_08; + PaletteData * v3 = param0->unk_14.unk_14; + + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 2; + v0.transferToVRAM = FALSE; + v0.plttIdx = 0; + v0.resources[0] = 9999; + v0.resources[1] = 9999; + v0.resources[2] = 9999; + v0.resources[3] = 9999; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; { int v4, v5; @@ -169,20 +169,20 @@ void ov62_02230464 (UnkStruct_0208C06C * param0) for (v5 = 0; v5 < ((3 * 2)); v5++) { for (v4 = 0; v4 < 2; v4++) { if (v4 == 0) { - v0.unk_10 = 1; - v0.unk_14[0] = 9999; - v0.unk_14[1] = 9999; - v0.unk_14[2] = 9999; - v0.unk_14[3] = 9999; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.resources[0] = 9999; + v0.resources[1] = 9999; + v0.resources[2] = 9999; + v0.resources[3] = 9999; } else { - v0.unk_10 = 2; - v0.unk_14[0] = 10000; - v0.unk_14[1] = 10000; - v0.unk_14[2] = 10000; - v0.unk_14[3] = 10000; + v0.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v0.resources[0] = 10000; + v0.resources[1] = 10000; + v0.resources[2] = 10000; + v0.resources[3] = 10000; } - param0->unk_6F8[v5].unk_00[v4] = sub_0200CE6C(v1, v2, &v0); + param0->unk_6F8[v5].unk_00[v4] = SpriteActor_LoadResources(v1, v2, &v0); if (v4 == 0) { ov62_02230E68(param0->unk_6F8[v5].unk_00[v4], v6[v5], 192 / 2); @@ -256,9 +256,9 @@ void ov62_022306B8 (UnkStruct_0208C06C * param0) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; int v5; int v6; int v7; @@ -297,18 +297,18 @@ void ov62_022306B8 (UnkStruct_0208C06C * param0) break; } - sub_0200CC3C(v2, v3, v0, v5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CC3C(v2, v3, v0, v5, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10002); - sub_0200CE24(v2, v3, v0, v6, 0, 10001); - sub_0200CE24(v2, v3, v0, v6, 0, 10002); - sub_0200CE54(v2, v3, v0, v7, 0, 10001); - sub_0200CE54(v2, v3, v0, v7, 0, 10002); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, v5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, v5, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10002); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, v6, 0, 10001); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, v6, 0, 10002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, v7, 0, 10001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, v7, 0, 10002); } void ov62_022307A0 (UnkStruct_0208C06C * param0) { - sub_0200D070(param0->unk_14.unk_08, 10001); - sub_0200D070(param0->unk_14.unk_08, 10002); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 10001); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 10002); } void ov62_022307C0 (UnkStruct_0208C06C * param0) @@ -352,55 +352,55 @@ void ov62_0223088C (UnkStruct_0208C06C * param0) { int v0; UnkStruct_ov62_022307C0 * v1 = ¶m0->unk_534; - UnkStruct_ov104_0223F9E0 v2; - CellTransferStateData * v3 = param0->unk_14.unk_04; - AnimationResourceCollection * v4 = param0->unk_14.unk_08; - PaletteSys * v5 = param0->unk_14.unk_14; + SpriteTemplate v2; + SpriteRenderer * v3 = param0->unk_14.unk_04; + SpriteGfxHandler * v4 = param0->unk_14.unk_08; + PaletteData * v5 = param0->unk_14.unk_14; - v2.unk_00 = 42; - v2.unk_02 = (25 + (36 * 4) + (16 * (5 - (param0->unk_534.unk_1AC)))) + 32; + v2.x = 42; + v2.y = (25 + (36 * 4) + (16 * (5 - (param0->unk_534.unk_1AC)))) + 32; if (param0->unk_534.unk_1AC == 2) { - v2.unk_02 = (25 + (36 * 4) + (16 * (4 - (param0->unk_534.unk_1AC)))) + 32; + v2.y = (25 + (36 * 4) + (16 * (4 - (param0->unk_534.unk_1AC)))) + 32; } - v2.unk_04 = 0; - v2.unk_06 = 0; - v2.unk_08 = 0; - v2.unk_10 = 1; - v2.unk_2C = 3; - v2.unk_30 = 0; - v2.unk_0C = (2 - 1); - v2.unk_14[0] = 10001; - v2.unk_14[1] = 9999; - v2.unk_14[2] = 10001; - v2.unk_14[3] = 10001; - v2.unk_14[4] = 0xffffffff; - v2.unk_14[5] = 0xffffffff; + v2.z = 0; + v2.animIdx = 0; + v2.priority = 0; + v2.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v2.bgPriority = 3; + v2.transferToVRAM = FALSE; + v2.plttIdx = (2 - 1); + v2.resources[0] = 10001; + v2.resources[1] = 9999; + v2.resources[2] = 10001; + v2.resources[3] = 10001; + v2.resources[4] = SPRITE_RESOURCE_NONE; + v2.resources[5] = SPRITE_RESOURCE_NONE; for (v0 = 0; v0 < 5; v0++) { - v2.unk_10 = 2; - v2.unk_14[0] = 10002; - v2.unk_14[1] = 10000; - v2.unk_14[2] = 10002; - v2.unk_14[3] = 10002; - v2.unk_08 = Unk_ov62_022488A8[1][v0]; - v1->unk_00[v0].unk_00 = sub_0200CE6C(v3, v4, &v2); + v2.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v2.resources[0] = 10002; + v2.resources[1] = 10000; + v2.resources[2] = 10002; + v2.resources[3] = 10002; + v2.priority = Unk_ov62_022488A8[1][v0]; + v1->unk_00[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v2); sub_0200D330(v1->unk_00[v0].unk_00); sub_0200D3F4(v1->unk_00[v0].unk_00, 1); - ov62_02230E68(v1->unk_00[v0].unk_00, v2.unk_00 + 8, v2.unk_02); + ov62_02230E68(v1->unk_00[v0].unk_00, v2.x + 8, v2.y); - v2.unk_10 = 1; - v2.unk_14[0] = 10001; - v2.unk_14[1] = 9999; - v2.unk_14[2] = 10001; - v2.unk_14[3] = 10001; - v2.unk_08 = Unk_ov62_022488A8[0][v0]; - v1->unk_C8[v0].unk_00 = sub_0200CE6C(v3, v4, &v2); + v2.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v2.resources[0] = 10001; + v2.resources[1] = 9999; + v2.resources[2] = 10001; + v2.resources[3] = 10001; + v2.priority = Unk_ov62_022488A8[0][v0]; + v1->unk_C8[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v2); sub_0200D330(v1->unk_C8[v0].unk_00); - ov62_02230E68(v1->unk_C8[v0].unk_00, v2.unk_00, v2.unk_02); + ov62_02230E68(v1->unk_C8[v0].unk_00, v2.x, v2.y); sub_0200D3F4(v1->unk_C8[v0].unk_00, param0->unk_818[v0].unk_00); } @@ -565,8 +565,8 @@ void ov62_02230C28 (SysTask * param0, void * param1) 90, 135, 270, 45, 225, 0, }; - sub_0200D550(v0->unk_00[0], &v5, &v6); - sub_0200D550(v0->unk_00[1], &v5, &v7); + SpriteActor_GetSpritePositionXY(v0->unk_00[0], &v5, &v6); + SpriteActor_GetSpritePositionXY(v0->unk_00[1], &v5, &v7); if (v0->unk_28 == 0) { v0->unk_14 = v0->unk_16 - v5; @@ -582,8 +582,8 @@ void ov62_02230C28 (SysTask * param0, void * param1) v0->unk_28++; } - sub_0200D4C4(v0->unk_00[0], v5, v6); - sub_0200D4C4(v0->unk_00[1], v5, v7); + SpriteActor_SetSpritePositionXY(v0->unk_00[0], v5, v6); + SpriteActor_SetSpritePositionXY(v0->unk_00[1], v5, v7); } break; case 3: @@ -659,7 +659,7 @@ void ov62_02230E80 (UnkStruct_0208C06C * param0) v4 = sub_02012898(&v6, v8[v11], 102); sub_0201ED94(v4, 1, v8[v11], &v7[v11]->unk_1C); - sub_0200D550(v7[v11]->unk_00, &v0, &v1); + SpriteActor_GetSpritePositionXY(v7[v11]->unk_00, &v0, &v1); v2.unk_00 = param0->unk_14.unk_3C; v2.unk_04 = &v6; @@ -775,7 +775,7 @@ void ov62_0223118C (UnkStruct_ov62_022312B0 * param0, UnkStruct_ov62_0223118C * v4 = sub_02012898(&v6, param2, 102); sub_0201ED94(v4, 1, param2, ¶m0->unk_14); - sub_0200D550(param0->unk_08, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_08, &v0, &v1); v2.unk_00 = param1->unk_3C; v2.unk_04 = &v6; @@ -825,78 +825,78 @@ void ov62_022312CC (UnkStruct_0208C06C * param0, int param1) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; - sub_0200CC3C(v2, v3, v0, 49, 0, param1, 11924); - sub_0200CE24(v2, v3, v0, 26, 0, 11924); - sub_0200CE54(v2, v3, v0, 27, 0, 11924); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 49, 0, param1, 11924); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 26, 0, 11924); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 27, 0, 11924); } void ov62_0223131C (UnkStruct_0208C06C * param0, int param1) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; - sub_0200CC3C(v2, v3, v0, 122, 0, param1, 11924); - sub_0200CE24(v2, v3, v0, 123, 0, 11924); - sub_0200CE54(v2, v3, v0, 124, 0, 11924); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 122, 0, param1, 11924); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 123, 0, 11924); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 124, 0, 11924); } void ov62_0223136C (UnkStruct_0208C06C * param0, int param1) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; int v5 = 30; int v6 = 32; int v7 = 31; - sub_0200CC3C(v2, v3, v0, v5, 0, param1, 11924); - sub_0200CE24(v2, v3, v0, v6, 0, 11924); - sub_0200CE54(v2, v3, v0, v7, 0, 11924); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, v5, 0, param1, 11924); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, v6, 0, 11924); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, v7, 0, 11924); } void ov62_022313BC (UnkStruct_0208C06C * param0) { - sub_0200D070(param0->unk_14.unk_08, 11924); - sub_0200D090(param0->unk_14.unk_08, 11924); - sub_0200D0A0(param0->unk_14.unk_08, 11924); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 11924); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 11924); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 11924); } CellActorData * ov62_022313E0 (UnkStruct_0208C06C * param0, int param1) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; - - v1.unk_00 = 128; - v1.unk_02 = 96; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 1; - v1.unk_0C = 0; - v1.unk_10 = param1; - v1.unk_2C = 3; - v1.unk_30 = 0; - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - v1.unk_14[0] = 11924; - v1.unk_14[2] = 11924; - v1.unk_14[3] = 11924; + SpriteTemplate v1; + + v1.x = 128; + v1.y = 96; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 1; + v1.plttIdx = 0; + v1.vramType = param1; + v1.bgPriority = 3; + v1.transferToVRAM = FALSE; + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + v1.resources[0] = 11924; + v1.resources[2] = 11924; + v1.resources[3] = 11924; if (param1 == NNS_G2D_VRAM_TYPE_2DMAIN) { - v1.unk_14[1] = 9999; + v1.resources[1] = 9999; } else { - v1.unk_14[1] = 10000; + v1.resources[1] = 10000; } - v0 = sub_0200CE6C(param0->unk_14.unk_04, param0->unk_14.unk_08, &v1); + v0 = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v1); sub_0200D41C(v0, 2); sub_0200D364(v0, 0); diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index 31c8ad8cb3..c8830e8179 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -37,7 +37,7 @@ #include "overlay062/struct_ov62_022349A8.h" #include "overlay062/struct_ov62_0223CAA4.h" #include "overlay062/struct_ov62_02248CDC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02002F38.h" @@ -137,9 +137,9 @@ int ov62_02231710 (UnkStruct_0208C06C * param0, int param1) void ov62_022317CC (UnkStruct_0208C06C * param0, int param1) { - PaletteSys * v0 = param0->unk_14.unk_14; - CellTransferStateData * v1 = param0->unk_14.unk_04; - AnimationResourceCollection * v2 = param0->unk_14.unk_08; + PaletteData * v0 = param0->unk_14.unk_14; + SpriteRenderer * v1 = param0->unk_14.unk_04; + SpriteGfxHandler * v2 = param0->unk_14.unk_08; NARC * v3 = param0->unk_14.unk_00; PaletteSys_LoadPalette(v0, 162, ov62_02231710(param0, 3), 102, 0, 0x20 * (8 + 1), 0); @@ -148,10 +148,10 @@ void ov62_022317CC (UnkStruct_0208C06C * param0, int param1) PaletteSys_LoadPalette(v0, 162, ov62_02231710(param0, 0), 102, 1, 0x20, 14 * 16); sub_0208B63C(param0->unk_6F0, param0->unk_14.unk_48); sub_0208B63C(param0->unk_6F0, param0->unk_14.unk_48); - sub_0200D080(v2, 9999); - sub_0200D080(v2, 10000); - sub_0200CDC4(v0, 2, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); - sub_0200CDC4(v0, 3, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); + SpriteGfxHandler_UnloadPlttObjById(v2, 9999); + SpriteGfxHandler_UnloadPlttObjById(v2, 10000); + SpriteRenderer_LoadPalette(v0, 2, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 9999); + SpriteRenderer_LoadPalette(v0, 3, v1, v2, v3, ov62_02231710(param0, 2), 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 10000); } void ov62_022318E8 (UnkStruct_0208C06C * param0) @@ -814,10 +814,10 @@ static void ov62_022320A0 (UnkStruct_ov62_022323B8 * param0, int param1) static void ov62_022320B0 (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C * param1) { - sub_0200D070(param1->unk_14.unk_08, 100000); - sub_0200D080(param1->unk_14.unk_08, 100000); - sub_0200D090(param1->unk_14.unk_08, 100000); - sub_0200D0A0(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadPlttObjById(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 100000); if (param0->unk_04) { sub_0200D0F4(param0->unk_04); @@ -832,10 +832,10 @@ static void ov62_022320EC (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C int v2; int v3; u8 v4; - CellTransferStateData * v5; - AnimationResourceCollection * v6; - PaletteSys * v7; - UnkStruct_ov104_0223F9E0 v8; + SpriteRenderer * v5; + SpriteGfxHandler * v6; + PaletteData * v7; + SpriteTemplate v8; v5 = param1->unk_14.unk_04; v6 = param1->unk_14.unk_08; @@ -868,23 +868,23 @@ static void ov62_022320EC (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C sub_0200D888(v5, v6, 19, v11, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000); - v8.unk_00 = 72 + 4; - v8.unk_02 = 64 - 4; - v8.unk_04 = 0; - v8.unk_06 = 0; - v8.unk_08 = 0; - v8.unk_0C = 0; - v8.unk_10 = 1; - v8.unk_2C = 0; - v8.unk_30 = 0; - v8.unk_14[0] = 100000; - v8.unk_14[1] = 100000; - v8.unk_14[2] = 100000; - v8.unk_14[3] = 100000; - v8.unk_14[4] = 0xffffffff; - v8.unk_14[5] = 0xffffffff; - - param0->unk_04 = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v8); + v8.x = 72 + 4; + v8.y = 64 - 4; + v8.z = 0; + v8.animIdx = 0; + v8.priority = 0; + v8.plttIdx = 0; + v8.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v8.bgPriority = 0; + v8.transferToVRAM = FALSE; + v8.resources[0] = 100000; + v8.resources[1] = 100000; + v8.resources[2] = 100000; + v8.resources[3] = 100000; + v8.resources[4] = SPRITE_RESOURCE_NONE; + v8.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_04 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v8); v2 = PokeIconPaletteIndex(v1, v3, v0); sub_0200D430(param0->unk_04, v4 + v2); @@ -899,10 +899,10 @@ static void ov62_022321F4 (UnkStruct_ov62_022323B8 * param0, int param1) static void ov62_02232200 (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C * param1) { - sub_0200D070(param1->unk_14.unk_08, 165535); - sub_0200D080(param1->unk_14.unk_08, 165535); - sub_0200D090(param1->unk_14.unk_08, 165535); - sub_0200D0A0(param1->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadPlttObjById(param1->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 165535); sub_0200D0F4(param0->unk_08); } @@ -948,10 +948,10 @@ int ov62_02232234 (int param0, int param1) static void ov62_0223226C (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C * param1) { int v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; - UnkStruct_ov104_0223F9E0 v4; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; + SpriteTemplate v4; int v5 = 13; int v6 = 14; int v7 = 9; @@ -983,23 +983,23 @@ static void ov62_0223226C (UnkStruct_ov62_022323B8 * param0, UnkStruct_0208C06C sub_0200CE3C(v1, v2, 146, v8, 0, 165535); sub_0200D888(v1, v2, 146, v6, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 165535); - v4.unk_00 = 40; - v4.unk_02 = 56 + 4; - v4.unk_04 = 0; - v4.unk_06 = 0; - v4.unk_08 = 0; - v4.unk_0C = 0; - v4.unk_10 = 1; - v4.unk_2C = 0; - v4.unk_30 = 0; - v4.unk_14[0] = 165535; - v4.unk_14[1] = 165535; - v4.unk_14[2] = 165535; - v4.unk_14[3] = 165535; - v4.unk_14[4] = 0xffffffff; - v4.unk_14[5] = 0xffffffff; - - param0->unk_08 = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); + v4.x = 40; + v4.y = 56 + 4; + v4.z = 0; + v4.animIdx = 0; + v4.priority = 0; + v4.plttIdx = 0; + v4.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v4.bgPriority = 0; + v4.transferToVRAM = FALSE; + v4.resources[0] = 165535; + v4.resources[1] = 165535; + v4.resources[2] = 165535; + v4.resources[3] = 165535; + v4.resources[4] = SPRITE_RESOURCE_NONE; + v4.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_08 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); sub_0200D364(param0->unk_08, 1); sub_0200D330(param0->unk_08); } @@ -2248,40 +2248,40 @@ void ov62_02233310 (UnkStruct_ov62_02233310 * param0) void ov62_0223331C (UnkStruct_ov62_02233310 * param0, UnkStruct_0208C06C * param1, int param2) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; NARC * v2 = param1->unk_14.unk_00; BGL * v3 = param1->unk_14.unk_10; - CellTransferStateData * v4 = param1->unk_14.unk_04; - AnimationResourceCollection * v5 = param1->unk_14.unk_08; - PaletteSys * v6 = param1->unk_14.unk_14; - - sub_0200CC3C(v4, v5, v2, 127, 0, param2, 200000); - sub_0200CE24(v4, v5, v2, 126, 0, 200000); - sub_0200CE54(v4, v5, v2, 125, 0, 200000); - - v1.unk_00 = 128; - v1.unk_02 = 96; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 1; - v1.unk_0C = 0; - v1.unk_10 = param2; - v1.unk_2C = 1; - v1.unk_30 = 0; - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - v1.unk_14[0] = 200000; - v1.unk_14[2] = 200000; - v1.unk_14[3] = 200000; + SpriteRenderer * v4 = param1->unk_14.unk_04; + SpriteGfxHandler * v5 = param1->unk_14.unk_08; + PaletteData * v6 = param1->unk_14.unk_14; + + SpriteRenderer_LoadCharResObjFromOpenNarc(v4, v5, v2, 127, 0, param2, 200000); + SpriteRenderer_LoadCellResObjFromOpenNarc(v4, v5, v2, 126, 0, 200000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v4, v5, v2, 125, 0, 200000); + + v1.x = 128; + v1.y = 96; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 1; + v1.plttIdx = 0; + v1.vramType = param2; + v1.bgPriority = 1; + v1.transferToVRAM = FALSE; + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + v1.resources[0] = 200000; + v1.resources[2] = 200000; + v1.resources[3] = 200000; if (param2 == NNS_G2D_VRAM_TYPE_2DMAIN) { - v1.unk_14[1] = 9999; + v1.resources[1] = 9999; } else { - v1.unk_14[1] = 10000; + v1.resources[1] = 10000; } - param0->unk_2C[0] = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); - param0->unk_2C[1] = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + param0->unk_2C[0] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + param0->unk_2C[1] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); sub_0200D41C(param0->unk_2C[0], 2); sub_0200D41C(param0->unk_2C[1], 2); @@ -2292,11 +2292,11 @@ void ov62_0223331C (UnkStruct_ov62_02233310 * param0, UnkStruct_0208C06C * param sub_0200D7D4(param0->unk_2C[1], 2); if (param2 == 1) { - sub_0200D4C4(param0->unk_2C[0], 256 / 2, 24); - sub_0200D4C4(param0->unk_2C[1], 256 / 2, 120); + SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, 24); + SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, 120); } else { - sub_0200D4C4(param0->unk_2C[0], 256 / 2, 24 + 64); - sub_0200D4C4(param0->unk_2C[1], 256 / 2, 120 + 64); + SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, 24 + 64); + SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, 120 + 64); } ov62_02233454(param0); @@ -2304,8 +2304,8 @@ void ov62_0223331C (UnkStruct_ov62_02233310 * param0, UnkStruct_0208C06C * param void ov62_02233434 (UnkStruct_ov62_02233310 * param0, s16 param1, s16 param2) { - sub_0200D4C4(param0->unk_2C[0], 256 / 2, param1); - sub_0200D4C4(param0->unk_2C[1], 256 / 2, param2); + SpriteActor_SetSpritePositionXY(param0->unk_2C[0], 256 / 2, param1); + SpriteActor_SetSpritePositionXY(param0->unk_2C[1], 256 / 2, param2); } void ov62_02233454 (UnkStruct_ov62_02233310 * param0) @@ -2349,9 +2349,9 @@ void ov62_0223349C (UnkStruct_ov62_02233310 * param0) void ov62_022334FC (UnkStruct_ov62_02233310 * param0, UnkStruct_0208C06C * param1) { - sub_0200D070(param1->unk_14.unk_08, 200000); - sub_0200D090(param1->unk_14.unk_08, 200000); - sub_0200D0A0(param1->unk_14.unk_08, 200000); + SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 200000); + SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 200000); + SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 200000); sub_0200D0F4(param0->unk_2C[0]); sub_0200D0F4(param0->unk_2C[1]); } @@ -2359,30 +2359,30 @@ void ov62_022334FC (UnkStruct_ov62_02233310 * param0, UnkStruct_0208C06C * param static CellActorData * ov62_0223352C (UnkStruct_ov62_0223359C * param0, UnkStruct_0208C06C * param1, int param2, int param3) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; - - v1.unk_00 = 128; - v1.unk_02 = 96; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 1; - v1.unk_0C = 0; - v1.unk_10 = param2; - v1.unk_2C = 1; - v1.unk_30 = 0; - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - v1.unk_14[0] = 11924; - v1.unk_14[2] = 11924; - v1.unk_14[3] = 11924; + SpriteTemplate v1; + + v1.x = 128; + v1.y = 96; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 1; + v1.plttIdx = 0; + v1.vramType = param2; + v1.bgPriority = 1; + v1.transferToVRAM = FALSE; + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + v1.resources[0] = 11924; + v1.resources[2] = 11924; + v1.resources[3] = 11924; if (param2 == NNS_G2D_VRAM_TYPE_2DMAIN) { - v1.unk_14[1] = 9999; + v1.resources[1] = 9999; } else { - v1.unk_14[1] = 10000; + v1.resources[1] = 10000; } - v0 = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); + v0 = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v1); sub_0200D41C(v0, 2); sub_0200D364(v0, param3); sub_0200D330(v0); @@ -2406,8 +2406,8 @@ void ov62_022335BC (UnkStruct_ov62_0223359C * param0, UnkStruct_0208C06C * param param0->unk_18[0] = ov62_0223352C(param0, param1, 2, param2); param0->unk_18[1] = ov62_0223352C(param0, param1, 2, param2); - sub_0200D4C4(param0->unk_18[0], 0 + 24, 72 + 64); - sub_0200D4C4(param0->unk_18[1], 256 - 24, 72 + 64); + SpriteActor_SetSpritePositionXY(param0->unk_18[0], 0 + 24, 72 + 64); + SpriteActor_SetSpritePositionXY(param0->unk_18[1], 256 - 24, 72 + 64); } void ov62_022335F4 (UnkStruct_ov62_0223359C * param0) @@ -2693,9 +2693,9 @@ void ov62_022339A0 (UnkStruct_0208C06C * param0) void ov62_022339DC (UnkStruct_0208C06C * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; v0 = param0->unk_14.unk_04; v1 = param0->unk_14.unk_08; @@ -2708,9 +2708,9 @@ void ov62_022339DC (UnkStruct_0208C06C * param0) void ov62_02233A44 (UnkStruct_0208C06C * param0) { - sub_0200D080(param0->unk_14.unk_08, 100000); - sub_0200D090(param0->unk_14.unk_08, 100000); - sub_0200D0A0(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 100000); } NARC * ov62_02233A68 (int param0) @@ -2729,10 +2729,10 @@ void ov62_02233A74 (NARC * param0) CellActorData * ov62_02233A7C (UnkStruct_0208C06C * param0, NARC * param1, int param2, int param3, int param4, int param5) { CellActorData * v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; - UnkStruct_ov104_0223F9E0 v4; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; + SpriteTemplate v4; int v5; v1 = param0->unk_14.unk_04; @@ -2745,23 +2745,23 @@ CellActorData * ov62_02233A7C (UnkStruct_0208C06C * param0, NARC * param1, int p sub_0200D8E8(v1, v2, param1, PokeIconSpriteIndex(param3, param5, param4), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + param2); - v4.unk_00 = 0; - v4.unk_02 = -48; - v4.unk_04 = 0; - v4.unk_06 = 0; - v4.unk_08 = 0; - v4.unk_0C = 0; - v4.unk_10 = 1; - v4.unk_2C = 0; - v4.unk_30 = 0; - v4.unk_14[0] = 100000 + param2; - v4.unk_14[1] = 100000; - v4.unk_14[2] = 100000; - v4.unk_14[3] = 100000; - v4.unk_14[4] = 0xffffffff; - v4.unk_14[5] = 0xffffffff; - - v0 = sub_0200CE6C(v1, v2, &v4); + v4.x = 0; + v4.y = -48; + v4.z = 0; + v4.animIdx = 0; + v4.priority = 0; + v4.plttIdx = 0; + v4.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v4.bgPriority = 0; + v4.transferToVRAM = FALSE; + v4.resources[0] = 100000 + param2; + v4.resources[1] = 100000; + v4.resources[2] = 100000; + v4.resources[3] = 100000; + v4.resources[4] = SPRITE_RESOURCE_NONE; + v4.resources[5] = SPRITE_RESOURCE_NONE; + + v0 = SpriteActor_LoadResources(v1, v2, &v4); v5 = PokeIconPaletteIndex(param3, param4, param5); sub_0200D430(v0, 4 + v5); @@ -2779,7 +2779,7 @@ void ov62_02233B24 (UnkStruct_0208C06C * param0, int param1, CellActorData * par return; } - sub_0200D070(param0->unk_14.unk_08, 100000 + param1); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + param1); sub_0200D0F4(param2); } @@ -3006,15 +3006,15 @@ static void ov62_02234000 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C int v1; int v2; int v3 = 0; - UnkStruct_ov104_0223F9E0 v4; + SpriteTemplate v4; int v5; int v6; int v7[12]; int v8[12]; int v9; - CellTransferStateData * v10; - AnimationResourceCollection * v11; - PaletteSys * v12; + SpriteRenderer * v10; + SpriteGfxHandler * v11; + PaletteData * v12; s16 v13[][12][2] = { { {11 * 8, 13 * 8}, @@ -3118,23 +3118,23 @@ static void ov62_02234000 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C sub_0200D888(v10, v11, 19, v6, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + v3); - v4.unk_00 = v13[v9][v0][0] + 12 - 4; - v4.unk_02 = v13[v9][v0][1] - 12; - v4.unk_04 = 0; - v4.unk_06 = 0; - v4.unk_08 = 0; - v4.unk_0C = 0; - v4.unk_10 = 1; - v4.unk_2C = 0; - v4.unk_30 = 0; - v4.unk_14[0] = 100000 + v3; - v4.unk_14[1] = 100000; - v4.unk_14[2] = 100000; - v4.unk_14[3] = 100000; - v4.unk_14[4] = 0xffffffff; - v4.unk_14[5] = 0xffffffff; - - param0->unk_0C[v3] = sub_0200CE6C(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); + v4.x = v13[v9][v0][0] + 12 - 4; + v4.y = v13[v9][v0][1] - 12; + v4.z = 0; + v4.animIdx = 0; + v4.priority = 0; + v4.plttIdx = 0; + v4.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v4.bgPriority = 0; + v4.transferToVRAM = FALSE; + v4.resources[0] = 100000 + v3; + v4.resources[1] = 100000; + v4.resources[2] = 100000; + v4.resources[3] = 100000; + v4.resources[4] = SPRITE_RESOURCE_NONE; + v4.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_0C[v3] = SpriteActor_LoadResources(param1->unk_14.unk_04, param1->unk_14.unk_08, &v4); v5 = PokeIconPaletteIndex(v1, v2, 0); sub_0200D430(param0->unk_0C[v3], 4 + v5); @@ -3155,13 +3155,13 @@ void ov62_02234228 (UnkStruct_ov62_02233F74 * param0, UnkStruct_0208C06C * param { int v0; - sub_0200D080(param1->unk_14.unk_08, 100000); - sub_0200D090(param1->unk_14.unk_08, 100000); - sub_0200D0A0(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadPlttObjById(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadCellObjById(param1->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadAnimObjById(param1->unk_14.unk_08, 100000); for (v0 = 0; v0 < 12; v0++) { if (param0->unk_0C[v0]) { - sub_0200D070(param1->unk_14.unk_08, 100000 + v0); + SpriteGfxHandler_UnloadCharObjById(param1->unk_14.unk_08, 100000 + v0); sub_0200D0F4(param0->unk_0C[v0]); param0->unk_0C[v0] = NULL; } @@ -3333,7 +3333,7 @@ void ov62_0223454C (UnkStruct_0208C06C * param0, UnkStruct_ov62_022312B0 * param ov62_0223118C(param1, ¶m0->unk_14, param2); ov62_0223124C(param1, ¶m0->unk_14, param3); - sub_0200D4C4(param1->unk_08, param4, param5); + SpriteActor_SetSpritePositionXY(param1->unk_08, param4, param5); sub_020128C4(param1->unk_0C, param6, param7); sub_020129D0(param1->unk_0C, param9); sub_0200D364(param1->unk_08, param8); diff --git a/src/overlay062/ov62_02235E64.c b/src/overlay062/ov62_02235E64.c index e4c6618ece..7f15066c2e 100644 --- a/src/overlay062/ov62_02235E64.c +++ b/src/overlay062/ov62_02235E64.c @@ -741,7 +741,7 @@ static void ov62_02236C20 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_158[0], ¶m0->unk_14, 3); sub_0200D364(v0->unk_158[0].unk_08, 0); - sub_0200D4C4(v0->unk_158[0].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_158[0].unk_08, 80, 232); sub_020128C4(v0->unk_158[0].unk_0C, 36, -8); sub_020129D0(v0->unk_158[0].unk_0C, 1); } diff --git a/src/overlay062/ov62_02236CBC.c b/src/overlay062/ov62_02236CBC.c index 95782e4fa6..8038fc76d4 100644 --- a/src/overlay062/ov62_02236CBC.c +++ b/src/overlay062/ov62_02236CBC.c @@ -14,7 +14,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_0208C06C.h" #include "overlay062/struct_ov62_022312B0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002F38.h" #include "unk_02005474.h" @@ -77,9 +77,9 @@ static void ov62_02236CBC (UnkStruct_0208C06C * param0, int param1) UnkStruct_ov62_02236CBC * v0 = param0->unk_860; if (param1 == 0) { - sub_0200D4C4(v0->unk_9C[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 128, 232); } else { - sub_0200D4C4(v0->unk_9C[1].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 80, 232); } sub_020128C4(v0->unk_9C[1].unk_0C, 36, -8); @@ -89,13 +89,13 @@ static void ov62_02236CF8 (UnkStruct_0208C06C * param0, int param1) { NARC * v0 = param0->unk_14.unk_00; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; - sub_0200CC3C(v2, v3, v0, 50, 0, param1, 11924); - sub_0200CE24(v2, v3, v0, 28, 0, 11924); - sub_0200CE54(v2, v3, v0, 29, 0, 11924); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 50, 0, param1, 11924); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 28, 0, 11924); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 29, 0, 11924); } static void ov62_02236D48 (UnkStruct_0208C06C * param0) @@ -109,13 +109,13 @@ static void ov62_02236D48 (UnkStruct_0208C06C * param0) ov62_0223118C(&v0->unk_9C[1], ¶m0->unk_14, NNS_G2D_VRAM_TYPE_2DSUB); ov62_0223124C(&v0->unk_9C[1], ¶m0->unk_14, 3); - sub_0200D4C4(v0->unk_9C[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_9C[1].unk_08, 128, 232); sub_020128C4(v0->unk_9C[1].unk_0C, 36, -8); sub_020129D0(v0->unk_9C[1].unk_0C, 1); v0->unk_94[1] = ov62_022313E0(param0, NNS_G2D_VRAM_TYPE_2DSUB); - sub_0200D4C4(v0->unk_94[1], 220, 160 + 64); + SpriteActor_SetSpritePositionXY(v0->unk_94[1], 220, 160 + 64); sub_0200D364(v0->unk_94[1], 2); sub_0200D3F4(v0->unk_94[1], 0); @@ -137,20 +137,20 @@ static void ov62_02236E14 (UnkStruct_0208C06C * param0) UnkStruct_ov62_02236CBC * v0 = param0->unk_860; NARC * v1 = param0->unk_14.unk_00; BGL * v2 = param0->unk_14.unk_10; - CellTransferStateData * v3 = param0->unk_14.unk_04; - AnimationResourceCollection * v4 = param0->unk_14.unk_08; - PaletteSys * v5 = param0->unk_14.unk_14; + SpriteRenderer * v3 = param0->unk_14.unk_04; + SpriteGfxHandler * v4 = param0->unk_14.unk_08; + PaletteData * v5 = param0->unk_14.unk_14; sub_020070E8(param0->unk_14.unk_00, 62, param0->unk_14.unk_10, 6, 0, 0, 0, 102); sub_0200710C(v1, 68, v2, 6, 0, 0, 0, 102); - sub_0200CDC4(v5, 3, v3, v4, v1, ov62_02231710(param0, 0), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 29292); - sub_0200CC3C(v3, v4, v1, 66, 0, NNS_G2D_VRAM_TYPE_2DSUB, 29292); - sub_0200CE24(v3, v4, v1, 71, 0, 29292); - sub_0200CE54(v3, v4, v1, 72, 0, 29292); - sub_0200CDC4(v5, 2, v3, v4, v1, ov62_02231710(param0, 1), 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); - sub_0200CC3C(v3, v4, v1, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); - sub_0200CE24(v3, v4, v1, 38, 0, 28282); - sub_0200CE54(v3, v4, v1, 39, 0, 28282); + SpriteRenderer_LoadPalette(v5, 3, v3, v4, v1, ov62_02231710(param0, 0), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 29292); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 66, 0, NNS_G2D_VRAM_TYPE_2DSUB, 29292); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 71, 0, 29292); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 72, 0, 29292); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v1, ov62_02231710(param0, 1), 0, 6, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 64, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 28282); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 38, 0, 28282); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 39, 0, 28282); { int v6; @@ -161,8 +161,8 @@ static void ov62_02236E14 (UnkStruct_0208C06C * param0) for (v6 = 0; v6 < 5; v6++) { if (v6 == 3) { - sub_0200CDC4(v5, 2, v3, v4, v1, 92, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); - sub_0200CC3C(v3, v4, v1, 91, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v1, 92, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v1, 91, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); } else { sub_0200CD7C(v5, 2, v3, v4, 146, v7[v6], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); sub_0200D888(v3, v4, 146, v8[v6], 0, NNS_G2D_VRAM_TYPE_2DMAIN, 18181 + v6); @@ -171,8 +171,8 @@ static void ov62_02236E14 (UnkStruct_0208C06C * param0) sub_0200CE0C(v3, v4, 146, v9, 0, 18181); sub_0200CE3C(v3, v4, 146, v10, 0, 18181); - sub_0200CE24(v3, v4, v1, 89, 0, 18181 + 1); - sub_0200CE54(v3, v4, v1, 90, 0, 18181 + 1); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v1, 89, 0, 18181 + 1); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v1, 90, 0, 18181 + 1); } { @@ -223,9 +223,9 @@ static void ov62_0223712C (UnkStruct_0208C06C * param0) { UnkStruct_ov62_02236CBC * v0 = param0->unk_860; BGL * v1 = param0->unk_14.unk_10; - CellTransferStateData * v2 = param0->unk_14.unk_04; - AnimationResourceCollection * v3 = param0->unk_14.unk_08; - PaletteSys * v4 = param0->unk_14.unk_14; + SpriteRenderer * v2 = param0->unk_14.unk_04; + SpriteGfxHandler * v3 = param0->unk_14.unk_08; + PaletteData * v4 = param0->unk_14.unk_14; int v5; int v6[5]; @@ -244,7 +244,7 @@ static void ov62_0223712C (UnkStruct_0208C06C * param0) int v8[] = {0, 1, 4, 3, 2}; if (v6[v5] == 2) { - PaletteSys * v9 = param0->unk_14.unk_14; + PaletteData * v9 = param0->unk_14.unk_14; u16 * v10; v10 = sub_0200316C(v9, 2); @@ -264,47 +264,47 @@ static void ov62_022371CC (UnkStruct_0208C06C * param0) int v3[5]; UnkStruct_ov62_02236CBC * v4 = param0->unk_860; BGL * v5 = param0->unk_14.unk_10; - CellTransferStateData * v6 = param0->unk_14.unk_04; - AnimationResourceCollection * v7 = param0->unk_14.unk_08; - PaletteSys * v8 = param0->unk_14.unk_14; - UnkStruct_ov104_0223F9E0 v9; - - v9.unk_00 = 0; - v9.unk_02 = 256; - v9.unk_04 = 0; - v9.unk_06 = 0; - v9.unk_08 = 10; - v9.unk_0C = 0; - v9.unk_10 = 1; - v9.unk_2C = 0; - v9.unk_30 = 0; - v9.unk_14[4] = 0xffffffff; - v9.unk_14[5] = 0xffffffff; - v9.unk_14[0] = 165535; - v9.unk_14[1] = 165535; - v9.unk_14[2] = 165535; - v9.unk_14[3] = 165535; + SpriteRenderer * v6 = param0->unk_14.unk_04; + SpriteGfxHandler * v7 = param0->unk_14.unk_08; + PaletteData * v8 = param0->unk_14.unk_14; + SpriteTemplate v9; + + v9.x = 0; + v9.y = 256; + v9.z = 0; + v9.animIdx = 0; + v9.priority = 10; + v9.plttIdx = 0; + v9.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v9.bgPriority = 0; + v9.transferToVRAM = FALSE; + v9.resources[4] = SPRITE_RESOURCE_NONE; + v9.resources[5] = SPRITE_RESOURCE_NONE; + v9.resources[0] = 165535; + v9.resources[1] = 165535; + v9.resources[2] = 165535; + v9.resources[3] = 165535; for (v0 = 0; v0 < 5; v0++) { - v4->unk_40[v0] = sub_0200CE6C(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_40[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); sub_0200D364(v4->unk_40[v0], 1); sub_0200D330(v4->unk_40[v0]); sub_0200D6E8(v4->unk_40[v0], v4->unk_04[v0], v4->unk_04[v0]); } for (v0 = 0; v0 < 5; v0++) { - v9.unk_14[0] = 18181 + v0; - v9.unk_14[1] = 18181 + v0; + v9.resources[0] = 18181 + v0; + v9.resources[1] = 18181 + v0; if (v0 == 3) { - v9.unk_14[2] = 18181 + 1; - v9.unk_14[3] = 18181 + 1; + v9.resources[2] = 18181 + 1; + v9.resources[3] = 18181 + 1; } else { - v9.unk_14[2] = 18181; - v9.unk_14[3] = 18181; + v9.resources[2] = 18181; + v9.resources[3] = 18181; } - v4->unk_54[v0] = sub_0200CE6C(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_54[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v0 == 3) { sub_0200D364(v4->unk_54[v0], 0); @@ -317,13 +317,13 @@ static void ov62_022371CC (UnkStruct_0208C06C * param0) sub_0200D41C(v4->unk_54[v0], 10 + v0); } - v9.unk_14[0] = 28282; - v9.unk_14[1] = 28282; - v9.unk_14[2] = 28282; - v9.unk_14[3] = 28282; - v9.unk_14[4] = 0xffffffff; - v9.unk_14[5] = 0xffffffff; - v9.unk_08 = 20; + v9.resources[0] = 28282; + v9.resources[1] = 28282; + v9.resources[2] = 28282; + v9.resources[3] = 28282; + v9.resources[4] = SPRITE_RESOURCE_NONE; + v9.resources[5] = SPRITE_RESOURCE_NONE; + v9.priority = 20; { UnkStruct_020507E4 * v10 = sub_020507E4(param0->unk_830); @@ -336,7 +336,7 @@ static void ov62_022371CC (UnkStruct_0208C06C * param0) } for (v0 = 0; v0 < 5; v0++) { - v4->unk_68[v0] = sub_0200CE6C(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_68[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v3[v0] == 0) { sub_0200D364(v4->unk_68[v0], 5); @@ -354,14 +354,14 @@ static void ov62_022371CC (UnkStruct_0208C06C * param0) sub_0200D6E8(v4->unk_68[v0], v4->unk_04[v0], v4->unk_04[v0]); } - v9.unk_14[0] = 29292; - v9.unk_14[1] = 29292; - v9.unk_14[2] = 29292; - v9.unk_14[3] = 29292; - v9.unk_14[4] = 0xffffffff; - v9.unk_14[5] = 0xffffffff; - v9.unk_10 = 2; - v9.unk_08 = 0; + v9.resources[0] = 29292; + v9.resources[1] = 29292; + v9.resources[2] = 29292; + v9.resources[3] = 29292; + v9.resources[4] = SPRITE_RESOURCE_NONE; + v9.resources[5] = SPRITE_RESOURCE_NONE; + v9.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v9.priority = 0; { int v12 = 1000; @@ -384,7 +384,7 @@ static void ov62_022371CC (UnkStruct_0208C06C * param0) } for (v0 = 0; v0 < 4 + 1; v0++) { - v4->unk_7C[v0] = sub_0200CE6C(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); + v4->unk_7C[v0] = SpriteActor_LoadResources(param0->unk_14.unk_04, param0->unk_14.unk_08, &v9); if (v2[v0] == 0) { if (v0 < v1) { @@ -413,42 +413,42 @@ static void ov62_022374A8 (UnkStruct_0208C06C * param0) UnkStruct_ov62_02236CBC * v1 = param0->unk_860; for (v0 = 0; v0 < 5; v0++) { - sub_0200D070(param0->unk_14.unk_08, 18181 + v0); - sub_0200D080(param0->unk_14.unk_08, 18181 + v0); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 18181 + v0); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 18181 + v0); sub_0200D0F4(v1->unk_54[v0]); } - sub_0200D090(param0->unk_14.unk_08, 18181); - sub_0200D0A0(param0->unk_14.unk_08, 18181); - sub_0200D090(param0->unk_14.unk_08, 18181 + 1); - sub_0200D0A0(param0->unk_14.unk_08, 18181 + 1); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 18181); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 18181); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 18181 + 1); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 18181 + 1); for (v0 = 0; v0 < 5; v0++) { sub_0200D0F4(v1->unk_40[v0]); } - sub_0200D070(param0->unk_14.unk_08, 165535); - sub_0200D080(param0->unk_14.unk_08, 165535); - sub_0200D090(param0->unk_14.unk_08, 165535); - sub_0200D0A0(param0->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 165535); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 165535); for (v0 = 0; v0 < 5; v0++) { sub_0200D0F4(v1->unk_68[v0]); } - sub_0200D070(param0->unk_14.unk_08, 28282); - sub_0200D080(param0->unk_14.unk_08, 28282); - sub_0200D090(param0->unk_14.unk_08, 28282); - sub_0200D0A0(param0->unk_14.unk_08, 28282); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 28282); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 28282); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 28282); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 28282); for (v0 = 0; v0 < 4 + 1; v0++) { sub_0200D0F4(v1->unk_7C[v0]); } - sub_0200D070(param0->unk_14.unk_08, 29292); - sub_0200D080(param0->unk_14.unk_08, 29292); - sub_0200D090(param0->unk_14.unk_08, 29292); - sub_0200D0A0(param0->unk_14.unk_08, 29292); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 29292); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 29292); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 29292); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 29292); } static BOOL ov62_022375A4 (UnkStruct_0208C06C * param0) @@ -479,9 +479,9 @@ static BOOL ov62_022375A4 (UnkStruct_0208C06C * param0) v5 = (106 << FX32_SHIFT) - sub_0201D264(v0->unk_2C[v1]) * v0->unk_18[v1]; sub_0200D614(v0->unk_68[v1], v4, v5); - sub_0200D550(v0->unk_68[v1], &v2, &v3); - sub_0200D4C4(v0->unk_40[v1], v2 - 32, v3 - 2); - sub_0200D4C4(v0->unk_54[v1], v2 + 16, v3 - 2); + SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); + SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); + SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); @@ -529,9 +529,9 @@ static BOOL ov62_022376C4 (UnkStruct_0208C06C * param0) v5 = (106 << FX32_SHIFT) - sub_0201D264(v0->unk_2C[v1]) * v0->unk_18[v1]; sub_0200D614(v0->unk_68[v1], v4, v5); - sub_0200D550(v0->unk_68[v1], &v2, &v3); - sub_0200D4C4(v0->unk_40[v1], v2 - 32, v3 - 2); - sub_0200D4C4(v0->unk_54[v1], v2 + 16, v3 - 2); + SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v2, &v3); + SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v2 - 32, v3 - 2); + SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v2 + 16, v3 - 2); sub_0200D6E8(v0->unk_68[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_40[v1], v0->unk_04[v1], v0->unk_04[v1]); sub_0200D6E8(v0->unk_54[v1], v0->unk_04[v1], v0->unk_04[v1]); @@ -564,9 +564,9 @@ static void ov62_02237814 (UnkStruct_0208C06C * param0) v6 = v7[v1][1] << FX32_SHIFT; sub_0200D614(v0->unk_68[v1], v5, v6); - sub_0200D550(v0->unk_68[v1], &v3, &v4); - sub_0200D4C4(v0->unk_40[v1], v3 - 32, v4 - 2); - sub_0200D4C4(v0->unk_54[v1], v3 + 16, v4 - 2); + SpriteActor_GetSpritePositionXY(v0->unk_68[v1], &v3, &v4); + SpriteActor_SetSpritePositionXY(v0->unk_40[v1], v3 - 32, v4 - 2); + SpriteActor_SetSpritePositionXY(v0->unk_54[v1], v3 + 16, v4 - 2); } } diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 9f560ba124..c7b489d482 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1307,11 +1307,11 @@ static void ov62_0223958C (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_198[1].unk_08, 1); sub_020129D0(v0->unk_198[1].unk_0C, 1); - sub_0200D4C4(v0->unk_198[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 32, 232); } else { sub_0200D3F4(v0->unk_198[1].unk_08, 0); sub_020129D0(v0->unk_198[1].unk_0C, 0); - sub_0200D4C4(v0->unk_198[0].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 80, 232); } sub_020128C4(v0->unk_198[0].unk_0C, 36, -8); @@ -1334,8 +1334,8 @@ static void ov62_02239608 (UnkStruct_0208C06C * param0) sub_0200D364(v0->unk_198[0].unk_08, 0); sub_0200D364(v0->unk_198[1].unk_08, 4); - sub_0200D4C4(v0->unk_198[0].unk_08, 32, 232); - sub_0200D4C4(v0->unk_198[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_198[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_198[1].unk_08, 128, 232); sub_020128C4(v0->unk_198[0].unk_0C, 36, -8); sub_020128C4(v0->unk_198[1].unk_0C, 36, -8); sub_020129D0(v0->unk_198[0].unk_0C, 1); diff --git a/src/overlay062/ov62_02239D60.c b/src/overlay062/ov62_02239D60.c index 12646e5778..e938c2bff8 100644 --- a/src/overlay062/ov62_02239D60.c +++ b/src/overlay062/ov62_02239D60.c @@ -25,7 +25,7 @@ #include "overlay062/struct_ov62_02239DA4.h" #include "overlay062/struct_ov62_0223CAA4.h" #include "overlay062/struct_ov62_02248CDC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02002F38.h" @@ -584,11 +584,11 @@ static void ov62_0223A4C8 (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_348[1].unk_08, 1); sub_020129D0(v0->unk_348[1].unk_0C, 1); - sub_0200D4C4(v0->unk_348[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_348[0].unk_08, 32, 232); } else { sub_0200D3F4(v0->unk_348[1].unk_08, 0); sub_020129D0(v0->unk_348[1].unk_0C, 0); - sub_0200D4C4(v0->unk_348[0].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_348[0].unk_08, 80, 232); } sub_020128C4(v0->unk_348[0].unk_0C, 36, -8); @@ -1073,10 +1073,10 @@ static void ov62_0223ADC0 (UnkStruct_0208C06C * param0, int param1) static void ov62_0223AE60 (UnkStruct_0208C06C * param0) { UnkStruct_ov62_02239DBC * v0 = param0->unk_860; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; - UnkStruct_ov104_0223F9E0 v4; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; + SpriteTemplate v4; v1 = param0->unk_14.unk_04; v2 = param0->unk_14.unk_08; @@ -1104,23 +1104,23 @@ static void ov62_0223AE60 (UnkStruct_0208C06C * param0) sub_0200D888(v1, v2, 19, PokeIconSpriteIndex(v7, v9, v6), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 100000 + v5); - v4.unk_00 = 110 + ((v5 % 6) * 24); - v4.unk_02 = 48 + ((v5 / 6) * 22); - v4.unk_04 = 0; - v4.unk_06 = 0; - v4.unk_08 = 0; - v4.unk_0C = 0; - v4.unk_10 = 1; - v4.unk_2C = 0; - v4.unk_30 = 0; - v4.unk_14[0] = 100000 + v5; - v4.unk_14[1] = 100000; - v4.unk_14[2] = 100000; - v4.unk_14[3] = 100000; - v4.unk_14[4] = 0xffffffff; - v4.unk_14[5] = 0xffffffff; - - v0->unk_2B4[v5] = sub_0200CE6C(v1, v2, &v4); + v4.x = 110 + ((v5 % 6) * 24); + v4.y = 48 + ((v5 / 6) * 22); + v4.z = 0; + v4.animIdx = 0; + v4.priority = 0; + v4.plttIdx = 0; + v4.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v4.bgPriority = 0; + v4.transferToVRAM = FALSE; + v4.resources[0] = 100000 + v5; + v4.resources[1] = 100000; + v4.resources[2] = 100000; + v4.resources[3] = 100000; + v4.resources[4] = SPRITE_RESOURCE_NONE; + v4.resources[5] = SPRITE_RESOURCE_NONE; + + v0->unk_2B4[v5] = SpriteActor_LoadResources(v1, v2, &v4); v8 = PokeIconPaletteIndex(v7, v6, v9); sub_0200D430(v0->unk_2B4[v5], 4 + v8); @@ -1153,9 +1153,9 @@ static void ov62_0223AFEC (UnkStruct_0208C06C * param0) int v1; int v2; - sub_0200D080(param0->unk_14.unk_08, 100000); - sub_0200D090(param0->unk_14.unk_08, 100000); - sub_0200D0A0(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadCellObjById(param0->unk_14.unk_08, 100000); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_14.unk_08, 100000); for (v1 = 0; v1 < 30; v1++) { v2 = v0->unk_04.unk_28[v1]; @@ -1168,7 +1168,7 @@ static void ov62_0223AFEC (UnkStruct_0208C06C * param0) continue; } - sub_0200D070(param0->unk_14.unk_08, 100000 + v1); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + v1); sub_0200D0F4(v0->unk_2B4[v1]); v0->unk_2B4[v1] = NULL; } diff --git a/src/overlay062/ov62_0223CAEC.c b/src/overlay062/ov62_0223CAEC.c index a0b55bdeb6..3f950789bb 100644 --- a/src/overlay062/ov62_0223CAEC.c +++ b/src/overlay062/ov62_0223CAEC.c @@ -796,11 +796,11 @@ static void ov62_0223D3A8 (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_A4[0].unk_08, 1); sub_020129D0(v0->unk_A4[0].unk_0C, 1); - sub_0200D4C4(v0->unk_A4[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 128, 232); } else { sub_0200D3F4(v0->unk_A4[0].unk_08, 0); sub_020129D0(v0->unk_A4[0].unk_0C, 0); - sub_0200D4C4(v0->unk_A4[1].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 80, 232); } sub_020128C4(v0->unk_A4[0].unk_0C, 36, -8); @@ -821,8 +821,8 @@ static void ov62_0223D424 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_A4[0], ¶m0->unk_14, 53); ov62_0223124C(&v0->unk_A4[1], ¶m0->unk_14, 3); - sub_0200D4C4(v0->unk_A4[0].unk_08, 32, 232); - sub_0200D4C4(v0->unk_A4[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_A4[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_A4[1].unk_08, 128, 232); sub_020128C4(v0->unk_A4[0].unk_0C, 36, -8); sub_020128C4(v0->unk_A4[1].unk_0C, 36, -8); sub_020129D0(v0->unk_A4[0].unk_0C, 0); diff --git a/src/overlay062/ov62_0223DFA8.c b/src/overlay062/ov62_0223DFA8.c index 0e42d3308e..b1aaefddd6 100644 --- a/src/overlay062/ov62_0223DFA8.c +++ b/src/overlay062/ov62_0223DFA8.c @@ -207,7 +207,7 @@ static void ov62_0223DFA8 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 5; v1++) { for (v2 = 0; v2 < 6; v2++) { if (v3->unk_2008.unk_0C[v1][v2].unk_04) { - sub_0200D4C4(v3->unk_2008.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); + SpriteActor_SetSpritePositionXY(v3->unk_2008.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); } } } @@ -229,8 +229,8 @@ static void ov62_0223E01C (UnkStruct_0208C06C * param0) sub_0200D364(v0->unk_114[0].unk_08, 0); sub_0200D364(v0->unk_114[1].unk_08, 3); - sub_0200D4C4(v0->unk_114[0].unk_08, 32, 232); - sub_0200D4C4(v0->unk_114[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_114[1].unk_08, 128, 232); sub_020128C4(v0->unk_114[0].unk_0C, 36, -8); sub_020128C4(v0->unk_114[1].unk_0C, 36, -8); sub_020129D0(v0->unk_114[0].unk_0C, 1); @@ -873,7 +873,7 @@ static void ov62_0223EF60 (UnkStruct_0208C06C * param0) ov62_0223EE88(&v0->unk_114[v1], param0, v1 + 1); } - sub_0200D4C4(v0->unk_114[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); + SpriteActor_SetSpritePositionXY(v0->unk_114[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); sub_0200D364(v0->unk_114[v1].unk_08, v3[v1]); sub_020128C4(v0->unk_114[v1].unk_0C, 36, -8); sub_020129D0(v0->unk_114[v1].unk_0C, 1); @@ -911,11 +911,11 @@ static void ov62_0223F0A8 (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_114[1].unk_08, 1); sub_020129D0(v0->unk_114[1].unk_0C, 1); - sub_0200D4C4(v0->unk_114[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 32, 232); } else { sub_0200D3F4(v0->unk_114[1].unk_08, 0); sub_020129D0(v0->unk_114[1].unk_0C, 0); - sub_0200D4C4(v0->unk_114[0].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_114[0].unk_08, 80, 232); } sub_020128C4(v0->unk_114[0].unk_0C, 36, -8); @@ -2750,7 +2750,7 @@ static void ov62_02240E30 (UnkStruct_0208C06C * param0) continue; } - sub_0200D070(param0->unk_14.unk_08, 100000 + v4[v0]); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + v4[v0]); } ov62_02234540(param0, 0); diff --git a/src/overlay062/ov62_02241204.c b/src/overlay062/ov62_02241204.c index adf5415c2f..e346d19db5 100644 --- a/src/overlay062/ov62_02241204.c +++ b/src/overlay062/ov62_02241204.c @@ -322,7 +322,7 @@ static void ov62_02241204 (UnkStruct_0208C06C * param0) for (v1 = 0; v1 < 5; v1++) { for (v2 = 0; v2 < 6; v2++) { if (v3->unk_50C.unk_0C[v1][v2].unk_04) { - sub_0200D4C4(v3->unk_50C.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); + SpriteActor_SetSpritePositionXY(v3->unk_50C.unk_0C[v1][v2].unk_04, v0[(v1 * 6) + v2][0], v0[(v1 * 6) + v2][1]); } } } @@ -568,7 +568,7 @@ static void ov62_022414C0 (UnkStruct_0208C06C * param0) continue; } - sub_0200D070(param0->unk_14.unk_08, 100000 + v4[v0]); + SpriteGfxHandler_UnloadCharObjById(param0->unk_14.unk_08, 100000 + v4[v0]); } ov62_02234540(param0, 0); @@ -3255,7 +3255,7 @@ static void ov62_02244BE4 (UnkStruct_0208C06C * param0) ov62_022448E0(&v0->unk_10[v1], param0, v1 + 1); } - sub_0200D4C4(v0->unk_10[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); + SpriteActor_SetSpritePositionXY(v0->unk_10[v1].unk_08, 42 + 8, (25 + (36 * (v1)) + (16 * (5 - 4))) + 64); sub_0200D364(v0->unk_10[v1].unk_08, v3[v1]); sub_020128C4(v0->unk_10[v1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[v1].unk_0C, 1); @@ -4029,11 +4029,11 @@ static void ov62_02245AC8 (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_10[0].unk_08, 1); sub_020129D0(v0->unk_10[0].unk_0C, 1); - sub_0200D4C4(v0->unk_10[1].unk_08, 128, 232 - 64); + SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); } else { sub_0200D3F4(v0->unk_10[0].unk_08, 0); sub_020129D0(v0->unk_10[0].unk_0C, 0); - sub_0200D4C4(v0->unk_10[1].unk_08, 80, 232 - 64); + SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 80, 232 - 64); } sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); @@ -4054,8 +4054,8 @@ static void ov62_02245B24 (UnkStruct_0208C06C * param0) ov62_0223124C(&v0->unk_10[0], ¶m0->unk_14, 3); ov62_0223124C(&v0->unk_10[1], ¶m0->unk_14, 111); - sub_0200D4C4(v0->unk_10[0].unk_08, 32, 232 - 64); - sub_0200D4C4(v0->unk_10[1].unk_08, 128, 232 - 64); + SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232 - 64); + SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232 - 64); sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); sub_020128C4(v0->unk_10[1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[0].unk_0C, 1); @@ -4086,11 +4086,11 @@ static void ov62_02245C08 (UnkStruct_0208C06C * param0, int param1) if (param1 == 0) { sub_0200D3F4(v0->unk_10[1].unk_08, 1); sub_020129D0(v0->unk_10[1].unk_0C, 1); - sub_0200D4C4(v0->unk_10[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232); } else { sub_0200D3F4(v0->unk_10[1].unk_08, 0); sub_020129D0(v0->unk_10[1].unk_0C, 0); - sub_0200D4C4(v0->unk_10[0].unk_08, 80, 232); + SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 80, 232); } sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); @@ -4121,8 +4121,8 @@ static void ov62_02245C64 (UnkStruct_0208C06C * param0) sub_0200D364(v0->unk_10[1].unk_08, 3); } - sub_0200D4C4(v0->unk_10[0].unk_08, 32, 232); - sub_0200D4C4(v0->unk_10[1].unk_08, 128, 232); + SpriteActor_SetSpritePositionXY(v0->unk_10[0].unk_08, 32, 232); + SpriteActor_SetSpritePositionXY(v0->unk_10[1].unk_08, 128, 232); sub_020128C4(v0->unk_10[0].unk_0C, 36, -8); sub_020128C4(v0->unk_10[1].unk_0C, 36, -8); sub_020129D0(v0->unk_10[0].unk_0C, 1); diff --git a/src/overlay062/ov62_02246B00.c b/src/overlay062/ov62_02246B00.c index b81aeadc8d..1e42ef7d2a 100644 --- a/src/overlay062/ov62_02246B00.c +++ b/src/overlay062/ov62_02246B00.c @@ -15,7 +15,7 @@ #include "overlay062/struct_ov62_02246B00.h" #include "overlay062/struct_ov62_02246BF4.h" #include "overlay062/struct_ov62_02246BF4_sub1.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02005474.h" #include "unk_02006E3C.h" @@ -585,9 +585,9 @@ void ov62_02247574 (UnkStruct_ov62_02246BF4 * param0) { NARC * v0; BGL * v1; - CellTransferStateData * v2; - AnimationResourceCollection * v3; - PaletteSys * v4; + SpriteRenderer * v2; + SpriteGfxHandler * v3; + PaletteData * v4; v2 = param0->unk_220.unk_04; v3 = param0->unk_220.unk_08; @@ -597,14 +597,14 @@ void ov62_02247574 (UnkStruct_ov62_02246BF4 * param0) sub_020070E8(v0, 54, param0->unk_220.unk_0C, 3, 0, 0, 0, 102); sub_0200710C(v0, 43, v1, 3, 0, 0, 0, 102); - sub_0200CDC4(v4, 2, v2, v3, v0, 44, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); - sub_0200CC3C(v2, v3, v0, 40, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); - sub_0200CE24(v2, v3, v0, 41, 0, 1000); - sub_0200CE54(v2, v3, v0, 42, 0, 1000); - sub_0200CDC4(v4, 2, v2, v3, v0, 88, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); - sub_0200CC3C(v2, v3, v0, 87, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); - sub_0200CE24(v2, v3, v0, 85, 0, 1001); - sub_0200CE54(v2, v3, v0, 86, 0, 1001); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 44, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 40, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 41, 0, 1000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 42, 0, 1000); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 88, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 87, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 85, 0, 1001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 86, 0, 1001); } void ov62_02247694 (UnkStruct_ov62_02246BF4 * param0) @@ -623,14 +623,14 @@ void ov62_02247694 (UnkStruct_ov62_02246BF4 * param0) sub_0200D0F4(param0->unk_188[v0].unk_0C); } - sub_0200D070(param0->unk_220.unk_08, 1000); - sub_0200D080(param0->unk_220.unk_08, 1000); - sub_0200D090(param0->unk_220.unk_08, 1000); - sub_0200D0A0(param0->unk_220.unk_08, 1000); - sub_0200D070(param0->unk_220.unk_08, 1001); - sub_0200D080(param0->unk_220.unk_08, 1001); - sub_0200D090(param0->unk_220.unk_08, 1001); - sub_0200D0A0(param0->unk_220.unk_08, 1001); + SpriteGfxHandler_UnloadCharObjById(param0->unk_220.unk_08, 1000); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_220.unk_08, 1000); + SpriteGfxHandler_UnloadCellObjById(param0->unk_220.unk_08, 1000); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_220.unk_08, 1000); + SpriteGfxHandler_UnloadCharObjById(param0->unk_220.unk_08, 1001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_220.unk_08, 1001); + SpriteGfxHandler_UnloadCellObjById(param0->unk_220.unk_08, 1001); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_220.unk_08, 1001); } void ov62_02247754 (UnkStruct_ov62_02246BF4 * param0) @@ -638,41 +638,41 @@ void ov62_02247754 (UnkStruct_ov62_02246BF4 * param0) int v0; int v1 = 0; int v2 = 0; - UnkStruct_ov104_0223F9E0 v3; - CellTransferStateData * v4; - AnimationResourceCollection * v5; - PaletteSys * v6; + SpriteTemplate v3; + SpriteRenderer * v4; + SpriteGfxHandler * v5; + PaletteData * v6; v4 = param0->unk_220.unk_04; v5 = param0->unk_220.unk_08; v6 = param0->unk_220.unk_10; - v3.unk_00 = 0; - v3.unk_02 = 0; - v3.unk_04 = 0; - v3.unk_06 = 0; - v3.unk_08 = 10; - v3.unk_10 = 1; - v3.unk_2C = 0; - v3.unk_30 = 0; - v3.unk_0C = 0; - v3.unk_14[0] = 1000; - v3.unk_14[1] = 1000; - v3.unk_14[2] = 1000; - v3.unk_14[3] = 1000; - v3.unk_14[4] = 0xffffffff; - v3.unk_14[5] = 0xffffffff; + v3.x = 0; + v3.y = 0; + v3.z = 0; + v3.animIdx = 0; + v3.priority = 10; + v3.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v3.bgPriority = 0; + v3.transferToVRAM = FALSE; + v3.plttIdx = 0; + v3.resources[0] = 1000; + v3.resources[1] = 1000; + v3.resources[2] = 1000; + v3.resources[3] = 1000; + v3.resources[4] = SPRITE_RESOURCE_NONE; + v3.resources[5] = SPRITE_RESOURCE_NONE; for (v0 = 0; v0 < param0->unk_204 + 3 - 1; v0++) { if (v0 == (param0->unk_150[v2].unk_00 + v2 + 1)) { - param0->unk_150[v2].unk_0C = sub_0200CE6C(v4, v5, &v3); - sub_0200D4C4(param0->unk_150[v2].unk_0C, 72 + (v0 * 8) + 4, 24); + param0->unk_150[v2].unk_0C = SpriteActor_LoadResources(v4, v5, &v3); + SpriteActor_SetSpritePositionXY(param0->unk_150[v2].unk_0C, 72 + (v0 * 8) + 4, 24); sub_0200D364(param0->unk_150[v2].unk_0C, 22); sub_0200D330(param0->unk_150[v2].unk_0C); v2++; } else { - param0->unk_00[v1].unk_0C = sub_0200CE6C(v4, v5, &v3); - sub_0200D4C4(param0->unk_00[v1].unk_0C, 72 + (v0 * 8) + 4, 24); + param0->unk_00[v1].unk_0C = SpriteActor_LoadResources(v4, v5, &v3); + SpriteActor_SetSpritePositionXY(param0->unk_00[v1].unk_0C, 72 + (v0 * 8) + 4, 24); sub_0200D364(param0->unk_00[v1].unk_0C, ov62_02247B3C(param0->unk_00[v1].unk_00, param0->unk_00[v1].unk_08)); sub_0200D6A4(param0->unk_00[v1].unk_0C, 0); sub_0200D330(param0->unk_00[v1].unk_0C); @@ -683,34 +683,34 @@ void ov62_02247754 (UnkStruct_ov62_02246BF4 * param0) void ov62_0224784C (UnkStruct_ov62_02246BF4 * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteTemplate v0; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; v1 = param0->unk_220.unk_04; v2 = param0->unk_220.unk_08; v3 = param0->unk_220.unk_10; - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 0; - v0.unk_10 = 1; - v0.unk_2C = 0; - v0.unk_30 = 0; - v0.unk_0C = 0; - v0.unk_14[0] = 1001; - v0.unk_14[1] = 1001; - v0.unk_14[2] = 1001; - v0.unk_14[3] = 1001; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; - - param0->unk_188[0].unk_0C = sub_0200CE6C(v1, v2, &v0); - param0->unk_188[1].unk_0C = sub_0200CE6C(v1, v2, &v0); - param0->unk_188[2].unk_0C = sub_0200CE6C(v1, v2, &v0); + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 0; + v0.transferToVRAM = FALSE; + v0.plttIdx = 0; + v0.resources[0] = 1001; + v0.resources[1] = 1001; + v0.resources[2] = 1001; + v0.resources[3] = 1001; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_188[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_188[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_188[2].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); ov62_02247998(param0, 0); sub_0200D364(param0->unk_188[0].unk_0C, 0); @@ -723,7 +723,7 @@ void ov62_0224784C (UnkStruct_ov62_02246BF4 * param0) ov62_022479D4(param0, 0); sub_0200D364(param0->unk_188[1].unk_0C, param0->unk_188[1].unk_00); sub_0200D330(param0->unk_188[1].unk_0C); - sub_0200D810(param0->unk_188[1].unk_0C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_188[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_188[2].unk_14.unk_00 = 0; param0->unk_188[2].unk_14.unk_02 = 0; @@ -732,7 +732,7 @@ void ov62_0224784C (UnkStruct_ov62_02246BF4 * param0) ov62_022479D4(param0, 0); sub_0200D364(param0->unk_188[2].unk_0C, param0->unk_188[2].unk_00); sub_0200D330(param0->unk_188[2].unk_0C); - sub_0200D810(param0->unk_188[2].unk_0C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_188[2].unk_0C, GX_OAM_MODE_XLU); ov62_02247968(param0, 1, 0); ov62_02247968(param0, 2, 0); } @@ -754,8 +754,8 @@ void ov62_02247998 (UnkStruct_ov62_02246BF4 * param0, int param1) v2 = param0->unk_00[param1].unk_0C; param0->unk_188[0].unk_00 = param1; - sub_0200D550(v2, &v0, &v1); - sub_0200D4C4(param0->unk_188[0].unk_0C, v0, v1 + 16); + SpriteActor_GetSpritePositionXY(v2, &v0, &v1); + SpriteActor_SetSpritePositionXY(param0->unk_188[0].unk_0C, v0, v1 + 16); } void ov62_022479D4 (UnkStruct_ov62_02246BF4 * param0, int param1) @@ -765,7 +765,7 @@ void ov62_022479D4 (UnkStruct_ov62_02246BF4 * param0, int param1) v0 = (param0->unk_220.unk_18[param1 + 12].val1.unk_02 + param0->unk_220.unk_18[param1 + 12].val1.unk_03) / 2; v1 = (param0->unk_220.unk_18[param1 + 12].val1.unk_00 + param0->unk_220.unk_18[param1 + 12].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_188[1].unk_0C, v0 - 0, v1 - 8); + SpriteActor_SetSpritePositionXY(param0->unk_188[1].unk_0C, v0 - 0, v1 - 8); } void ov62_02247A20 (UnkStruct_ov62_02246BF4 * param0, int param1, int param2) @@ -775,7 +775,7 @@ void ov62_02247A20 (UnkStruct_ov62_02246BF4 * param0, int param1, int param2) v0 = (param0->unk_220.unk_18[param1 + 12].val1.unk_02 + param0->unk_220.unk_18[param1 + 12].val1.unk_03) / 2; v1 = (param0->unk_220.unk_18[param1 + 12].val1.unk_00 + param0->unk_220.unk_18[param1 + 12].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_188[param2].unk_0C, v0 - 0, v1 - 8); + SpriteActor_SetSpritePositionXY(param0->unk_188[param2].unk_0C, v0 - 0, v1 - 8); } void ov62_02247A70 (UnkStruct_ov62_02246BF4 * param0) @@ -877,10 +877,10 @@ void ov62_02247B88 (UnkStruct_ov62_02246BF4 * param0, int param1) } } - sub_0200D550(param0->unk_00[v0].unk_0C, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { - sub_0200D4C4(param0->unk_00[v0].unk_0C, v2, v4); + SpriteActor_SetSpritePositionXY(param0->unk_00[v0].unk_0C, v2, v4); } else { param0->unk_00[v0].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_00[v0].unk_14.unk_02 = 0; @@ -889,7 +889,7 @@ void ov62_02247B88 (UnkStruct_ov62_02246BF4 * param0, int param1) } if ((v0 == param0->unk_150[v1].unk_00) && (v1 != 3 - 1)) { - sub_0200D550(param0->unk_150[v1].unk_0C, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_150[v1].unk_0C, &v3, &v4); if (param0->unk_210 == param0->unk_214) { v2 += 8; @@ -902,7 +902,7 @@ void ov62_02247B88 (UnkStruct_ov62_02246BF4 * param0, int param1) } if (param1 == 0) { - sub_0200D4C4(param0->unk_150[v1].unk_0C, v2, v4); + SpriteActor_SetSpritePositionXY(param0->unk_150[v1].unk_0C, v2, v4); } else { param0->unk_150[v1].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_150[v1].unk_14.unk_02 = 0; @@ -921,7 +921,7 @@ static inline void inline_ov62_02247CE0 (UnkStruct_ov62_02246BF4 * param0, int p v2 = ¶m0->unk_00[param1]; - sub_0200D550(v2->unk_0C, &v0, &v1); + SpriteActor_GetSpritePositionXY(v2->unk_0C, &v0, &v1); v2->unk_10->val1.unk_00 = v1 - param3; v2->unk_10->val1.unk_02 = v0 - param2; diff --git a/src/overlay063/ov63_0222AE60.c b/src/overlay063/ov63_0222AE60.c index d16207bb63..ce0ba0b9d8 100644 --- a/src/overlay063/ov63_0222AE60.c +++ b/src/overlay063/ov63_0222AE60.c @@ -50,7 +50,7 @@ typedef struct { typedef struct UnkStruct_ov63_0222AE60_t { GraphicElementManager * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; UnkStruct_ov63_0222BB38 * unk_08; u32 unk_0C; UnkStruct_ov63_0222BB38_sub1 unk_10[151]; @@ -302,7 +302,7 @@ static const u8 Unk_ov63_0222D904[10] = { 0x0 }; -UnkStruct_ov63_0222AE60 * ov63_0222AE60 (GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3) +UnkStruct_ov63_0222AE60 * ov63_0222AE60 (GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3) { UnkStruct_ov63_0222AE60 * v0; int v1; @@ -472,9 +472,9 @@ UnkStruct_ov63_0222BB38 * ov63_0222B0C0 (UnkStruct_ov63_0222AE60 * param0, const sub_02021E80(v0->unk_04, param1->unk_06); if (param0->unk_10[v2].unk_10 == 1) { - sub_02021D6C(v0->unk_04, 5 + 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 5 + 1); } else { - sub_02021D6C(v0->unk_04, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_04, 1); } v0->unk_0C = 9; @@ -580,7 +580,7 @@ int ov63_0222B2C4 (const UnkStruct_ov63_0222BB38 * param0) void ov63_0222B2C8 (UnkStruct_ov63_0222BB38 * param0, u16 param1) { - sub_02021E50(param0->unk_04, param1); + SpriteActor_SetAnimFrame(param0->unk_04, param1); } u16 ov63_0222B2D4 (const UnkStruct_ov63_0222BB38 * param0) @@ -1080,9 +1080,9 @@ static void ov63_0222BBF0 (UnkStruct_ov63_0222BB38 * param0) static void ov63_0222BC00 (UnkStruct_ov63_0222BB38 * param0) { if (param0->unk_14 == 0) { - sub_02021E50(param0->unk_04, 1); + SpriteActor_SetAnimFrame(param0->unk_04, 1); } else { - sub_02021D6C(param0->unk_04, 5 + param0->unk_10); + SpriteActor_SetSpriteAnimActive(param0->unk_04, 5 + param0->unk_10); } } diff --git a/src/overlay063/ov63_0222CCE4.c b/src/overlay063/ov63_0222CCE4.c index beb63e5ba2..a217a1f9c9 100644 --- a/src/overlay063/ov63_0222CCE4.c +++ b/src/overlay063/ov63_0222CCE4.c @@ -23,7 +23,7 @@ static int ov63_0222D0C4(const UnkStruct_ov63_0222BB38 * param0, int param1); static void ov63_0222D0E0(const UnkStruct_ov63_0222CE44 * param0, s16 * param1, s16 * param2); static void ov63_0222D110(UnkStruct_ov63_0222CE44 * param0, int param1, int param2); -UnkStruct_ov63_0222CD2C * ov63_0222CCE4 (GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3, u32 param4) +UnkStruct_ov63_0222CD2C * ov63_0222CCE4 (GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3, u32 param4) { UnkStruct_ov63_0222CD2C * v0; @@ -40,7 +40,7 @@ UnkStruct_ov63_0222CD2C * ov63_0222CCE4 (GraphicElementManager * param0, Palette return v0; } -UnkStruct_ov63_0222CD2C * ov63_0222CD2C (GraphicElementManager * param0, PaletteSys * param1, u32 param2, u32 param3, int param4, u32 param5, u32 param6) +UnkStruct_ov63_0222CD2C * ov63_0222CD2C (GraphicElementManager * param0, PaletteData * param1, u32 param2, u32 param3, int param4, u32 param5, u32 param6) { UnkStruct_ov63_0222CD2C * v0; diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index c1b861184b..4c3a2d6bf1 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -1246,7 +1246,7 @@ static void ov64_0222E9A4 (UnkStruct_ov64_0222E21C * param0, u32 param1) sub_02021CC8(param0->unk_270[v1], 1); sub_02021CAC(param0->unk_270[v1], 0); - sub_02021D6C(param0->unk_270[v1], v1); + SpriteActor_SetSpriteAnimActive(param0->unk_270[v1], v1); } } @@ -2648,7 +2648,7 @@ static void ov64_0222FF5C (UnkStruct_ov64_0222F0C4 * param0) u32 v1; sub_02021CAC(param0->unk_104, 1); - sub_02021D6C(param0->unk_104, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_104, 2); param0->unk_108 = 0; diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index a47f298111..13d4049c61 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -6709,7 +6709,7 @@ static void ov65_02234A68 (UnkStruct_ov65_0222EBE0 * param0, NARC * param1, u32 param0->unk_BE0.unk_21C[v1] = sub_02021AA0(&v9[v1]); - sub_02021D6C(param0->unk_BE0.unk_21C[v1], Unk_ov65_02238930[v1]); + SpriteActor_SetSpriteAnimActive(param0->unk_BE0.unk_21C[v1], Unk_ov65_02238930[v1]); } sub_02002BB8(2, param2); @@ -6838,8 +6838,8 @@ static void ov65_02234E40 (u32 param0, u32 param1, void * param2) static void ov65_02234E50 (UnkStruct_ov65_02234E50 * param0, u32 param1) { - sub_02021D6C(param0->unk_21C[param1], Unk_ov65_02238930[param1]); - sub_02021E50(param0->unk_21C[param1], (5 - 1)); + SpriteActor_SetSpriteAnimActive(param0->unk_21C[param1], Unk_ov65_02238930[param1]); + SpriteActor_SetAnimFrame(param0->unk_21C[param1], (5 - 1)); if (param1 == 1) { sub_020128C4(param0->unk_234, -18, Unk_ov65_0223893C[0]); @@ -6857,7 +6857,7 @@ static BOOL ov65_02234E8C (UnkStruct_ov65_02234E50 * param0, u32 param1, u32 par if ((param3 == 0) || (param3 == 2)) { if (param3 == 0) { - sub_02021D6C(param0->unk_21C[param1], Unk_ov65_0223892C[param1]); + SpriteActor_SetSpriteAnimActive(param0->unk_21C[param1], Unk_ov65_0223892C[param1]); } if (v1 < 3) { @@ -6882,8 +6882,8 @@ static BOOL ov65_02234E8C (UnkStruct_ov65_02234E50 * param0, u32 param1, u32 par v1 = sub_02021E74(param0->unk_21C[param1]); if (v2 == Unk_ov65_0223892C[param1]) { - sub_02021D6C(param0->unk_21C[param1], Unk_ov65_02238930[param1]); - sub_02021E50(param0->unk_21C[param1], (5 - 1) - v1); + SpriteActor_SetSpriteAnimActive(param0->unk_21C[param1], Unk_ov65_02238930[param1]); + SpriteActor_SetAnimFrame(param0->unk_21C[param1], (5 - 1) - v1); } sub_02021E2C(param0->unk_21C[param1], FX32_CONST(2)); diff --git a/src/overlay065/ov65_02235060.c b/src/overlay065/ov65_02235060.c index ddbbc9d268..6e808a620b 100644 --- a/src/overlay065/ov65_02235060.c +++ b/src/overlay065/ov65_02235060.c @@ -697,7 +697,7 @@ static void ov65_02235A94 (UnkStruct_ov65_022358CC * param0, u32 param1) sub_02021CAC(param0->unk_1A0.unk_34, 0); sub_02021CAC(param0->unk_1A0.unk_38, 0); sub_02021CC8(param0->unk_1A0.unk_34, 1); - sub_02021D6C(param0->unk_1A0.unk_38, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1A0.unk_38, 1); } static void ov65_02235B14 (UnkStruct_ov65_022358CC * param0) diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index 30f63dcdcd..7267d6a054 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -1700,7 +1700,7 @@ static void ov70_0225EC20 (UnkStruct_ov70_0225EC20 * param0, UnkStruct_ov70_0225 v1.unk_08.y = Unk_ov70_0226D580[v2] * FX32_ONE; param0->unk_50[v2] = sub_02021B90(&v1); - sub_02021D6C(param0->unk_50[v2], v2); + SpriteActor_SetSpriteAnimActive(param0->unk_50[v2], v2); sub_02021CC8(param0->unk_50[v2], 1); sub_02021CAC(param0->unk_50[v2], 0); } @@ -2753,7 +2753,7 @@ static void ov70_0225FEF0 (UnkStruct_ov70_0225FA84 * param0, UnkStruct_ov70_0225 v4.unk_08.y = (FX32_CONST(152) + (256 * FX32_ONE)); param0->unk_54 = sub_02021B90(&v4); - sub_02021D6C(param0->unk_54, v1); + SpriteActor_SetSpriteAnimActive(param0->unk_54, v1); sub_02021CAC(param0->unk_54, param5); } } diff --git a/src/overlay071/ov71_0223B140.c b/src/overlay071/ov71_0223B140.c index ec8fcdce8c..88dbc4839d 100644 --- a/src/overlay071/ov71_0223B140.c +++ b/src/overlay071/ov71_0223B140.c @@ -284,7 +284,7 @@ int ov71_0223B388 (UnkStruct_020067E8 * param0, int * param1) sub_02021CAC(v0->unk_30E4.unk_1C0[((8 + 8) + 8)], 1); sub_02021CC8(v0->unk_30E4.unk_1C0[((8 + 8) + 8)], 1); - sub_02021D6C(v0->unk_30E4.unk_1C0[((8 + 8) + 8)], 10); + SpriteActor_SetSpriteAnimActive(v0->unk_30E4.unk_1C0[((8 + 8) + 8)], 10); v0->unk_337E = 0; v0->unk_3380 = 0; diff --git a/src/overlay071/ov71_0223CF0C.c b/src/overlay071/ov71_0223CF0C.c index d912774d73..ec930c7ed4 100644 --- a/src/overlay071/ov71_0223CF0C.c +++ b/src/overlay071/ov71_0223CF0C.c @@ -130,7 +130,7 @@ void ov71_0223D070 (UnkStruct_ov71_0223D238 * param0, const u8 * param1) v3.unk_08.y = FX32_ONE * Unk_ov71_0223D73C[v0].unk_04; param0->unk_1C0[v0] = sub_02021AA0(&v3); sub_02021CC8(param0->unk_1C0[v0], 0); - sub_02021D6C(param0->unk_1C0[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_1C0[v0], v0); if (!param1[v0]) { sub_02021CAC(param0->unk_1C0[v0], 0); @@ -146,7 +146,7 @@ void ov71_0223D070 (UnkStruct_ov71_0223D238 * param0, const u8 * param1) v3.unk_24 = 1; param0->unk_1C0[v2 + v0] = sub_02021AA0(&v3); sub_02021CC8(param0->unk_1C0[v2 + v0], 1); - sub_02021D6C(param0->unk_1C0[v2 + v0], 8); + SpriteActor_SetSpriteAnimActive(param0->unk_1C0[v2 + v0], 8); sub_02021CAC(param0->unk_1C0[v2 + v0], 0); } @@ -158,7 +158,7 @@ void ov71_0223D070 (UnkStruct_ov71_0223D238 * param0, const u8 * param1) v3.unk_24 = 1; param0->unk_1C0[v2 + v0] = sub_02021AA0(&v3); sub_02021CC8(param0->unk_1C0[v2 + v0], 1); - sub_02021D6C(param0->unk_1C0[v2 + v0], 9); + SpriteActor_SetSpriteAnimActive(param0->unk_1C0[v2 + v0], 9); sub_02021CAC(param0->unk_1C0[v2 + v0], 0); } } @@ -171,7 +171,7 @@ void ov71_0223D070 (UnkStruct_ov71_0223D238 * param0, const u8 * param1) v3.unk_24 = 0; param0->unk_1C0[v2] = sub_02021AA0(&v3); sub_02021CC8(param0->unk_1C0[v2], 0); - sub_02021D6C(param0->unk_1C0[v2], 10); + SpriteActor_SetSpriteAnimActive(param0->unk_1C0[v2], 10); sub_02021CAC(param0->unk_1C0[v2], 0); } } diff --git a/src/overlay072/ov72_0223D7A0.c b/src/overlay072/ov72_0223D7A0.c index 3573abe133..69ceda43ff 100644 --- a/src/overlay072/ov72_0223D7A0.c +++ b/src/overlay072/ov72_0223D7A0.c @@ -543,7 +543,7 @@ static void ov72_0223DF58 (UnkStruct_ov72_0223DB98 * param0) param0->unk_2B4[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_2B4[v0], 1); - sub_02021D6C(param0->unk_2B4[v0], Unk_ov72_0223EB3C[v0][2]); + SpriteActor_SetSpriteAnimActive(param0->unk_2B4[v0], Unk_ov72_0223EB3C[v0][2]); sub_02021E90(param0->unk_2B4[v0], 0); if (v0 == 0) { @@ -703,9 +703,9 @@ static void ov72_0223E388 (GraphicElementData ** param0, int param1) for (v0 = 0; v0 < 1; v0++) { if (v0 == param1) { - sub_02021D6C(param0[v0], Unk_ov72_0223EB3C[v0][2] + 1); + SpriteActor_SetSpriteAnimActive(param0[v0], Unk_ov72_0223EB3C[v0][2] + 1); } else { - sub_02021D6C(param0[v0], Unk_ov72_0223EB3C[v0][2]); + SpriteActor_SetSpriteAnimActive(param0[v0], Unk_ov72_0223EB3C[v0][2]); } } } @@ -713,9 +713,9 @@ static void ov72_0223E388 (GraphicElementData ** param0, int param1) static void ov72_0223E3A8 (GraphicElementData ** param0, BOOL param1) { if (param1 == 1) { - sub_02021D6C(param0[0], Unk_ov72_0223EB3C[0][2] + 1); + SpriteActor_SetSpriteAnimActive(param0[0], Unk_ov72_0223EB3C[0][2] + 1); } else { - sub_02021D6C(param0[0], Unk_ov72_0223EB3C[0][2]); + SpriteActor_SetSpriteAnimActive(param0[0], Unk_ov72_0223EB3C[0][2]); } } diff --git a/src/overlay074/ov74_021D0D80.c b/src/overlay074/ov74_021D0D80.c index faf70d7be5..a63c522979 100644 --- a/src/overlay074/ov74_021D0D80.c +++ b/src/overlay074/ov74_021D0D80.c @@ -71,8 +71,8 @@ typedef struct UnkStruct_ov74_021D0D80_t { UnkStruct_ov74_021D1720 unk_5C[7]; UIControlData * unk_2A8; u32 unk_2AC; - CellTransferStateData * unk_2B0; - AnimationResourceCollection * unk_2B4; + SpriteRenderer * unk_2B0; + SpriteGfxHandler * unk_2B4; CellActorData * unk_2B8; } UnkStruct_ov74_021D0D80; diff --git a/src/overlay075/ov75_021D0D80.c b/src/overlay075/ov75_021D0D80.c index 97a4fd74d4..a729788c93 100644 --- a/src/overlay075/ov75_021D0D80.c +++ b/src/overlay075/ov75_021D0D80.c @@ -23,7 +23,7 @@ #include "overlay061/struct_ov61_0222C884.h" #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -93,15 +93,15 @@ typedef struct { UnkStruct_020978D8 * unk_1C; MessageLoader * unk_20; Strbuf* unk_24[3]; - PaletteSys * unk_30; + PaletteData * unk_30; void * unk_34; void * unk_38; NNSG2dScreenData * unk_3C; NNSG2dScreenData * unk_40; Window unk_44[6]; UIControlData * unk_A4; - CellTransferStateData * unk_A8; - AnimationResourceCollection * unk_AC; + SpriteRenderer * unk_A8; + SpriteGfxHandler * unk_AC; CellActorData * unk_B0[3]; } UnkStruct_ov75_021D1184; @@ -872,7 +872,7 @@ static void ov75_021D19C8 (UnkStruct_ov75_021D1184 * param0) static void ov75_021D1ADC (UnkStruct_ov75_021D1184 * param0) { int v0 = 0, v1 = 0; - UnkStruct_ov104_0223F9E0 v2; + SpriteTemplate v2; sub_020397E4(); @@ -912,26 +912,26 @@ static void ov75_021D1ADC (UnkStruct_ov75_021D1184 * param0) } sub_0200D828(param0->unk_A8, param0->unk_AC, 19, param0->unk_1C->unk_14[v0].val1_0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v0); - MI_CpuClear8(&v2, sizeof(UnkStruct_ov104_0223F9E0)); - - v2.unk_00 = (16 * 8) - (40 * v0); - v2.unk_02 = 160; - v2.unk_04 = 0; - - v2.unk_06 = 0; - v2.unk_2C = 2; - v2.unk_0C = param0->unk_1C->unk_14[v0].val1_12; - v2.unk_30 = 0; - v2.unk_10 = NNS_G2D_VRAM_TYPE_2DMAIN; - - v2.unk_14[0] = v0; - v2.unk_14[1] = 0; - v2.unk_14[2] = 0; - v2.unk_14[3] = 0; - v2.unk_14[4] = 0xffffffff; - v2.unk_14[5] = 0xffffffff; - - param0->unk_B0[v0] = sub_0200CE6C(param0->unk_A8, param0->unk_AC, &v2); + MI_CpuClear8(&v2, sizeof(SpriteTemplate)); + + v2.x = (16 * 8) - (40 * v0); + v2.y = 160; + v2.z = 0; + + v2.animIdx = 0; + v2.bgPriority = 2; + v2.plttIdx = param0->unk_1C->unk_14[v0].val1_12; + v2.transferToVRAM = FALSE; + v2.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + + v2.resources[0] = v0; + v2.resources[1] = 0; + v2.resources[2] = 0; + v2.resources[3] = 0; + v2.resources[4] = SPRITE_RESOURCE_NONE; + v2.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_B0[v0] = SpriteActor_LoadResources(param0->unk_A8, param0->unk_AC, &v2); if (param0->unk_1C->unk_14[v0].val1_0 == 7) { sub_0200D3F4(param0->unk_B0[v0], 0); diff --git a/src/overlay076/ov76_0223B140.c b/src/overlay076/ov76_0223B140.c index 993934f8d4..8e6ff66f60 100644 --- a/src/overlay076/ov76_0223B140.c +++ b/src/overlay076/ov76_0223B140.c @@ -13,7 +13,7 @@ #include "struct_defs/struct_0202CA28.h" #include "overlay076/struct_ov76_0223B52C.h" #include "overlay076/struct_ov76_0223DE00.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "game_overlay.h" #include "unk_0200C6E4.h" @@ -57,11 +57,11 @@ void ov76_0223B184 (UnkUnion_02022594 * param0, CellActorData * param1, BOOL par } if (param2 == 1) { - sub_0200D4C4(param1, gCoreSys.touchX, gCoreSys.touchY); - sub_0200D550(param1, &v0, &v1); + SpriteActor_SetSpritePositionXY(param1, gCoreSys.touchX, gCoreSys.touchY); + SpriteActor_GetSpritePositionXY(param1, &v0, &v1); ov76_0223B174(param0); } else { - sub_0200D550(param1, &v0, &v1); + SpriteActor_GetSpritePositionXY(param1, &v0, &v1); ov76_0223B15C(param0, v0, v1); } } @@ -176,9 +176,9 @@ void ov76_0223B36C (UnkStruct_ov76_0223DE00 * param0, u8 param1, u8 param2) { int v0; int v1; - CellTransferStateData * v2; - AnimationResourceCollection * v3; - PaletteSys * v4; + SpriteRenderer * v2; + SpriteGfxHandler * v3; + PaletteData * v4; v2 = param0->unk_D4.unk_08; v3 = param0->unk_D4.unk_0C; @@ -276,10 +276,10 @@ BOOL ov76_0223B52C (UnkStruct_ov76_0223DE00 * param0, u8 param1) int v0; int v1; UnkStruct_ov76_0223B52C * v2; - UnkStruct_ov104_0223F9E0 v3; - CellTransferStateData * v4; - AnimationResourceCollection * v5; - PaletteSys * v6; + SpriteTemplate v3; + SpriteRenderer * v4; + SpriteGfxHandler * v5; + PaletteData * v6; v4 = param0->unk_D4.unk_08; v5 = param0->unk_D4.unk_0C; @@ -293,26 +293,26 @@ BOOL ov76_0223B52C (UnkStruct_ov76_0223DE00 * param0, u8 param1) ov76_0223B36C(param0, v2->unk_04, param1); - v3.unk_00 = v2->unk_05; - v3.unk_02 = v2->unk_06; - v3.unk_04 = 0; - v3.unk_06 = 0; - v3.unk_0C = 0; - v3.unk_30 = 0; - v3.unk_08 = 0; - v3.unk_10 = 2; - v3.unk_2C = 1; - v3.unk_14[4] = 0xffffffff; - v3.unk_14[5] = 0xffffffff; + v3.x = v2->unk_05; + v3.y = v2->unk_06; + v3.z = 0; + v3.animIdx = 0; + v3.plttIdx = 0; + v3.transferToVRAM = FALSE; + v3.priority = 0; + v3.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v3.bgPriority = 1; + v3.resources[4] = SPRITE_RESOURCE_NONE; + v3.resources[5] = SPRITE_RESOURCE_NONE; v0 = sub_02098140(v2->unk_04); v1 = (param1 + 20000); - v3.unk_14[0] = v1; - v3.unk_14[1] = 21000 + 293; - v3.unk_14[2] = 22000 + 93; - v3.unk_14[3] = 23000 + 1; - v2->unk_08 = sub_0200CE6C(v4, v5, &v3); + v3.resources[0] = v1; + v3.resources[1] = 21000 + 293; + v3.resources[2] = 22000 + 93; + v3.resources[3] = 23000 + 1; + v2->unk_08 = SpriteActor_LoadResources(v4, v5, &v3); sub_0200D330(v2->unk_08); @@ -403,7 +403,7 @@ BOOL ov76_0223B6C4 (UnkStruct_ov76_0223DE00 * param0, int param1) return 1; } - sub_0200D550(param0->unk_324[param1].unk_08, &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_324[param1].unk_08, &v1, &v2); v0 = ov12_02237E54(v1, v2, 190, 70); if (v0 > 60) { @@ -421,7 +421,7 @@ void ov76_0223B704 (UnkStruct_ov76_0223DE00 * param0, int param1) v0 = sub_02098140(param0->unk_324[param1].unk_04); v1 = (param1 + 20000); - sub_0200D070(param0->unk_D4.unk_0C, v1); + SpriteGfxHandler_UnloadCharObjById(param0->unk_D4.unk_0C, v1); sub_0200D0F4(param0->unk_324[param1].unk_08); param0->unk_324[param1].unk_08 = NULL; @@ -440,9 +440,9 @@ void ov76_0223B758 (UnkStruct_ov76_0223DE00 * param0, int param1) v0 = ov76_0223B6C4(param0, param1); if (v0 == 0) { - sub_0200D810(param0->unk_324[param1].unk_08, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_XLU); } else { - sub_0200D810(param0->unk_324[param1].unk_08, GX_OAM_MODE_NORMAL); + SpriteActor_SetOAMMode(param0->unk_324[param1].unk_08, GX_OAM_MODE_NORMAL); } } @@ -468,7 +468,7 @@ void ov76_0223B7D4 (UnkStruct_ov76_0223DE00 * param0, int param1) { s16 v0, v1; - sub_0200D550(param0->unk_324[param1].unk_08, &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_324[param1].unk_08, &v0, &v1); param0->unk_324[param1].unk_05 = (u8)v0; param0->unk_324[param1].unk_06 = (u8)v1; diff --git a/src/overlay076/ov76_0223B870.c b/src/overlay076/ov76_0223B870.c index c5074908d8..9c3f1a3d03 100644 --- a/src/overlay076/ov76_0223B870.c +++ b/src/overlay076/ov76_0223B870.c @@ -24,7 +24,7 @@ #include "overlay076/struct_ov76_0223BBAC.h" #include "overlay076/struct_ov76_0223C398.h" #include "overlay076/struct_ov76_0223DE00.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -76,14 +76,14 @@ void ov76_0223C32C(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C354(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C398(UnkStruct_ov76_0223C398 * param0); void ov76_0223C424(UnkStruct_ov76_0223C398 * param0); -void ov76_0223C5A4(CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10); +void ov76_0223C5A4(SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10); void ov76_0223C61C(UnkStruct_ov76_0223DE00 * param0, NARC * param1); void ov76_0223C7E0(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C80C(UnkStruct_ov76_0223DE00 * param0, int param1, int param2); void ov76_0223C88C(UnkStruct_ov76_0223DE00 * param0); void ov76_0223C8BC(UnkStruct_ov76_0223DE00 * param0); -void ov76_0223C8EC(BGL * param0, PaletteSys * param1, int param2); -void ov76_0223C974(BGL * param0, PaletteSys * param1, int param2); +void ov76_0223C8EC(BGL * param0, PaletteData * param1, int param2); +void ov76_0223C974(BGL * param0, PaletteData * param1, int param2); void ov76_0223CA30(Window * param0, int param1); void ov76_0223CA98(BGL * param0, Window * param1, int param2, int param3, int param4, int param5, int param6, int param7); void ov76_0223CB58(UnkStruct_ov76_0223DE00 * param0); @@ -104,7 +104,7 @@ static void ov76_0223B870 (UnkUnion_02022594 * param0, CellActorData * param1, i { s16 v0, v1; - sub_0200D550(param1, &v0, &v1); + SpriteActor_GetSpritePositionXY(param1, &v0, &v1); param0->val1.unk_00 = v1 - param3; param0->val1.unk_01 = v1 + param3; @@ -238,9 +238,9 @@ void ov76_0223BB04 (UnkStruct_ov76_0223DE00 * param0) { int v0; int v1; - CellTransferStateData * v2; - AnimationResourceCollection * v3; - PaletteSys * v4; + SpriteRenderer * v2; + SpriteGfxHandler * v3; + PaletteData * v4; v2 = param0->unk_D4.unk_08; v3 = param0->unk_D4.unk_0C; @@ -260,34 +260,34 @@ void ov76_0223BBAC (UnkStruct_ov76_0223DE00 * param0) { int v0; UnkStruct_ov76_0223BBAC * v1; - UnkStruct_ov104_0223F9E0 v2; - CellTransferStateData * v3; - AnimationResourceCollection * v4; - PaletteSys * v5; + SpriteTemplate v2; + SpriteRenderer * v3; + SpriteGfxHandler * v4; + PaletteData * v5; v3 = param0->unk_D4.unk_08; v4 = param0->unk_D4.unk_0C; v5 = param0->unk_D4.unk_14; v1 = ¶m0->unk_3E4; - v2.unk_00 = 0; - v2.unk_02 = 0; - v2.unk_04 = 0; - v2.unk_06 = 0; - v2.unk_08 = 60; - v2.unk_10 = 2; - v2.unk_2C = 1; - v2.unk_30 = 0; - v2.unk_14[4] = 0xffffffff; - v2.unk_14[5] = 0xffffffff; - v2.unk_0C = 0; - v2.unk_14[1] = 26000 + 292; - v2.unk_14[2] = 27000 + 180; - v2.unk_14[3] = 28000 + 88; + v2.x = 0; + v2.y = 0; + v2.z = 0; + v2.animIdx = 0; + v2.priority = 60; + v2.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v2.bgPriority = 1; + v2.transferToVRAM = FALSE; + v2.resources[4] = SPRITE_RESOURCE_NONE; + v2.resources[5] = SPRITE_RESOURCE_NONE; + v2.plttIdx = 0; + v2.resources[1] = 26000 + 292; + v2.resources[2] = 27000 + 180; + v2.resources[3] = 28000 + 88; for (v0 = 0; v0 < 8; v0++) { - v2.unk_14[0] = (v0 + 25000); - v1->unk_00[v0] = sub_0200CE6C(v3, v4, &v2); + v2.resources[0] = (v0 + 25000); + v1->unk_00[v0] = SpriteActor_LoadResources(v3, v4, &v2); } { @@ -303,7 +303,7 @@ void ov76_0223BBAC (UnkStruct_ov76_0223DE00 * param0) }; for (v0 = 0; v0 < 8; v0++) { - sub_0200D4C4(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1] - 1); + SpriteActor_SetSpritePositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1] - 1); sub_0200D330(param0->unk_3E4.unk_00[v0]); sub_0200D3CC(param0->unk_3E4.unk_00[v0], 0); } @@ -315,7 +315,7 @@ void ov76_0223BC70 (UnkStruct_ov76_0223DE00 * param0) int v0; for (v0 = 0; v0 < 8; v0++) { - sub_0200D070(param0->unk_D4.unk_0C, (v0 + 25000)); + SpriteGfxHandler_UnloadCharObjById(param0->unk_D4.unk_0C, (v0 + 25000)); sub_0200D0F4(param0->unk_3E4.unk_00[v0]); } } @@ -370,7 +370,7 @@ void ov76_0223BD30 (UnkStruct_ov76_0223DE00 * param0, s8 param1, int param2) v0->unk_144[v1] = param0->unk_324[v1].unk_08; - sub_0200D550(v0->unk_144[v1], &v2, &v3); + SpriteActor_GetSpritePositionXY(v0->unk_144[v1], &v2, &v3); ov12_02225BC8(&v0->unk_00[v1], v2, v2 + ((+7 * 8) * param1), v3, v3 + ((-2 * 8) * param1), param2); ov12_02225C50(&v0->unk_00[v1], v0->unk_144[v1]); ov12_02225C50(&v0->unk_00[v1], v0->unk_144[v1]); @@ -541,9 +541,9 @@ void ov76_0223C0EC (int param0, s16 * param1, s16 * param2) void ov76_0223C110 (UnkStruct_ov76_0223DE00 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; v0 = param0->unk_D4.unk_08; v1 = param0->unk_D4.unk_0C; @@ -570,30 +570,30 @@ void ov76_0223C188 (UnkStruct_ov76_0223DE00 * param0) int v3; int v4; Pokemon * v5; - UnkStruct_ov104_0223F9E0 v6; + SpriteTemplate v6; for (v0 = 0; v0 < param0->unk_00->unk_00; v0++) { v5 = param0->unk_00->unk_04[v0]; sub_0200D888(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, 19, Pokemon_IconSpriteIndex(v5), 0, NNS_G2D_VRAM_TYPE_2DMAIN, (v0 + 15000)); - v6.unk_00 = 0; - v6.unk_02 = 0; - v6.unk_04 = 0; - v6.unk_06 = 0; - v6.unk_08 = 10; - v6.unk_0C = 0; - v6.unk_10 = 1; - v6.unk_2C = 2; - v6.unk_30 = 0; - v6.unk_14[0] = (v0 + 15000); - v6.unk_14[1] = 16000; - v6.unk_14[2] = 17000; - v6.unk_14[3] = 18000; - v6.unk_14[4] = 0xffffffff; - v6.unk_14[5] = 0xffffffff; - - param0->unk_2FC[v0] = sub_0200CE6C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v6); + v6.x = 0; + v6.y = 0; + v6.z = 0; + v6.animIdx = 0; + v6.priority = 10; + v6.plttIdx = 0; + v6.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v6.bgPriority = 2; + v6.transferToVRAM = FALSE; + v6.resources[0] = (v0 + 15000); + v6.resources[1] = 16000; + v6.resources[2] = 17000; + v6.resources[3] = 18000; + v6.resources[4] = SPRITE_RESOURCE_NONE; + v6.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_2FC[v0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v6); v2 = Pokemon_GetValue(v5, MON_DATA_SPECIES, NULL); v1 = Pokemon_GetValue(v5, MON_DATA_IS_EGG, NULL); @@ -620,7 +620,7 @@ void ov76_0223C288 (UnkStruct_ov76_0223DE00 * param0) if (v1 != 0xff) { ov76_0223C0EC(v0, &v2, &v3); - sub_0200D4C4(param0->unk_2FC[v1], v2 + -16, v3 + (+12)); + SpriteActor_SetSpritePositionXY(param0->unk_2FC[v1], v2 + -16, v3 + (+12)); sub_0200D3F4(param0->unk_2FC[v1], 1); } } @@ -700,15 +700,15 @@ void ov76_0223C424 (UnkStruct_ov76_0223C398 * param0) void ov76_0223C438 (UnkStruct_ov76_0223DE00 * param0, NARC * param1) { - sub_0200CC3C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 265, 1, 2, 45000); - sub_0200CE24(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 173, 1, 47000); - sub_0200CE54(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 81, 1, 48000); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 265, 1, 2, 45000); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 173, 1, 47000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param1, 81, 1, 48000); } void ov76_0223C4AC (UnkStruct_ov76_0223DE00 * param0) { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2[][3] = { {136, 16, 1}, {136, 128, 3}, @@ -717,22 +717,22 @@ void ov76_0223C4AC (UnkStruct_ov76_0223DE00 * param0) }; for (v0 = 0; v0 < 4; v0++) { - v1.unk_00 = v2[v0][0]; - v1.unk_02 = v2[v0][1]; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 40; - v1.unk_0C = 2; - v1.unk_10 = 2; - v1.unk_2C = 1; - v1.unk_30 = 0; - v1.unk_14[0] = 45000; - v1.unk_14[1] = 26000 + 290; - v1.unk_14[2] = 47000; - v1.unk_14[3] = 48000; - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - param0->unk_314[v0] = sub_0200CE6C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + v1.x = v2[v0][0]; + v1.y = v2[v0][1]; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 40; + v1.plttIdx = 2; + v1.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v1.bgPriority = 1; + v1.transferToVRAM = FALSE; + v1.resources[0] = 45000; + v1.resources[1] = 26000 + 290; + v1.resources[2] = 47000; + v1.resources[3] = 48000; + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + param0->unk_314[v0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); sub_0200D7D4(param0->unk_314[v0], v2[v0][2]); } @@ -769,12 +769,12 @@ void ov76_0223C588 (UnkStruct_ov76_0223DE00 * param0) } } -void ov76_0223C5A4 (CellTransferStateData * param0, AnimationResourceCollection * param1, PaletteSys * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10) +void ov76_0223C5A4 (SpriteRenderer * param0, SpriteGfxHandler * param1, PaletteData * param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, NARC * param10) { - sub_0200CC3C(param0, param1, param10, param3, 1, param7, (param3 + 11000)); - sub_0200CDC4(param2, param8, param0, param1, param10, param4, 0, param9, param7, (param4 + 11000)); - sub_0200CE24(param0, param1, param10, param5, 1, (param5 + 11000)); - sub_0200CE54(param0, param1, param10, param6, 1, (param6 + 11000)); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param10, param3, 1, param7, (param3 + 11000)); + SpriteRenderer_LoadPalette(param2, param8, param0, param1, param10, param4, 0, param9, param7, (param4 + 11000)); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param10, param5, 1, (param5 + 11000)); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param10, param6, 1, (param6 + 11000)); } void ov76_0223C61C (UnkStruct_ov76_0223DE00 * param0, NARC * param1) @@ -783,59 +783,59 @@ void ov76_0223C61C (UnkStruct_ov76_0223DE00 * param0, NARC * param1) ov76_0223C5A4(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, param0->unk_D4.unk_14, 275, 291, 179, 87, NNS_G2D_VRAM_TYPE_2DMAIN, 2, 1, param1); { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; for (v0 = 0; v0 < 12; v0++) { - v1.unk_00 = 0; - v1.unk_02 = 0; - v1.unk_04 = 0; - v1.unk_06 = param0->unk_264[v0].unk_04; - v1.unk_08 = 40 - v0; - v1.unk_0C = 0; - v1.unk_10 = 1; - v1.unk_2C = 2; - v1.unk_30 = 0; - v1.unk_14[0] = (266 + 11000); - v1.unk_14[1] = (286 + 11000); - v1.unk_14[2] = (174 + 11000); - v1.unk_14[3] = (82 + 11000); - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - - param0->unk_264[v0].unk_08 = sub_0200CE6C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + v1.x = 0; + v1.y = 0; + v1.z = 0; + v1.animIdx = param0->unk_264[v0].unk_04; + v1.priority = 40 - v0; + v1.plttIdx = 0; + v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v1.bgPriority = 2; + v1.transferToVRAM = FALSE; + v1.resources[0] = (266 + 11000); + v1.resources[1] = (286 + 11000); + v1.resources[2] = (174 + 11000); + v1.resources[3] = (82 + 11000); + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_264[v0].unk_08 = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); { s16 v2, v3; ov76_0223C0EC(v0, &v2, &v3); - sub_0200D4C4(param0->unk_264[v0].unk_08, v2, v3); + SpriteActor_SetSpritePositionXY(param0->unk_264[v0].unk_08, v2, v3); } } - v1.unk_00 = 0; - v1.unk_02 = 0; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 20; - v1.unk_0C = 0; - v1.unk_10 = 1; - v1.unk_2C = 2; - v1.unk_30 = 0; - v1.unk_14[0] = (275 + 11000); - v1.unk_14[1] = (291 + 11000); - v1.unk_14[2] = (179 + 11000); - v1.unk_14[3] = (87 + 11000); - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; - - param0->unk_2F4[0] = sub_0200CE6C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); - param0->unk_2F4[1] = sub_0200CE6C(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + v1.x = 0; + v1.y = 0; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 20; + v1.plttIdx = 0; + v1.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v1.bgPriority = 2; + v1.transferToVRAM = FALSE; + v1.resources[0] = (275 + 11000); + v1.resources[1] = (291 + 11000); + v1.resources[2] = (179 + 11000); + v1.resources[3] = (87 + 11000); + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_2F4[0] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); + param0->unk_2F4[1] = SpriteActor_LoadResources(param0->unk_D4.unk_08, param0->unk_D4.unk_0C, &v1); { s16 v4, v5; ov76_0223C0EC(param0->unk_3C4[0], &v4, &v5); - sub_0200D4C4(param0->unk_2F4[0], v4, v5); - sub_0200D4C4(param0->unk_2F4[1], v4, v5); + SpriteActor_SetSpritePositionXY(param0->unk_2F4[0], v4, v5); + SpriteActor_SetSpritePositionXY(param0->unk_2F4[1], v4, v5); sub_0200D474(param0->unk_2F4[1], 25); sub_0200D364(param0->unk_2F4[0], 0); sub_0200D364(param0->unk_2F4[1], 0); @@ -915,7 +915,7 @@ void ov76_0223C8BC (UnkStruct_ov76_0223DE00 * param0) sub_0200D0F4(param0->unk_2F4[1]); } -void ov76_0223C8EC (BGL * param0, PaletteSys * param1, int param2) +void ov76_0223C8EC (BGL * param0, PaletteData * param1, int param2) { sub_0200DD0C(param0, 1, 1, 15, param2, 53); PaletteSys_LoadPalette(param1, 38, sub_0200DD08(param2), 53, 0, 0x20, 12 * 16); @@ -924,7 +924,7 @@ void ov76_0223C8EC (BGL * param0, PaletteSys * param1, int param2) PaletteSys_LoadPalette(param1, 14, 7, 53, 0, 0x20, 14 * 16); } -void ov76_0223C974 (BGL * param0, PaletteSys * param1, int param2) +void ov76_0223C974 (BGL * param0, PaletteData * param1, int param2) { sub_0200DD0C(param0, 4, 1, 15, param2, 53); PaletteSys_LoadPalette(param1, 38, sub_0200DD08(param2), 53, 1, 0x20, 12 * 16); @@ -1143,85 +1143,85 @@ void ov76_0223CF88 (UnkStruct_ov76_0223DE00 * param0, NARC * param1) void ov76_0223CFEC (UnkStruct_ov76_0223DE00 * param0, NARC * param1) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; v0 = param0->unk_D4.unk_08; v1 = param0->unk_D4.unk_0C; v2 = param0->unk_D4.unk_14; - sub_0200CDC4(v2, 3, v0, v1, param1, 290, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 290); - sub_0200CC3C(v0, v1, param1, 273, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 273); - sub_0200CE24(v0, v1, param1, 177, 1, 27000 + 177); - sub_0200CE54(v0, v1, param1, 85, 1, 28000 + 85); - sub_0200CC3C(v0, v1, param1, 274, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 274); - sub_0200CE24(v0, v1, param1, 178, 1, 27000 + 178); - sub_0200CE54(v0, v1, param1, 86, 1, 28000 + 86); - sub_0200CC3C(v0, v1, param1, 270, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 270); - sub_0200CE24(v0, v1, param1, 175, 1, 27000 + 175); - sub_0200CE54(v0, v1, param1, 83, 1, 28000 + 83); - sub_0200CC3C(v0, v1, param1, 272, 1, NNS_G2D_VRAM_TYPE_2DSUB, 35000 + 272); - sub_0200CE24(v0, v1, param1, 176, 1, 27000 + 176); - sub_0200CE54(v0, v1, param1, 84, 1, 28000 + 84); + SpriteRenderer_LoadPalette(v2, 3, v0, v1, param1, 290, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, 26000 + 290); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, param1, 273, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 273); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, param1, 177, 1, 27000 + 177); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, param1, 85, 1, 28000 + 85); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, param1, 274, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 274); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, param1, 178, 1, 27000 + 178); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, param1, 86, 1, 28000 + 86); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, param1, 270, 1, NNS_G2D_VRAM_TYPE_2DSUB, 25000 + 270); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, param1, 175, 1, 27000 + 175); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, param1, 83, 1, 28000 + 83); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, param1, 272, 1, NNS_G2D_VRAM_TYPE_2DSUB, 35000 + 272); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, param1, 176, 1, 27000 + 176); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, param1, 84, 1, 28000 + 84); } void ov76_0223D16C (UnkStruct_ov76_0223DE00 * param0) { int v0; UnkStruct_ov76_0223BBAC * v1; - UnkStruct_ov104_0223F9E0 v2; - CellTransferStateData * v3; - AnimationResourceCollection * v4; - PaletteSys * v5; + SpriteTemplate v2; + SpriteRenderer * v3; + SpriteGfxHandler * v4; + PaletteData * v5; v3 = param0->unk_D4.unk_08; v4 = param0->unk_D4.unk_0C; v5 = param0->unk_D4.unk_14; v1 = ¶m0->unk_3E4; - v2.unk_00 = 0; - v2.unk_02 = 0; - v2.unk_04 = 0; - v2.unk_06 = 0; - v2.unk_08 = 60; - v2.unk_10 = 2; - v2.unk_2C = 1; - v2.unk_30 = 0; - v2.unk_14[4] = 0xffffffff; - v2.unk_14[5] = 0xffffffff; + v2.x = 0; + v2.y = 0; + v2.z = 0; + v2.animIdx = 0; + v2.priority = 60; + v2.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v2.bgPriority = 1; + v2.transferToVRAM = FALSE; + v2.resources[4] = SPRITE_RESOURCE_NONE; + v2.resources[5] = SPRITE_RESOURCE_NONE; v0 = 8; - v2.unk_0C = 1; - v2.unk_14[0] = 25000 + 273; - v2.unk_14[1] = 26000 + 290; - v2.unk_14[2] = 27000 + 177; - v2.unk_14[3] = 28000 + 85; - v1->unk_00[v0++] = sub_0200CE6C(v3, v4, &v2); - - v2.unk_14[0] = 25000 + 274; - v2.unk_14[1] = 26000 + 290; - v2.unk_14[2] = 27000 + 178; - v2.unk_14[3] = 28000 + 86; - v1->unk_00[v0++] = sub_0200CE6C(v3, v4, &v2); - - v2.unk_2C = 1; - v2.unk_0C = 1; - v2.unk_14[0] = 35000 + 272; - v2.unk_14[1] = 26000 + 290; - v2.unk_14[2] = 27000 + 176; - v2.unk_14[3] = 28000 + 84; - v1->unk_00[v0++] = sub_0200CE6C(v3, v4, &v2); - - v2.unk_2C = 1; - v2.unk_0C = 0; - v2.unk_14[0] = 25000 + 270; - v2.unk_14[1] = 26000 + 290; - v2.unk_14[2] = 27000 + 175; - v2.unk_14[3] = 28000 + 83; - v1->unk_00[v0++] = sub_0200CE6C(v3, v4, &v2); - v1->unk_00[v0++] = sub_0200CE6C(v3, v4, &v2); + v2.plttIdx = 1; + v2.resources[0] = 25000 + 273; + v2.resources[1] = 26000 + 290; + v2.resources[2] = 27000 + 177; + v2.resources[3] = 28000 + 85; + v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + + v2.resources[0] = 25000 + 274; + v2.resources[1] = 26000 + 290; + v2.resources[2] = 27000 + 178; + v2.resources[3] = 28000 + 86; + v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + + v2.bgPriority = 1; + v2.plttIdx = 1; + v2.resources[0] = 35000 + 272; + v2.resources[1] = 26000 + 290; + v2.resources[2] = 27000 + 176; + v2.resources[3] = 28000 + 84; + v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + + v2.bgPriority = 1; + v2.plttIdx = 0; + v2.resources[0] = 25000 + 270; + v2.resources[1] = 26000 + 290; + v2.resources[2] = 27000 + 175; + v2.resources[3] = 28000 + 83; + v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); + v1->unk_00[v0++] = SpriteActor_LoadResources(v3, v4, &v2); { const s16 v6[][2] = { @@ -1256,7 +1256,7 @@ void ov76_0223D16C (UnkStruct_ov76_0223DE00 * param0) }; for (v0 = 8; v0 < 13; v0++) { - sub_0200D4C4(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1]); + SpriteActor_SetSpritePositionXY(param0->unk_3E4.unk_00[v0], v6[v0][0], v6[v0][1]); sub_0200D330(param0->unk_3E4.unk_00[v0]); sub_0200D3CC(param0->unk_3E4.unk_00[v0], 0); ov76_0223B870(¶m0->unk_D4.unk_FC[v0], param0->unk_3E4.unk_00[v0], v7[v0][0], v7[v0][1]); diff --git a/src/overlay076/ov76_0223D338.c b/src/overlay076/ov76_0223D338.c index 070f625fbe..e7d412280b 100644 --- a/src/overlay076/ov76_0223D338.c +++ b/src/overlay076/ov76_0223D338.c @@ -299,12 +299,12 @@ static void ov76_0223D600 (UnkStruct_ov76_0223DE00 * param0, int param1, BOOL pa } ov76_0223C0EC(param0->unk_3C4[param1], &v0, &v1); - sub_0200D4C4(param0->unk_2F4[param1], v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_2F4[param1], v0, v1); if (param2 == 1) { param0->unk_3C4[v2] = param0->unk_3C4[param1]; ov76_0223C0EC(param0->unk_3C4[v2], &v0, &v1); - sub_0200D4C4(param0->unk_2F4[v2], v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_2F4[v2], v0, v1); } } @@ -1174,7 +1174,7 @@ static BOOL ov76_0223DF94 (UnkStruct_ov76_0223DE00 * param0) v15 = sub_02098164(param0->unk_324[v13].unk_04); ov76_0223CDC4(¶m0->unk_D4.unk_18[0], v15); - sub_0200D4C4(param0->unk_324[v13].unk_08, v11, v12); + SpriteActor_SetSpritePositionXY(param0->unk_324[v13].unk_08, v11, v12); ov76_0223B758(param0, v13); ov76_0223B7D4(param0, v13); } else { diff --git a/src/overlay079/ov79_021D0D80.c b/src/overlay079/ov79_021D0D80.c index 3b2ef8b894..a0efd7017a 100644 --- a/src/overlay079/ov79_021D0D80.c +++ b/src/overlay079/ov79_021D0D80.c @@ -775,7 +775,7 @@ static void ov79_021D167C (UnkStruct_ov79_021D0E1C * param0) param0->unk_1CC[v0] = sub_0200CA08(param0->unk_1B8, param0->unk_1BC, &v1[3]); sub_02021CAC(param0->unk_1CC[v0], 1); - sub_02021D6C(param0->unk_1CC[v0], v0 + 3); + SpriteActor_SetSpriteAnimActive(param0->unk_1CC[v0], v0 + 3); sub_0200D494(param0->unk_1CC[v0], v2[v0].unk_00, v2[v0].unk_02); } @@ -794,7 +794,7 @@ static void ov79_021D167C (UnkStruct_ov79_021D0E1C * param0) param0->unk_1E0[v0] = sub_0200CA08(param0->unk_1B8, param0->unk_1BC, &v1[4]); sub_02021CAC(param0->unk_1E0[v0], 1); - sub_02021D6C(param0->unk_1E0[v0], v0 * 3); + SpriteActor_SetSpriteAnimActive(param0->unk_1E0[v0], v0 * 3); sub_02021CE4(param0->unk_1E0[v0], FX32_CONST(2)); sub_02021E90(param0->unk_1E0[v0], v0 + 2); sub_02021CC8(param0->unk_1E0[v0], 0); diff --git a/src/overlay079/ov79_021D183C.c b/src/overlay079/ov79_021D183C.c index 735f678036..9da0c1dd82 100644 --- a/src/overlay079/ov79_021D183C.c +++ b/src/overlay079/ov79_021D183C.c @@ -215,7 +215,7 @@ void ov79_021D1B24 (UnkStruct_ov79_021D0E1C * param0, u8 param1, u8 param2) { switch (param2) { case 0: - sub_02021D6C(param0->unk_1E0[param1], param1 * 3); + SpriteActor_SetSpriteAnimActive(param0->unk_1E0[param1], param1 * 3); sub_02021CC8(param0->unk_1E0[param1], 0); sub_0201C04C( ¶m0->unk_E8[7 + param1], 1, 2, ((0 << 4) | 0)); @@ -227,17 +227,17 @@ void ov79_021D1B24 (UnkStruct_ov79_021D0E1C * param0, u8 param1, u8 param2) param0->unk_14 = 1; break; case 2: - sub_02021D6C(param0->unk_1E0[param1], param1 * 3 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1E0[param1], param1 * 3 + 1); sub_0201C04C(¶m0->unk_E8[7 + param1], 1, 2, ((0 << 4) | 0)); param0->unk_14 = 0; break; case 3: - sub_02021D6C(param0->unk_1E0[param1], param1 * 3 + 2); + SpriteActor_SetSpriteAnimActive(param0->unk_1E0[param1], param1 * 3 + 2); sub_0201C04C(¶m0->unk_E8[7 + param1], 0, 2, ((0 << 4) | 0)); param0->unk_14 = 1; break; case 4: - sub_02021D6C(param0->unk_1E0[param1], param1 * 3 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1E0[param1], param1 * 3 + 1); sub_02021CC8(param0->unk_1E0[param1], 1); sub_0201C04C(¶m0->unk_E8[7 + param1], 0, 2, ((0 << 4) | 0)); param0->unk_14 = 0; diff --git a/src/overlay079/ov79_021D2268.c b/src/overlay079/ov79_021D2268.c index eedd26bd79..e223cc7869 100644 --- a/src/overlay079/ov79_021D2268.c +++ b/src/overlay079/ov79_021D2268.c @@ -121,7 +121,7 @@ typedef struct { UnkStruct_0209916C * unk_60[2]; BGL * unk_68; Window unk_6C; - CellTransferStateData * unk_7C; + SpriteRenderer * unk_7C; UnkStruct_ov79_021D29B4 unk_80; } UnkStruct_ov79_021D2928; diff --git a/src/overlay080/ov80_021D1458.c b/src/overlay080/ov80_021D1458.c index 6269c7326a..9efb8010b7 100644 --- a/src/overlay080/ov80_021D1458.c +++ b/src/overlay080/ov80_021D1458.c @@ -937,7 +937,7 @@ static void ov80_021D2398 (UnkStruct_ov80_021D2A08 * param0) v0->unk_108 = sub_0200CA08(param0->unk_D8, param0->unk_DC, &v1); sub_02021CAC(v0->unk_108, 1); - sub_02021E50(v0->unk_108, param0->unk_2C->unk_0C); + SpriteActor_SetAnimFrame(v0->unk_108, param0->unk_2C->unk_0C); sub_0200D494(v0->unk_108, v0->unk_18 * 7 + (48 - 23), v0->unk_1C * 7 + (6 - 40)); } @@ -1099,7 +1099,7 @@ static void ov80_021D2774 (SysTask * param0, void * param1) case 0: sub_02021CAC(v1->unk_100, 1); sub_02021CC8(v1->unk_100, 1); - sub_02021E50(v1->unk_100, 1); + SpriteActor_SetAnimFrame(v1->unk_100, 1); Sound_PlayEffect(1508); v1->unk_04++; break; diff --git a/src/overlay080/ov80_021D2AF4.c b/src/overlay080/ov80_021D2AF4.c index f290326fe0..f739bfca4d 100644 --- a/src/overlay080/ov80_021D2AF4.c +++ b/src/overlay080/ov80_021D2AF4.c @@ -41,7 +41,7 @@ const UnkStruct_ov80_021D2C5C_sub1 Unk_ov80_021D31D8[20] = { { 0xAC, 0x44, 0x0, 0x1, 0x3, 0xB6, 0x77 } }; -UnkStruct_ov80_021D2C1C * ov80_021D2AF4 (CellTransferStateData * param0, AnimationResourceCollection * param1, u8 * param2, short param3, int param4) +UnkStruct_ov80_021D2C1C * ov80_021D2AF4 (SpriteRenderer * param0, SpriteGfxHandler * param1, u8 * param2, short param3, int param4) { UnkStruct_ov80_021D2C1C * v0; UnkStruct_ov80_021D2C5C * v1; diff --git a/src/overlay083/ov83_0223D6A8.c b/src/overlay083/ov83_0223D6A8.c index ad6420a37a..7600f88be9 100644 --- a/src/overlay083/ov83_0223D6A8.c +++ b/src/overlay083/ov83_0223D6A8.c @@ -413,7 +413,7 @@ void ov83_0223DB4C (UnkStruct_ov83_0223DB30 * param0, UnkStruct_ov83_0223DB4C * param0->unk_18[v1] = ov83_0223D9A8(param2, ¶m3[0], 0, 0, 0, 0, param4); sub_02021CAC(param0->unk_18[v1], 0); - sub_02021D6C(param0->unk_18[v1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_18[v1], 1); v1++; } @@ -698,7 +698,7 @@ void ov83_0223E28C (UnkStruct_ov83_0223E244 * param0, UnkStruct_ov83_0223D784 * { param0->unk_08 = ov83_0223D9A8(param1, ¶m2[param4], (128 * FX32_ONE), (96 * FX32_ONE), 0, 0, param3); sub_02021CAC(param0->unk_08, 0); - sub_02021D6C(param0->unk_08, param5); + SpriteActor_SetSpriteAnimActive(param0->unk_08, param5); param0->unk_00 = 1; } @@ -922,7 +922,7 @@ void ov83_0223E5DC (UnkStruct_ov83_0223E5C0 * param0, UnkStruct_ov83_0223D784 * for (v0 = 0; v0 < 4; v0++) { param0->unk_04[v0] = ov83_0223D9A8(param1, ¶m2[1], 128, 96, 0, 2, param3); sub_02021CAC(param0->unk_04[v0], 0); - sub_02021D6C(param0->unk_04[v0], 4 + v0); + SpriteActor_SetSpriteAnimActive(param0->unk_04[v0], 4 + v0); sub_02021C50(param0->unk_04[v0], &v1); } @@ -1492,7 +1492,7 @@ static void ov83_0223F1C0 (UnkStruct_ov83_0223F054 * param0, int param1, fx32 pa sub_02021C80(param0->unk_78, ¶m0->unk_20, 2); } - sub_02021D6C(param0->unk_78, param14); + SpriteActor_SetSpriteAnimActive(param0->unk_78, param14); sub_02021CC8(param0->unk_78, 1); sub_02021E80(param0->unk_78, 2); } @@ -1536,7 +1536,7 @@ void ov83_0223F2C4 (UnkStruct_ov83_0223F29C * param0, UnkStruct_ov83_0223D784 * param0->unk_3C[v0].unk_00 = ov83_0223D9A8(param1, ¶m0->unk_04, (128 * FX32_ONE), (96 * FX32_ONE), 0, 0, param2); if (v0 >= 2) { - sub_02021D6C(param0->unk_3C[v0].unk_00, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_3C[v0].unk_00, 1); } sub_02021CAC(param0->unk_3C[v0].unk_00, 0); @@ -1779,7 +1779,7 @@ static void ov83_0223F6CC (UnkStruct_ov83_0223F670 * param0, int param1, fx32 pa param0->unk_08.y = param3; sub_02021CAC(param0->unk_44, 1); - sub_02021D6C(param0->unk_44, param1); + SpriteActor_SetSpriteAnimActive(param0->unk_44, param1); sub_02021DE0(param0->unk_44); sub_02021CC8(param0->unk_44, 1); sub_02021E80(param0->unk_44, 2); diff --git a/src/overlay084/ov84_0223B5A0.c b/src/overlay084/ov84_0223B5A0.c index ac510e21ab..5cd58f5b79 100644 --- a/src/overlay084/ov84_0223B5A0.c +++ b/src/overlay084/ov84_0223B5A0.c @@ -1249,7 +1249,7 @@ static u8 ov84_0223C5B8 (UnkStruct_ov84_0223B5A0 * param0) sub_020014DC(param0->unk_15C, &v2, &v3); if (v0->unk_04 != v3) { - sub_0200D4C4( + SpriteActor_SetSpritePositionXY( param0->unk_E0[4], 177, 24 + (v3 - 1) * 16); } @@ -1558,7 +1558,7 @@ static u8 ov84_0223CBD8 (UnkStruct_ov84_0223B5A0 * param0) ov84_0223C194(¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_09); ov84_0223C1D0(¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_09, 9); ov84_0223C224(param0, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06, param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04); - sub_0200D4C4(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); + SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); sub_0200D3F4(param0->unk_E0[4], 1); v0->unk_02++; @@ -1771,25 +1771,25 @@ static void ov84_0223D0FC (UnkStruct_ov84_0223B5A0 * param0) switch (param0->unk_480) { case 0: case 1: - sub_0200D550(param0->unk_E0[2], &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); v0 -= 1; - sub_0200D4C4(param0->unk_E0[2], v0, v1); - sub_0200D550(param0->unk_E0[3], &v0, &v1); + SpriteActor_SetSpritePositionXY(param0->unk_E0[2], v0, v1); + SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); v0 += 1; - sub_0200D4C4(param0->unk_E0[3], v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_E0[3], v0, v1); break; case 2: case 3: - sub_0200D550(param0->unk_E0[2], &v0, &v1); + SpriteActor_GetSpritePositionXY(param0->unk_E0[2], &v0, &v1); v0 += 1; - sub_0200D4C4(param0->unk_E0[2], v0, v1); - sub_0200D550(param0->unk_E0[3], &v0, &v1); + SpriteActor_SetSpritePositionXY(param0->unk_E0[2], v0, v1); + SpriteActor_GetSpritePositionXY(param0->unk_E0[3], &v0, &v1); v0 -= 1; - sub_0200D4C4(param0->unk_E0[3], v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_E0[3], v0, v1); break; } @@ -1879,7 +1879,7 @@ static u8 ov84_0223D2F8 (UnkStruct_ov84_0223B5A0 * param0) sub_020014DC(param0->unk_15C, &v2, &v3); if (v0->unk_04 != v3) { - sub_0200D4C4(param0->unk_E0[5], 177, 24 + (v3 - 1) * 16 - 8); + SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v3 - 1) * 16 - 8); } v0->unk_06 = v2; @@ -1954,7 +1954,7 @@ static void ov84_0223D4E8 (UnkStruct_ov84_0223B5A0 * param0) UnkStruct_ov84_0223BE5C * v0 = ¶m0->unk_C4->unk_04[param0->unk_C4->unk_64]; if (param0->unk_47A == 0) { - sub_0200D4C4(param0->unk_E0[4], 177, 24 + (v0->unk_04 - 1) * 16); + SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (v0->unk_04 - 1) * 16); sub_0200D3F4(param0->unk_E0[4], 1); sub_0200D3F4(param0->unk_E0[5], 0); @@ -1963,7 +1963,7 @@ static void ov84_0223D4E8 (UnkStruct_ov84_0223B5A0 * param0) sub_0200D3F4(param0->unk_E0[3], 1); } } else { - sub_0200D4C4(param0->unk_E0[5], 177, 24 + (v0->unk_04 - 1) * 16 - 8); + SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v0->unk_04 - 1) * 16 - 8); sub_0200D3F4(param0->unk_E0[4], 0); sub_0200D3F4(param0->unk_E0[5], 1); @@ -3082,7 +3082,7 @@ static BOOL ov84_0223ED64 (UnkStruct_ov84_0223B5A0 * param0, u16 param1) return 0; } - sub_0200D4C4(param0->unk_E0[4], 177, 24 + (v1 - 1) * 16); + SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (v1 - 1) * 16); param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06 = v0; param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 = v1; @@ -3128,7 +3128,7 @@ static BOOL ov84_0223EE80 (UnkStruct_ov84_0223B5A0 * param0, u16 param1) return 0; } - sub_0200D4C4(param0->unk_E0[5], 177, 24 + (v1 - 1) * 16 - 8); + SpriteActor_SetSpritePositionXY(param0->unk_E0[5], 177, 24 + (v1 - 1) * 16 - 8); param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_06 = v0; param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 = v1; diff --git a/src/overlay084/ov84_022403F4.c b/src/overlay084/ov84_022403F4.c index bf2c774b31..9536519915 100644 --- a/src/overlay084/ov84_022403F4.c +++ b/src/overlay084/ov84_022403F4.c @@ -4,7 +4,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_0207CB08.h" #include "overlay084/struct_ov84_0223B5A0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -25,7 +25,7 @@ static void ov84_02240C48(UnkStruct_ov84_0223B5A0 * param0); static u8 ov84_02240C30(UnkStruct_ov84_0223B5A0 * param0, u8 param1); static void ov84_02240B98(UnkStruct_ov84_0223B5A0 * param0); -static const UnkStruct_ov104_0223F9E0 Unk_ov84_022411B0[] = { +static const SpriteTemplate Unk_ov84_022411B0[] = { { 0x30, 0x32, @@ -227,12 +227,12 @@ static void ov84_022404C0 (UnkStruct_ov84_0223B5A0 * param0) v1 = 7; } - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, v0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49401); - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 25, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49402); - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 28, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49403); - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 31, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49404); - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); - sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 36, 0, NNS_G2D_VRAM_TYPE_2DSUB, 49406); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, v0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49401); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 25, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49402); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 28, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49403); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 31, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49404); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 36, 0, NNS_G2D_VRAM_TYPE_2DSUB, 49406); sub_0200CBDC(param0->unk_D8, param0->unk_DC, 62, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49408); sub_0200CBDC(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49407); sub_0207C948(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 49409); @@ -243,20 +243,20 @@ static void ov84_022404C0 (UnkStruct_ov84_0223B5A0 * param0) sub_0200CC9C(param0->unk_D8, param0->unk_DC, 62, 10, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49405); sub_0207C97C(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 49406); sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 37, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 49403); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 1, 0, 49401); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 24, 0, 49402); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 27, 0, 49403); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 30, 0, 49404); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 9, 0, 49405); - sub_0200CE24(param0->unk_D8, param0->unk_DC, param0->unk_D4, 35, 0, 49406); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 1, 0, 49401); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 24, 0, 49402); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 27, 0, 49403); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 30, 0, 49404); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 9, 0, 49405); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 35, 0, 49406); sub_0200CE0C(param0->unk_D8, param0->unk_DC, 16, Item_IconNCERFile(), 0, 49407); sub_0200CE0C(param0->unk_D8, param0->unk_DC, 62, 5, 0, 49408); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 0, 0, 49401); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 23, 0, 49402); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 26, 0, 49403); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 29, 0, 49404); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 8, 0, 49405); - sub_0200CE54(param0->unk_D8, param0->unk_DC, param0->unk_D4, 34, 0, 49406); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 0, 0, 49401); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 23, 0, 49402); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 26, 0, 49403); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 29, 0, 49404); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 8, 0, 49405); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_D8, param0->unk_DC, param0->unk_D4, 34, 0, 49406); sub_0200CE3C(param0->unk_D8, param0->unk_DC, 16, Item_IconNANRFile(), 0, 49407); sub_0200CE3C(param0->unk_D8, param0->unk_DC, 62, 6, 0, 49408); sub_0207C9EC(param0->unk_D8, param0->unk_DC, 49409, 49409); @@ -267,7 +267,7 @@ static void ov84_02240950 (UnkStruct_ov84_0223B5A0 * param0) u32 v0; for (v0 = 0; v0 < 12; v0++) { - param0->unk_E0[v0] = sub_0200CE6C(param0->unk_D8, param0->unk_DC, &Unk_ov84_022411B0[v0]); + param0->unk_E0[v0] = SpriteActor_LoadResources(param0->unk_D8, param0->unk_DC, &Unk_ov84_022411B0[v0]); } sub_0200D3F4(param0->unk_E0[5], 0); @@ -287,8 +287,8 @@ static void ov84_02240950 (UnkStruct_ov84_0223B5A0 * param0) ov84_02240D3C(param0, 0); sub_0200D364(param0->unk_E0[0], param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_08); - sub_0200D4C4(param0->unk_E0[1], ov84_02240C30(param0, param0->unk_C4->unk_64), 97); - sub_0200D4C4(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); + SpriteActor_SetSpritePositionXY(param0->unk_E0[1], ov84_02240C30(param0, param0->unk_C4->unk_64), 97); + SpriteActor_SetSpritePositionXY(param0->unk_E0[4], 177, 24 + (param0->unk_C4->unk_04[param0->unk_C4->unk_64].unk_04 - 1) * 16); { VecFx32 v1 = {FX32_ONE, FX32_ONE, FX32_ONE}; @@ -413,11 +413,11 @@ static void ov84_02240C48 (UnkStruct_ov84_0223B5A0 * param0) void ov84_02240CF0 (UnkStruct_ov84_0223B5A0 * param0, u8 param1) { if (param1 == 0) { - sub_0200D4C4(param0->unk_E0[8], 220, 156); - sub_0200D4C4(param0->unk_E0[9], 220, 180); + SpriteActor_SetSpritePositionXY(param0->unk_E0[8], 220, 156); + SpriteActor_SetSpritePositionXY(param0->unk_E0[9], 220, 180); } else { - sub_0200D4C4(param0->unk_E0[8], 162, 108); - sub_0200D4C4(param0->unk_E0[9], 162, 132); + SpriteActor_SetSpritePositionXY(param0->unk_E0[8], 162, 108); + SpriteActor_SetSpritePositionXY(param0->unk_E0[9], 162, 132); } ov84_02240D3C(param0, 1); @@ -455,7 +455,7 @@ void ov84_02240D5C (UnkStruct_ov84_0223B5A0 * param0, u16 param1, u8 param2) void ov84_02240E24 (UnkStruct_ov84_0223B5A0 * param0, s16 param1, s16 param2) { sub_0200D3F4(param0->unk_E0[6], 1); - sub_0200D4C4(param0->unk_E0[6], param1, param2); + SpriteActor_SetSpritePositionXY(param0->unk_E0[6], param1, param2); sub_0200D3CC(param0->unk_E0[6], 0); sub_0200D364(param0->unk_E0[6], 0); } diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index 0d77bf523e..ad1a53b570 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -551,14 +551,14 @@ static void ov88_0223B7A0 (Party * param0, int param1, UnkStruct_02095E80 * para sub_02021CAC(param2->unk_404[v1], 0); } else { sub_02021CAC(param2->unk_404[v1], 1); - sub_02021D6C(param2->unk_404[v1], 3 + param2->unk_6F4[v1].unk_02 - 1); + SpriteActor_SetSpriteAnimActive(param2->unk_404[v1], 3 + param2->unk_6F4[v1].unk_02 - 1); } if (param2->unk_6F4[v1].unk_0C == 0) { sub_02021CAC(param2->unk_434[v1], 0); } else { sub_02021CAC(param2->unk_434[v1], 1); - sub_02021D6C(param2->unk_434[v1], 21); + SpriteActor_SetSpriteAnimActive(param2->unk_434[v1], 21); } } @@ -797,7 +797,7 @@ static void ov88_0223BDA4 (UnkStruct_02095E80 * param0, int param1) param0->unk_2168 = ov88_0223C800(1, v0, param0->unk_848[param1 / 6], ¶m0->unk_2148[param1 / 6]); ov88_0223C8D8(param0->unk_49C, 1, param0->unk_2274, param1 % 6, param0); - sub_02021D6C(param0->unk_464[3], param0->unk_6F4[param1].unk_04 + 6 - 1); + SpriteActor_SetSpriteAnimActive(param0->unk_464[3], param0->unk_6F4[param1].unk_04 + 6 - 1); } static void ov88_0223BE28 (UnkStruct_02095E80 * param0) @@ -1339,7 +1339,7 @@ static void ov88_0223C8D8 (Window * param0, int param1, Party * param2, int para sub_02021D0C(param4->unk_464[param1], param4->unk_6F4[param3].unk_0A); } - sub_02021D6C(param4->unk_464[2 + param1], param4->unk_6F4[param3].unk_04 + 6 - 1); + SpriteActor_SetSpriteAnimActive(param4->unk_464[2 + param1], param4->unk_6F4[param3].unk_04 + 6 - 1); sub_02021CAC(param4->unk_464[2 + param1], 1); ov88_0223C860(¶m0[26 + param1], param2, param3, 9, 6); @@ -1358,11 +1358,11 @@ static void ov88_0223C8D8 (Window * param0, int param1, Party * param2, int para break; case 0: sub_02021CAC(param4->unk_464[4 + param1], 1); - sub_02021D6C(param4->unk_464[4 + param1], 22 + 1); + SpriteActor_SetSpriteAnimActive(param4->unk_464[4 + param1], 22 + 1); break; case 1: sub_02021CAC(param4->unk_464[4 + param1], 1); - sub_02021D6C(param4->unk_464[4 + param1], 22); + SpriteActor_SetSpriteAnimActive(param4->unk_464[4 + param1], 22); break; } } @@ -1440,7 +1440,7 @@ static void ov88_0223CBA0 (UnkStruct_02095E80 * param0) v0.unk_08.y = FX32_ONE * (Unk_ov88_0223EF9C[v1][1] - 6); param0->unk_3D4[v1] = sub_02021AA0(&v0); sub_02021CC8(param0->unk_3D4[v1], 1); - sub_02021D6C(param0->unk_3D4[v1], 5 + v1); + SpriteActor_SetSpriteAnimActive(param0->unk_3D4[v1], 5 + v1); sub_02021F58(param0->unk_3D4[v1], 5); sub_02021CAC(param0->unk_3D4[v1], 0); } @@ -1467,7 +1467,7 @@ static void ov88_0223CBA0 (UnkStruct_02095E80 * param0) v0.unk_08.y = FX32_ONE * (8 * 8 + 2); param0->unk_47C = sub_02021AA0(&v0); sub_02021CC8(param0->unk_47C, 1); - sub_02021D6C(param0->unk_47C, 20); + SpriteActor_SetSpriteAnimActive(param0->unk_47C, 20); sub_02021CAC(param0->unk_47C, 0); for (v1 = 0; v1 < 6; v1++) { @@ -1478,7 +1478,7 @@ static void ov88_0223CBA0 (UnkStruct_02095E80 * param0) param0->unk_464[v1] = sub_02021AA0(&v0); sub_02021CAC(param0->unk_464[v1], 0); sub_02021CC8(param0->unk_464[v1], 0); - sub_02021D6C(param0->unk_464[v1], Unk_ov88_0223EF54[v1][2]); + SpriteActor_SetSpriteAnimActive(param0->unk_464[v1], Unk_ov88_0223EF54[v1][2]); } } } @@ -1544,7 +1544,7 @@ static void ov88_0223CE74 (UnkStruct_02095E80 * param0) } sub_02021CC8(param0->unk_464[v2], 1); - sub_02021D6C(param0->unk_464[v2], 4 + v2); + SpriteActor_SetSpriteAnimActive(param0->unk_464[v2], 4 + v2); } } @@ -1599,14 +1599,14 @@ static void ov88_0223CF68 (int param0, GraphicElementData * param1, int param2) if (param0 == 12) { sub_02021C50(param1, &v0); - sub_02021D6C(param1, Unk_ov88_0223EE50[param2][2]); + SpriteActor_SetSpriteAnimActive(param1, Unk_ov88_0223EE50[param2][2]); } else { sub_02021C50(param1, &v0); if (param0 < 6) { - sub_02021D6C(param1, Unk_ov88_0223EE50[param2][0]); + SpriteActor_SetSpriteAnimActive(param1, Unk_ov88_0223EE50[param2][0]); } else { - sub_02021D6C(param1, Unk_ov88_0223EE50[param2][1]); + SpriteActor_SetSpriteAnimActive(param1, Unk_ov88_0223EE50[param2][1]); } } } diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 4287fe9669..a8817c6516 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -98,8 +98,8 @@ typedef struct { UnkStruct_ov90_021D0ECC_sub1 unk_28; Window unk_6C[5]; UnkStruct_ov90_021D17F8 unk_BC[30]; - CellTransferStateData * unk_29C; - AnimationResourceCollection * unk_2A0; + SpriteRenderer * unk_29C; + SpriteGfxHandler * unk_2A0; GraphicElementData * unk_2A4[4]; } UnkStruct_ov90_021D0ECC; @@ -978,10 +978,10 @@ static void ov90_021D1C90 (UnkStruct_ov90_021D0ECC * param0, u8 param1, u8 param sub_02021CAC(param0->unk_2A4[1], 1); if (param1 == 10) { - sub_02021E50(param0->unk_2A4[1], 1); + SpriteActor_SetAnimFrame(param0->unk_2A4[1], 1); sub_02021CAC(param0->unk_2A4[0], 0); } else { - sub_02021E50(param0->unk_2A4[1], 0); + SpriteActor_SetAnimFrame(param0->unk_2A4[1], 0); sub_02021CAC(param0->unk_2A4[0], 1); } } else { diff --git a/src/overlay091/ov91_021D0D80.c b/src/overlay091/ov91_021D0D80.c index 5b56dc004b..f11fd58c0b 100644 --- a/src/overlay091/ov91_021D0D80.c +++ b/src/overlay091/ov91_021D0D80.c @@ -28,7 +28,7 @@ #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay084/struct_ov84_02240FA8.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -74,8 +74,8 @@ typedef struct { UnkStruct_0200112C * unk_104; ResourceMetadata * unk_108; UIControlData * unk_10C; - CellTransferStateData * unk_110; - AnimationResourceCollection * unk_114; + SpriteRenderer * unk_110; + SpriteGfxHandler * unk_114; CellActorData * unk_118[13]; UnkStruct_02098D38 unk_14C; UnkStruct_020067E8 * unk_17C; @@ -205,7 +205,7 @@ static const GameWindowLayout_1 Unk_ov91_021D27DC[] = { {ov91_021D1FF4, ov91_021D2008} }; -static const UnkStruct_ov104_0223F9E0 Unk_ov91_021D28FC[] = { +static const SpriteTemplate Unk_ov91_021D28FC[] = { { 0x92, 0x8, @@ -1345,9 +1345,9 @@ static void ov91_021D2110 (UnkStruct_ov91_021D0ED8 * param0, NARC * param1) { u32 v0; - sub_0200CC3C(param0->unk_110, param0->unk_114, param1, 5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47272); - sub_0200CC3C(param0->unk_110, param0->unk_114, param1, 8, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47273); - sub_0200CC3C(param0->unk_110, param0->unk_114, param1, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47274); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 5, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47272); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 8, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47273); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 47274); for (v0 = 47276; v0 <= 47282; v0++) { sub_0207C948(param0->unk_110, param0->unk_114, NNS_G2D_VRAM_TYPE_2DMAIN, 0, v0); @@ -1356,12 +1356,12 @@ static void ov91_021D2110 (UnkStruct_ov91_021D0ED8 * param0, NARC * param1) sub_0207CAC4(param0->unk_110, param0->unk_114, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 47275); sub_0200CD0C(param0->unk_110, param0->unk_114, param1, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 47272); sub_0207C97C(param0->unk_110, param0->unk_114, NNS_G2D_VRAM_TYPE_2DMAIN, 47273); - sub_0200CE24(param0->unk_110, param0->unk_114, param1, 4, 0, 47272); - sub_0200CE24(param0->unk_110, param0->unk_114, param1, 7, 0, 47273); - sub_0200CE24(param0->unk_110, param0->unk_114, param1, 1, 0, 47274); - sub_0200CE54(param0->unk_110, param0->unk_114, param1, 3, 0, 47272); - sub_0200CE54(param0->unk_110, param0->unk_114, param1, 6, 0, 47273); - sub_0200CE54(param0->unk_110, param0->unk_114, param1, 0, 0, 47274); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 4, 0, 47272); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 7, 0, 47273); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 1, 0, 47274); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 3, 0, 47272); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 6, 0, 47273); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_110, param0->unk_114, param1, 0, 0, 47274); sub_0207C9EC(param0->unk_110, param0->unk_114, 47275, 47275); } @@ -1384,7 +1384,7 @@ static void ov91_021D2314 (UnkStruct_ov91_021D0ED8 * param0) u32 v0; for (v0 = 0; v0 < 7; v0++) { - sub_0200D4C4( + SpriteActor_SetSpritePositionXY( param0->unk_118[6 + v0], 152, 32 + 16 * v0); if (param0->unk_00->unk_12 + v0 >= param0->unk_184 - 1) { @@ -1403,7 +1403,7 @@ static void ov91_021D237C (UnkStruct_ov91_021D0ED8 * param0, u16 param1, u16 par if (param1 < param2) { for (v0 = 0; v0 < 7; v0++) { - sub_0200D550(param0->unk_118[6 + v0], &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); if (v2 == 32) { v2 = ((((((32 + 16) + 16) + 16) + 16) + 16) + 16); @@ -1415,11 +1415,11 @@ static void ov91_021D237C (UnkStruct_ov91_021D0ED8 * param0, u16 param1, u16 par v2 -= 16; } - sub_0200D4C4(param0->unk_118[6 + v0], v1, v2); + SpriteActor_SetSpritePositionXY(param0->unk_118[6 + v0], v1, v2); } } else if (param1 > param2) { for (v0 = 0; v0 < 7; v0++) { - sub_0200D550(param0->unk_118[6 + v0], &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); if (v2 == ((((((32 + 16) + 16) + 16) + 16) + 16) + 16)) { v2 = 32; @@ -1431,14 +1431,14 @@ static void ov91_021D237C (UnkStruct_ov91_021D0ED8 * param0, u16 param1, u16 par v2 += 16; } - sub_0200D4C4(param0->unk_118[6 + v0], v1, v2); + SpriteActor_SetSpritePositionXY(param0->unk_118[6 + v0], v1, v2); } } else { return; } for (v0 = 0; v0 < 7; v0++) { - sub_0200D550(param0->unk_118[6 + v0], &v1, &v2); + SpriteActor_GetSpritePositionXY(param0->unk_118[6 + v0], &v1, &v2); v2 = (v2 - 32) / 16; if (param2 + v2 >= param0->unk_184 - 1) { @@ -1465,13 +1465,13 @@ static void ov91_021D2508 (UnkStruct_ov91_021D0ED8 * param0, NARC * param1) ov91_021D2110(param0, param1); for (v0 = 0; v0 < 13; v0++) { - param0->unk_118[v0] = sub_0200CE6C(param0->unk_110, param0->unk_114, &Unk_ov91_021D28FC[v0]); + param0->unk_118[v0] = SpriteActor_LoadResources(param0->unk_110, param0->unk_114, &Unk_ov91_021D28FC[v0]); } } static void ov91_021D2548 (UnkStruct_ov91_021D0ED8 * param0, u8 param1, u8 param2) { - sub_0200D4C4(param0->unk_118[4], 196, 32 + 16 * param1); + SpriteActor_SetSpritePositionXY(param0->unk_118[4], 196, 32 + 16 * param1); sub_0200D41C(param0->unk_118[4], param2); } diff --git a/src/overlay094/ov94_0223C610.c b/src/overlay094/ov94_0223C610.c index 5bab314c7e..54f6a59f27 100644 --- a/src/overlay094/ov94_0223C610.c +++ b/src/overlay094/ov94_0223C610.c @@ -316,7 +316,7 @@ static void ov94_0223C950 (UnkStruct_ov94_0223FD4C * param0) param0->unk_E20 = sub_02021AA0(&v0); sub_02021CC8(param0->unk_E20, 1); - sub_02021D6C(param0->unk_E20, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_E20, 1); } static void ov94_0223C9B0 (UnkStruct_ov94_0223FD4C * param0) diff --git a/src/overlay094/ov94_0223D0C4.c b/src/overlay094/ov94_0223D0C4.c index f5ace6f35e..b8c27963ef 100644 --- a/src/overlay094/ov94_0223D0C4.c +++ b/src/overlay094/ov94_0223D0C4.c @@ -271,7 +271,7 @@ static void ov94_0223D3DC (UnkStruct_ov94_0223FD4C * param0) param0->unk_F30 = sub_02021AA0(&v0); sub_02021CC8(param0->unk_F30, 1); - sub_02021D6C(param0->unk_F30, 37); + SpriteActor_SetSpriteAnimActive(param0->unk_F30, 37); sub_02039734(); } diff --git a/src/overlay094/ov94_0223DC04.c b/src/overlay094/ov94_0223DC04.c index 47d6ad2f22..61e40a0181 100644 --- a/src/overlay094/ov94_0223DC04.c +++ b/src/overlay094/ov94_0223DC04.c @@ -233,7 +233,7 @@ static void ov94_0223DE7C (UnkStruct_ov94_0223FD4C * param0) param0->unk_F30 = sub_02021AA0(&v0); sub_02021CC8(param0->unk_F30, 1); - sub_02021D6C(param0->unk_F30, 37); + SpriteActor_SetSpriteAnimActive(param0->unk_F30, 37); sub_02039734(); } @@ -357,7 +357,7 @@ static int ov94_0223E0A4 (UnkStruct_ov94_0223FD4C * param0) if (1) { if ((v0 != param0->unk_11C) && (v0 >= 0)) { - sub_02021D6C(param0->unk_F34[v0 + 1], 16 + v0 * 4); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v0 + 1], 16 + v0 * 4); param0->unk_2C = 2; ov94_0223C4C0(param0, 3, 0); param0->unk_11C = v0; diff --git a/src/overlay094/ov94_0223E46C.c b/src/overlay094/ov94_0223E46C.c index 1fad2d470b..eabe93d1ae 100644 --- a/src/overlay094/ov94_0223E46C.c +++ b/src/overlay094/ov94_0223E46C.c @@ -304,7 +304,7 @@ static void ov94_0223E770 (UnkStruct_ov94_0223FD4C * param0) param0->unk_E20 = sub_02021AA0(&v0); sub_02021CC8(param0->unk_E20, 1); - sub_02021D6C(param0->unk_E20, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_E20, 0); sub_02021E80(param0->unk_E20, 1); sub_02039734(); } @@ -464,7 +464,7 @@ static int ov94_0223EA84 (UnkStruct_ov94_0223FD4C * param0) if (param0->unk_10F2) { if (v1 >= 0) { - sub_02021D6C(param0->unk_F34[v1 + 1], 16 + v1 * 4); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v1 + 1], 16 + v1 * 4); param0->unk_2C = 2; ov94_0223C4C0(param0, 3, 0); param0->unk_11C = v1; diff --git a/src/overlay094/ov94_0223FB48.c b/src/overlay094/ov94_0223FB48.c index ed06da0bd6..0b18145491 100644 --- a/src/overlay094/ov94_0223FB48.c +++ b/src/overlay094/ov94_0223FB48.c @@ -368,7 +368,7 @@ static void ov94_0223FE24 (UnkStruct_ov94_0223FD4C * param0) param0->unk_E20 = sub_02021AA0(&v1); sub_02021CC8(param0->unk_E20, 1); - sub_02021D6C(param0->unk_E20, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_E20, 4); if ((param0->unk_112 == 31) || ((param0->unk_112 >= 0) && (param0->unk_112 <= 5))) { sub_02021E80(param0->unk_E20, 0); @@ -383,7 +383,7 @@ static void ov94_0223FE24 (UnkStruct_ov94_0223FD4C * param0) param0->unk_E28[v0] = sub_02021AA0(&v1); - sub_02021D6C(param0->unk_E28[v0], 6 + v0); + SpriteActor_SetSpriteAnimActive(param0->unk_E28[v0], 6 + v0); sub_02021E80(param0->unk_E28[v0], 1); } @@ -394,7 +394,7 @@ static void ov94_0223FE24 (UnkStruct_ov94_0223FD4C * param0) param0->unk_EA0[v0] = sub_02021AA0(&v1); - sub_02021D6C(param0->unk_EA0[v0], 40); + SpriteActor_SetSpriteAnimActive(param0->unk_EA0[v0], 40); sub_02021E80(param0->unk_EA0[v0], 1); } @@ -405,7 +405,7 @@ static void ov94_0223FE24 (UnkStruct_ov94_0223FD4C * param0) param0->unk_F18[v0] = sub_02021AA0(&v1); - sub_02021D6C(param0->unk_F18[v0], 42); + SpriteActor_SetSpriteAnimActive(param0->unk_F18[v0], 42); sub_02021E80(param0->unk_F18[v0], 1); } @@ -416,7 +416,7 @@ static void ov94_0223FE24 (UnkStruct_ov94_0223FD4C * param0) param0->unk_F54[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_F54[v0], 1); - sub_02021D6C(param0->unk_F54[v0], 38 + v0); + SpriteActor_SetSpriteAnimActive(param0->unk_F54[v0], 38 + v0); sub_02021E80(param0->unk_F54[v0], 1); } } @@ -1119,9 +1119,9 @@ static void ov94_02240EAC (BoxPokemon * param0, GraphicElementData * param1, Gra sub_02021CAC(param2, 1); if (Item_IsMail(v1)) { - sub_02021D6C(param2, 41); + SpriteActor_SetSpriteAnimActive(param2, 41); } else { - sub_02021D6C(param2, 40); + SpriteActor_SetSpriteAnimActive(param2, 40); } } else { sub_02021CAC(param2, 0); diff --git a/src/overlay094/ov94_02243EF8.c b/src/overlay094/ov94_02243EF8.c index dd5b4970c1..444ae55a4c 100644 --- a/src/overlay094/ov94_02243EF8.c +++ b/src/overlay094/ov94_02243EF8.c @@ -60,14 +60,14 @@ void ov94_02243EF8 (UnkStruct_ov94_0223FD4C * param0, int param1) param0->unk_F34[0] = sub_02021AA0(&v0); sub_02021CC8(param0->unk_F34[0], 1); - sub_02021D6C(param0->unk_F34[0], 3 + param1 * 7); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[0], 3 + param1 * 7); sub_02021CAC(param0->unk_F34[0], 1); for (v1 = 0; v1 < 7; v1++) { param0->unk_F34[v1 + 1] = sub_02021AA0(&v0); sub_02021CC8(param0->unk_F34[v1 + 1], 1); - sub_02021D6C(param0->unk_F34[v1 + 1], 14 + v1 * 4); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v1 + 1], 14 + v1 * 4); sub_02021CAC(param0->unk_F34[v1 + 1], 0); ov94_022441A0(param0->unk_F34[v1 + 1], Unk_ov94_02246322[v1][0], Unk_ov94_02246322[v1][1]); @@ -96,7 +96,7 @@ void ov94_02243FA8 (UnkStruct_ov94_0223FD4C * param0, int param1) static void ov94_02243FF0 (UnkStruct_ov94_02243FF0 * param0, int param1) { - sub_02021D6C(param0->unk_0C->unk_F34[0], param1 + param0->unk_08 * 7); + SpriteActor_SetSpriteAnimActive(param0->unk_0C->unk_F34[0], param1 + param0->unk_08 * 7); } static void ov94_0224400C (SysTask * param0, void * param1) @@ -253,9 +253,9 @@ void ov94_02244234 (UnkStruct_ov94_0223FD4C * param0, int param1, int param2) ov94_02244378(param0->unk_10F8, param0->unk_1100, v0, v1, v2); if (param2) { - sub_02021D6C(param0->unk_F34[v0 + 1], 14 + v0 * 4); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v0 + 1], 14 + v0 * 4); } else { - sub_02021D6C(param0->unk_F34[v0 + 1], 17 + v0 * 4); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v0 + 1], 17 + v0 * 4); } sub_02021CAC(param0->unk_F34[v0 + 1], 1); @@ -277,7 +277,7 @@ void ov94_022442E4 (UnkStruct_ov94_0223FD4C * param0) for (v0 = 0; v0 < 7; v0++) { if (sub_02021D34(param0->unk_F34[v0 + 1])) { if (sub_02021E24(param0->unk_F34[v0 + 1]) != ov94_022442DC(v0) + 1) { - sub_02021D6C(param0->unk_F34[v0 + 1], ov94_022442DC(v0) + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_F34[v0 + 1], ov94_022442DC(v0) + 1); } } } diff --git a/src/overlay095/ov95_02247B6C.c b/src/overlay095/ov95_02247B6C.c index 09ae1dd979..0c8dab1826 100644 --- a/src/overlay095/ov95_02247B6C.c +++ b/src/overlay095/ov95_02247B6C.c @@ -309,7 +309,7 @@ static int ov95_02247ED8 (UnkStruct_ov95_02247C6C * param0, int * param1) switch (*param1) { case 0: if (ScreenWipe_Done()) { - sub_02021D6C(param0->unk_3C[0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_3C[0], 1); sub_02021CAC(param0->unk_3C[0], 1); return 1; } @@ -404,7 +404,7 @@ static int ov95_02248090 (UnkStruct_ov95_02247C6C * param0, int * param1) case 1: if (ov95_022483B4(param0)) { sub_02007DC8(param0->unk_10); - sub_02021D6C(param0->unk_3C[1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_3C[1], 0); sub_02021CAC(param0->unk_3C[1], 1); (*param1)++; } diff --git a/src/overlay095/ov95_02248590.c b/src/overlay095/ov95_02248590.c index 6be41afa02..192e2f7b7a 100644 --- a/src/overlay095/ov95_02248590.c +++ b/src/overlay095/ov95_02248590.c @@ -627,8 +627,8 @@ static void ov95_02248CA8 (UnkStruct_ov95_02248688 * param0) param0->unk_1C[v3][0] = ov95_022475E4(param0->unk_00, &v2, v4, v5, 0, NNS_G2D_VRAM_TYPE_2DMAIN); param0->unk_1C[v3][1] = ov95_022475E4(param0->unk_00, &v2, v4, v5 + 56, 0, NNS_G2D_VRAM_TYPE_2DMAIN); - sub_02021D6C(param0->unk_1C[v3][0], 0); - sub_02021D6C(param0->unk_1C[v3][1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v3][0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_1C[v3][1], 1); sub_02021CAC(param0->unk_1C[v3][0], 0); sub_02021CAC(param0->unk_1C[v3][1], 0); } diff --git a/src/overlay095/ov95_02249740.c b/src/overlay095/ov95_02249740.c index 2e036692af..3d01c699c9 100644 --- a/src/overlay095/ov95_02249740.c +++ b/src/overlay095/ov95_02249740.c @@ -221,7 +221,7 @@ static int ov95_02249840 (UnkStruct_ov95_022497D8 * param0, int * param1) case 2: if (ov95_02249CF0(&(param0->unk_34))) { Sound_PlayEffect(1709); - sub_02021D6C(param0->unk_20[0], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_20[0], 3); sub_02021CAC(param0->unk_20[0], 1); (*param1)++; } diff --git a/src/overlay095/ov95_0224A390.c b/src/overlay095/ov95_0224A390.c index 505acdc4a0..72365fd26a 100644 --- a/src/overlay095/ov95_0224A390.c +++ b/src/overlay095/ov95_0224A390.c @@ -191,7 +191,7 @@ static int ov95_0224A464 (UnkStruct_ov95_0224A42C * param0, int * param1) switch (*param1) { case 0: if (ScreenWipe_Done()) { - sub_02021D6C(param0->unk_20[0], 3); + SpriteActor_SetSpriteAnimActive(param0->unk_20[0], 3); sub_02021CAC(param0->unk_20[0], 1); (*param1)++; } diff --git a/src/overlay095/ov95_0224B3D8.c b/src/overlay095/ov95_0224B3D8.c index 7c6b4cae07..06d6e4f43f 100644 --- a/src/overlay095/ov95_0224B3D8.c +++ b/src/overlay095/ov95_0224B3D8.c @@ -337,7 +337,7 @@ static int ov95_0224B6F0 (UnkStruct_ov95_0224B4D4 * param0, int * param1) switch (*param1) { case 0: if (ScreenWipe_Done()) { - sub_02021D6C(param0->unk_40[0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_40[0], 1); sub_02021CAC(param0->unk_40[0], 1); return 1; } @@ -355,7 +355,7 @@ static int ov95_0224B71C (UnkStruct_ov95_0224B4D4 * param0, int * param1) (*param1)++; case 1: if (param0->unk_80 == NULL) { - sub_02021D6C(param0->unk_40[1], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_40[1], 2); sub_02021CAC(param0->unk_40[1], 1); ov95_022479A8(param0->unk_78, 0); param0->unk_08 = 0; diff --git a/src/overlay096/ov96_0223B6A0.c b/src/overlay096/ov96_0223B6A0.c index 1d31f737ac..2d1c3cc0c5 100644 --- a/src/overlay096/ov96_0223B6A0.c +++ b/src/overlay096/ov96_0223B6A0.c @@ -316,7 +316,7 @@ static void ov96_0223BB0C (UnkStruct_ov96_0223BF40 * param0) v1.unk_08.y = FX32_ONE * Unk_ov96_0223DA80[v0][1]; param0->unk_E30[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_E30[v0], 1); - sub_02021D6C(param0->unk_E30[v0], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_E30[v0], v0); sub_02021CAC(param0->unk_E30[v0], 0); } } diff --git a/src/overlay097/ov97_0222D30C.c b/src/overlay097/ov97_0222D30C.c index 663dca0b73..222e7e8088 100644 --- a/src/overlay097/ov97_0222D30C.c +++ b/src/overlay097/ov97_0222D30C.c @@ -1208,7 +1208,7 @@ static GraphicElementData * ov97_0222E538 (UnkStruct_ov97_0222E398 * param0, int if (v0) { sub_02021CC8(v0, 1); sub_02021E80(v0, 0); - sub_02021D6C(v0, 0); + SpriteActor_SetSpriteAnimActive(v0, 0); sub_02021CAC(v0, 1); } @@ -1220,7 +1220,7 @@ static void ov97_0222E5B4 (UnkStruct_ov97_0222E398 * param0) param0->unk_3008.unk_0C = ov97_0222E538(param0, NNS_G2D_VRAM_TYPE_2DMAIN); sub_02021DCC(param0->unk_3008.unk_0C, 2); - sub_02021E50(param0->unk_3008.unk_0C, 0); + SpriteActor_SetAnimFrame(param0->unk_3008.unk_0C, 0); sub_02021CAC(param0->unk_3008.unk_0C, 0); sub_02021F58(param0->unk_3008.unk_0C, 0); sub_02021CF8(param0->unk_3008.unk_0C, 2); @@ -1239,7 +1239,7 @@ static void ov97_0222E60C (UnkStruct_ov97_0222E398 * param0) param0->unk_3054.unk_0C = ov97_0222E538(param0, NNS_G2D_VRAM_TYPE_2DSUB); sub_02021DCC(param0->unk_3054.unk_0C, 4); - sub_02021E50(param0->unk_3054.unk_0C, 0); + SpriteActor_SetAnimFrame(param0->unk_3054.unk_0C, 0); sub_02021CAC(param0->unk_3054.unk_0C, 0); sub_02021F58(param0->unk_3054.unk_0C, 0); sub_02021CF8(param0->unk_3054.unk_0C, 2); @@ -1295,7 +1295,7 @@ static void ov97_0222E6F8 (UnkStruct_ov97_0222E398 * param0) for (v0 = 0; v0 < 80; v0++) { param0->unk_88[v0].unk_0C = ov97_0222E538(param0, NNS_G2D_VRAM_TYPE_2DMAIN); sub_02021DCC(param0->unk_88[v0].unk_0C, 1); - sub_02021E50(param0->unk_88[v0].unk_0C, 0); + SpriteActor_SetAnimFrame(param0->unk_88[v0].unk_0C, 0); } } @@ -1307,7 +1307,7 @@ static void ov97_0222E734 (UnkStruct_ov97_0222E398 * param0) if (v0 < (80 / 4)) { param0->unk_88[v0].unk_0C = ov97_0222E538(param0, NNS_G2D_VRAM_TYPE_2DMAIN); sub_02021DCC(param0->unk_88[v0].unk_0C, 1); - sub_02021E50(param0->unk_88[v0].unk_0C, 0); + SpriteActor_SetAnimFrame(param0->unk_88[v0].unk_0C, 0); } else { param0->unk_88[v0].unk_0C = NULL; } @@ -1321,7 +1321,7 @@ static void ov97_0222E77C (UnkStruct_ov97_0222E398 * param0) for (v0 = 0; v0 < 80; v0++) { param0->unk_1848[v0].unk_0C = ov97_0222E538(param0, NNS_G2D_VRAM_TYPE_2DSUB); sub_02021DCC(param0->unk_1848[v0].unk_0C, 5); - sub_02021E50(param0->unk_1848[v0].unk_0C, 0); + SpriteActor_SetAnimFrame(param0->unk_1848[v0].unk_0C, 0); } } @@ -1573,7 +1573,7 @@ static void ov97_0222EEB8 (SysTask * param0, void * param1) f32 v2, v3; if (v0->unk_30) { - sub_02021E50(v0->unk_0C, 0); + SpriteActor_SetAnimFrame(v0->unk_0C, 0); v0->unk_30--; return; } else { diff --git a/src/overlay097/ov97_02230410.c b/src/overlay097/ov97_02230410.c index 707bca193b..d8b27566b1 100644 --- a/src/overlay097/ov97_02230410.c +++ b/src/overlay097/ov97_02230410.c @@ -1002,8 +1002,8 @@ static void ov97_022314FC (UnkStruct_ov97_02230868 * param0, int param1, int * p } if (v1 != param0->unk_3E10) { - sub_02021D6C(param0->unk_2E88[0], param0->unk_3E10 == 0 ? 1 : 0); - sub_02021D6C(param0->unk_2E88[1], param0->unk_3E10 == 0 ? 0 : 1); + SpriteActor_SetSpriteAnimActive(param0->unk_2E88[0], param0->unk_3E10 == 0 ? 1 : 0); + SpriteActor_SetSpriteAnimActive(param0->unk_2E88[1], param0->unk_3E10 == 0 ? 0 : 1); } v0 = 0; diff --git a/src/overlay097/ov97_02233B18.c b/src/overlay097/ov97_02233B18.c index d068d8fad1..cdf62e099f 100644 --- a/src/overlay097/ov97_02233B18.c +++ b/src/overlay097/ov97_02233B18.c @@ -772,7 +772,7 @@ static void ov97_02234508 (UnkStruct_ov97_02234A2C * param0) } sub_02021CC8(param0->unk_20C[v0].unk_00, 1); - sub_02021D6C(param0->unk_20C[v0].unk_00, 10 + v0); + SpriteActor_SetSpriteAnimActive(param0->unk_20C[v0].unk_00, 10 + v0); sub_02021E80(param0->unk_20C[v0].unk_00, 1); sub_02021CAC(param0->unk_20C[v0].unk_00, 1); sub_02021F58(param0->unk_20C[v0].unk_00, 100 + v0); @@ -785,7 +785,7 @@ static void ov97_02234508 (UnkStruct_ov97_02234A2C * param0) } sub_02021CC8(param0->unk_20C[v0].unk_04, 1); - sub_02021D6C(param0->unk_20C[v0].unk_04, 40); + SpriteActor_SetSpriteAnimActive(param0->unk_20C[v0].unk_04, 40); sub_02021E80(param0->unk_20C[v0].unk_04, 1); sub_02021CAC(param0->unk_20C[v0].unk_04, 0); sub_02021F58(param0->unk_20C[v0].unk_04, 0 + v0); @@ -813,7 +813,7 @@ static GraphicElementData * ov97_02234638 (UnkStruct_ov97_02234A2C * param0, int v1 = sub_02021AA0(&v0); sub_02021CC8(v1, 1); - sub_02021D6C(v1, param3); + SpriteActor_SetSpriteAnimActive(v1, param3); sub_02021E80(v1, 1); sub_02021CAC(v1, param4); @@ -1485,7 +1485,7 @@ static void ov97_02234F88 (UnkStruct_ov97_02234A2C * param0) param0->unk_478[v0] = sub_02021AA0(&v5); sub_02021CC8(param0->unk_478[v0], 1); - sub_02021D6C(param0->unk_478[v0], 10 + v0); + SpriteActor_SetSpriteAnimActive(param0->unk_478[v0], 10 + v0); sub_02021E80(param0->unk_478[v0], 1); sub_02021CAC(param0->unk_478[v0], 1); diff --git a/src/overlay097/ov97_02237694.c b/src/overlay097/ov97_02237694.c index 6baa87cf66..718e738d94 100644 --- a/src/overlay097/ov97_02237694.c +++ b/src/overlay097/ov97_02237694.c @@ -468,7 +468,7 @@ GraphicElementData * ov97_02237D14 (int param0, GraphicElementData * param1, int sub_02021CC8(param1, 1); sub_02021E80(param1, 0); - sub_02021D6C(param1, param4); + SpriteActor_SetSpriteAnimActive(param1, param4); sub_02021CAC(param1, 1); return param1; diff --git a/src/overlay099/ov99_021D1A54.c b/src/overlay099/ov99_021D1A54.c index 1171870587..138a04b9ed 100644 --- a/src/overlay099/ov99_021D1A54.c +++ b/src/overlay099/ov99_021D1A54.c @@ -10,7 +10,7 @@ #include "overlay099/struct_ov99_021D2CB0.h" #include "overlay099/struct_ov99_021D2CB0_sub2.h" #include "overlay099/struct_ov99_021D3A40.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02002F38.h" @@ -240,7 +240,7 @@ static const UnkStruct_ov99_021D4A04 Unk_ov99_021D4A04[] = { } }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D499C = { +static const SpriteTemplate Unk_ov99_021D499C = { 0x0, 0x0, 0x0, @@ -253,7 +253,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D499C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D4968 = { +static const SpriteTemplate Unk_ov99_021D4968 = { 0x0, 0x0, 0x0, @@ -266,7 +266,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D4968 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D4934 = { +static const SpriteTemplate Unk_ov99_021D4934 = { 0x0, 0x0, 0x0, @@ -279,7 +279,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D4934 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D49D0 = { +static const SpriteTemplate Unk_ov99_021D49D0 = { 0x0, 0x0, 0x0, @@ -292,7 +292,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D49D0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D48CC = { +static const SpriteTemplate Unk_ov99_021D48CC = { 0x0, 0x0, 0x0, @@ -305,7 +305,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D48CC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov99_021D4900 = { +static const SpriteTemplate Unk_ov99_021D4900 = { 0xC0, 0xA0, 0x0, @@ -323,15 +323,15 @@ static void ov99_021D1A54 (UnkStruct_ov99_021D2CB0 * param0) u8 v0; if (param0->unk_00->unk_00 == 0) { - v0 = sub_0200CDC4(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 31, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 28, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 29, 0, 10001); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 30, 0, 10001); + v0 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 31, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 28, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 29, 0, 10001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 30, 0, 10001); } else { - v0 = sub_0200CDC4(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 36, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 33, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 34, 0, 10001); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 35, 0, 10001); + v0 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 36, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 33, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 34, 0, 10001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 35, 0, 10001); } switch (param0->unk_1101) { @@ -348,32 +348,32 @@ static void ov99_021D1A54 (UnkStruct_ov99_021D2CB0 * param0) static void ov99_021D1B98 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D070(param0->unk_1C, 10001); - sub_0200D080(param0->unk_1C, 10001); - sub_0200D090(param0->unk_1C, 10001); - sub_0200D0A0(param0->unk_1C, 10001); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 10001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_1C, 10001); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 10001); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 10001); } static void ov99_021D1BC4 (UnkStruct_ov99_021D2CB0 * param0, CellActorData ** param1, CellActorData ** param2) { CellActorData * v0; CellActorData * v1; - UnkStruct_ov104_0223F9E0 v2 = Unk_ov99_021D4900; + SpriteTemplate v2 = Unk_ov99_021D4900; MI_CpuClear8(¶m0->unk_1114, sizeof(UnkStruct_ov99_021D2CB0_sub2)); - v0 = sub_0200CE6C(param0->unk_18, param0->unk_1C, &v2); + v0 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); sub_0200D390(v0, 1); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); *param1 = v0; - v2.unk_08 = 60; - v1 = sub_0200CE6C(param0->unk_18, param0->unk_1C, &v2); + v2.priority = 60; + v1 = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &v2); sub_0200D364(v1, 2); sub_0200D390(v1, 1); - sub_0200D324(v1->unk_00); + SpriteActor_UpdateObject(v1->unk_00); *param2 = v1; @@ -507,18 +507,18 @@ static void ov99_021D1EB4 (UnkStruct_ov99_021D2CB0 * param0) static void ov99_021D1EC8 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200CDC4(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10003); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10003); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10003); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10003); + SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10003); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10003); } static void ov99_021D1F44 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D070(param0->unk_1C, 10003); - sub_0200D080(param0->unk_1C, 10003); - sub_0200D090(param0->unk_1C, 10003); - sub_0200D0A0(param0->unk_1C, 10003); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 10003); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_1C, 10003); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 10003); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 10003); } static void ov99_021D1F70 (UnkStruct_ov99_021D2CB0 * param0) @@ -526,11 +526,11 @@ static void ov99_021D1F70 (UnkStruct_ov99_021D2CB0 * param0) int v0; for (v0 = 2; v0 <= 4; v0++) { - param0->unk_10E0[v0] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov99_021D499C); + param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D499C); sub_0200D6A4(param0->unk_10E0[v0], 2); sub_0200D390(param0->unk_10E0[v0], 1); - sub_0200D324(param0->unk_10E0[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); } } @@ -725,18 +725,18 @@ static void ov99_021D22F4 (UnkStruct_ov99_021D2CB0 * param0) static void ov99_021D2308 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200CDC4(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10004); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10004); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10004); + SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10004); } static void ov99_021D2384 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D070(param0->unk_1C, 10004); - sub_0200D080(param0->unk_1C, 10004); - sub_0200D090(param0->unk_1C, 10004); - sub_0200D0A0(param0->unk_1C, 10004); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 10004); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_1C, 10004); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 10004); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 10004); } static void ov99_021D23B0 (UnkStruct_ov99_021D2CB0 * param0) @@ -744,9 +744,9 @@ static void ov99_021D23B0 (UnkStruct_ov99_021D2CB0 * param0) int v0; for (v0 = 2; v0 <= 3; v0++) { - param0->unk_10E0[v0] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4968); + param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4968); sub_0200D390(param0->unk_10E0[v0], 1); - sub_0200D324(param0->unk_10E0[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); } } @@ -850,18 +850,18 @@ static void ov99_021D2664 (UnkStruct_ov99_021D2CB0 * param0) { ov99_021D1A54(param0); - sub_0200CDC4(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10002); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10002); + SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 4, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10002); } static void ov99_021D26E4 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D070(param0->unk_1C, 10002); - sub_0200D080(param0->unk_1C, 10002); - sub_0200D090(param0->unk_1C, 10002); - sub_0200D0A0(param0->unk_1C, 10002); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 10002); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_1C, 10002); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 10002); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 10002); ov99_021D1B98(param0); } @@ -870,11 +870,11 @@ static void ov99_021D2714 (UnkStruct_ov99_021D2CB0 * param0) { ov99_021D1BC4(param0, ¶m0->unk_10E0[0], ¶m0->unk_10E0[1]); - param0->unk_10E0[3] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov99_021D49D0); + param0->unk_10E0[3] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D49D0); sub_0200D390(param0->unk_10E0[3], 1); sub_0200D3F4(param0->unk_10E0[3], 0); - sub_0200D324(param0->unk_10E0[3]->unk_00); + SpriteActor_UpdateObject(param0->unk_10E0[3]->unk_00); } static void ov99_021D275C (UnkStruct_ov99_021D2CB0 * param0) @@ -885,18 +885,18 @@ static void ov99_021D275C (UnkStruct_ov99_021D2CB0 * param0) static void ov99_021D2780 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200CDC4(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10005); - sub_0200CC3C(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10005); - sub_0200CE24(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10005); - sub_0200CE54(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10005); + SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_18, param0->unk_1C, param0->unk_10F8, 15, 0, 10, NNS_G2D_VRAM_TYPE_2DSUB, 10005); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 0, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10005); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 1, 0, 10005); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_18, param0->unk_1C, param0->unk_10F8, 2, 0, 10005); } static void ov99_021D27FC (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D070(param0->unk_1C, 10005); - sub_0200D080(param0->unk_1C, 10005); - sub_0200D090(param0->unk_1C, 10005); - sub_0200D0A0(param0->unk_1C, 10005); + SpriteGfxHandler_UnloadCharObjById(param0->unk_1C, 10005); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_1C, 10005); + SpriteGfxHandler_UnloadCellObjById(param0->unk_1C, 10005); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_1C, 10005); } static void ov99_021D2828 (UnkStruct_ov99_021D2CB0 * param0) @@ -904,16 +904,16 @@ static void ov99_021D2828 (UnkStruct_ov99_021D2CB0 * param0) int v0; for (v0 = 2; v0 <= 2; v0++) { - param0->unk_10E0[v0] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4934); + param0->unk_10E0[v0] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D4934); sub_0200D390(param0->unk_10E0[v0], 1); - sub_0200D324(param0->unk_10E0[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_10E0[v0]->unk_00); } - param0->unk_10E0[4] = sub_0200CE6C(param0->unk_18, param0->unk_1C, &Unk_ov99_021D48CC); + param0->unk_10E0[4] = SpriteActor_LoadResources(param0->unk_18, param0->unk_1C, &Unk_ov99_021D48CC); sub_0200D390(param0->unk_10E0[4], 1); sub_0200D3F4(param0->unk_10E0[4], 0); - sub_0200D324(param0->unk_10E0[4]->unk_00); + SpriteActor_UpdateObject(param0->unk_10E0[4]->unk_00); } static void ov99_021D288C (UnkStruct_ov99_021D2CB0 * param0) diff --git a/src/overlay099/ov99_021D340C.c b/src/overlay099/ov99_021D340C.c index fdf676dcb9..b3b76cd917 100644 --- a/src/overlay099/ov99_021D340C.c +++ b/src/overlay099/ov99_021D340C.c @@ -218,8 +218,8 @@ static void ov99_021D35E8 (UnkStruct_ov99_021D2CB0 * param0, UnkStruct_ov99_021D static void ov99_021D36B0 (UnkStruct_ov99_021D2CB0 * param0) { - sub_0200D810(param0->unk_10E0[3], GX_OAM_MODE_XLU); - sub_0200D810(param0->unk_10E0[4], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_10E0[3], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_10E0[4], GX_OAM_MODE_XLU); } static void ov99_021D36D4 (UnkStruct_ov99_021D2CB0 * param0, UnkStruct_ov99_021D340C * param1) diff --git a/src/overlay100/ov100_021D13E4.c b/src/overlay100/ov100_021D13E4.c index dfea306b45..412584a601 100644 --- a/src/overlay100/ov100_021D13E4.c +++ b/src/overlay100/ov100_021D13E4.c @@ -11,7 +11,7 @@ #include "overlay100/struct_ov100_021D1808.h" #include "overlay100/struct_ov100_021D4DD8.h" #include "overlay100/struct_ov100_021D4EBC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay115/struct_ov115_0226527C.h" #include "unk_02002F38.h" @@ -233,9 +233,9 @@ static void ov100_021D1808 (UnkStruct_ov100_021D1808 * param0) { NARC * v0 = param0->unk_7C4->unk_00; BGL * v1 = param0->unk_7C4->unk_0C; - CellTransferStateData * v2 = param0->unk_7C4->unk_04; - AnimationResourceCollection * v3 = param0->unk_7C4->unk_08; - PaletteSys * v4 = param0->unk_7C4->unk_10; + SpriteRenderer * v2 = param0->unk_7C4->unk_04; + SpriteGfxHandler * v3 = param0->unk_7C4->unk_08; + PaletteData * v4 = param0->unk_7C4->unk_10; int v5 = 50000; sub_020070E8(v0, 70, v1, 5, 0, 0, 0, 111); @@ -248,10 +248,10 @@ static void ov100_021D1808 (UnkStruct_ov100_021D1808 * param0) sub_02002FBC(v4, &v6, 0, 0, 0x2); } - sub_0200CDC4(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); - sub_0200CE24(v2, v3, v0, 48, 0, v5); - sub_0200CE54(v2, v3, v0, 47, 0, v5); - sub_0200CC3C(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 48, 0, v5); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, v5); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); ov100_021D4AC8(¶m0->unk_1A4.unk_498, 60, param0->unk_7C4->unk_00); @@ -289,36 +289,36 @@ static void ov100_021D1A54 (UnkStruct_ov100_021D1808 * param0) int v0; NARC * v1 = param0->unk_7C4->unk_00; BGL * v2 = param0->unk_7C4->unk_0C; - CellTransferStateData * v3 = param0->unk_7C4->unk_04; - AnimationResourceCollection * v4 = param0->unk_7C4->unk_08; - PaletteSys * v5 = param0->unk_7C4->unk_10; - UnkStruct_ov104_0223F9E0 v6; - - v6.unk_00 = 0; - v6.unk_02 = 0; - v6.unk_04 = 0; - v6.unk_06 = 0; - v6.unk_08 = 0; - v6.unk_0C = 0; - v6.unk_10 = 2; - v6.unk_2C = 2; - v6.unk_30 = 0; - - v6.unk_14[4] = 0xffffffff; - v6.unk_14[5] = 0xffffffff; - - v6.unk_14[0] = 50000; - v6.unk_14[1] = 50000; - v6.unk_14[2] = 50000; - v6.unk_14[3] = 50000; + SpriteRenderer * v3 = param0->unk_7C4->unk_04; + SpriteGfxHandler * v4 = param0->unk_7C4->unk_08; + PaletteData * v5 = param0->unk_7C4->unk_10; + SpriteTemplate v6; + + v6.x = 0; + v6.y = 0; + v6.z = 0; + v6.animIdx = 0; + v6.priority = 0; + v6.plttIdx = 0; + v6.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v6.bgPriority = 2; + v6.transferToVRAM = FALSE; + + v6.resources[4] = SPRITE_RESOURCE_NONE; + v6.resources[5] = SPRITE_RESOURCE_NONE; + + v6.resources[0] = 50000; + v6.resources[1] = 50000; + v6.resources[2] = 50000; + v6.resources[3] = 50000; for (v0 = 0; v0 < 3; v0++) { - param0->unk_0C.unk_D4[v0].unk_00 = sub_0200CE6C(v3, v4, &v6); + param0->unk_0C.unk_D4[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); sub_0200D330(param0->unk_0C.unk_D4[v0].unk_00); sub_0200D3F4(param0->unk_0C.unk_D4[v0].unk_00, 0); sub_0200D430(param0->unk_0C.unk_D4[v0].unk_00, v0); - sub_0200D4C4(param0->unk_0C.unk_D4[v0].unk_00, 0, 0); + SpriteActor_SetSpritePositionXY(param0->unk_0C.unk_D4[v0].unk_00, 0, 0); param0->unk_0C.unk_D4[v0].unk_0C = 1; param0->unk_0C.unk_D4[v0].unk_08 = v0; @@ -339,19 +339,19 @@ static void ov100_021D1A54 (UnkStruct_ov100_021D1808 * param0) f32 v9[] = {0.1f, 0.3f, 0.2f}; if (v0 == 1) { - v6.unk_2C = 0; + v6.bgPriority = 0; } else { - v6.unk_2C = 2; + v6.bgPriority = 2; } - param0->unk_0C.unk_0C[v0].unk_00 = sub_0200CE6C(v3, v4, &v6); + param0->unk_0C.unk_0C[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); param0->unk_0C.unk_0C[v0].unk_04 = param0->unk_0C.unk_D4[v0].unk_00; sub_0200D330(param0->unk_0C.unk_0C[v0].unk_00); sub_0200D6A4(param0->unk_0C.unk_0C[v0].unk_00, 2); sub_0200D6E8(param0->unk_0C.unk_0C[v0].unk_00, v9[v0], v9[v0]); sub_0200D430(param0->unk_0C.unk_0C[v0].unk_00, v0); - sub_0200D4C4(param0->unk_0C.unk_0C[v0].unk_00, v7[v0], v8[v0]); + SpriteActor_SetSpritePositionXY(param0->unk_0C.unk_0C[v0].unk_00, v7[v0], v8[v0]); param0->unk_0C.unk_0C[v0].unk_0C = 0; param0->unk_0C.unk_0C[v0].unk_08 = v0; diff --git a/src/overlay100/ov100_021D1C44.c b/src/overlay100/ov100_021D1C44.c index daa994bff4..30b22657bf 100644 --- a/src/overlay100/ov100_021D1C44.c +++ b/src/overlay100/ov100_021D1C44.c @@ -11,7 +11,7 @@ #include "overlay100/struct_ov100_021D1C98.h" #include "overlay100/struct_ov100_021D4DD8.h" #include "overlay100/struct_ov100_021D54D0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay115/struct_ov115_0226527C.h" #include "unk_02002F38.h" @@ -74,9 +74,9 @@ static void ov100_021D1C98 (UnkStruct_ov100_021D1C98 * param0) { NARC * v0 = param0->unk_1EBC->unk_00; BGL * v1 = param0->unk_1EBC->unk_0C; - CellTransferStateData * v2 = param0->unk_1EBC->unk_04; - AnimationResourceCollection * v3 = param0->unk_1EBC->unk_08; - PaletteSys * v4 = param0->unk_1EBC->unk_10; + SpriteRenderer * v2 = param0->unk_1EBC->unk_04; + SpriteGfxHandler * v3 = param0->unk_1EBC->unk_08; + PaletteData * v4 = param0->unk_1EBC->unk_10; int v5 = 50000; sub_020070E8(v0, 18, v1, 5, 0, 0, 0, 111); @@ -84,10 +84,10 @@ static void ov100_021D1C98 (UnkStruct_ov100_021D1C98 * param0) PaletteSys_LoadPalette(v4, 172, 19, 111, 1, 0x20 * 2, 0); PaletteSys_LoadPalette(v4, 172, 19, 111, 0, 0x20 * 2, 0); - sub_0200CDC4(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); - sub_0200CE24(v2, v3, v0, 48, 0, v5); - sub_0200CE54(v2, v3, v0, 47, 0, v5); - sub_0200CC3C(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadPalette(v4, 3, v2, v3, v0, 50, 0, 3, NNS_G2D_VRAM_TYPE_2DSUB, v5); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 48, 0, v5); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 47, 0, v5); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 49, 0, NNS_G2D_VRAM_TYPE_2DSUB, v5); ov100_021D4AC8(¶m0->unk_1A0.unk_04, 46, param0->unk_1EBC->unk_00); @@ -198,37 +198,37 @@ static void ov100_021D2250 (UnkStruct_ov100_021D1C98 * param0) int v0; NARC * v1 = param0->unk_1EBC->unk_00; BGL * v2 = param0->unk_1EBC->unk_0C; - CellTransferStateData * v3 = param0->unk_1EBC->unk_04; - AnimationResourceCollection * v4 = param0->unk_1EBC->unk_08; - PaletteSys * v5 = param0->unk_1EBC->unk_10; - UnkStruct_ov104_0223F9E0 v6; - - v6.unk_00 = 0; - v6.unk_02 = 0; - v6.unk_04 = 0; - v6.unk_06 = 0; - v6.unk_08 = 0; - v6.unk_0C = 0; - v6.unk_10 = 2; - v6.unk_2C = 0; - v6.unk_30 = 0; - - v6.unk_14[4] = 0xffffffff; - v6.unk_14[5] = 0xffffffff; - - v6.unk_14[0] = 50000; - v6.unk_14[1] = 50000; - v6.unk_14[2] = 50000; - v6.unk_14[3] = 50000; + SpriteRenderer * v3 = param0->unk_1EBC->unk_04; + SpriteGfxHandler * v4 = param0->unk_1EBC->unk_08; + PaletteData * v5 = param0->unk_1EBC->unk_10; + SpriteTemplate v6; + + v6.x = 0; + v6.y = 0; + v6.z = 0; + v6.animIdx = 0; + v6.priority = 0; + v6.plttIdx = 0; + v6.vramType = NNS_G2D_VRAM_TYPE_2DSUB; + v6.bgPriority = 0; + v6.transferToVRAM = FALSE; + + v6.resources[4] = SPRITE_RESOURCE_NONE; + v6.resources[5] = SPRITE_RESOURCE_NONE; + + v6.resources[0] = 50000; + v6.resources[1] = 50000; + v6.resources[2] = 50000; + v6.resources[3] = 50000; for (v0 = 0; v0 < 3; v0++) { - param0->unk_08.unk_0C[v0].unk_00 = sub_0200CE6C(v3, v4, &v6); + param0->unk_08.unk_0C[v0].unk_00 = SpriteActor_LoadResources(v3, v4, &v6); sub_0200D330(param0->unk_08.unk_0C[v0].unk_00); sub_0200D6A4(param0->unk_08.unk_0C[v0].unk_00, 2); sub_0200D6E8(param0->unk_08.unk_0C[v0].unk_00, 0.5f, 0.5f); sub_0200D430(param0->unk_08.unk_0C[v0].unk_00, v0); - sub_0200D4C4(param0->unk_08.unk_0C[v0].unk_00, 16 + (v0 * 64), 64); + SpriteActor_SetSpritePositionXY(param0->unk_08.unk_0C[v0].unk_00, 16 + (v0 * 64), 64); param0->unk_08.unk_0C[v0].unk_0C = 1; param0->unk_08.unk_0C[v0].unk_08 = v0; diff --git a/src/overlay100/ov100_021D2F0C.c b/src/overlay100/ov100_021D2F0C.c index f40b9f32c3..843d9637ef 100644 --- a/src/overlay100/ov100_021D2F0C.c +++ b/src/overlay100/ov100_021D2F0C.c @@ -41,7 +41,7 @@ void * ov100_021D3620(UnkStruct_ov100_021D4DD8 * param0); BOOL ov100_021D39E4(void * param0); BOOL ov100_021D3FD4(void * param0); -static void ov100_021D2F0C (BGL * param0, PaletteSys * param1) +static void ov100_021D2F0C (BGL * param0, PaletteData * param1) { int v0 = 12; int v1 = 10; @@ -59,9 +59,9 @@ static void ov100_021D2F64 (UnkStruct_ov100_021D3084 * param0) { NARC * v0 = param0->unk_1D28->unk_00; BGL * v1 = param0->unk_1D28->unk_0C; - CellTransferStateData * v2 = param0->unk_1D28->unk_04; - AnimationResourceCollection * v3 = param0->unk_1D28->unk_08; - PaletteSys * v4 = param0->unk_1D28->unk_10; + SpriteRenderer * v2 = param0->unk_1D28->unk_04; + SpriteGfxHandler * v3 = param0->unk_1D28->unk_08; + PaletteData * v4 = param0->unk_1D28->unk_10; ov100_021D4AC8(¶m0->unk_0C.unk_934[0], 84, param0->unk_1D28->unk_00); ov100_021D4B4C(0, ¶m0->unk_0C.unk_934[0], 82, param0->unk_1D28->unk_00, ¶m0->unk_1D28->unk_1C); @@ -87,9 +87,9 @@ static void ov100_021D3084 (UnkStruct_ov100_021D3084 * param0) { NARC * v0 = param0->unk_1D28->unk_00; BGL * v1 = param0->unk_1D28->unk_0C; - CellTransferStateData * v2 = param0->unk_1D28->unk_04; - AnimationResourceCollection * v3 = param0->unk_1D28->unk_08; - PaletteSys * v4 = param0->unk_1D28->unk_10; + SpriteRenderer * v2 = param0->unk_1D28->unk_04; + SpriteGfxHandler * v3 = param0->unk_1D28->unk_08; + PaletteData * v4 = param0->unk_1D28->unk_10; ov100_021D4AC8(¶m0->unk_0C.unk_04, 46, param0->unk_1D28->unk_00); ov100_021D4AC8(¶m0->unk_0C.unk_314, 24, param0->unk_1D28->unk_00); diff --git a/src/overlay100/ov100_021D400C.c b/src/overlay100/ov100_021D400C.c index fc883462f1..ebc72780ed 100644 --- a/src/overlay100/ov100_021D400C.c +++ b/src/overlay100/ov100_021D400C.c @@ -228,7 +228,7 @@ void ov100_021D4438 (SysTask * param0, void * param1) BOOL v3; if (v0->unk_04 && v0->unk_3C) { - sub_0200D550(v0->unk_04, &v1, &v2); + SpriteActor_GetSpritePositionXY(v0->unk_04, &v1, &v2); v3 = ov100_021D4104(v0, v1, v2, 3.0f, 1); diff --git a/src/overlay101/ov101_021D59AC.c b/src/overlay101/ov101_021D59AC.c index 5ee5e6bd2e..085592f9fc 100644 --- a/src/overlay101/ov101_021D59AC.c +++ b/src/overlay101/ov101_021D59AC.c @@ -236,8 +236,8 @@ static void ov101_021D5A70 (UnkStruct_ov101_021D5D90 * param0, void * param1) v1 = Unk_ov101_021D927C[ov101_021D55A4(v4->unk_00.unk_00, v0, ((v2) / FX32_ONE))]; if (v1 != sub_02021E24(v4->unk_0C.unk_04)) { - sub_02021D6C(v4->unk_0C.unk_04, v1); - sub_02021E50(v4->unk_0C.unk_04, 0); + SpriteActor_SetSpriteAnimActive(v4->unk_0C.unk_04, v1); + SpriteActor_SetAnimFrame(v4->unk_0C.unk_04, 0); } } @@ -303,7 +303,7 @@ static void ov101_021D5BA8 (UnkStruct_ov101_021D5D90 * param0, void * param1) v2 /= v1->unk_04; if (v2 != sub_02021E24(v1->unk_0C.unk_04)) { - sub_02021D6C(v1->unk_0C.unk_04, v2); + SpriteActor_SetSpriteAnimActive(v1->unk_0C.unk_04, v2); sub_02021DE0(v1->unk_0C.unk_04); } @@ -376,7 +376,7 @@ static void ov101_021D5CE0 (UnkStruct_ov101_021D5D90 * param0, void * param1) v2 /= v1->unk_04; if (v2 != sub_02021E24(v1->unk_0C.unk_04)) { - sub_02021D6C(v1->unk_0C.unk_04, v2); + SpriteActor_SetSpriteAnimActive(v1->unk_0C.unk_04, v2); sub_02021DE0(v1->unk_0C.unk_04); } @@ -528,8 +528,8 @@ static int ov101_021D5E84 (UnkStruct_ov101_021D630C * param0) sub_02021C70(param0->unk_3C.unk_04, &v1); sub_02021C94(param0->unk_3C.unk_04, 0); sub_02021C50(param0->unk_3C.unk_04, &v0); - sub_02021D6C(param0->unk_3C.unk_04, 0); - sub_02021E50(param0->unk_3C.unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 0); + SpriteActor_SetAnimFrame(param0->unk_3C.unk_04, 0); Sound_PlayEffect(1572); param0->unk_04++; @@ -582,7 +582,7 @@ static int(*const Unk_ov101_021D912C[])(UnkStruct_ov101_021D630C *) = { static int ov101_021D5F70 (UnkStruct_ov101_021D630C * param0) { - sub_02021D6C(param0->unk_3C.unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 1); sub_02021DE0(param0->unk_3C.unk_04); sub_02021CC8(param0->unk_3C.unk_04, 1); @@ -619,7 +619,7 @@ static int ov101_021D5FB8 (UnkStruct_ov101_021D630C * param0) sub_02021C50(param0->unk_3C.unk_04, &v1); sub_02021C70(param0->unk_3C.unk_04, &v0); sub_02021C94(param0->unk_3C.unk_04, 0); - sub_02021D6C(param0->unk_3C.unk_04, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 3); sub_02021DE0(param0->unk_3C.unk_04); param0->unk_04++; @@ -661,7 +661,7 @@ static int ov101_021D6084 (UnkStruct_ov101_021D630C * param0) sub_02021C50(param0->unk_3C.unk_04, &v1); sub_02021C70(param0->unk_3C.unk_04, &v0); sub_02021C94(param0->unk_3C.unk_04, 0); - sub_02021D6C(param0->unk_3C.unk_04, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 4); sub_02021DE0(param0->unk_3C.unk_04); param0->unk_04++; @@ -717,7 +717,7 @@ static int ov101_021D6158 (UnkStruct_ov101_021D630C * param0) sub_02021C50(param0->unk_3C.unk_04, &v1); sub_02021C70(param0->unk_3C.unk_04, &v0); sub_02021C94(param0->unk_3C.unk_04, 0); - sub_02021D6C(param0->unk_3C.unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 2); sub_02021DE0(param0->unk_3C.unk_04); param0->unk_04++; @@ -767,7 +767,7 @@ static int ov101_021D6288 (UnkStruct_ov101_021D630C * param0) sub_02021C50(param0->unk_3C.unk_04, &v1); sub_02021C70(param0->unk_3C.unk_04, &v0); sub_02021C94(param0->unk_3C.unk_04, 0); - sub_02021D6C(param0->unk_3C.unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_3C.unk_04, 2); sub_02021DE0(param0->unk_3C.unk_04); param0->unk_04++; @@ -1129,7 +1129,7 @@ static int ov101_021D68AC (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 1); sub_02021CE4(param0->unk_24.unk_04, 0); sub_02021CC8(param0->unk_24.unk_04, 0); @@ -1189,7 +1189,7 @@ static int ov101_021D6994 (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 1); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 1); sub_02021CE4(param0->unk_24.unk_04, 0); sub_02021CC8(param0->unk_24.unk_04, 0); Sound_PlayEffect(1745); @@ -1236,7 +1236,7 @@ static int ov101_021D6A60 (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 0); sub_02021CC8(param0->unk_24.unk_04, 0); sub_02021CE4(param0->unk_24.unk_04, 0); sub_02021DE0(param0->unk_24.unk_04); @@ -1262,7 +1262,7 @@ static int ov101_021D6AC8 (UnkStruct_ov101_021D66D0 * param0) sub_02021CE4(param0->unk_24.unk_04, FX32_ONE / 2); if (sub_02021E24(param0->unk_24.unk_04) != 2) { - sub_02021D6C(param0->unk_24.unk_04, 2); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 2); sub_02021DE0(param0->unk_24.unk_04); } @@ -1283,7 +1283,7 @@ static int ov101_021D6B3C (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 5); sub_02021CC8(param0->unk_24.unk_04, 1); sub_02021CE4(param0->unk_24.unk_04, FX32_ONE); sub_02021DE0(param0->unk_24.unk_04); @@ -1305,7 +1305,7 @@ static int ov101_021D6BA4 (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 4); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 4); sub_02021CC8(param0->unk_24.unk_04, 1); sub_02021CE4(param0->unk_24.unk_04, FX32_ONE); sub_02021DE0(param0->unk_24.unk_04); @@ -1327,7 +1327,7 @@ static int ov101_021D6C0C (UnkStruct_ov101_021D66D0 * param0) sub_02021C70(param0->unk_24.unk_04, &v1); sub_02021C50(param0->unk_24.unk_04, &v0); - sub_02021D6C(param0->unk_24.unk_04, 3); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 3); sub_02021CC8(param0->unk_24.unk_04, 1); sub_02021CE4(param0->unk_24.unk_04, FX32_ONE); sub_02021DE0(param0->unk_24.unk_04); @@ -1352,7 +1352,7 @@ static int ov101_021D6C74 (UnkStruct_ov101_021D66D0 * param0) sub_02021CC8(param0->unk_24.unk_04, 0); sub_02021CE4(param0->unk_24.unk_04, FX32_ONE); - sub_02021D6C(param0->unk_24.unk_04, 5); + SpriteActor_SetSpriteAnimActive(param0->unk_24.unk_04, 5); sub_02021DE0(param0->unk_24.unk_04); param0->unk_14 = 0; @@ -1957,7 +1957,7 @@ static void ov101_021D7604 (UnkStruct_ov101_021D5D90 * param0, void * param1) if (v4) { sub_02021C50(v0->unk_04[v3].unk_04, &v2); - sub_02021D6C(v0->unk_04[v3].unk_04, v4); + SpriteActor_SetSpriteAnimActive(v0->unk_04[v3].unk_04, v4); sub_02021DE0(v0->unk_04[v3].unk_04); sub_02021CAC(v0->unk_04[v3].unk_04, 1); v2.x += (FX32_ONE * 8); @@ -1967,7 +1967,7 @@ static void ov101_021D7604 (UnkStruct_ov101_021D5D90 * param0, void * param1) v4 = (v5 % 10); sub_02021C50(v0->unk_04[v3].unk_04, &v2); - sub_02021D6C(v0->unk_04[v3].unk_04, v4); + SpriteActor_SetSpriteAnimActive(v0->unk_04[v3].unk_04, v4); sub_02021DE0(v0->unk_04[v3].unk_04); sub_02021CAC(v0->unk_04[v3].unk_04, 1); } @@ -2051,7 +2051,7 @@ static void ov101_021D776C (UnkStruct_ov101_021D5D90 * param0, void * param1) for (v4 = 10000; v4 >= 1; v4 /= 10, v5++) { v6 = (v7 % (v4 * 10)) / v4; - sub_02021D6C(v1->unk_04[v5].unk_04, v6); + SpriteActor_SetSpriteAnimActive(v1->unk_04[v5].unk_04, v6); sub_02021DE0(v1->unk_04[v5].unk_04); } } @@ -2140,7 +2140,7 @@ static int ov101_021D7810 (UnkStruct_ov101_021D5D90 * param0, void * param1) v2 = (v6->unk_04 % (v1 * 10)) / v1; - sub_02021D6C(v6->unk_18[v0].unk_04, v2); + SpriteActor_SetSpriteAnimActive(v6->unk_18[v0].unk_04, v2); sub_02021DE0(v6->unk_18[v0].unk_04); } @@ -2222,7 +2222,7 @@ static int ov101_021D7A00 (UnkStruct_ov101_021D5D90 * param0, void * param1) ov101_021D84A4(v5->unk_08->unk_450, &v5->unk_0C[v0], &v4, (NNS_G2D_VRAM_TYPE_2DSUB), 0, 9, 7, 9, 9, 2, 3); v3 = (v1 % (v2 * 10)) / v2; - sub_02021D6C(v5->unk_0C[v0].unk_04, v3); + SpriteActor_SetSpriteAnimActive(v5->unk_0C[v0].unk_04, v3); } return 1; diff --git a/src/overlay104/ov104_0222DCE0.c b/src/overlay104/ov104_0222DCE0.c index 3b76c9edca..8d84dd70bc 100644 --- a/src/overlay104/ov104_0222DCE0.c +++ b/src/overlay104/ov104_0222DCE0.c @@ -391,8 +391,8 @@ void ov104_0222E1D8 (GraphicElementData * param0, u8 param1) return; } - sub_02021E50(param0, 0); - sub_02021D6C(param0, param1); + SpriteActor_SetAnimFrame(param0, 0); + SpriteActor_SetSpriteAnimActive(param0, param1); sub_02021E2C(param0, FX32_ONE); return; } diff --git a/src/overlay104/ov104_0222FBE4.c b/src/overlay104/ov104_0222FBE4.c index eaad1e247a..05364ef5d7 100644 --- a/src/overlay104/ov104_0222FBE4.c +++ b/src/overlay104/ov104_0222FBE4.c @@ -141,7 +141,7 @@ typedef struct { UnkStruct_ov104_0223EBD0 * unk_2C; } UnkStruct_ov104_02231148; -void ov104_0223DC7C(int param0, BGL * param1, CellTransferStateData * param2, AnimationResourceCollection * param3, PaletteSys * param4, u16 * param5, s16 param6, s16 param7); +void ov104_0223DC7C(int param0, BGL * param1, SpriteRenderer * param2, SpriteGfxHandler * param3, PaletteData * param4, u16 * param5, s16 param6, s16 param7); u16 ov104_0222FC8C(UnkStruct_ov104_0222E930 * param0, u16 param1); u16 * ov104_0222FC14(UnkStruct_ov104_0222E930 * param0, u16 param1); static BOOL ov104_0222FCA0(UnkStruct_ov104_0222E930 * param0); @@ -1332,7 +1332,7 @@ static BOOL ov104_0223066C (UnkStruct_ov104_0222E930 * param0) v9 = (*((param0)->unk_1C++)); v10 = ov104_0223D2FC(v1, v9, v4); - sub_0200D4C4(v10, v5, v6); + SpriteActor_SetSpritePositionXY(v10, v5, v6); sub_0200D3F4(v10, v7); ov104_0223D378(v1, v9, v8); diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index e330ab3ccc..4f7bd9b1f4 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -35,7 +35,7 @@ #include "overlay104/struct_ov104_0223319C.h" #include "overlay104/struct_ov104_022331E8.h" #include "overlay104/struct_ov104_0223C4CC.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200112C.h" #include "unk_02001AF4.h" @@ -873,9 +873,9 @@ void ov104_02232C80 (UnkStruct_ov63_0222CCB8 * param0, UnkStruct_ov63_0222BEC0 * void ov104_02232CE0 (UnkStruct_ov104_0223C4CC * param0, Pokemon * param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, u16 param9) { - CellTransferStateData * v0 = param0->unk_34.unk_00; - AnimationResourceCollection * v1 = param0->unk_34.unk_04; - PaletteSys * v2 = param0->unk_04; + SpriteRenderer * v0 = param0->unk_34.unk_00; + SpriteGfxHandler * v1 = param0->unk_34.unk_04; + PaletteData * v2 = param0->unk_04; ArchivedSprite v3; void * v4; CellActorData * v5; @@ -885,34 +885,34 @@ void ov104_02232CE0 (UnkStruct_ov104_0223C4CC * param0, Pokemon * param1, int pa v6 = NARC_ctor(NARC_INDEX_BATTLE__GRAPHIC__PL_BATT_OBJ, param2); - sub_0200CC3C(v0, v1, v6, 112, 0, NNS_G2D_VRAM_TYPE_2DMAIN, param3); - sub_0200CDC4(v2, 2, v0, v1, v6, 111, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param3); - sub_0200CE24(v0, v1, v6, 113, 0, param3); - sub_0200CE54(v0, v1, v6, 114, 0, param3); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v6, 112, 0, NNS_G2D_VRAM_TYPE_2DMAIN, param3); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, v6, 111, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, param3); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v6, 113, 0, param3); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v6, 114, 0, param3); NARC_dtor(v6); } { int v7; - UnkStruct_ov104_0223F9E0 v8; + SpriteTemplate v8; - MI_CpuClear8(&v8, sizeof(UnkStruct_ov104_0223F9E0)); + MI_CpuClear8(&v8, sizeof(SpriteTemplate)); - v8.unk_00 = param4; - v8.unk_02 = param5; - v8.unk_04 = 0; - v8.unk_06 = 0; - v8.unk_08 = param6; - v8.unk_0C = 0; - v8.unk_10 = NNS_G2D_VRAM_TYPE_2DMAIN; - v8.unk_2C = param7; - v8.unk_30 = 0; + v8.x = param4; + v8.y = param5; + v8.z = 0; + v8.animIdx = 0; + v8.priority = param6; + v8.plttIdx = 0; + v8.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v8.bgPriority = param7; + v8.transferToVRAM = FALSE; for (v7 = 0; v7 < 6; v7++) { - v8.unk_14[v7] = param3; + v8.resources[v7] = param3; } - v5 = sub_0200CE6C(v0, v1, &v8); + v5 = SpriteActor_LoadResources(v0, v1, &v8); sub_0200D330(v5); } @@ -958,13 +958,13 @@ void ov104_02232E80 (UnkStruct_ov104_0223C4CC * param0, int param1) param0->unk_80[param1 - 50000] = NULL; - sub_0200D070(param0->unk_34.unk_04, param1); - sub_0200D080(param0->unk_34.unk_04, param1); - sub_0200D090(param0->unk_34.unk_04, param1); - sub_0200D0A0(param0->unk_34.unk_04, param1); + SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, param1); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_34.unk_04, param1); + SpriteGfxHandler_UnloadCellObjById(param0->unk_34.unk_04, param1); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_34.unk_04, param1); } -static const UnkStruct_ov104_0223F9E0 Unk_ov104_0223F9E0 = { +static const SpriteTemplate Unk_ov104_0223F9E0 = { 0x0, 0x0, 0x0, @@ -977,7 +977,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov104_0223F9E0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov104_0223F9AC = { +static const SpriteTemplate Unk_ov104_0223F9AC = { 0x0, 0x0, 0x0, @@ -999,15 +999,15 @@ void ov104_02232EC0 (UnkStruct_ov104_0223C4CC * param0) void ov104_02232F28 (UnkStruct_ov104_0223C4CC * param0) { - sub_0200D090(param0->unk_34.unk_04, 2000); - sub_0200D0A0(param0->unk_34.unk_04, 2000); - sub_0200D080(param0->unk_34.unk_04, 2000); + SpriteGfxHandler_UnloadCellObjById(param0->unk_34.unk_04, 2000); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_34.unk_04, 2000); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_34.unk_04, 2000); } CellActorData * ov104_02232F4C (UnkStruct_ov104_0223C4CC * param0, Pokemon * param1, int param2, int param3, int param4) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; GF_ASSERT(param2 < (2008 - 2000)); @@ -1016,12 +1016,12 @@ CellActorData * ov104_02232F4C (UnkStruct_ov104_0223C4CC * param0, Pokemon * par v1 = Unk_ov104_0223F9E0; - v1.unk_14[0] += param2; - v1.unk_00 = param3; - v1.unk_02 = param4; - v1.unk_08 = 200; + v1.resources[0] += param2; + v1.x = param3; + v1.y = param4; + v1.priority = 200; - v0 = sub_0200CE6C(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); + v0 = SpriteActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); sub_02021F24(v0->unk_00, Pokemon_IconPaletteIndex(param1)); sub_0200D330(v0); @@ -1031,7 +1031,7 @@ CellActorData * ov104_02232F4C (UnkStruct_ov104_0223C4CC * param0, Pokemon * par void ov104_02232FD4 (UnkStruct_ov104_0223C4CC * param0, CellActorData * param1, int param2) { - sub_0200D070(param0->unk_34.unk_04, 2000 + param2); + SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, 2000 + param2); sub_0200D0F4(param1); } @@ -1041,33 +1041,33 @@ void ov104_02232FEC (UnkStruct_ov104_0223C4CC * param0) v0 = NARC_ctor(NARC_INDEX_GRAPHIC__PL_PLIST_GRA, 94); - sub_0200CDC4(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2001); - sub_0200CE24(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081938(), 0, 2001); - sub_0200CE54(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_0208193C(), 0, 2001); + SpriteRenderer_LoadPalette(param0->unk_04, 2, param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081934(), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2001); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_02081938(), 0, 2001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_34.unk_00, param0->unk_34.unk_04, v0, sub_0208193C(), 0, 2001); sub_0200D888(param0->unk_34.unk_00, param0->unk_34.unk_04, 20, sub_02081930(), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2009); NARC_dtor(v0); } void ov104_0223307C (UnkStruct_ov104_0223C4CC * param0) { - sub_0200D070(param0->unk_34.unk_04, 2009); - sub_0200D090(param0->unk_34.unk_04, 2001); - sub_0200D0A0(param0->unk_34.unk_04, 2001); - sub_0200D080(param0->unk_34.unk_04, 2001); + SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, 2009); + SpriteGfxHandler_UnloadCellObjById(param0->unk_34.unk_04, 2001); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_34.unk_04, 2001); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_34.unk_04, 2001); } CellActorData * ov104_022330AC (UnkStruct_ov104_0223C4CC * param0, int param1, int param2) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov104_0223F9AC; - v1.unk_00 = param1; - v1.unk_02 = param2; - v1.unk_08 = 300; + v1.x = param1; + v1.y = param2; + v1.priority = 300; - v0 = sub_0200CE6C(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); + v0 = SpriteActor_LoadResources(param0->unk_34.unk_00, param0->unk_34.unk_04, &v1); sub_0200D330(v0); return v0; diff --git a/src/overlay104/ov104_0223C2D4.c b/src/overlay104/ov104_0223C2D4.c index 0a92ef0253..3eba32b822 100644 --- a/src/overlay104/ov104_0223C2D4.c +++ b/src/overlay104/ov104_0223C2D4.c @@ -852,10 +852,10 @@ static void ov104_0223D058 (UnkStruct_ov104_0223C4CC * param0) if (param0->unk_80[v1] != NULL) { sub_0200D0F4(param0->unk_80[v1]); - sub_0200D070(param0->unk_34.unk_04, 50000 + v1); - sub_0200D080(param0->unk_34.unk_04, 50000 + v1); - sub_0200D090(param0->unk_34.unk_04, 50000 + v1); - sub_0200D0A0(param0->unk_34.unk_04, 50000 + v1); + SpriteGfxHandler_UnloadCharObjById(param0->unk_34.unk_04, 50000 + v1); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_34.unk_04, 50000 + v1); + SpriteGfxHandler_UnloadCellObjById(param0->unk_34.unk_04, 50000 + v1); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_34.unk_04, 50000 + v1); } } } @@ -1086,7 +1086,7 @@ static void ov104_0223D3B0 (UnkStruct_ov104_0223C4CC * param0) v1->unk_10[v0].unk_06_13 = ov104_0223D3A4(param0, v0); v1->unk_10[v0].unk_06_14 = sub_0200D408(v2->unk_00[v0]); v1->unk_10[v0].unk_04 = v2->unk_20[v0]; - sub_0200D550(v2->unk_00[v0], &v1->unk_10[v0].unk_00, &v1->unk_10[v0].unk_02); + SpriteActor_GetSpritePositionXY(v2->unk_00[v0], &v1->unk_10[v0].unk_00, &v1->unk_10[v0].unk_02); v1->unk_10[v0].unk_06_15 = 1; } } @@ -1112,7 +1112,7 @@ static void ov104_0223D498 (UnkStruct_ov104_0223C4CC * param0) for (v0 = 0; v0 < 8; v0++) { if (v2->unk_10[v0].unk_06_15 == 1) { v3 = ov104_0223D2FC(param0, v0, v2->unk_10[v0].unk_04); - sub_0200D4C4(v3, v2->unk_10[v0].unk_00, v2->unk_10[v0].unk_02); + SpriteActor_SetSpritePositionXY(v3, v2->unk_10[v0].unk_00, v2->unk_10[v0].unk_02); sub_0200D3F4(v3, v2->unk_10[v0].unk_06_14); ov104_0223D378(param0, v0, v2->unk_10[v0].unk_06_13); diff --git a/src/overlay104/ov104_0223D768.c b/src/overlay104/ov104_0223D768.c index 7d1ab6718f..c436351e27 100644 --- a/src/overlay104/ov104_0223D768.c +++ b/src/overlay104/ov104_0223D768.c @@ -7,12 +7,12 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "overlay104/ov104_0223D768.h" -static const UnkStruct_ov104_0223F9E0 Unk_ov104_022417D8[] = { +static const SpriteTemplate Unk_ov104_022417D8[] = { { 0x0, 0x0, @@ -63,40 +63,40 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov104_022417D8[] = { } }; -void ov104_0223D768 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, PaletteSys * param3, u16 param4) +void ov104_0223D768 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, PaletteData * param3, u16 param4) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; GF_ASSERT(param4 < NELEMS(Unk_ov104_022417D8)); v0 = &Unk_ov104_022417D8[param4]; - sub_0200CC3C(param0, param1, param2, v0->unk_14[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->unk_14[0]); - sub_0200CDC4(param3, 2, param0, param1, param2, v0->unk_14[1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->unk_14[1]); - sub_0200CE24(param0, param1, param2, v0->unk_14[2], 1, v0->unk_14[2]); - sub_0200CE54(param0, param1, param2, v0->unk_14[3], 1, v0->unk_14[3]); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, param2, v0->resources[0], 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[0]); + SpriteRenderer_LoadPalette(param3, 2, param0, param1, param2, v0->resources[1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v0->resources[1]); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, param2, v0->resources[2], 1, v0->resources[2]); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, param2, v0->resources[3], 1, v0->resources[3]); } -void ov104_0223D7EC (AnimationResourceCollection * param0, u16 param1) +void ov104_0223D7EC (SpriteGfxHandler * param0, u16 param1) { - const UnkStruct_ov104_0223F9E0 * v0; + const SpriteTemplate * v0; GF_ASSERT(param1 < NELEMS(Unk_ov104_022417D8)); v0 = &Unk_ov104_022417D8[param1]; - sub_0200D070(param0, v0->unk_14[0]); - sub_0200D080(param0, v0->unk_14[1]); - sub_0200D090(param0, v0->unk_14[2]); - sub_0200D0A0(param0, v0->unk_14[3]); + SpriteGfxHandler_UnloadCharObjById(param0, v0->resources[0]); + SpriteGfxHandler_UnloadPlttObjById(param0, v0->resources[1]); + SpriteGfxHandler_UnloadCellObjById(param0, v0->resources[2]); + SpriteGfxHandler_UnloadAnimObjById(param0, v0->resources[3]); } -CellActorData * ov104_0223D828 (CellTransferStateData * param0, AnimationResourceCollection * param1, u16 param2) +CellActorData * ov104_0223D828 (SpriteRenderer * param0, SpriteGfxHandler * param1, u16 param2) { CellActorData * v0; GF_ASSERT(param2 < NELEMS(Unk_ov104_022417D8)); - v0 = sub_0200CE6C(param0, param1, &Unk_ov104_022417D8[param2]); - sub_0200D324(v0->unk_00); + v0 = SpriteActor_LoadResources(param0, param1, &Unk_ov104_022417D8[param2]); + SpriteActor_UpdateObject(v0->unk_00); return v0; } diff --git a/src/overlay104/ov104_0223D9E4.c b/src/overlay104/ov104_0223D9E4.c index bb8f9a51c9..812f2acb3d 100644 --- a/src/overlay104/ov104_0223D9E4.c +++ b/src/overlay104/ov104_0223D9E4.c @@ -27,7 +27,7 @@ typedef struct { typedef struct { SysTask * unk_00; - PaletteSys * unk_04; + PaletteData * unk_04; u16 unk_08[3][16]; u8 unk_68; u8 unk_69; @@ -54,7 +54,7 @@ typedef struct UnkStruct_ov104_0223DA28_t { static UnkStruct_ov104_0223DB34 * ov104_0223DA40(BGL * param0); static void ov104_0223DB34(UnkStruct_ov104_0223DB34 * param0); static void ov104_0223DB48(SysTask * param0, void * param1); -static UnkStruct_ov104_0223DC04 * ov104_0223DBB8(PaletteSys * param0); +static UnkStruct_ov104_0223DC04 * ov104_0223DBB8(PaletteData * param0); static void ov104_0223DC04(UnkStruct_ov104_0223DC04 * param0); static void ov104_0223DC18(SysTask * param0, void * param1); @@ -63,7 +63,7 @@ static const u16 Unk_ov104_022418B0[] = { 0x15 }; -UnkStruct_ov104_0223DA28 * ov104_0223D9E4 (BGL * param0, PaletteSys * param1) +UnkStruct_ov104_0223DA28 * ov104_0223D9E4 (BGL * param0, PaletteData * param1) { UnkStruct_ov104_0223DA28 * v0; @@ -164,7 +164,7 @@ static void ov104_0223DB48 (SysTask * param0, void * param1) v1->unk_22009 ^= 1; } -static UnkStruct_ov104_0223DC04 * ov104_0223DBB8 (PaletteSys * param0) +static UnkStruct_ov104_0223DC04 * ov104_0223DBB8 (PaletteData * param0) { UnkStruct_ov104_0223DC04 * v0; diff --git a/src/overlay104/ov104_0223DC7C.c b/src/overlay104/ov104_0223DC7C.c index b39df4b65c..928282418f 100644 --- a/src/overlay104/ov104_0223DC7C.c +++ b/src/overlay104/ov104_0223DC7C.c @@ -16,7 +16,7 @@ #include "struct_defs/struct_020127E8.h" #include "struct_defs/sprite_manager_allocation.h" #include "struct_defs/struct_0205AA50.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_02002B7C.h" #include "unk_02002F38.h" @@ -75,9 +75,9 @@ typedef struct { int unk_08; void * unk_0C; BGL * unk_10; - CellTransferStateData * unk_14; - AnimationResourceCollection * unk_18; - PaletteSys * unk_1C; + SpriteRenderer * unk_14; + SpriteGfxHandler * unk_18; + PaletteData * unk_1C; u16 * unk_20; NARC * unk_24; s16 unk_28; @@ -130,7 +130,7 @@ typedef struct { u8 unk_0B; } UnkStruct_ov104_0224191C; -void ov104_0223DC7C(int param0, BGL * param1, CellTransferStateData * param2, AnimationResourceCollection * param3, PaletteSys * param4, u16 * param5, s16 param6, s16 param7); +void ov104_0223DC7C(int param0, BGL * param1, SpriteRenderer * param2, SpriteGfxHandler * param3, PaletteData * param4, u16 * param5, s16 param6, s16 param7); static void ov104_0223DD30(UnkStruct_ov104_0223DD30 * param0, SysTask * param1); static void ov104_0223DD5C(SysTask * param0, void * param1); static void ov104_0223DDB4(SysTask * param0, void * param1); @@ -160,7 +160,7 @@ static const UnkStruct_ov104_0224191C Unk_ov104_0224191C[] = { {0x388, 0x75, 0x76, 0x77, 0x78, 0x89, 0x88, 0x87, 0x0} }; -static const UnkStruct_ov104_0223F9E0 Unk_ov104_022418B4 = { +static const SpriteTemplate Unk_ov104_022418B4 = { 0x0, 0x0, 0x0, @@ -173,7 +173,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov104_022418B4 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov104_022418E8 = { +static const SpriteTemplate Unk_ov104_022418E8 = { 0x0, 0x0, 0x0, @@ -186,7 +186,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov104_022418E8 = { 0x0 }; -void ov104_0223DC7C (int param0, BGL * param1, CellTransferStateData * param2, AnimationResourceCollection * param3, PaletteSys * param4, u16 * param5, s16 param6, s16 param7) +void ov104_0223DC7C (int param0, BGL * param1, SpriteRenderer * param2, SpriteGfxHandler * param3, PaletteData * param4, u16 * param5, s16 param6, s16 param7) { SysTask * v0; UnkStruct_ov104_0223DD30 * v1; @@ -265,7 +265,7 @@ static BOOL ov104_0223DDE4 (UnkStruct_ov104_0223DD30 * param0, u32 param1, const memset(param0->unk_0C, 0, sizeof(UnkStruct_ov104_0223DDE4)); v0 = param0->unk_0C; - v7 = sub_0200CDC4(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2004); + v7 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 11, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2004); param0->unk_164 |= 1 << v7; param0->unk_30 = sub_02012744(4, 94); @@ -285,26 +285,26 @@ static BOOL ov104_0223DDE4 (UnkStruct_ov104_0223DD30 * param0, u32 param1, const } { - param0->unk_160 = sub_0200CDC4(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_04, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2002); + param0->unk_160 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_04, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2002); param0->unk_164 |= 1 << param0->unk_160; - sub_0200CC3C(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_05, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2010); - sub_0200CE24(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_06, 0, 2002); - sub_0200CE54(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_07, 0, 2002); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_05, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2010); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_06, 0, 2002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, param2->unk_07, 0, 2002); sub_020039B0(param0->unk_1C, 2, param0->unk_160 * 16, 16, 14, (GX_RGB(0, 0, 0))); - v7 = sub_0200CDC4(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 51, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2003); + v7 = SpriteRenderer_LoadPalette(param0->unk_1C, 2, param0->unk_14, param0->unk_18, param0->unk_24, 51, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 2003); param0->unk_164 |= 1 << v7; - sub_0200CC3C(param0->unk_14, param0->unk_18, param0->unk_24, 144, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2011); - sub_0200CE24(param0->unk_14, param0->unk_18, param0->unk_24, 145, 0, 2003); - sub_0200CE54(param0->unk_14, param0->unk_18, param0->unk_24, 146, 0, 2003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, 144, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 2011); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, 145, 0, 2003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_14, param0->unk_18, param0->unk_24, 146, 0, 2003); } - v0->unk_90 = sub_0200CE6C(param0->unk_14, param0->unk_18, &Unk_ov104_022418B4); + v0->unk_90 = SpriteActor_LoadResources(param0->unk_14, param0->unk_18, &Unk_ov104_022418B4); sub_0200D3F4(v0->unk_90, 0); - sub_0200D324(v0->unk_90->unk_00); + SpriteActor_UpdateObject(v0->unk_90->unk_00); ov104_0223E3FC(param0, &v0->unk_14, (FX32_CONST(72)) + FX32_CONST(param0->unk_28), (FX32_CONST(82)) + FX32_CONST(param0->unk_2A), param1); param0->unk_00++; break; @@ -435,7 +435,7 @@ static void ov104_0223E29C (UnkStruct_ov104_0223DD30 * param0, UnkStruct_ov104_0 int v3; FontOAM * v4; BGL * v5; - AnimationResourceCollection * v6; + SpriteGfxHandler * v6; int v7, v8; GF_ASSERT(param1->unk_00 == NULL); @@ -518,21 +518,21 @@ static void ov104_0223E3CC (const Strbuf *param0, int param1, int * param2, int static void ov104_0223E3FC (UnkStruct_ov104_0223DD30 * param0, UnkStruct_ov104_0223E48C * param1, fx32 param2, fx32 param3, u32 param4) { int v0; - UnkStruct_ov104_0223F9E0 v1 = Unk_ov104_022418E8; + SpriteTemplate v1 = Unk_ov104_022418E8; - v1.unk_00 = param2 >> FX32_SHIFT; - v1.unk_02 = param3 >> FX32_SHIFT; + v1.x = param2 >> FX32_SHIFT; + v1.y = param3 >> FX32_SHIFT; param1->unk_00 = 0; param1->unk_02 = 0; for (v0 = 0; v0 < 4; v0++) { - param1->unk_04[v0] = sub_0200CE6C(param0->unk_14, param0->unk_18, &v1); + param1->unk_04[v0] = SpriteActor_LoadResources(param0->unk_14, param0->unk_18, &v1); sub_0200D3F4(param1->unk_04[v0], 0); if (v0 != 3) { sub_02021CF8(param1->unk_04[v0]->unk_00, 2); - sub_02021D6C(param1->unk_04[v0]->unk_00, 1); + SpriteActor_SetSpriteAnimActive(param1->unk_04[v0]->unk_00, 1); ov104_0223E534(¶m1->unk_14[v0], FX32_CONST(2), FX32_CONST(1), 6); } else { ov104_0223E534(¶m1->unk_14[v0], FX32_CONST(1), FX32_CONST(1), 6); diff --git a/src/overlay105/ov105_02241AE0.c b/src/overlay105/ov105_02241AE0.c index 66861995ba..1c192310aa 100644 --- a/src/overlay105/ov105_02241AE0.c +++ b/src/overlay105/ov105_02241AE0.c @@ -116,7 +116,7 @@ struct UnkStruct_ov105_02241FF4_t { UnkStruct_02081CF4 unk_F0; UIControlData * unk_FC; ResourceMetadata unk_100[4]; - PaletteSys * unk_120; + PaletteData * unk_120; GenericPointerData * unk_124; UnkStruct_02007768 * unk_128; Sprite * unk_12C[3]; diff --git a/src/overlay105/ov105_02245AAC.c b/src/overlay105/ov105_02245AAC.c index 0a8cbeffcc..0bffd0ba0b 100644 --- a/src/overlay105/ov105_02245AAC.c +++ b/src/overlay105/ov105_02245AAC.c @@ -97,7 +97,7 @@ GraphicElementData * ov105_02245BA4 (UnkStruct_ov105_02245AAC * param0, u32 para v2 = sub_02021AA0(&v3); sub_02021CC8(v2, 1); - sub_02021D6C(v2, param2); + SpriteActor_SetSpriteAnimActive(v2, param2); } return v2; diff --git a/src/overlay105/ov105_02245E54.c b/src/overlay105/ov105_02245E54.c index 554948a650..dcd47b1660 100644 --- a/src/overlay105/ov105_02245E54.c +++ b/src/overlay105/ov105_02245E54.c @@ -145,7 +145,7 @@ int ov105_02245F8C (UnkStruct_ov105_02245EA8 * param0) void ov105_02245F90 (UnkStruct_ov105_02245EA8 * param0, u32 param1) { sub_02021CE4(param0->unk_0C, FX32_ONE); - sub_02021D6C(param0->unk_0C, param1); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, param1); return; } diff --git a/src/overlay106/ov106_02241AE0.c b/src/overlay106/ov106_02241AE0.c index d86dbe4258..8adafbbd96 100644 --- a/src/overlay106/ov106_02241AE0.c +++ b/src/overlay106/ov106_02241AE0.c @@ -107,7 +107,7 @@ struct UnkStruct_ov106_02243118_t { UnkStruct_02081CF4 unk_8C; UIControlData * unk_98; ResourceMetadata unk_9C[2]; - PaletteSys * unk_AC; + PaletteData * unk_AC; UnkStruct_0200C440 * unk_B0; AnimationControlFlags * unk_B4; SaveData * unk_B8; diff --git a/src/overlay106/ov106_02243310.c b/src/overlay106/ov106_02243310.c index d2e1e20b9e..cec7d74064 100644 --- a/src/overlay106/ov106_02243310.c +++ b/src/overlay106/ov106_02243310.c @@ -112,7 +112,7 @@ GraphicElementData * ov106_022434BC (UnkStruct_ov106_02243310 * param0, u32 para sub_02021CC8(v2, 1); sub_02021CE4(v2, FX32_ONE); - sub_02021D6C(v2, param2); + SpriteActor_SetSpriteAnimActive(v2, param2); } return v2; diff --git a/src/overlay107/ov107_02241AE0.c b/src/overlay107/ov107_02241AE0.c index db987d0b21..bc4479de97 100644 --- a/src/overlay107/ov107_02241AE0.c +++ b/src/overlay107/ov107_02241AE0.c @@ -268,7 +268,7 @@ struct UnkStruct_ov107_02241D6C_t { UnkStruct_0200112C * unk_198; ResourceMetadata * unk_19C; UnkStruct_ov84_02240FA8 unk_1A0; - PaletteSys * unk_1C0; + PaletteData * unk_1C0; UnkStruct_0200C440 * unk_1C4; AnimationControlFlags * unk_1C8; SaveData * unk_1CC; diff --git a/src/overlay107/ov107_02245EB0.c b/src/overlay107/ov107_02245EB0.c index fc6e64b5e5..3566eeca1a 100644 --- a/src/overlay107/ov107_02245EB0.c +++ b/src/overlay107/ov107_02245EB0.c @@ -122,7 +122,7 @@ struct UnkStruct_ov107_02246170_t { ResourceMetadata unk_120[3]; UnkStruct_0200112C * unk_138; ResourceMetadata * unk_13C; - PaletteSys * unk_140; + PaletteData * unk_140; UnkStruct_0200C440 * unk_144; AnimationControlFlags * unk_148; SaveData * unk_14C; diff --git a/src/overlay107/ov107_02249604.c b/src/overlay107/ov107_02249604.c index 2d05ac2d7d..756cd87bc2 100644 --- a/src/overlay107/ov107_02249604.c +++ b/src/overlay107/ov107_02249604.c @@ -150,7 +150,7 @@ GraphicElementData * ov107_022498A4 (UnkStruct_ov107_02249954 * param0, u32 para sub_02021CC8(v2, 1); sub_02021CE4(v2, FX32_ONE); - sub_02021D6C(v2, param4); + SpriteActor_SetSpriteAnimActive(v2, param4); } return v2; diff --git a/src/overlay107/ov107_02249B1C.c b/src/overlay107/ov107_02249B1C.c index 7fd244c3bf..16c6ac24b3 100644 --- a/src/overlay107/ov107_02249B1C.c +++ b/src/overlay107/ov107_02249B1C.c @@ -87,7 +87,7 @@ void ov107_02249BB8 (UnkStruct_ov107_02249B8C * param0, u16 param1, u16 param2) void ov107_02249BEC (UnkStruct_ov107_02249B8C * param0, u32 param1) { sub_02021CE4(param0->unk_04, FX32_ONE); - sub_02021D6C(param0->unk_04, param1); + SpriteActor_SetSpriteAnimActive(param0->unk_04, param1); return; } diff --git a/src/overlay108/ov108_02241AE0.c b/src/overlay108/ov108_02241AE0.c index c6ed4c9a39..725aea9321 100644 --- a/src/overlay108/ov108_02241AE0.c +++ b/src/overlay108/ov108_02241AE0.c @@ -211,7 +211,7 @@ struct UnkStruct_ov108_02241DB0_t { UnkStruct_02081CF4 unk_B4; UIControlData * unk_C0; ResourceMetadata unk_C4[2]; - PaletteSys * unk_D4; + PaletteData * unk_D4; AnimationControlFlags * unk_D8; SaveData * unk_DC; UnkStruct_020304A0 * unk_E0; diff --git a/src/overlay108/ov108_02243030.c b/src/overlay108/ov108_02243030.c index 62beecaec9..8d7ea7a0cc 100644 --- a/src/overlay108/ov108_02243030.c +++ b/src/overlay108/ov108_02243030.c @@ -108,7 +108,7 @@ GraphicElementData * ov108_022430F0 (UnkStruct_ov108_02243030 * param0, u32 para sub_02021CC8(v2, 1); sub_02021CE4(v2, FX32_ONE); - sub_02021D6C(v2, param4); + SpriteActor_SetSpriteAnimActive(v2, param4); } return v2; diff --git a/src/overlay109/ov109_021D0D80.c b/src/overlay109/ov109_021D0D80.c index 0979b8cdf3..ca367ebbe6 100644 --- a/src/overlay109/ov109_021D0D80.c +++ b/src/overlay109/ov109_021D0D80.c @@ -28,7 +28,7 @@ #include "overlay072/struct_ov72_0223E2A8.h" #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -307,9 +307,9 @@ typedef struct UnkStruct_ov109_021D0F70_t { NNSG2dScreenData * unk_D88; NNSG2dCharacterData * unk_D8C; NNSG2dPaletteData * unk_D90; - CellTransferStateData * unk_D94; - AnimationResourceCollection * unk_D98; - PaletteSys * unk_D9C; + SpriteRenderer * unk_D94; + SpriteGfxHandler * unk_D98; + PaletteData * unk_D9C; GXRgb unk_DA0[8]; SysTask * unk_DB0; SysTask * unk_DB4; @@ -350,7 +350,7 @@ static void ov109_021D2344(UnkStruct_ov109_021D0F70 * param0, u32 param1); static void ov109_021D2368(UnkStruct_ov109_021D0F70 * param0); static void ov109_021D2408(UnkStruct_ov109_021D0F70 * param0); static void ov109_021D24C0(UnkStruct_ov109_021D0F70 * param0); -static CellActorData * ov109_021D24E0(UnkStruct_ov109_021D0F70 * param0, const UnkStruct_ov104_0223F9E0 * param1); +static CellActorData * ov109_021D24E0(UnkStruct_ov109_021D0F70 * param0, const SpriteTemplate * param1); static void ov109_021D24F8(UnkStruct_ov109_021D0F70 * param0); static void ov109_021D25E8(UnkStruct_ov109_021D0F70 * param0); static void ov109_021D2634(UnkStruct_ov109_021D0F70 * param0, u32 param1); @@ -1963,9 +1963,9 @@ static void ov109_021D2368 (UnkStruct_ov109_021D0F70 * param0) static void ov109_021D2408 (UnkStruct_ov109_021D0F70 * param0) { - CellTransferStateData * v0 = param0->unk_D94; - AnimationResourceCollection * v1 = param0->unk_D98; - PaletteSys * v2 = param0->unk_D9C; + SpriteRenderer * v0 = param0->unk_D94; + SpriteGfxHandler * v1 = param0->unk_D98; + PaletteData * v2 = param0->unk_D9C; NARC * v3 = param0->unk_D80; { @@ -1977,10 +1977,10 @@ static void ov109_021D2408 (UnkStruct_ov109_021D0F70 * param0) v4 = NARC_ctor(NARC_INDEX_GRAPHIC__NUTMIXER, 95); - sub_0200CC3C(v0, v1, v4, 14, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 4); - sub_0200CDC4(v2, 2, v0, v1, v4, 8, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 5); - sub_0200CE24(v0, v1, v4, 13, 0, 6); - sub_0200CE54(v0, v1, v4, 12, 0, 7); + SpriteRenderer_LoadCharResObjFromOpenNarc(v0, v1, v4, 14, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 4); + SpriteRenderer_LoadPalette(v2, 2, v0, v1, v4, 8, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 5); + SpriteRenderer_LoadCellResObjFromOpenNarc(v0, v1, v4, 13, 0, 6); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v0, v1, v4, 12, 0, 7); NARC_dtor(v4); } @@ -2004,9 +2004,9 @@ static void ov109_021D24C0 (UnkStruct_ov109_021D0F70 * param0) sub_0200C8D4(param0->unk_D94); } -static CellActorData * ov109_021D24E0 (UnkStruct_ov109_021D0F70 * param0, const UnkStruct_ov104_0223F9E0 * param1) +static CellActorData * ov109_021D24E0 (UnkStruct_ov109_021D0F70 * param0, const SpriteTemplate * param1) { - CellActorData * v0 = sub_0200CE6C(param0->unk_D94, param0->unk_D98, param1); + CellActorData * v0 = SpriteActor_LoadResources(param0->unk_D94, param0->unk_D98, param1); return v0; } @@ -3107,26 +3107,26 @@ static void ov109_021D3600 (SysTask * param0, void * param1) static SysTask * ov109_021D3684 (UnkStruct_ov109_021D0F70 * param0) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; UnkStruct_ov109_021D3600 * v1 = Heap_AllocFromHeapAtEnd(95, sizeof(UnkStruct_ov109_021D3600)); memset(v1, 0, sizeof(UnkStruct_ov109_021D3600)); - v0.unk_00 = 128; - v0.unk_02 = 100; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 0; - v0.unk_0C = 0; - v0.unk_10 = 1; - v0.unk_2C = 0; - v0.unk_30 = 0; - v0.unk_14[0] = 4; - v0.unk_14[1] = 5; - v0.unk_14[2] = 6; - v0.unk_14[3] = 7; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; + v0.x = 128; + v0.y = 100; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 0; + v0.plttIdx = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 0; + v0.transferToVRAM = FALSE; + v0.resources[0] = 4; + v0.resources[1] = 5; + v0.resources[2] = 6; + v0.resources[3] = 7; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; v1->unk_14 = ov109_021D24E0(param0, &v0); sub_0200D330(v1->unk_14); diff --git a/src/overlay109/ov109_021D3D50.c b/src/overlay109/ov109_021D3D50.c index 6a02f28b49..26b7e1ec89 100644 --- a/src/overlay109/ov109_021D3D50.c +++ b/src/overlay109/ov109_021D3D50.c @@ -663,7 +663,7 @@ static void ov109_021D4518 (UnkStruct_ov109_021D5140 * param0) param0->unk_29C[v0 + 1] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_29C[v0 + 1], 1); - sub_02021D6C(param0->unk_29C[v0 + 1], 27 + (v0 - 1) * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_29C[v0 + 1], 27 + (v0 - 1) * 2); sub_02021CAC(param0->unk_29C[v0 + 1], 0); } @@ -1628,10 +1628,10 @@ static void ov109_021D5668 (UnkStruct_ov109_021D5140 * param0) v2 = TrainerInfo_Appearance(param0->unk_3D8[v0][0]); if (sub_0203608C() == v0) { - sub_02021D6C(param0->unk_29C[v0 + 1], 38 + v3 * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_29C[v0 + 1], 38 + v3 * 2); } else { ov109_021D57E0(param0->unk_3A0, param0->unk_3B0, v0, v2, v3); - sub_02021D6C(param0->unk_29C[v0 + 1], 27 + v0 * 2); + SpriteActor_SetSpriteAnimActive(param0->unk_29C[v0 + 1], 27 + v0 * 2); } } sub_02021CAC(param0->unk_29C[v0 + 1], 1); @@ -1644,9 +1644,9 @@ static void ov109_021D5668 (UnkStruct_ov109_021D5140 * param0) if (sub_0203608C() == v0) { int v4 = TrainerInfo_Gender(param0->unk_3D8[v0][0]); - sub_02021D6C(param0->unk_29C[v0 + 1], 38 + v4 * 2 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_29C[v0 + 1], 38 + v4 * 2 + 1); } else { - sub_02021D6C(param0->unk_29C[v0 + 1], 27 + v0 * 2 + 1); + SpriteActor_SetSpriteAnimActive(param0->unk_29C[v0 + 1], 27 + v0 * 2 + 1); } param0->unk_400[v0] = 0; diff --git a/src/overlay110/ov110_021D0D80.c b/src/overlay110/ov110_021D0D80.c index c5ede4e7b6..4a1402079b 100644 --- a/src/overlay110/ov110_021D0D80.c +++ b/src/overlay110/ov110_021D0D80.c @@ -61,7 +61,7 @@ typedef struct { UnkStruct_0200B358 * unk_114; Strbuf* unk_118; Strbuf* unk_11C; - PaletteSys * unk_120; + PaletteData * unk_120; const AnimationControlFlags * unk_124; SaveData * unk_128; UnkStruct_0203068C * unk_12C; diff --git a/src/overlay111/ov111_021D0D80.c b/src/overlay111/ov111_021D0D80.c index a2aa1156cf..627b4044f0 100644 --- a/src/overlay111/ov111_021D0D80.c +++ b/src/overlay111/ov111_021D0D80.c @@ -92,7 +92,7 @@ struct UnkStruct_ov111_021D0F7C_t { u16 unk_48[8]; BGL * unk_58; Window unk_5C[16]; - PaletteSys * unk_15C; + PaletteData * unk_15C; UnkStruct_0200C440 * unk_160; AnimationControlFlags * unk_164; SaveData * unk_168; diff --git a/src/overlay111/ov111_021D2F80.c b/src/overlay111/ov111_021D2F80.c index 232057927c..8fed14176e 100644 --- a/src/overlay111/ov111_021D2F80.c +++ b/src/overlay111/ov111_021D2F80.c @@ -146,7 +146,7 @@ GraphicElementData * ov111_021D3280 (UnkStruct_ov111_021D2F80 * param0, u32 para sub_02021CC8(v2, 0); sub_02021CE4(v2, FX32_ONE); - sub_02021D6C(v2, param2); + SpriteActor_SetSpriteAnimActive(v2, param2); } return v2; diff --git a/src/overlay111/ov111_021D33F4.c b/src/overlay111/ov111_021D33F4.c index 46308b1dc8..ad12c9bc7e 100644 --- a/src/overlay111/ov111_021D33F4.c +++ b/src/overlay111/ov111_021D33F4.c @@ -143,7 +143,7 @@ void ov111_021D350C (UnkStruct_ov111_021D33F4 * param0, int param1) { sub_02021CC8(param0->unk_0C, param1); sub_02021CE4(param0->unk_0C, FX32_ONE); - sub_02021D6C(param0->unk_0C, sub_02021E24(param0->unk_0C)); + SpriteActor_SetSpriteAnimActive(param0->unk_0C, sub_02021E24(param0->unk_0C)); return; } diff --git a/src/overlay113/ov113_0225C700.c b/src/overlay113/ov113_0225C700.c index 2c7f3a43ca..42b3176f58 100644 --- a/src/overlay113/ov113_0225C700.c +++ b/src/overlay113/ov113_0225C700.c @@ -36,7 +36,7 @@ #include "overlay066/struct_ov66_022589B4.h" #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -105,12 +105,12 @@ typedef struct UnkStruct_ov113_0225DBCC_t { UnkStruct_ov66_0223127C * unk_00; SaveData * unk_04; BGL * unk_08; - PaletteSys * unk_0C; + PaletteData * unk_0C; UnkStruct_02012744 * unk_10; GenericPointerData * unk_14; SysTask * unk_18; - CellTransferStateData * unk_1C; - AnimationResourceCollection * unk_20; + SpriteRenderer * unk_1C; + SpriteGfxHandler * unk_20; UnkStruct_02015920 * unk_24; u8 unk_28; u8 unk_29; @@ -272,7 +272,7 @@ static const u16 Unk_ov113_022608AC[] = { 0x55 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A04 = { +static const SpriteTemplate Unk_ov113_02260A04 = { 0x0, 0x0, 0x0, @@ -285,7 +285,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A04 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A38 = { +static const SpriteTemplate Unk_ov113_02260A38 = { 0x0, 0x0, 0x0, @@ -298,7 +298,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A38 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A6C = { +static const SpriteTemplate Unk_ov113_02260A6C = { 0x0, 0x0, 0x0, @@ -311,7 +311,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260A6C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260AA0 = { +static const SpriteTemplate Unk_ov113_02260AA0 = { 0x0, 0x0, 0x0, @@ -324,7 +324,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov113_02260AA0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_0226099C = { +static const SpriteTemplate Unk_ov113_0226099C = { 0x0, 0x0, 0x0, @@ -337,7 +337,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov113_0226099C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov113_022609D0 = { +static const SpriteTemplate Unk_ov113_022609D0 = { 0x0, 0x0, 0x0, @@ -942,19 +942,19 @@ static void ov113_0225D304 (UnkStruct_ov113_0225DBCC * param0, NARC * param1) int v0, v1; u16 v2; - sub_0200CDC4(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); - sub_0200CC3C(param0->unk_1C, param0->unk_20, param1, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10007); - sub_0200CE24(param0->unk_1C, param0->unk_20, param1, 5, 0, 10002); - sub_0200CE54(param0->unk_1C, param0->unk_20, param1, 6, 0, 10002); + SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 3, NNS_G2D_VRAM_TYPE_2DMAIN, 10001); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10007); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 5, 0, 10002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 6, 0, 10002); for (v0 = 0; v0 < 6; v0++) { - sub_0200CC3C(param0->unk_1C, param0->unk_20, param1, 16, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001 + v0); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 16, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10001 + v0); } - sub_0200CE24(param0->unk_1C, param0->unk_20, param1, 15, 0, 10001); - sub_0200CE54(param0->unk_1C, param0->unk_20, param1, 14, 0, 10001); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 15, 0, 10001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 14, 0, 10001); - v1 = sub_0200CDC4(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); + v1 = SpriteRenderer_LoadPalette(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, param1, 3, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10002); if (param0->unk_00->unk_04 == 0) { v2 = 0x0; @@ -963,9 +963,9 @@ static void ov113_0225D304 (UnkStruct_ov113_0225DBCC * param0, NARC * param1) } sub_020038B0(param0->unk_0C, 2, 2, v2, v1 * 16, v1 * 16 + 16); - sub_0200CC3C(param0->unk_1C, param0->unk_20, param1, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10008); - sub_0200CE24(param0->unk_1C, param0->unk_20, param1, 1, 0, 10003); - sub_0200CE54(param0->unk_1C, param0->unk_20, param1, 0, 0, 10003); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10008); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 1, 0, 10003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 0, 0, 10003); param0->unk_921 = sub_0200CD7C(param0->unk_0C, 2, param0->unk_1C, param0->unk_20, 187, 26, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); } @@ -973,41 +973,41 @@ static void ov113_0225D304 (UnkStruct_ov113_0225DBCC * param0, NARC * param1) static void ov113_0225D484 (UnkStruct_ov113_0225DBCC * param0) { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov113_02260A04; for (v0 = 0; v0 < 6; v0++) { - v1.unk_00 = 16 + 32 * v0; - v1.unk_02 = 176; + v1.x = 16 + 32 * v0; + v1.y = 176; - param0->unk_924[v0] = sub_0200CE6C(param0->unk_1C, param0->unk_20, &v1); + param0->unk_924[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); sub_0200D364(param0->unk_924[v0], v0); - sub_0200D324(param0->unk_924[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_924[v0]->unk_00); } v1 = Unk_ov113_02260A38; for (v0 = 0; v0 < 6; v0++) { - v1.unk_00 = 16 + 32 * v0; - v1.unk_02 = 176; + v1.x = 16 + 32 * v0; + v1.y = 176; - param0->unk_93C[v0] = sub_0200CE6C(param0->unk_1C, param0->unk_20, &v1); + param0->unk_93C[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); sub_0200D364(param0->unk_93C[v0], v0); - sub_0200D324(param0->unk_93C[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_93C[v0]->unk_00); } v1 = Unk_ov113_02260A6C; for (v0 = 0; v0 < 6; v0++) { - v1.unk_00 = 16 + 32 * v0; - v1.unk_02 = 176; - v1.unk_14[0] = 10001 + v0; + v1.x = 16 + 32 * v0; + v1.y = 176; + v1.resources[0] = 10001 + v0; - param0->unk_954[v0] = sub_0200CE6C(param0->unk_1C, param0->unk_20, &v1); - sub_0200D324(param0->unk_954[v0]->unk_00); + param0->unk_954[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); + SpriteActor_UpdateObject(param0->unk_954[v0]->unk_00); } { @@ -1043,37 +1043,37 @@ static void ov113_0225D630 (UnkStruct_ov113_0225DBCC * param0, NARC * param1) { int v0; - sub_0200CDC4(param0->unk_0C, 3, param0->unk_1C, param0->unk_20, param1, 10, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 10004); - sub_0200CC3C(param0->unk_1C, param0->unk_20, param1, 9, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10009); - sub_0200CE24(param0->unk_1C, param0->unk_20, param1, 8, 0, 10004); - sub_0200CE54(param0->unk_1C, param0->unk_20, param1, 7, 0, 10004); + SpriteRenderer_LoadPalette(param0->unk_0C, 3, param0->unk_1C, param0->unk_20, param1, 10, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 9, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10009); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 8, 0, 10004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 7, 0, 10004); for (v0 = 0; v0 < 8; v0++) { - sub_0200CC3C(param0->unk_1C, param0->unk_20, param1, 13, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10010 + v0); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 13, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10010 + v0); } - sub_0200CE24(param0->unk_1C, param0->unk_20, param1, 12, 0, 10005); - sub_0200CE54(param0->unk_1C, param0->unk_20, param1, 11, 0, 10005); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 12, 0, 10005); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_1C, param0->unk_20, param1, 11, 0, 10005); } static void ov113_0225D6F8 (UnkStruct_ov113_0225DBCC * param0) { int v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; - param0->unk_96C = sub_0200CE6C(param0->unk_1C, param0->unk_20, &Unk_ov113_0226099C); + param0->unk_96C = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &Unk_ov113_0226099C); - sub_0200D324(param0->unk_96C->unk_00); + SpriteActor_UpdateObject(param0->unk_96C->unk_00); sub_0200D3F4(param0->unk_96C, 0); v1 = Unk_ov113_022609D0; for (v0 = 0; v0 < 8; v0++) { - v1.unk_14[0] = 10010 + v0; - param0->unk_970[v0] = sub_0200CE6C(param0->unk_1C, param0->unk_20, &v1); + v1.resources[0] = 10010 + v0; + param0->unk_970[v0] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v1); sub_0200D500(param0->unk_970[v0], Unk_ov113_02260934[v0][0], Unk_ov113_02260934[v0][1], ((192 + 80) << FX32_SHIFT)); - sub_0200D324(param0->unk_970[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_970[v0]->unk_00); sub_0200D3F4(param0->unk_970[v0], 0); } } @@ -1467,16 +1467,16 @@ void ov113_0225E05C (UnkStruct_ov113_0225DBCC * param0, u32 param1) static void ov113_0225E068 (UnkStruct_ov113_0225DBCC * param0, int param1) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; int v1; v0 = Unk_ov113_02260AA0; for (v1 = 0; v1 < 3; v1++) { if (param0->unk_990[v1] == NULL) { - v0.unk_00 = 16 + 32 * param1; - v0.unk_02 = 176; - param0->unk_990[v1] = sub_0200CE6C(param0->unk_1C, param0->unk_20, &v0); + v0.x = 16 + 32 * param1; + v0.y = 176; + param0->unk_990[v1] = SpriteActor_LoadResources(param0->unk_1C, param0->unk_20, &v0); break; } @@ -1507,7 +1507,7 @@ static void ov113_0225E118 (UnkStruct_ov113_0225DBCC * param0) sub_0200D0F4(param0->unk_990[v0]); param0->unk_990[v0] = NULL; } else { - sub_0200D324(param0->unk_990[v0]->unk_00); + SpriteActor_UpdateObject(param0->unk_990[v0]->unk_00); } } } @@ -1521,7 +1521,7 @@ static void ov113_0225E15C (UnkStruct_ov113_0225DBCC * param0, UnkStruct_ov113_0 int v3; FontOAM * v4; BGL * v5; - AnimationResourceCollection * v6; + SpriteGfxHandler * v6; int v7, v8; GF_ASSERT(param1->unk_00 == NULL); diff --git a/src/overlay114/ov114_0225C700.c b/src/overlay114/ov114_0225C700.c index 4b1d6722d1..c9a6642ee9 100644 --- a/src/overlay114/ov114_0225C700.c +++ b/src/overlay114/ov114_0225C700.c @@ -1986,7 +1986,7 @@ static void ov114_0225DAC0 (UnkStruct_ov114_0225DAC0 * param0, u32 param1, u32 p param0->unk_10 = ov114_0225CDB4(param8, param7->unk_00, v2, v3, 0, param9); - sub_02021D6C(param0->unk_10, v1); + SpriteActor_SetSpriteAnimActive(param0->unk_10, v1); sub_02021EF0(param0->unk_10, param5); sub_02021CAC(param0->unk_10, 0); sub_02021CC8(param0->unk_10, 1); @@ -2000,7 +2000,7 @@ static void ov114_0225DAC0 (UnkStruct_ov114_0225DAC0 * param0, u32 param1, u32 p param0->unk_14 = ov114_0225CDB4(param8, param7->unk_00, v4, v5, 0, param9); - sub_02021D6C(param0->unk_14, 0); + SpriteActor_SetSpriteAnimActive(param0->unk_14, 0); sub_02021CAC(param0->unk_14, 0); } @@ -2040,7 +2040,7 @@ static void ov114_0225DCA0 (UnkStruct_ov114_0225DAC0 * param0, UnkStruct_ov114_0 static void ov114_0225DD0C (UnkStruct_ov114_0225DAC0 * param0, u32 param1) { sub_02021CAC(param0->unk_14, 1); - sub_02021D6C(param0->unk_14, 4 + param1); + SpriteActor_SetSpriteAnimActive(param0->unk_14, 4 + param1); sub_02021CC8(param0->unk_14, 1); } @@ -3416,7 +3416,7 @@ static void ov114_0225F484 (UnkStruct_ov114_0225F578 * param0, UnkStruct_ov114_0 v2 = (v0 * 5) + v1; param0->unk_08[v2] = ov114_0225CDB4(param0->unk_44, param2->unk_00, v3, v4, 0, param5); sub_02021CAC(param0->unk_08[v2], 0); - sub_02021D6C(param0->unk_08[v2], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_08[v2], v0); sub_02021E80(param0->unk_08[v2], 0); v3 += 24; @@ -3483,7 +3483,7 @@ static BOOL ov114_0225F5AC (UnkStruct_ov114_0225F578 * param0, UnkStruct_ov114_0 if (param0->unk_4A != param0->unk_4B) { for (v0 = 0; v0 < (5 * 3); v0++) { sub_02021CAC(param0->unk_08[v0], 0); - sub_02021D6C(param0->unk_08[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_08[v0], 2); } } } @@ -3668,7 +3668,7 @@ static void ov114_0225F9B8 (UnkStruct_ov114_0225FAB8 * param0, UnkStruct_ov114_0 for (v0 = 0; v0 < 2; v0++) { param0->unk_00[v0] = ov114_0225CDB4(param1, param2, Unk_ov114_0226019C[v0].x >> FX32_SHIFT, Unk_ov114_0226019C[v0].y >> FX32_SHIFT, 0, param3); - sub_02021D6C(param0->unk_00[v0], 5); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0], 5); sub_02021E80(param0->unk_00[v0], 0); } @@ -3944,7 +3944,7 @@ static void ov114_0225FF54 (SysTask * param0, void * param1) case 1: ov114_0225F9B8(&v0->unk_34, v0->unk_28, v0->unk_08, v0->unk_00); v0->unk_30 = ov114_0225CDB4(v0->unk_28, v0->unk_08, 128, 97, 64, v0->unk_00); - sub_02021D6C(v0->unk_30, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_30, 1); sub_02021E80(v0->unk_30, 0); v0->unk_04++; break; diff --git a/src/overlay115/ov115_02260CEC.c b/src/overlay115/ov115_02260CEC.c index e6ddaded71..60143f1c23 100644 --- a/src/overlay115/ov115_02260CEC.c +++ b/src/overlay115/ov115_02260CEC.c @@ -1315,7 +1315,7 @@ static void ov115_022615B0 (UnkStruct_ov115_022615B0 * param0, UnkStruct_ov115_0 param0->unk_18[v0] = param1->unk_08; param0->unk_00[v0] = sub_02021AA0(param1); - sub_02021D6C(param0->unk_00[v0], 2); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v0], 2); sub_02021CAC(param0->unk_00[v0], 0); sub_02021CC8(param0->unk_00[v0], 1); sub_02021CE4(param0->unk_00[v0], FX32_CONST(1.5)); @@ -1393,7 +1393,7 @@ static void ov115_02261660 (UnkStruct_ov115_022615B0 * param0, u32 param1, u32 p v6 = 7; } - sub_02021D6C(param0->unk_00[v1], v5); + SpriteActor_SetSpriteAnimActive(param0->unk_00[v1], v5); param0->unk_0C[v1] = 0; sub_02021CAC(param0->unk_00[v1], 1); ov115_0226177C(param0, v1); @@ -2740,7 +2740,7 @@ static BOOL ov115_02263150 (UnkStruct_ov115_02263130 * param0, UnkStruct_ov115_0 { switch (param0->unk_3A) { case 0: - sub_02021E50(param0->unk_34, 0); + SpriteActor_SetAnimFrame(param0->unk_34, 0); ov115_02264BAC(¶m1->unk_1AB4.unk_6A34); ov115_02264BD8(¶m1->unk_1AB4.unk_6A34, 128, Unk_ov115_02265B7C[0]); diff --git a/src/overlay116/ov116_022604C4.c b/src/overlay116/ov116_022604C4.c index 09a108fdb7..b3ce0b8db2 100644 --- a/src/overlay116/ov116_022604C4.c +++ b/src/overlay116/ov116_022604C4.c @@ -402,7 +402,7 @@ static BOOL ov116_02260B6C (UnkStruct_ov116_02262A8C * param0) if (param0->unk_0C == 2) { if (sub_0200D37C(param0->unk_D8) != 2) { - sub_0200D4C4(param0->unk_D8, 128, 100); + SpriteActor_SetSpritePositionXY(param0->unk_D8, 128, 100); sub_0200D370(param0->unk_D8, 2); ov116_02266FEC(¶m0->unk_FC.unk_190); diff --git a/src/overlay116/ov116_02261870.c b/src/overlay116/ov116_02261870.c index d97c7d46ee..65e45be6b1 100644 --- a/src/overlay116/ov116_02261870.c +++ b/src/overlay116/ov116_02261870.c @@ -15,7 +15,7 @@ #include "struct_defs/struct_0200D0F4.h" #include "struct_defs/struct_02017294.h" #include "struct_defs/struct_0205AA50.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay116/struct_ov116_0226139C.h" #include "overlay116/struct_ov116_02262A8C.h" #include "overlay116/struct_ov116_0226501C.h" @@ -40,7 +40,7 @@ static inline void inline_ov116_02261940(UnkStruct_ov116_0226501C * param0); static inline void inline_ov116_02261940_1(void); -static void ov116_02261CD8(UnkStruct_ov104_0223F9E0 * param0, s16 param1, s16 param2, int param3, int param4, int param5); +static void ov116_02261CD8(SpriteTemplate * param0, s16 param1, s16 param2, int param3, int param4, int param5); void include_ov116_02261870(void); void ov116_02261870 (UnkStruct_02017294 * param0, MtxFx43 * param1, VecFx32 * param2) @@ -203,23 +203,23 @@ void ov116_02261C88 (UnkStruct_ov116_0226139C * param0) sub_020203D4(param0->unk_48.unk_1C); } -static void ov116_02261CD8 (UnkStruct_ov104_0223F9E0 * param0, s16 param1, s16 param2, int param3, int param4, int param5) +static void ov116_02261CD8 (SpriteTemplate * param0, s16 param1, s16 param2, int param3, int param4, int param5) { - param0->unk_00 = param1; - param0->unk_02 = param2; - param0->unk_04 = 0; - param0->unk_06 = 0; - param0->unk_08 = 0; - param0->unk_10 = param3; - param0->unk_2C = 2; - param0->unk_30 = 0; - param0->unk_0C = param4; - param0->unk_14[0] = param5; - param0->unk_14[1] = param5; - param0->unk_14[2] = param5; - param0->unk_14[3] = param5; - param0->unk_14[4] = 0xffffffff; - param0->unk_14[5] = 0xffffffff; + param0->x = param1; + param0->y = param2; + param0->z = 0; + param0->animIdx = 0; + param0->priority = 0; + param0->vramType = param3; + param0->bgPriority = 2; + param0->transferToVRAM = FALSE; + param0->plttIdx = param4; + param0->resources[0] = param5; + param0->resources[1] = param5; + param0->resources[2] = param5; + param0->resources[3] = param5; + param0->resources[4] = SPRITE_RESOURCE_NONE; + param0->resources[5] = SPRITE_RESOURCE_NONE; } static const s16 Unk_ov116_02267A78[][3] = { @@ -231,15 +231,15 @@ static const s16 Unk_ov116_02267A78[][3] = { void ov116_02261D08 (UnkStruct_ov116_02262A8C * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1 = param0->unk_14->unk_08; - AnimationResourceCollection * v2 = param0->unk_14->unk_0C; - PaletteSys * v3 = param0->unk_14->unk_14; + SpriteTemplate v0; + SpriteRenderer * v1 = param0->unk_14->unk_08; + SpriteGfxHandler * v2 = param0->unk_14->unk_0C; + PaletteData * v3 = param0->unk_14->unk_14; int v4; for (v4 = 0; v4 < (3 * 12); v4++) { ov116_02261CD8(&v0, v4 * 8, 20, 1, 3, 9006); - param0->unk_28[v4] = sub_0200CE6C(v1, v2, &v0); + param0->unk_28[v4] = SpriteActor_LoadResources(v1, v2, &v0); sub_0200D430(param0->unk_28[v4], 3); sub_0200D364(param0->unk_28[v4], (v4 % 11) + 1); } @@ -249,19 +249,19 @@ void ov116_02261D08 (UnkStruct_ov116_02262A8C * param0) void ov116_02261D70 (UnkStruct_ov116_02262A8C * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1 = param0->unk_14->unk_08; - AnimationResourceCollection * v2 = param0->unk_14->unk_0C; - PaletteSys * v3 = param0->unk_14->unk_14; + SpriteTemplate v0; + SpriteRenderer * v1 = param0->unk_14->unk_08; + SpriteGfxHandler * v2 = param0->unk_14->unk_0C; + PaletteData * v3 = param0->unk_14->unk_14; int v4; s16 v5[] = {72, 180, 24, 232}; for (v4 = 0; v4 < 4; v4++) { ov116_02261CD8(&v0, v5[v4], (192 + 32), 1, 1, 9004); - v0.unk_2C = 0; - v0.unk_08 = 1; - param0->unk_B8[v4] = sub_0200CE6C(v1, v2, &v0); + v0.bgPriority = 0; + v0.priority = 1; + param0->unk_B8[v4] = SpriteActor_LoadResources(v1, v2, &v0); sub_0200D33C(param0->unk_B8[v4]); sub_0200D430(param0->unk_B8[v4], 1); @@ -422,7 +422,7 @@ void ov116_02262004 (UnkStruct_ov116_02262A8C * param0) void ov116_02262034 (UnkStruct_ov116_0226139C * param0, int param1) { - PaletteSys * v0 = param0->unk_48.unk_14; + PaletteData * v0 = param0->unk_48.unk_14; static int v1[][4][4 + 1] = { { {0, 0, 0, 0, 0}, @@ -577,9 +577,9 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) NARC * v0 = param0->unk_48.unk_00; NARC * v1 = param0->unk_48.unk_04; BGL * v2 = param0->unk_48.unk_10; - CellTransferStateData * v3 = param0->unk_48.unk_08; - AnimationResourceCollection * v4 = param0->unk_48.unk_0C; - PaletteSys * v5 = param0->unk_48.unk_14; + SpriteRenderer * v3 = param0->unk_48.unk_08; + SpriteGfxHandler * v4 = param0->unk_48.unk_0C; + PaletteData * v5 = param0->unk_48.unk_14; NARC * v6; int v7; int v8; @@ -596,10 +596,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9000; v12 = 13; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DSUB, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 3, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DSUB, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DSUB, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 3, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DSUB, v11); v7 = 27; v8 = 28; @@ -608,10 +608,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9003; v12 = 1; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 11; v8 = 12; @@ -620,10 +620,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9004; v12 = 1; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 19; v8 = 20; @@ -632,10 +632,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9005; v12 = 1; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 15; v8 = 16; @@ -644,10 +644,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9006; v12 = 1; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); v7 = 23; v8 = 24; @@ -656,10 +656,10 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9002; v12 = 3; - sub_0200CC3C(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v6, v8, 0, v11); - sub_0200CE54(v3, v4, v6, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v6, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v6, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v6, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v6, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); { NARC * v13 = NARC_ctor(NARC_INDEX_RESOURCE__ENG__WIFI_LOBBY_MINIGAME__WLMNGM_TOOL, 106); @@ -671,20 +671,20 @@ void ov116_022622C8 (UnkStruct_ov116_0226139C * param0) v11 = 9007; v12 = 2; - sub_0200CC3C(v3, v4, v13, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); - sub_0200CE24(v3, v4, v13, v8, 0, v11); - sub_0200CE54(v3, v4, v13, v7, 0, v11); - sub_0200CDC4(v5, 2, v3, v4, v13, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCharResObjFromOpenNarc(v3, v4, v13, v9, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v11); + SpriteRenderer_LoadCellResObjFromOpenNarc(v3, v4, v13, v8, 0, v11); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v3, v4, v13, v7, 0, v11); + SpriteRenderer_LoadPalette(v5, 2, v3, v4, v13, v10, 0, v12, NNS_G2D_VRAM_TYPE_2DMAIN, v11); NARC_dtor(v13); } } void ov116_022625A8 (UnkStruct_ov116_0226139C * param0, UnkStruct_ov116_02262A8C * param1) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1 = param1->unk_14->unk_08; - AnimationResourceCollection * v2 = param1->unk_14->unk_0C; - PaletteSys * v3 = param1->unk_14->unk_14; + SpriteTemplate v0; + SpriteRenderer * v1 = param1->unk_14->unk_08; + SpriteGfxHandler * v2 = param1->unk_14->unk_0C; + PaletteData * v3 = param1->unk_14->unk_14; int v4; int v5 = 0; @@ -696,18 +696,18 @@ void ov116_022625A8 (UnkStruct_ov116_0226139C * param0, UnkStruct_ov116_02262A8C param1->unk_DC[v4] = v5; ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, (176 + 64), 2, 0, 9000); - v0.unk_08 = 1; + v0.priority = 1; - param1->unk_1C[v5] = sub_0200CE6C(v1, v2, &v0); + param1->unk_1C[v5] = SpriteActor_LoadResources(v1, v2, &v0); ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, ((176 + 64) + 0), 2, 0, 9000); - v0.unk_08 = 2; + v0.priority = 2; - param1->unk_20[v5] = sub_0200CE6C(v1, v2, &v0); + param1->unk_20[v5] = SpriteActor_LoadResources(v1, v2, &v0); sub_0200D430(param1->unk_20[v5], 0 + ov116_02264680(param0, v4)); ov116_02261CD8(&v0, Unk_ov116_02267A78[param1->unk_04 - 1][v5] + 0, ((176 + 64) + 0), 2, 0, 9000); - v0.unk_08 = 3; + v0.priority = 3; - param1->unk_24[v5] = sub_0200CE6C(v1, v2, &v0); + param1->unk_24[v5] = SpriteActor_LoadResources(v1, v2, &v0); sub_0200D430(param1->unk_24[v5], 0 + ov116_02264680(param0, v4)); sub_0200D364(param1->unk_24[v5], 5); sub_0200D33C(param1->unk_1C[v5]); @@ -722,16 +722,16 @@ void ov116_022625A8 (UnkStruct_ov116_0226139C * param0, UnkStruct_ov116_02262A8C CellActorData * ov116_022626E8 (UnkStruct_ov116_02262A8C * param0, s16 param1, s16 param2) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; - CellTransferStateData * v2 = param0->unk_14->unk_08; - AnimationResourceCollection * v3 = param0->unk_14->unk_0C; - PaletteSys * v4 = param0->unk_14->unk_14; + SpriteTemplate v1; + SpriteRenderer * v2 = param0->unk_14->unk_08; + SpriteGfxHandler * v3 = param0->unk_14->unk_0C; + PaletteData * v4 = param0->unk_14->unk_14; ov116_02261CD8(&v1, param1, param2, 1, 0, 9003); - v1.unk_2C = 0; - v1.unk_08 = 0; - v0 = sub_0200CE6C(v2, v3, &v1); + v1.bgPriority = 0; + v1.priority = 0; + v0 = SpriteActor_LoadResources(v2, v3, &v1); sub_0200D33C(v0); @@ -742,34 +742,34 @@ void ov116_02262724 (UnkStruct_ov116_02262A8C * param0) { int v0; CellActorData * v1; - UnkStruct_ov104_0223F9E0 v2; - CellTransferStateData * v3 = param0->unk_14->unk_08; - AnimationResourceCollection * v4 = param0->unk_14->unk_0C; - PaletteSys * v5 = param0->unk_14->unk_14; + SpriteTemplate v2; + SpriteRenderer * v3 = param0->unk_14->unk_08; + SpriteGfxHandler * v4 = param0->unk_14->unk_0C; + PaletteData * v5 = param0->unk_14->unk_14; for (v0 = 0; v0 < 2; v0++) { ov116_02261CD8(&v2, 0, 0, 1, 4, 9002); - v2.unk_2C = 2; - v2.unk_08 = 20; - param0->unk_D0[v0] = sub_0200CE6C(v3, v4, &v2); + v2.bgPriority = 2; + v2.priority = 20; + param0->unk_D0[v0] = SpriteActor_LoadResources(v3, v4, &v2); sub_0200D364(param0->unk_D0[v0], 0); sub_0200D330(param0->unk_D0[v0]); sub_0200D430(param0->unk_D0[v0], 4); - sub_0200D810(param0->unk_D0[v0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_D0[v0], GX_OAM_MODE_XLU); sub_0200D3F4(param0->unk_D0[v0], 0); ov116_02261CD8(&v2, 0, 0, 2, 0, 9000); - v2.unk_2C = 2; - v2.unk_08 = 20; - param0->unk_C8[v0] = sub_0200CE6C(v3, v4, &v2); + v2.bgPriority = 2; + v2.priority = 20; + param0->unk_C8[v0] = SpriteActor_LoadResources(v3, v4, &v2); sub_0200D364(param0->unk_C8[v0], 6); sub_0200D330(param0->unk_C8[v0]); sub_0200D430(param0->unk_C8[v0], 0); - sub_0200D810(param0->unk_C8[v0], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_C8[v0], GX_OAM_MODE_XLU); sub_0200D3F4(param0->unk_C8[v0], 0); } } @@ -788,16 +788,16 @@ void ov116_02262840 (UnkStruct_ov116_02262A8C * param0) { int v0; CellActorData * v1; - UnkStruct_ov104_0223F9E0 v2; - CellTransferStateData * v3 = param0->unk_14->unk_08; - AnimationResourceCollection * v4 = param0->unk_14->unk_0C; - PaletteSys * v5 = param0->unk_14->unk_14; + SpriteTemplate v2; + SpriteRenderer * v3 = param0->unk_14->unk_08; + SpriteGfxHandler * v4 = param0->unk_14->unk_0C; + PaletteData * v5 = param0->unk_14->unk_14; ov116_02261CD8(&v2, 128, 128, 1, 7, 9007); - v2.unk_2C = 0; - v2.unk_08 = 0; - param0->unk_D8 = sub_0200CE6C(v3, v4, &v2); + v2.bgPriority = 0; + v2.priority = 0; + param0->unk_D8 = SpriteActor_LoadResources(v3, v4, &v2); sub_0200D364(param0->unk_D8, 1); sub_0200D3F4(param0->unk_D8, 1); @@ -815,9 +815,9 @@ void ov116_022628B8 (UnkStruct_ov116_0226139C * param0) NARC * v0 = param0->unk_48.unk_00; NARC * v1 = param0->unk_48.unk_04; BGL * v2 = param0->unk_48.unk_10; - CellTransferStateData * v3 = param0->unk_48.unk_08; - AnimationResourceCollection * v4 = param0->unk_48.unk_0C; - PaletteSys * v5 = param0->unk_48.unk_14; + SpriteRenderer * v3 = param0->unk_48.unk_08; + SpriteGfxHandler * v4 = param0->unk_48.unk_0C; + PaletteData * v5 = param0->unk_48.unk_14; NARC * v6 = v0; sub_020070E8(v6, 72, v2, 4, 0, 0, 0, 106); diff --git a/src/overlay116/ov116_0226432C.c b/src/overlay116/ov116_0226432C.c index a5533ba750..2f0f75e438 100644 --- a/src/overlay116/ov116_0226432C.c +++ b/src/overlay116/ov116_0226432C.c @@ -617,7 +617,7 @@ static void ov116_0226501C (UnkStruct_ov116_02265470 * param0) UnkStruct_ov116_0226501C * v0 = param0->unk_08[0]; int * v1 = param0->unk_08[1]; int * v2 = param0->unk_08[3]; - PaletteSys * v3 = param0->unk_08[2]; + PaletteData * v3 = param0->unk_08[2]; if (param0->unk_04 == 0) { return; @@ -694,10 +694,10 @@ static void ov116_0226510C (UnkStruct_ov116_02265470 * param0) continue; } - sub_0200D550(v5, &v1, &v2); + SpriteActor_GetSpritePositionXY(v5, &v1, &v2); if (v2 > v3[v0]) { v2 -= 6; - sub_0200D4C4(v5, v1, v2); + SpriteActor_SetSpritePositionXY(v5, v1, v2); v4[v0] = 0; } } @@ -725,10 +725,10 @@ static void ov116_0226510C (UnkStruct_ov116_02265470 * param0) continue; } - sub_0200D550(v5, &v1, &v2); + SpriteActor_GetSpritePositionXY(v5, &v1, &v2); if (v2 < (192 + 32)) { v2 += 6; - sub_0200D4C4(v5, v1, v2); + SpriteActor_SetSpritePositionXY(v5, v1, v2); v4[v0] = 0; } } @@ -918,10 +918,10 @@ void ov116_02265470 (UnkStruct_ov116_02262A8C * param0) { s16 v2, v3; - sub_0200D550(param0->unk_B8[0], &v2, &v3); - sub_0200D4C4(param0->unk_B8[0], v2, (192 + 32)); - sub_0200D550(param0->unk_B8[1], &v2, &v3); - sub_0200D4C4(param0->unk_B8[1], v2, (192 + 32)); + SpriteActor_GetSpritePositionXY(param0->unk_B8[0], &v2, &v3); + SpriteActor_SetSpritePositionXY(param0->unk_B8[0], v2, (192 + 32)); + SpriteActor_GetSpritePositionXY(param0->unk_B8[1], &v2, &v3); + SpriteActor_SetSpritePositionXY(param0->unk_B8[1], v2, (192 + 32)); } break; case 2: @@ -941,10 +941,10 @@ void ov116_02265470 (UnkStruct_ov116_02262A8C * param0) { s16 v5, v6; - sub_0200D550(param0->unk_B8[2], &v5, &v6); - sub_0200D4C4(param0->unk_B8[2], v5, (192 + 32)); - sub_0200D550(param0->unk_B8[3], &v5, &v6); - sub_0200D4C4(param0->unk_B8[3], v5, (192 + 32)); + SpriteActor_GetSpritePositionXY(param0->unk_B8[2], &v5, &v6); + SpriteActor_SetSpritePositionXY(param0->unk_B8[2], v5, (192 + 32)); + SpriteActor_GetSpritePositionXY(param0->unk_B8[3], &v5, &v6); + SpriteActor_SetSpritePositionXY(param0->unk_B8[3], v5, (192 + 32)); } break; case 4: diff --git a/src/overlay117/ov117_02260668.c b/src/overlay117/ov117_02260668.c index 36a3bd805b..0a2676cd7a 100644 --- a/src/overlay117/ov117_02260668.c +++ b/src/overlay117/ov117_02260668.c @@ -1010,7 +1010,7 @@ asm static void ov117_0226168C (UnkStruct_ov117_02261280 * param0, NARC * param1 ldr r2, [r5, #0x24] ldr r3, [r5, #0x28] mov r1, #2 - bl sub_0200CDC4 + bl SpriteRenderer_LoadPalette add r0, r5, #0 add r0, #0x80 ldr r0, [r0, #0] @@ -1164,7 +1164,7 @@ asm static void ov117_0226168C (UnkStruct_ov117_02261280 * param0, NARC * param1 ldr r0, [r0, #0] ldr r2, [r5, #0x24] ldr r3, [r5, #0x28] - bl sub_0200CDC4 + bl SpriteRenderer_LoadPalette mov r0, #0 str r0, [sp] mov r0, #1 @@ -1175,7 +1175,7 @@ asm static void ov117_0226168C (UnkStruct_ov117_02261280 * param0, NARC * param1 ldr r0, [r5, #0x24] ldr r1, [r5, #0x28] mov r3, #0x18 - bl sub_0200CC3C + bl SpriteRenderer_LoadCharResObjFromOpenNarc mov r0, #0 str r0, [sp] ldr r0, = 0x2712 @@ -1184,7 +1184,7 @@ asm static void ov117_0226168C (UnkStruct_ov117_02261280 * param0, NARC * param1 ldr r0, [r5, #0x24] ldr r1, [r5, #0x28] mov r3, #0x1a - bl sub_0200CE24 + bl SpriteRenderer_LoadCellResObjFromOpenNarc mov r0, #0 str r0, [sp] ldr r0, = 0x2712 @@ -1193,7 +1193,7 @@ asm static void ov117_0226168C (UnkStruct_ov117_02261280 * param0, NARC * param1 ldr r0, [r5, #0x24] ldr r1, [r5, #0x28] mov r3, #0x19 - bl sub_0200CE54 + bl SpriteRenderer_LoadAnimResObjFromOpenNarc add r0, r5, #0 bl ov117_02266130 ldr r1, = 0x15A8 @@ -1271,10 +1271,10 @@ static void ov117_022618E8 (UnkStruct_ov117_02261280 * param0) static void ov117_02261940 (UnkStruct_ov117_02261280 * param0, NARC * param1) { - sub_0200CDC4(param0->unk_8C, 3, param0->unk_24, param0->unk_28, param1, 23, 0, 9, NNS_G2D_VRAM_TYPE_2DSUB, 10006); - sub_0200CC3C(param0->unk_24, param0->unk_28, param1, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); - sub_0200CE24(param0->unk_24, param0->unk_28, param1, 22, 0, 10004); - sub_0200CE54(param0->unk_24, param0->unk_28, param1, 21, 0, 10004); + SpriteRenderer_LoadPalette(param0->unk_8C, 3, param0->unk_24, param0->unk_28, param1, 23, 0, 9, NNS_G2D_VRAM_TYPE_2DSUB, 10006); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 20, 0, NNS_G2D_VRAM_TYPE_2DSUB, 10004); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 22, 0, 10004); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_24, param0->unk_28, param1, 21, 0, 10004); ov117_022648E0(param0); ov117_02264FB0(param0, ¶m0->unk_1458); diff --git a/src/overlay117/ov117_022626B0.c b/src/overlay117/ov117_022626B0.c index 8f4b9eae1d..3a3ecd20e4 100644 --- a/src/overlay117/ov117_022626B0.c +++ b/src/overlay117/ov117_022626B0.c @@ -7,7 +7,7 @@ #include "struct_decls/struct_02006C24_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay117/struct_ov117_02261280.h" #include "overlay117/struct_ov117_02264E84.h" @@ -129,7 +129,7 @@ static const fx16 Unk_ov117_02266B12[3 * 6] = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266B38 = { +static const SpriteTemplate Unk_ov117_02266B38 = { 0x0, 0x0, 0x0, @@ -920,31 +920,31 @@ static void ov117_022638D8 (UnkStruct_ov117_02261280 * param0) v0 = NARC_ctor(NARC_INDEX_APPLICATION__BALLOON__GRAPHIC__BALLOON_GRA, 110); - sub_0200CDC4(param0->unk_8C, 2, param0->unk_24, param0->unk_28, v0, 58, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10005); - sub_0200CC3C(param0->unk_24, param0->unk_28, v0, 55, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); - sub_0200CE24(param0->unk_24, param0->unk_28, v0, 57, 0, 10003); - sub_0200CE54(param0->unk_24, param0->unk_28, v0, 56, 0, 10003); + SpriteRenderer_LoadPalette(param0->unk_8C, 2, param0->unk_24, param0->unk_28, v0, 58, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 10005); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 55, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 10003); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 57, 0, 10003); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0->unk_24, param0->unk_28, v0, 56, 0, 10003); NARC_dtor(v0); } static void ov117_022639BC (UnkStruct_ov117_02261280 * param0) { - sub_0200D070(param0->unk_28, 10003); - sub_0200D090(param0->unk_28, 10003); - sub_0200D0A0(param0->unk_28, 10003); - sub_0200D080(param0->unk_28, 10005); + SpriteGfxHandler_UnloadCharObjById(param0->unk_28, 10003); + SpriteGfxHandler_UnloadCellObjById(param0->unk_28, 10003); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_28, 10003); + SpriteGfxHandler_UnloadPlttObjById(param0->unk_28, 10005); } static CellActorData * ov117_02263A00 (UnkStruct_ov117_02261280 * param0) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov117_02266B38; - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v1); + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D3F4(v0, 0); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -961,7 +961,7 @@ static void ov117_02263A6C (UnkStruct_ov117_022626B0 * param0, CellActorData * p sub_0200D500(param1, param0->unk_21C, (param0->unk_230 >> FX32_SHIFT) + Unk_ov117_02266B05[param0->unk_270].unk_02, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param1, v0); - sub_0200D324(param1->unk_00); + SpriteActor_UpdateObject(param1->unk_00); } static void ov117_02263AE4 (CellActorData * param0) diff --git a/src/overlay117/ov117_02263AF0.c b/src/overlay117/ov117_02263AF0.c index 2ea967dbf7..631ff3be9f 100644 --- a/src/overlay117/ov117_02263AF0.c +++ b/src/overlay117/ov117_02263AF0.c @@ -12,7 +12,7 @@ #include "struct_defs/struct_020127E8.h" #include "struct_defs/sprite_manager_allocation.h" #include "struct_defs/struct_0205AA50.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay117/struct_ov117_02261280.h" #include "overlay117/struct_ov117_02263DAC.h" #include "overlay117/struct_ov117_02263EF8.h" @@ -138,7 +138,7 @@ static const UnkStruct_ov117_02266F10 Unk_ov117_02266F10[][4] = { } }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266CCC = { +static const SpriteTemplate Unk_ov117_02266CCC = { 0x0, 0x0, 0x0, @@ -151,7 +151,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266CCC = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D00 = { +static const SpriteTemplate Unk_ov117_02266D00 = { 0x80, 0x60, 0x0, @@ -164,7 +164,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D00 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D34 = { +static const SpriteTemplate Unk_ov117_02266D34 = { 0x0, 0x0, 0x0, @@ -177,7 +177,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D34 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D68 = { +static const SpriteTemplate Unk_ov117_02266D68 = { 0x0, 0x0, 0x0, @@ -190,7 +190,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D68 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D9C = { +static const SpriteTemplate Unk_ov117_02266D9C = { 0x0, 0x0, 0x0, @@ -203,7 +203,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266D9C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266DD0 = { +static const SpriteTemplate Unk_ov117_02266DD0 = { 0x0, 0x0, 0x0, @@ -216,7 +216,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266DD0 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E04 = { +static const SpriteTemplate Unk_ov117_02266E04 = { 0x0, 0x0, 0x0, @@ -229,7 +229,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E04 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E38 = { +static const SpriteTemplate Unk_ov117_02266E38 = { 0x0, 0x0, 0x0, @@ -242,7 +242,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E38 = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E6C = { +static const SpriteTemplate Unk_ov117_02266E6C = { 0x28, 0xB0, 0x0, @@ -255,7 +255,7 @@ static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266E6C = { 0x0 }; -static const UnkStruct_ov104_0223F9E0 Unk_ov117_02266EA0 = { +static const SpriteTemplate Unk_ov117_02266EA0 = { 0x0, 0x0, 0x0, @@ -782,18 +782,18 @@ static BOOL ov117_02263F80 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 static CellActorData * ov117_0226417C (UnkStruct_ov117_02261280 * param0, const UnkStruct_ov117_02266F10 * param1) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov117_02266CCC; - v1.unk_00 = param1->unk_00; - v1.unk_02 = param1->unk_02; - v1.unk_0C = param1->unk_06; - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v1); + v1.x = param1->unk_00; + v1.y = param1->unk_02; + v1.plttIdx = param1->unk_06; + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(v0, param1->unk_00, param1->unk_02, ((192 + 160) << FX32_SHIFT)); sub_0200D364(v0, param1->unk_04); sub_0200D6A4(v0, 2); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -812,7 +812,7 @@ void ov117_022641E4 (UnkStruct_ov117_02261280 * param0) static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02264808 * param1, UnkStruct_ov117_02263DAC * param2) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; CellActorData * v1; int v2; int v3[4]; @@ -831,7 +831,7 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 for (v9 = 0; v9 < v3[v8]; v9++) { UnkStruct_ov117_02264508 * v10 = ¶m1->unk_04[v7]; - v1 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v0); + v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; @@ -839,7 +839,7 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); sub_0200D364(v1, v6); - sub_0200D324(v1->unk_00); + SpriteActor_UpdateObject(v1->unk_00); v10->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v10->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -853,13 +853,13 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 } } - v0.unk_08 = 14; - v0.unk_0C = 0; + v0.priority = 14; + v0.plttIdx = 0; for (v8 = 0; v8 < 8; v8++) { UnkStruct_ov117_02264508 * v11 = ¶m1->unk_868[v8]; - v1 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v0); + v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; @@ -867,7 +867,7 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); sub_0200D364(v1, 28 + LCRNG_Next() % 3); - sub_0200D324(v1->unk_00); + SpriteActor_UpdateObject(v1->unk_00); v11->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v11->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -878,13 +878,13 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 param1->unk_868[v8].unk_00 = v1; } - v0.unk_08 = 13; - v0.unk_0C = Unk_ov117_02266B6C[param2->unk_04]; + v0.priority = 13; + v0.plttIdx = Unk_ov117_02266B6C[param2->unk_04]; for (v8 = 0; v8 < 3; v8++) { UnkStruct_ov117_02264508 * v12 = ¶m1->unk_928[v8]; - v1 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v0); + v1 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); if (v1 == NULL) { break; @@ -892,7 +892,7 @@ static void ov117_02264214 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 sub_0200D500(v1, 128, 96, ((192 + 160) << FX32_SHIFT)); sub_0200D364(v1, 11); - sub_0200D324(v1->unk_00); + SpriteActor_UpdateObject(v1->unk_00); v12->unk_04 = LCRNG_Next() % 0x2000 + 0x2000; v12->unk_08 = LCRNG_Next() % 0x4000 + 0x2000; @@ -1065,14 +1065,14 @@ BOOL ov117_02264808 (UnkStruct_ov117_02261280 * param0) static CellActorData * ov117_02264884 (UnkStruct_ov117_02261280 * param0, int param1, int param2) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = Unk_ov117_02266D34; - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v1); + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(v0, (9 * 8) - param2 * 16, (4 * 8), ((192 + 160) << FX32_SHIFT)); sub_0200D364(v0, 0 + param1); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); sub_0200D390(v0, 1); return v0; @@ -1452,16 +1452,16 @@ BOOL ov117_02264EB8 (UnkStruct_ov117_02261280 * param0, int param1) void ov117_02264FB0 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0226504C * param1) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; int v2; v1 = Unk_ov117_02266D68; for (v2 = 0; v2 < 4; v2++) { - param1->unk_00[v2] = sub_0200CE6C(param0->unk_24, param0->unk_28, &v1); + param1->unk_00[v2] = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v1); sub_0200D500(param1->unk_00[v2], Unk_ov117_02266BB4[v2].unk_00, Unk_ov117_02266BB4[v2].unk_02, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param1->unk_00[v2], 31 + v2 / 2); - sub_0200D324(param1->unk_00[v2]->unk_00); + SpriteActor_UpdateObject(param1->unk_00[v2]->unk_00); } switch (param0->unk_00->unk_30) { @@ -1486,7 +1486,7 @@ void ov117_0226504C (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0226504C void ov117_02265064 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_022653F4 * param1) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; int v1, v2; fx32 v3, v4; @@ -1496,25 +1496,25 @@ void ov117_02265064 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_022653F4 v3 = 256 / 2 + FX_Mul(sub_0201D2B8(param1->unk_E4 + param1->unk_00[v1].unk_0C), 76); v4 = 196 / 2 + (-FX_Mul(sub_0201D2C4(param1->unk_E4 + param1->unk_00[v1].unk_0C), (64 + 4))); - param1->unk_00[v1].unk_00 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v0); + param1->unk_00[v1].unk_00 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); sub_0200D500(param1->unk_00[v1].unk_00, v3, v4 + -24, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param1->unk_00[v1].unk_00, Unk_ov117_02266B7A[v1 + 1]); - sub_0200D324(param1->unk_00[v1].unk_00->unk_00); + SpriteActor_UpdateObject(param1->unk_00[v1].unk_00->unk_00); sub_0200D3F4(param1->unk_00[v1].unk_00, 0); - param1->unk_00[v1].unk_04 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); + param1->unk_00[v1].unk_04 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param1->unk_00[v1].unk_04, 33); - sub_0200D324(param1->unk_00[v1].unk_04->unk_00); + SpriteActor_UpdateObject(param1->unk_00[v1].unk_04->unk_00); sub_0200D3F4(param1->unk_00[v1].unk_04, 0); - param1->unk_00[v1].unk_08 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266E04); + param1->unk_00[v1].unk_08 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E04); sub_0200D500(param1->unk_00[v1].unk_08, v3, v4 + -24 + 24, ((192 + 160) << FX32_SHIFT)); - sub_0200D810(param1->unk_00[v1].unk_08, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param1->unk_00[v1].unk_08, GX_OAM_MODE_XLU); sub_0200D6A4(param1->unk_00[v1].unk_08, 1); sub_0200D6E8(param1->unk_00[v1].unk_08, 1.0f, 1.0f); sub_0200D364(param1->unk_00[v1].unk_08, 34 + v1); - sub_0200D324(param1->unk_00[v1].unk_08->unk_00); + SpriteActor_UpdateObject(param1->unk_00[v1].unk_08->unk_00); sub_0200D3F4(param1->unk_00[v1].unk_08, 0); ov117_02266344(param0, ¶m1->unk_00[v1].unk_30); @@ -1867,22 +1867,22 @@ static int ov117_022657C4 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02 void ov117_02265ABC (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C * param1) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; int v1; v0 = Unk_ov117_02266D9C; for (v1 = 0; v1 < 3; v1++) { - param1->unk_00[v1].unk_00 = sub_0200CE6C(param0->unk_24, param0->unk_28, &v0); + param1->unk_00[v1].unk_00 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &v0); sub_0200D500(param1->unk_00[v1].unk_00, 0, 0, ((192 + 160) << FX32_SHIFT)); sub_0200D3F4(param1->unk_00[v1].unk_00, 0); - param1->unk_00[v1].unk_04 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); + param1->unk_00[v1].unk_04 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266DD0); sub_0200D500(param1->unk_00[v1].unk_04, 0, 0, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param1->unk_00[v1].unk_04, 33); - sub_0200D324(param1->unk_00[v1].unk_04->unk_00); + SpriteActor_UpdateObject(param1->unk_00[v1].unk_04->unk_00); sub_0200D3F4(param1->unk_00[v1].unk_04, 0); } } @@ -1927,7 +1927,7 @@ void ov117_02265B58 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_02265C3C v4->unk_10 = Unk_ov117_02266BB4[v3].unk_02 + -24; sub_0200D500(v4->unk_00, Unk_ov117_02266BB4[v3].unk_00, v4->unk_10 + -96, ((192 + 160) << FX32_SHIFT)); - sub_0200D324(v4->unk_00->unk_00); + SpriteActor_UpdateObject(v4->unk_00->unk_00); v4->unk_12 = param2; v4->unk_16 = param4 - (MATH_ABS(-96) * FX32_ONE) / 0x8000; @@ -2012,7 +2012,7 @@ static BOOL ov117_02265C3C (UnkStruct_ov117_02265C3C * param0, UnkStruct_ov117_0 return 1; } -void ov117_02265DB8 (BGL * param0, AnimationResourceCollection * param1, UnkStruct_02012744 * param2, UnkStruct_ov117_02265EB0 * param3, const Strbuf *param4, int param5, u32 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14) +void ov117_02265DB8 (BGL * param0, SpriteGfxHandler * param1, UnkStruct_02012744 * param2, UnkStruct_ov117_02265EB0 * param3, const Strbuf *param4, int param5, u32 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14) { UnkStruct_020127E8 v0; Window v1; @@ -2234,8 +2234,8 @@ CellActorData * ov117_02266130 (UnkStruct_ov117_02261280 * param0) { CellActorData * v0; - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266E6C); - sub_0200D324(v0->unk_00); + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E6C); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -2276,10 +2276,10 @@ CellActorData * ov117_02266244 (UnkStruct_ov117_02261280 * param0) { CellActorData * v0; - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266EA0); + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266EA0); sub_0200D3F4(v0, 0); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); return v0; } @@ -2353,12 +2353,12 @@ static void ov117_02266344 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 int v1; for (v1 = 0; v1 < 2; v1++) { - v0 = sub_0200CE6C(param0->unk_24, param0->unk_28, &Unk_ov117_02266E38); + v0 = SpriteActor_LoadResources(param0->unk_24, param0->unk_28, &Unk_ov117_02266E38); sub_0200D364(v0, 27); - sub_0200D810(v0, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(v0, GX_OAM_MODE_XLU); sub_0200D3F4(v0, 0); - sub_0200D324(v0->unk_00); + SpriteActor_UpdateObject(v0->unk_00); param1->unk_00[v1] = v0; } @@ -2383,7 +2383,7 @@ static void ov117_0226639C (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 for (v2 = 0; v2 < 2; v2++) { sub_0200D500(param2->unk_00[v2], v0, v1 + 28, ((192 + 160) << FX32_SHIFT)); sub_0200D364(param2->unk_00[v2], 27); - sub_0200D810(param2->unk_00[v2], GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param2->unk_00[v2], GX_OAM_MODE_XLU); sub_0200D3F4(param2->unk_00[v2], 1); param2->unk_08[v2] = LCRNG_Next() % 0x1000 + 0x1000; @@ -2408,7 +2408,7 @@ static void ov117_02266440 (UnkStruct_ov117_02261280 * param0, UnkStruct_ov117_0 case 1: for (v0 = 0; v0 < 2; v0++) { sub_0200D5E8(param2->unk_00[v0], param2->unk_08[v0], -param2->unk_10[v0]); - sub_0200D324(param2->unk_00[v0]->unk_00); + SpriteActor_UpdateObject(param2->unk_00[v0]->unk_00); } param2->unk_19++; diff --git a/src/overlay119/ov119_021D0D80.c b/src/overlay119/ov119_021D0D80.c index e3d4a91a81..ff2bbeef2b 100644 --- a/src/overlay119/ov119_021D0D80.c +++ b/src/overlay119/ov119_021D0D80.c @@ -20,7 +20,7 @@ #include "struct_defs/struct_02099F80.h" #include "overlay084/struct_ov84_0223BA5C.h" #include "overlay097/struct_ov97_0222DB78.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -287,7 +287,7 @@ void ov119_021D1048 (void) sub_0200F174(0, 0, 0, 0x0, 6, 1, 71); } -void ov119_021D1068 (BGL * param0, PaletteSys * param1, int param2) +void ov119_021D1068 (BGL * param0, PaletteData * param1, int param2) { int v0 = 71; @@ -388,7 +388,7 @@ void ov119_021D12F8 (Window * param0) BGL_DeleteWindow(param0); } -void ov119_021D1308 (BGL * param0, PaletteSys * param1) +void ov119_021D1308 (BGL * param0, PaletteData * param1) { int v0 = 118; int v1 = 0; @@ -402,7 +402,7 @@ void ov119_021D1308 (BGL * param0, PaletteSys * param1) PaletteSys_LoadPalette(param1, v0, v3, v5, 0, 0x20 * 2, 0); } -void ov119_021D135C (BGL * param0, PaletteSys * param1) +void ov119_021D135C (BGL * param0, PaletteData * param1) { int v0 = 12; int v1 = 10; @@ -536,9 +536,9 @@ void ov119_021D150C (UnkStruct_ov119_021D14DC * param0) void ov119_021D1514 (UnkStruct_ov119_021D0FD0 * param0) { - CellTransferStateData * v0; - AnimationResourceCollection * v1; - PaletteSys * v2; + SpriteRenderer * v0; + SpriteGfxHandler * v1; + PaletteData * v2; int v3[][4] = { {4, 9, 3, 2}, {4, 9, 3, 2} @@ -564,44 +564,44 @@ void ov119_021D1514 (UnkStruct_ov119_021D0FD0 * param0) void ov119_021D161C (UnkStruct_ov119_021D0FD0 * param0) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; - v0.unk_00 = 128; - v0.unk_02 = 120; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 0; - v0.unk_0C = 0; - v0.unk_10 = 1; - v0.unk_2C = 2; - v0.unk_30 = 0; + v0.x = 128; + v0.y = 120; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 0; + v0.plttIdx = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 2; + v0.transferToVRAM = FALSE; - v0.unk_14[0] = 20000; - v0.unk_14[1] = 20001; - v0.unk_14[2] = 20002; - v0.unk_14[3] = 20003; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; + v0.resources[0] = 20000; + v0.resources[1] = 20001; + v0.resources[2] = 20002; + v0.resources[3] = 20003; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; - param0->unk_74 = sub_0200CE6C(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + param0->unk_74 = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); sub_0200D330(param0->unk_74); sub_0200D6A4(param0->unk_74, 2); - v0.unk_00 = 0; - v0.unk_02 = 0 - (2 * 8); - v0.unk_2C = 0; - v0.unk_14[0] = 25000; - v0.unk_14[1] = 25001; - v0.unk_14[2] = 25002; - v0.unk_14[3] = 25003; + v0.x = 0; + v0.y = 0 - (2 * 8); + v0.bgPriority = 0; + v0.resources[0] = 25000; + v0.resources[1] = 25001; + v0.resources[2] = 25002; + v0.resources[3] = 25003; - param0->unk_78 = sub_0200CE6C(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + param0->unk_78 = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); sub_0200D330(param0->unk_78); - v0.unk_02 = 192 - (6 * 8); + v0.y = 192 - (6 * 8); - param0->unk_7C = sub_0200CE6C(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); + param0->unk_7C = SpriteActor_LoadResources(param0->unk_04.unk_50, param0->unk_04.unk_4C, &v0); sub_0200D330(param0->unk_7C); } diff --git a/src/overlay119/ov119_021D191C.c b/src/overlay119/ov119_021D191C.c index 2195226121..d9d461202f 100644 --- a/src/overlay119/ov119_021D191C.c +++ b/src/overlay119/ov119_021D191C.c @@ -589,7 +589,7 @@ static BOOL ov119_021D1FAC (UnkStruct_ov119_021D0FD0 * param0) s16 v3, v4; int v5 = 0; - sub_0200D550(param0->unk_78, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_78, &v3, &v4); if (v4 > -48) { sub_0200D5DC(param0->unk_78, 0, -4); @@ -597,7 +597,7 @@ static BOOL ov119_021D1FAC (UnkStruct_ov119_021D0FD0 * param0) v5++; } - sub_0200D550(param0->unk_7C, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_7C, &v3, &v4); if (v4 < 192) { sub_0200D5DC(param0->unk_7C, 0, +4); @@ -697,7 +697,7 @@ static BOOL ov119_021D21BC (UnkStruct_ov119_021D0FD0 * param0) s16 v2, v3; int v4 = 0; - sub_0200D550(param0->unk_78, &v2, &v3); + SpriteActor_GetSpritePositionXY(param0->unk_78, &v2, &v3); if (v3 > -48) { sub_0200D5DC(param0->unk_78, 0, -4); @@ -705,7 +705,7 @@ static BOOL ov119_021D21BC (UnkStruct_ov119_021D0FD0 * param0) v4++; } - sub_0200D550(param0->unk_7C, &v2, &v3); + SpriteActor_GetSpritePositionXY(param0->unk_7C, &v2, &v3); if (v3 < 192) { sub_0200D5DC(param0->unk_7C, 0, +4); diff --git a/src/pokemon.c b/src/pokemon.c index b8dc758f8d..0f351983a7 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -33,7 +33,7 @@ #include "struct_defs/poke_animation_settings.h" #include "struct_defs/struct_02078B40.h" #include "overlay005/struct_ov5_021DE5D0.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_020021B0.h" #include "unk_02005474.h" @@ -3119,7 +3119,7 @@ void sub_0207697C(ArchivedSprite *param0, u16 param1) param0->personality = 0; } -static const UnkStruct_ov104_0223F9E0 Unk_020F05E4 = { +static const SpriteTemplate Unk_020F05E4 = { 0x0, 0x0, 0x0, @@ -3141,9 +3141,9 @@ static const int Unk_020F0588[] = { 0x1 }; -CellActorData *sub_02076994(CellTransferStateData *param0, AnimationResourceCollection *param1, PaletteSys *param2, int param3, int param4, int param5, int param6, int param7, int heapID) +CellActorData *sub_02076994(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, int param3, int param4, int param5, int param6, int param7, int heapID) { - UnkStruct_ov104_0223F9E0 v0; + SpriteTemplate v0; CellActorData *v1; NARC *narc; UnkStruct_ov5_021DE5D0 v3; @@ -3158,25 +3158,25 @@ CellActorData *sub_02076994(CellTransferStateData *param0, AnimationResourceColl narc = NARC_ctor(v3.unk_00, heapID); - sub_0200CC3C(param0, param1, narc, v3.unk_04, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20015 + param7); - sub_0200CDC4(param2, 2, param0, param1, narc, v3.unk_08, 0, v4, NNS_G2D_VRAM_TYPE_2DMAIN, 20010 + param7); - sub_0200CE24(param0, param1, narc, v3.unk_0C, 0, 20007 + param7); - sub_0200CE54(param0, param1, narc, v3.unk_10, 0, 20007 + param7); + SpriteRenderer_LoadCharResObjFromOpenNarc(param0, param1, narc, v3.unk_04, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 20015 + param7); + SpriteRenderer_LoadPalette(param2, 2, param0, param1, narc, v3.unk_08, 0, v4, NNS_G2D_VRAM_TYPE_2DMAIN, 20010 + param7); + SpriteRenderer_LoadCellResObjFromOpenNarc(param0, param1, narc, v3.unk_0C, 0, 20007 + param7); + SpriteRenderer_LoadAnimResObjFromOpenNarc(param0, param1, narc, v3.unk_10, 0, 20007 + param7); NARC_dtor(narc); v0 = Unk_020F05E4; // TODO enum values? - v0.unk_14[0] = 20015 + param7; - v0.unk_14[1] = 20010 + param7; - v0.unk_14[2] = 20007 + param7; - v0.unk_14[3] = 20007 + param7; - v0.unk_08 = Unk_020F0588[param7]; + v0.resources[0] = 20015 + param7; + v0.resources[1] = 20010 + param7; + v0.resources[2] = 20007 + param7; + v0.resources[3] = 20007 + param7; + v0.priority = Unk_020F0588[param7]; - v1 = sub_0200CE6C(param0, param1, &v0); + v1 = SpriteActor_LoadResources(param0, param1, &v0); sub_02021F24(v1->unk_00, 0); - sub_0200D4C4(v1, param3, param4); + SpriteActor_SetSpritePositionXY(v1, param3, param4); sub_0200D330(v1); sub_0200D390(v1, 1); diff --git a/src/unk_02002F38.c b/src/unk_02002F38.c index fa7b805ca9..edf970ac8b 100644 --- a/src/unk_02002F38.c +++ b/src/unk_02002F38.c @@ -21,7 +21,7 @@ typedef struct UnkStruct_02002F38_t { u16 unk_11A_15 : 1; u8 unk_11C; u8 unk_11D[3]; -} PaletteSys; +} PaletteData; typedef struct { u16 unk_00_0 : 5; @@ -31,40 +31,40 @@ typedef struct { } UnkStruct_0200393C; static u8 sub_0200327C(u16 param0, u16 param1); -static void sub_02003290(PaletteSys * param0, u16 param1); +static void sub_02003290(PaletteData * param0, u16 param1); static void sub_020032D0(int param0, UnkStruct_020032D0 * param1, u16 * param2); static void sub_0200330C(UnkStruct_0200330C * param0, u16 param1, s8 param2, u8 param3, u8 param4, u16 param5); static void sub_020033CC(SysTask * param0, void * param1); -static void sub_02003468(PaletteSys * param0); -static void sub_02003488(PaletteSys * param0); -static void sub_020034A8(PaletteSys * param0, u16 param1, u16 param2); -static void sub_02003504(PaletteSys * param0, u16 param1, u16 param2); +static void sub_02003468(PaletteData * param0); +static void sub_02003488(PaletteData * param0); +static void sub_020034A8(PaletteData * param0, u16 param1, u16 param2); +static void sub_02003504(PaletteData * param0, u16 param1, u16 param2); static void sub_02003560(u16 * param0, u16 * param1, UnkStruct_0200330C * param2, u32 param3); -static void sub_020035EC(PaletteSys * param0, u8 param1, UnkStruct_0200330C * param2); +static void sub_020035EC(PaletteData * param0, u8 param1, UnkStruct_0200330C * param2); -PaletteSys * sub_02002F38 (int param0) +PaletteData * sub_02002F38 (int param0) { - PaletteSys * v0; + PaletteData * v0; - v0 = Heap_AllocFromHeap(param0, sizeof(PaletteSys)); - MI_CpuClear8(v0, sizeof(PaletteSys)); + v0 = Heap_AllocFromHeap(param0, sizeof(PaletteData)); + MI_CpuClear8(v0, sizeof(PaletteData)); return v0; } -void sub_02002F54 (PaletteSys * param0) +void sub_02002F54 (PaletteData * param0) { Heap_FreeToHeap(param0); } -void sub_02002F5C (PaletteSys * param0, int param1, void * param2, void * param3, u32 param4) +void sub_02002F5C (PaletteData * param0, int param1, void * param2, void * param3, u32 param4) { param0->unk_00[param1].unk_00 = (u16 *)param2; param0->unk_00[param1].unk_04 = (u16 *)param3; param0->unk_00[param1].unk_08 = param4; } -void sub_02002F70 (PaletteSys * param0, int param1, u32 param2, u32 param3) +void sub_02002F70 (PaletteData * param0, int param1, u32 param2, u32 param3) { void * v0; void * v1; @@ -75,19 +75,19 @@ void sub_02002F70 (PaletteSys * param0, int param1, u32 param2, u32 param3) sub_02002F5C(param0, param1, v0, v1, param2); } -void sub_02002FA0 (PaletteSys * param0, int param1) +void sub_02002FA0 (PaletteData * param0, int param1) { Heap_FreeToHeap(param0->unk_00[param1].unk_00); Heap_FreeToHeap(param0->unk_00[param1].unk_04); } -void sub_02002FBC (PaletteSys * param0, const void * param1, int param2, u16 param3, u16 param4) +void sub_02002FBC (PaletteData * param0, const void * param1, int param2, u16 param3, u16 param4) { MI_CpuCopy16(param1, (void *)¶m0->unk_00[param2].unk_00[param3], (u32)param4); MI_CpuCopy16(param1, (void *)¶m0->unk_00[param2].unk_04[param3], (u32)param4); } -void sub_02002FEC (PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7) +void sub_02002FEC (PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, u16 param7) { NNSG2dPaletteData * v0; void * v1; @@ -105,12 +105,12 @@ void sub_02002FEC (PaletteSys * param0, u32 param1, u32 param2, u32 param3, int Heap_FreeToHeap(v1); } -void PaletteSys_LoadPalette (PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6) +void PaletteSys_LoadPalette (PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6) { sub_02002FEC(param0, param1, param2, param3, param4, param5, param6, 0); } -void sub_02003070 (PaletteSys * param0, int param1, u16 param2, u32 param3) +void sub_02003070 (PaletteData * param0, int param1, u16 param2, u32 param3) { u16 * v0; @@ -153,23 +153,23 @@ void sub_020030E4 (u32 param0, u32 param1, u32 param2, u32 param3, u16 param4, v Heap_FreeToHeap(v1); } -void sub_02003120 (PaletteSys * param0, int param1, u16 param2, int param3, u16 param4, u16 param5) +void sub_02003120 (PaletteData * param0, int param1, u16 param2, int param3, u16 param4, u16 param5) { MI_CpuCopy16((void *)¶m0->unk_00[param1].unk_00[param2], (void *)¶m0->unk_00[param3].unk_00[param4], param5); MI_CpuCopy16((void *)¶m0->unk_00[param1].unk_00[param2], (void *)¶m0->unk_00[param3].unk_04[param4], param5); } -u16 * sub_02003164 (PaletteSys * param0, int param1) +u16 * sub_02003164 (PaletteData * param0, int param1) { return param0->unk_00[param1].unk_00; } -u16 * sub_0200316C (PaletteSys * param0, int param1) +u16 * sub_0200316C (PaletteData * param0, int param1) { return param0->unk_00[param1].unk_04; } -u8 sub_02003178 (PaletteSys * param0, u16 param1, u16 param2, s8 param3, u8 param4, u8 param5, u16 param6) +u8 sub_02003178 (PaletteData * param0, u16 param1, u16 param2, s8 param3, u8 param4, u8 param5, u16 param6) { u16 v0; u8 v1; @@ -219,7 +219,7 @@ static u8 sub_0200327C (u16 param0, u16 param1) return 0; } -static void sub_02003290 (PaletteSys * param0, u16 param1) +static void sub_02003290 (PaletteData * param0, u16 param1) { if (sub_0200327C(param0->unk_11A_0, param1) == 1) { return; @@ -273,7 +273,7 @@ static void sub_0200330C (UnkStruct_0200330C * param0, u16 param1, s8 param2, u8 static void sub_020033CC (SysTask * param0, void * param1) { - PaletteSys * v0 = param1; + PaletteData * v0 = param1; if (v0->unk_11C == 1) { v0->unk_11C = 0; @@ -299,7 +299,7 @@ static void sub_020033CC (SysTask * param0, void * param1) } } -static void sub_02003468 (PaletteSys * param0) +static void sub_02003468 (PaletteData * param0) { u8 v0, v1; @@ -308,7 +308,7 @@ static void sub_02003468 (PaletteSys * param0) } } -static void sub_02003488 (PaletteSys * param0) +static void sub_02003488 (PaletteData * param0) { u8 v0, v1; @@ -317,7 +317,7 @@ static void sub_02003488 (PaletteSys * param0) } } -static void sub_020034A8 (PaletteSys * param0, u16 param1, u16 param2) +static void sub_020034A8 (PaletteData * param0, u16 param1, u16 param2) { if (sub_0200327C(param0->unk_118_2, param1) == 0) { return; @@ -333,7 +333,7 @@ static void sub_020034A8 (PaletteSys * param0, u16 param1, u16 param2) sub_02003504(param0, param1, param2); } -static void sub_02003504 (PaletteSys * param0, u16 param1, u16 param2) +static void sub_02003504 (PaletteData * param0, u16 param1, u16 param2) { u32 v0; @@ -362,7 +362,7 @@ static void sub_02003560 (u16 * param0, u16 * param1, UnkStruct_0200330C * param } } -static void sub_020035EC (PaletteSys * param0, u8 param1, UnkStruct_0200330C * param2) +static void sub_020035EC (PaletteData * param0, u8 param1, UnkStruct_0200330C * param2) { s16 v0; @@ -391,7 +391,7 @@ static void sub_020035EC (PaletteSys * param0, u8 param1, UnkStruct_0200330C * p } } -void sub_02003694 (PaletteSys * param0) +void sub_02003694 (PaletteData * param0) { if ((param0->unk_11A_15 == 0) && (param0->unk_118_0 != 1)) { return; @@ -482,23 +482,23 @@ void sub_02003694 (PaletteSys * param0) } } -u16 sub_0200384C (PaletteSys * param0) +u16 sub_0200384C (PaletteData * param0) { return param0->unk_118_2; } -void sub_02003858 (PaletteSys * param0, int param1) +void sub_02003858 (PaletteData * param0, int param1) { param0->unk_11A_15 = param1; } -void sub_0200387C (PaletteSys * param0, u8 param1) +void sub_0200387C (PaletteData * param0, u8 param1) { param0->unk_118_0 = param1 & 0x1; param0->unk_118_2 = 0xFFFFFFFF; } -void sub_020038B0 (PaletteSys * param0, int param1, int param2, u16 param3, u16 param4, u16 param5) +void sub_020038B0 (PaletteData * param0, int param1, int param2, u16 param3, u16 param4, u16 param5) { GF_ASSERT(param5 * sizeof(u16) <= param0->unk_00[param1].unk_08); @@ -511,7 +511,7 @@ void sub_020038B0 (PaletteSys * param0, int param1, int param2, u16 param3, u16 } } -u16 sub_02003910 (PaletteSys * param0, int param1, int param2, u16 param3) +u16 sub_02003910 (PaletteData * param0, int param1, int param2, u16 param3) { if (param2 == 1) { return param0->unk_00[param1].unk_00[param3]; @@ -544,7 +544,7 @@ void sub_0200393C (const u16 * param0, u16 * param1, u16 param2, u8 param3, u16 } } -void sub_020039B0 (PaletteSys * param0, int param1, u16 param2, u16 param3, u8 param4, u16 param5) +void sub_020039B0 (PaletteData * param0, int param1, u16 param2, u16 param3, u8 param4, u16 param5) { GF_ASSERT(param0->unk_00[param1].unk_00 != NULL && param0->unk_00[param1].unk_04 != NULL); sub_0200393C(¶m0->unk_00[param1].unk_00[param2], ¶m0->unk_00[param1].unk_04[param2], param3, param4, param5); @@ -564,7 +564,7 @@ void sub_020039F8 (const u16 * param0, u16 * param1, u16 param2, u8 param3, u16 } } -void sub_02003A2C (PaletteSys * param0, int param1, u16 param2, u8 param3, u16 param4) +void sub_02003A2C (PaletteData * param0, int param1, u16 param2, u8 param3, u16 param4) { int v0 = 0; @@ -613,7 +613,7 @@ void sub_02003A8C (u16 * param0, int param1, int param2, int param3, int param4) } } -void sub_02003B08 (PaletteSys * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, int param7, int param8, int param9) +void sub_02003B08 (PaletteData * param0, u32 param1, u32 param2, u32 param3, int param4, u32 param5, u16 param6, int param7, int param8, int param9) { NNSG2dPaletteData * v0; void * v1; diff --git a/src/unk_0200C6E4.c b/src/unk_0200C6E4.c index 2694af9f0f..3619ec97df 100644 --- a/src/unk_0200C6E4.c +++ b/src/unk_0200C6E4.c @@ -17,7 +17,7 @@ #include "overlay007/struct_ov7_0224F358.h" #include "overlay019/struct_ov19_021DA864.h" #include "overlay022/struct_ov22_022559F8.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -42,7 +42,7 @@ typedef struct CellTransferStateData_t { int unk_08; NNSG2dCellTransferState * unk_0C; UnkStruct_0200C738 unk_10; -} CellTransferStateData; +} SpriteRenderer; typedef struct AnimationResourceCollection_t { GraphicElementManager * unk_00; @@ -52,20 +52,20 @@ typedef struct AnimationResourceCollection_t { UnkStruct_02009CFC * unk_24[6]; int unk_3C[6]; int unk_54; -} AnimationResourceCollection; +} SpriteGfxHandler; -static BOOL sub_0200D11C(CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5, int param6); -static BOOL sub_0200D18C(CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6); +static BOOL sub_0200D11C(SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5, int param6); +static BOOL sub_0200D18C(SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, int param4, int param5, int param6); static BOOL sub_0200D1FC(UnkStruct_02009CFC * param0, UnkStruct_02009DC8 * param1); static BOOL sub_0200D27C(UnkStruct_02009714 * param0, UnkStruct_02009CFC * param1, int param2); static BOOL sub_0200D2D0(UnkStruct_02009714 * param0, UnkStruct_02009CFC * param1, int param2); static BOOL sub_0200D230(UnkStruct_02009714 * param0, UnkStruct_02009CFC * param1, int param2); -CellTransferStateData * sub_0200C6E4 (int param0) +SpriteRenderer * sub_0200C6E4 (int param0) { - CellTransferStateData * v0 = NULL; + SpriteRenderer * v0 = NULL; - v0 = Heap_AllocFromHeap(param0, sizeof(CellTransferStateData)); + v0 = Heap_AllocFromHeap(param0, sizeof(SpriteRenderer)); if (v0 == NULL) { return NULL; @@ -78,14 +78,14 @@ CellTransferStateData * sub_0200C6E4 (int param0) return v0; } -AnimationResourceCollection * sub_0200C704 (CellTransferStateData * param0) +SpriteGfxHandler * sub_0200C704 (SpriteRenderer * param0) { int v0; - AnimationResourceCollection * v1 = NULL; + SpriteGfxHandler * v1 = NULL; GF_ASSERT(param0 != NULL); - v1 = Heap_AllocFromHeap(param0->unk_00, sizeof(AnimationResourceCollection)); + v1 = Heap_AllocFromHeap(param0->unk_00, sizeof(SpriteGfxHandler)); if (v1 == NULL) { return NULL; @@ -100,12 +100,12 @@ AnimationResourceCollection * sub_0200C704 (CellTransferStateData * param0) return v1; } -UnkStruct_0200C738 * sub_0200C738 (CellTransferStateData * param0) +UnkStruct_0200C738 * sub_0200C738 (SpriteRenderer * param0) { return ¶m0->unk_10; } -BOOL sub_0200C73C (CellTransferStateData * param0, const UnkStruct_ov104_0224133C * param1, const UnkStruct_ov104_022412F4 * param2, int param3) +BOOL sub_0200C73C (SpriteRenderer * param0, const UnkStruct_ov104_0224133C * param1, const UnkStruct_ov104_022412F4 * param2, int param3) { GF_ASSERT(param0 != NULL); @@ -139,7 +139,7 @@ BOOL sub_0200C73C (CellTransferStateData * param0, const UnkStruct_ov104_0224133 return 1; } -BOOL sub_0200C7C0 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2) +BOOL sub_0200C7C0 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2) { if ((param0 == NULL) || (param1 == NULL)) { return 0; @@ -154,7 +154,7 @@ void sub_0200C7E4 (GraphicElementData * param0) sub_02021BD4(param0); } -void sub_0200C7EC (AnimationResourceCollection * param0) +void sub_0200C7EC (SpriteGfxHandler * param0) { GF_ASSERT(param0 != NULL); sub_020219F8(param0->unk_00); @@ -170,12 +170,12 @@ void sub_0200C808 (void) sub_0201DCE8(); } -void sub_0200C810 (AnimationResourceCollection * param0) +void sub_0200C810 (SpriteGfxHandler * param0) { sub_02021964(param0->unk_00); } -void sub_0200C81C (AnimationResourceCollection * param0) +void sub_0200C81C (SpriteGfxHandler * param0) { if (param0->unk_04 == NULL) { return; @@ -184,7 +184,7 @@ void sub_0200C81C (AnimationResourceCollection * param0) sub_020095A8(param0->unk_04); } -void sub_0200C82C (AnimationResourceCollection * param0) +void sub_0200C82C (SpriteGfxHandler * param0) { int v0; UnkStruct_02009F38 * v1; @@ -204,7 +204,7 @@ void sub_0200C82C (AnimationResourceCollection * param0) } } -void sub_0200C880 (CellTransferStateData * param0) +void sub_0200C880 (SpriteRenderer * param0) { sub_0201DCF0(param0->unk_0C); sub_0201E958(); @@ -215,13 +215,13 @@ void sub_0200C880 (CellTransferStateData * param0) } } -void sub_0200C8A0 (CellTransferStateData * param0, AnimationResourceCollection * param1) +void sub_0200C8A0 (SpriteRenderer * param0, SpriteGfxHandler * param1) { param0->unk_04--; Heap_FreeToHeap(param1); } -void sub_0200C8B0 (CellTransferStateData * param0, AnimationResourceCollection * param1) +void sub_0200C8B0 (SpriteRenderer * param0, SpriteGfxHandler * param1) { sub_0200C810(param1); sub_0200C81C(param1); @@ -229,7 +229,7 @@ void sub_0200C8B0 (CellTransferStateData * param0, AnimationResourceCollection * sub_0200C8A0(param0, param1); } -void sub_0200C8D4 (CellTransferStateData * param0) +void sub_0200C8D4 (SpriteRenderer * param0) { GF_ASSERT(param0->unk_04 == 0); @@ -237,7 +237,7 @@ void sub_0200C8D4 (CellTransferStateData * param0) Heap_FreeToHeap(param0); } -BOOL sub_0200C8F0 (CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov7_0224F2EC * param2) +BOOL sub_0200C8F0 (SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov7_0224F2EC * param2) { int v0; int v1 = 6; @@ -290,7 +290,7 @@ BOOL sub_0200C8F0 (CellTransferStateData * param0, AnimationResourceCollection * return 1; } -GraphicElementData * sub_0200CA08 (CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov7_0224F358 * param2) +GraphicElementData * sub_0200CA08 (SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov7_0224F358 * param2) { GraphicElementData * v0 = NULL; @@ -298,7 +298,7 @@ GraphicElementData * sub_0200CA08 (CellTransferStateData * param0, AnimationReso return v0; } -GraphicElementData * sub_0200CA44 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13) +GraphicElementData * sub_0200CA44 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, s16 param3, s16 param4, s16 param5, u16 param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13) { GraphicElementData * v0 = NULL; UnkStruct_ov115_02261520 v1; @@ -324,14 +324,14 @@ GraphicElementData * sub_0200CA44 (CellTransferStateData * param0, AnimationReso v0 = sub_02021AA0(&v1); if (v0 != NULL) { - sub_02021D6C(v0, param6); + SpriteActor_SetSpriteAnimActive(v0, param6); sub_02021E90(v0, param8); } return v0; } -BOOL sub_0200CB30 (CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov104_02241308 * param2) +BOOL sub_0200CB30 (SpriteRenderer * param0, SpriteGfxHandler * param1, const UnkStruct_ov104_02241308 * param2) { int v0; int v1; @@ -371,7 +371,7 @@ BOOL sub_0200CB30 (CellTransferStateData * param0, AnimationResourceCollection * return 1; } -BOOL sub_0200CBDC (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200CBDC (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6) { UnkStruct_02009DC8 * v0; @@ -393,7 +393,7 @@ BOOL sub_0200CBDC (CellTransferStateData * param0, AnimationResourceCollection * return (v0 == NULL) ? 0 : 1; } -BOOL sub_0200CC3C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6) +BOOL SpriteRenderer_LoadCharResObjFromOpenNarc (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5, int param6) { UnkStruct_02009DC8 * v0; @@ -414,7 +414,7 @@ BOOL sub_0200CC3C (CellTransferStateData * param0, AnimationResourceCollection * return (v0 == NULL) ? 0 : 1; } -s8 sub_0200CC9C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5, int param6, int param7) +s8 sub_0200CC9C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5, int param6, int param7) { UnkStruct_02009DC8 * v0; int v1; @@ -438,7 +438,7 @@ s8 sub_0200CC9C (CellTransferStateData * param0, AnimationResourceCollection * p return -1; } -s8 sub_0200CD0C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6, int param7) +s8 sub_0200CD0C (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, int param4, int param5, int param6, int param7) { UnkStruct_02009DC8 * v0; int v1; @@ -461,7 +461,7 @@ s8 sub_0200CD0C (CellTransferStateData * param0, AnimationResourceCollection * p return -1; } -u8 sub_0200CD7C (PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, int param4, int param5, int param6, int param7, int param8, int param9) +u8 sub_0200CD7C (PaletteData * param0, int param1, SpriteRenderer * param2, SpriteGfxHandler * param3, int param4, int param5, int param6, int param7, int param8, int param9) { int v0; @@ -474,7 +474,7 @@ u8 sub_0200CD7C (PaletteSys * param0, int param1, CellTransferStateData * param2 return v0; } -u8 sub_0200CDC4 (PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, NARC * param4, int param5, int param6, int param7, int param8, int param9) +u8 SpriteRenderer_LoadPalette (PaletteData * param0, enum PaletteBufferId param1, SpriteRenderer * param2, SpriteGfxHandler * param3, NARC * param4, int param5, BOOL param6, int param7, int param8, int param9) { int v0; @@ -487,27 +487,27 @@ u8 sub_0200CDC4 (PaletteSys * param0, int param1, CellTransferStateData * param2 return v0; } -BOOL sub_0200CE0C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5) +BOOL sub_0200CE0C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5) { return sub_0200D11C(param0, param1, param2, param3, param4, 2, param5); } -BOOL sub_0200CE24 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5) +BOOL SpriteRenderer_LoadCellResObjFromOpenNarc (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5) { return sub_0200D18C(param0, param1, param2, param3, param4, 2, param5); } -BOOL sub_0200CE3C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5) +BOOL sub_0200CE3C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5) { return sub_0200D11C(param0, param1, param2, param3, param4, 3, param5); } -BOOL sub_0200CE54 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5) +BOOL SpriteRenderer_LoadAnimResObjFromOpenNarc (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5) { return sub_0200D18C(param0, param1, param2, param3, param4, 3, param5); } -CellActorData * sub_0200CE6C (CellTransferStateData * param0, AnimationResourceCollection * param1, const UnkStruct_ov104_0223F9E0 * param2) +CellActorData * SpriteActor_LoadResources (SpriteRenderer * param0, SpriteGfxHandler * param1, const SpriteTemplate * param2) { int v0; int v1; @@ -539,7 +539,7 @@ CellActorData * sub_0200CE6C (CellTransferStateData * param0, AnimationResourceC } for (v0 = 0; v0 < 6; v0++) { - v4[v0] = param2->unk_14[v0]; + v4[v0] = param2->resources[v0]; } if ((param1->unk_0C[4] == NULL) || (param1->unk_0C[5] == NULL)) { @@ -555,15 +555,15 @@ CellActorData * sub_0200CE6C (CellTransferStateData * param0, AnimationResourceC } } - sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param2->unk_30, param2->unk_2C, param1->unk_0C[0], param1->unk_0C[1], param1->unk_0C[2], param1->unk_0C[3], param1->unk_0C[4], param1->unk_0C[5]); + sub_020093B4(v2->unk_04, v4[0], v4[1], v4[2], v4[3], v4[4], v4[5], param2->transferToVRAM, param2->bgPriority, param1->unk_0C[0], param1->unk_0C[1], param1->unk_0C[2], param1->unk_0C[3], param1->unk_0C[4], param1->unk_0C[5]); v3.unk_00 = param1->unk_00; v3.unk_04 = v2->unk_04; - v3.unk_08.x = FX32_CONST(param2->unk_00); - v3.unk_08.y = FX32_CONST(param2->unk_02); - v3.unk_08.z = FX32_CONST(param2->unk_04); + v3.unk_08.x = FX32_CONST(param2->x); + v3.unk_08.y = FX32_CONST(param2->y); + v3.unk_08.z = FX32_CONST(param2->z); - if (param2->unk_10 == NNS_G2D_VRAM_TYPE_2DSUB) { + if (param2->vramType == NNS_G2D_VRAM_TYPE_2DSUB) { v3.unk_08.y += (192 << FX32_SHIFT); } @@ -571,17 +571,17 @@ CellActorData * sub_0200CE6C (CellTransferStateData * param0, AnimationResourceC v3.unk_14.y = FX32_ONE; v3.unk_14.z = FX32_ONE; v3.unk_20 = 0; - v3.unk_24 = param2->unk_08; - v3.unk_28 = param2->unk_10; + v3.unk_24 = param2->priority; + v3.unk_28 = param2->vramType; v3.unk_2C = param0->unk_00; v2->unk_00 = sub_02021AA0(&v3); - v2->unk_0C = param2->unk_30; + v2->unk_0C = param2->transferToVRAM; if (v2->unk_00 != NULL) { v1 = sub_02021EE8(v2->unk_00); - sub_02021D6C(v2->unk_00, param2->unk_06); - sub_02021E90(v2->unk_00, v1 + param2->unk_0C); + SpriteActor_SetSpriteAnimActive(v2->unk_00, param2->animIdx); + sub_02021E90(v2->unk_00, v1 + param2->plttIdx); } else { GF_ASSERT(FALSE); } @@ -589,39 +589,39 @@ CellActorData * sub_0200CE6C (CellTransferStateData * param0, AnimationResourceC return v2; } -const NNSG2dImagePaletteProxy * sub_0200D04C (AnimationResourceCollection * param0, int param1) +const NNSG2dImagePaletteProxy * sub_0200D04C (SpriteGfxHandler * param0, int param1) { UnkStruct_02009DC8 * v0 = sub_02009DC8(param0->unk_0C[1], param1); return sub_0200A72C(v0, NULL); } -u32 sub_0200D05C (AnimationResourceCollection * param0, int param1, NNS_G2D_VRAM_TYPE param2) +u32 sub_0200D05C (SpriteGfxHandler * param0, int param1, NNS_G2D_VRAM_TYPE param2) { UnkStruct_02009DC8 * v0 = sub_02009DC8(param0->unk_0C[1], param1); return sub_0200A760(v0, param2); } -BOOL sub_0200D070 (AnimationResourceCollection * param0, int param1) +BOOL SpriteGfxHandler_UnloadCharObjById (SpriteGfxHandler * param0, int param1) { return sub_0200D27C(param0->unk_0C[0], param0->unk_24[0], param1); } -BOOL sub_0200D080 (AnimationResourceCollection * param0, int param1) +BOOL SpriteGfxHandler_UnloadPlttObjById (SpriteGfxHandler * param0, int param1) { return sub_0200D2D0(param0->unk_0C[1], param0->unk_24[1], param1); } -BOOL sub_0200D090 (AnimationResourceCollection * param0, int param1) +BOOL SpriteGfxHandler_UnloadCellObjById (SpriteGfxHandler * param0, int param1) { return sub_0200D230(param0->unk_0C[2], param0->unk_24[2], param1); } -BOOL sub_0200D0A0 (AnimationResourceCollection * param0, int param1) +BOOL SpriteGfxHandler_UnloadAnimObjById (SpriteGfxHandler * param0, int param1) { return sub_0200D230(param0->unk_0C[3], param0->unk_24[3], param1); } -void sub_0200D0B0 (CellTransferStateData * param0, AnimationResourceCollection * param1) +void sub_0200D0B0 (SpriteRenderer * param0, SpriteGfxHandler * param1) { int v0; @@ -648,7 +648,7 @@ void sub_0200D0F4 (CellActorData * param0) Heap_FreeToHeap(param0); } -static BOOL sub_0200D11C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, int param4, int param5, int param6) +static BOOL sub_0200D11C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, int param4, int param5, int param6) { UnkStruct_02009DC8 * v0; int v1; @@ -670,7 +670,7 @@ static BOOL sub_0200D11C (CellTransferStateData * param0, AnimationResourceColle return (v0 == NULL) ? 0 : 1; } -static BOOL sub_0200D18C (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, int param4, int param5, int param6) +static BOOL sub_0200D18C (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, int param4, int param5, int param6) { UnkStruct_02009DC8 * v0; int v1; @@ -788,14 +788,14 @@ static BOOL sub_0200D2D0 (UnkStruct_02009714 * param0, UnkStruct_02009CFC * para return 0; } -void sub_0200D324 (GraphicElementData * param0) +void SpriteActor_UpdateObject (GraphicElementData * param0) { sub_02021E2C(param0, FX32_ONE); } void sub_0200D330 (CellActorData * param0) { - sub_0200D324(param0->unk_00); + SpriteActor_UpdateObject(param0->unk_00); } void sub_0200D33C (CellActorData * param0) @@ -815,7 +815,7 @@ u32 sub_0200D358 (CellActorData * param0) void sub_0200D364 (CellActorData * param0, u32 param1) { - sub_02021D6C(param0->unk_00, param1); + SpriteActor_SetSpriteAnimActive(param0->unk_00, param1); } void sub_0200D370 (CellActorData * param0, u32 param1) @@ -860,7 +860,7 @@ BOOL sub_0200D3B8 (CellActorData * param0) void sub_0200D3C4 (GraphicElementData * param0, u16 param1) { - sub_02021E50(param0, param1); + SpriteActor_SetAnimFrame(param0, param1); } void sub_0200D3CC (CellActorData * param0, u16 param1) @@ -878,14 +878,14 @@ u16 sub_0200D3E0 (CellActorData * param0) return sub_0200D3D8(param0->unk_00); } -void sub_0200D3EC (GraphicElementData * param0, int param1) +void SpriteActor_DrawSprite (GraphicElementData * param0, int param1) { sub_02021CAC(param0, param1); } void sub_0200D3F4 (CellActorData * param0, int param1) { - sub_0200D3EC(param0->unk_00, param1); + SpriteActor_DrawSprite(param0->unk_00, param1); } int sub_0200D400 (GraphicElementData * param0) @@ -974,7 +974,7 @@ void sub_0200D494 (GraphicElementData * param0, s16 param1, s16 param2) sub_02021C50(param0, &v0); } -void sub_0200D4C4 (CellActorData * param0, s16 param1, s16 param2) +void SpriteActor_SetSpritePositionXY (CellActorData * param0, s16 param1, s16 param2) { sub_0200D494(param0->unk_00, param1, param2); } @@ -1014,7 +1014,7 @@ void sub_0200D50C (GraphicElementData * param0, s16 * param1, s16 * param2) } } -void sub_0200D550 (CellActorData * param0, s16 * param1, s16 * param2) +void SpriteActor_GetSpritePositionXY (CellActorData * param0, s16 * param1, s16 * param2) { sub_0200D50C(param0->unk_00, param1, param2); } @@ -1234,7 +1234,7 @@ void sub_0200D808 (GraphicElementData * param0, GXOamMode param1) sub_02021FE0(param0, param1); } -void sub_0200D810 (CellActorData * param0, GXOamMode param1) +void SpriteActor_SetOAMMode (CellActorData * param0, GXOamMode param1) { sub_0200D808(param0->unk_00, param1); } @@ -1244,7 +1244,7 @@ u32 sub_0200D81C (CellActorData * param0) return sub_020220F4(param0->unk_00); } -BOOL sub_0200D828 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D828 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6) { UnkStruct_02009DC8 * v0; @@ -1266,7 +1266,7 @@ BOOL sub_0200D828 (CellTransferStateData * param0, AnimationResourceCollection * return (v0 == NULL) ? 0 : 1; } -BOOL sub_0200D888 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D888 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5, int param6) { UnkStruct_02009DC8 * v0; @@ -1288,7 +1288,7 @@ BOOL sub_0200D888 (CellTransferStateData * param0, AnimationResourceCollection * return (v0 == NULL) ? 0 : 1; } -BOOL sub_0200D8E8 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, BOOL param4, int param5, int param6) +BOOL sub_0200D8E8 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5, int param6) { UnkStruct_02009DC8 * v0; @@ -1310,7 +1310,7 @@ BOOL sub_0200D8E8 (CellTransferStateData * param0, AnimationResourceCollection * return (v0 == NULL) ? 0 : 1; } -void sub_0200D948 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5) +void sub_0200D948 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5) { UnkStruct_02009DC8 * v0; @@ -1320,7 +1320,7 @@ void sub_0200D948 (CellTransferStateData * param0, AnimationResourceCollection * sub_0200A4C0(v0); } -void sub_0200D97C (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, int param3, BOOL param4, int param5) +void sub_0200D97C (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, int param3, BOOL param4, int param5) { UnkStruct_02009DC8 * v0; @@ -1330,12 +1330,12 @@ void sub_0200D97C (CellTransferStateData * param0, AnimationResourceCollection * sub_0200A6B8(v0); } -GraphicElementManager * sub_0200D9B0 (AnimationResourceCollection * param0) +GraphicElementManager * sub_0200D9B0 (SpriteGfxHandler * param0) { return param0->unk_00; } -void sub_0200D9B4 (CellTransferStateData * param0, AnimationResourceCollection * param1, NARC * param2, int param3, BOOL param4, int param5) +void sub_0200D9B4 (SpriteRenderer * param0, SpriteGfxHandler * param1, NARC * param2, int param3, BOOL param4, int param5) { UnkStruct_02009DC8 * v0; diff --git a/src/unk_0200DA60.c b/src/unk_0200DA60.c index 32f2273b7a..4f1eb7029c 100644 --- a/src/unk_0200DA60.c +++ b/src/unk_0200DA60.c @@ -13,7 +13,7 @@ #include "struct_defs/struct_0201AE08.h" #include "struct_defs/struct_0205AA50.h" #include "overlay005/struct_ov5_021D30A8.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "unk_02002328.h" @@ -72,7 +72,7 @@ static void sub_0200EC9C(SysTask * param0, void * param1); static void sub_0200EF7C(UnkStruct_0200ED50 * param0, u8 param1, u16 param2); static void sub_0200F12C(UnkStruct_0200ED50 * param0); -static const UnkStruct_ov104_0223F9E0 Unk_020E5040 = { +static const SpriteTemplate Unk_020E5040 = { 0x0, 0x0, 0x0, @@ -590,7 +590,7 @@ static void sub_0200EC9C (SysTask * param0, void * param1) return; case 2: v0->unk_1D3 = 3; - sub_02021D6C(v0->unk_1C8->unk_00, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_1C8->unk_00, 1); break; case 3: if (sub_02021E74(v0->unk_1C8->unk_00) == 6) { @@ -631,10 +631,10 @@ static void sub_0200ED7C (UnkStruct_0200ED50 * param0) static void sub_0200EDD4 (UnkStruct_0200ED50 * param0, u8 param1, u8 param2) { - UnkStruct_ov104_0223F9E0 v0 = Unk_020E5040; + SpriteTemplate v0 = Unk_020E5040; - v0.unk_00 = (param1 + 5) * 8; - v0.unk_02 = (param2 + 5) * 8; + v0.x = (param1 + 5) * 8; + v0.y = (param2 + 5) * 8; param0->unk_1C8 = ov5_021D3584(¶m0->unk_00, &v0); diff --git a/src/unk_0201567C.c b/src/unk_0201567C.c index f1c1950338..43dc27cf58 100644 --- a/src/unk_0201567C.c +++ b/src/unk_0201567C.c @@ -16,7 +16,7 @@ typedef void (* UnkFuncPtr_020157E4)(void *, u16 *); typedef struct { SysTask * unk_00; UnkFuncPtr_020157E4 unk_04; - PaletteSys * unk_08; + PaletteData * unk_08; u16 unk_0C[16]; u16 unk_2C[16]; u8 unk_4C; @@ -32,7 +32,7 @@ static void sub_02015858(void * param0, u16 * param1); static void sub_02015870(void * param0, u16 * param1); static void sub_0201588C(void * param0, u16 * param1); -void * sub_0201567C (PaletteSys * param0, u16 param1, u16 param2, u32 param3) +void * sub_0201567C (PaletteData * param0, u16 param1, u16 param2, u32 param3) { UnkStruct_020157E4 * v0; SysTask * v1; diff --git a/src/unk_020218BC.c b/src/unk_020218BC.c index e52f8e7041..4ed066fa51 100644 --- a/src/unk_020218BC.c +++ b/src/unk_020218BC.c @@ -457,7 +457,7 @@ u32 sub_02021D44 (const GraphicElementData * param0) return v0; } -void sub_02021D6C (GraphicElementData * param0, u32 param1) +void SpriteActor_SetSpriteAnimActive (GraphicElementData * param0, u32 param1) { const NNSG2dAnimSequence * v0; @@ -482,7 +482,7 @@ void sub_02021D6C (GraphicElementData * param0, u32 param1) void sub_02021DCC (GraphicElementData * param0, u32 param1) { if (param0->unk_F0 != param1) { - sub_02021D6C(param0, param1); + SpriteActor_SetSpriteAnimActive(param0, param1); } } @@ -493,13 +493,13 @@ void sub_02021DE0 (GraphicElementData * param0) NNS_G2dResetAnimCtrlState(&v0->unk_08.animCtrl); NNS_G2dStartAnimCtrl(&v0->unk_08.animCtrl); - sub_02021E50(param0, 0); + SpriteActor_SetAnimFrame(param0, 0); } else { MultiCellAnimationData * v1 = (MultiCellAnimationData *)¶m0->unk_40; NNS_G2dResetAnimCtrlState(&v1->unk_08.animCtrl); NNS_G2dStartAnimCtrl(&v1->unk_08.animCtrl); - sub_02021E50(param0, 0); + SpriteActor_SetAnimFrame(param0, 0); } } @@ -519,7 +519,7 @@ void sub_02021E2C (GraphicElementData * param0, fx32 param1) } } -void sub_02021E50 (GraphicElementData * param0, u16 param1) +void SpriteActor_SetAnimFrame (GraphicElementData * param0, u16 param1) { if ((param0->unk_EC == 1) || (param0->unk_EC == 3)) { CellAnimationData * v0 = (CellAnimationData *)¶m0->unk_40; diff --git a/src/unk_0203A9C8.c b/src/unk_0203A9C8.c index 883780df48..c5df01531a 100644 --- a/src/unk_0203A9C8.c +++ b/src/unk_0203A9C8.c @@ -36,7 +36,7 @@ #include "struct_defs/struct_02098C44.h" #include "struct_defs/struct_02098D38.h" #include "overlay021/struct_ov21_021D0D80.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "unk_02001AF4.h" @@ -194,7 +194,7 @@ static const u32 Unk_020EA05C[][2] = { {0x8, (u32)sub_0203C164} }; -static const UnkStruct_ov104_0223F9E0 Unk_020EA0A4[] = { +static const SpriteTemplate Unk_020EA0A4[] = { { 0xCC, 0x14, @@ -793,15 +793,15 @@ static void sub_0203B318 (UnkStruct_020708E0 * param0, u8 * param1, u32 param2, ov5_021D3414(¶m0->unk_38, v2, 6, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 13529); for (v1 = 0; v1 < param2; v1++) { - UnkStruct_ov104_0223F9E0 v3; + SpriteTemplate v3; v3 = Unk_020EA0A4[1]; - v3.unk_02 += 24 * v1; + v3.y += 24 * v1; if ((param1[v1] == 2) && (param3 == 1)) { - v3.unk_06 = 9 * 3; + v3.animIdx = 9 * 3; } else { - v3.unk_06 = param1[v1] * 3; + v3.animIdx = param1[v1] * 3; } param0->unk_200[1 + v1] = ov5_021D3584(¶m0->unk_38, &v3); @@ -854,7 +854,7 @@ static void sub_0203B588 (GraphicElementData * param0, u16 param1, u16 param2) { u32 v0 = sub_02021E24(param0); - sub_02021D6C(param0, (v0 / 3) * 3 + param1); + SpriteActor_SetSpriteAnimActive(param0, (v0 / 3) * 3 + param1); sub_02021EC4(param0, param2); } diff --git a/src/unk_0205CA94.c b/src/unk_0205CA94.c index 549b066b70..1f9e8a3460 100644 --- a/src/unk_0205CA94.c +++ b/src/unk_0205CA94.c @@ -740,7 +740,7 @@ void sub_0205D5E0 (UnkStruct_0205D094 * param0, struct UnkStruct_0205D3AC_t * pa v0->unk_00.y = (69 * FX32_ONE); v0->unk_0C = sub_0205D344(param0, 0, &v0->unk_00, 0, 1); - sub_02021D6C(v0->unk_0C, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_0C, 1); } void sub_0205D624 (struct UnkStruct_0205D3AC_t * param0) @@ -820,7 +820,7 @@ void sub_0205D714 (UnkStruct_0205D094 * param0, struct UnkStruct_0205D3AC_t * pa v0->unk_00.y = (69 * FX32_ONE); v0->unk_0C = sub_0205D344(param0, 0, &v0->unk_00, 0, 1); - sub_02021D6C(v0->unk_0C, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_0C, 1); v0->unk_14 = (2 * FX32_ONE); sub_02021CAC(v0->unk_0C, 0); } @@ -888,7 +888,7 @@ void sub_0205D844 (UnkStruct_0205D094 * param0, struct UnkStruct_0205D3AC_t * pa v0->unk_00.y = 96 * FX32_ONE; v0->unk_0C = sub_0205D344(param0, 1, &v0->unk_00, 1, 1); - sub_02021D6C(v0->unk_0C, 1); + SpriteActor_SetSpriteAnimActive(v0->unk_0C, 1); } void sub_0205D888 (struct UnkStruct_0205D3AC_t * param0) diff --git a/src/unk_0206A780.c b/src/unk_0206A780.c index 5a5b61e6c1..229c7fd648 100644 --- a/src/unk_0206A780.c +++ b/src/unk_0206A780.c @@ -4,7 +4,7 @@ #include "struct_decls/struct_02006C24_decl.h" #include "struct_defs/struct_0206A844.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "narc.h" @@ -14,7 +14,7 @@ #include "unk_0206A780.h" #include "overlay005/ov5_021D2F14.h" -static const UnkStruct_ov104_0223F9E0 Unk_020EFA04[] = { +static const SpriteTemplate Unk_020EFA04[] = { { 0x50, 0x10, @@ -99,8 +99,8 @@ void sub_0206A870 (UnkStruct_0206A844 * param0) void sub_0206A8A0 (UnkStruct_0206A844 * param0, s16 param1, s16 param2, s16 param3) { - sub_0200D4C4(param0->unk_1C8[0], param1, param2); - sub_0200D4C4(param0->unk_1C8[1], param1, param3); + SpriteActor_SetSpritePositionXY(param0->unk_1C8[0], param1, param2); + SpriteActor_SetSpritePositionXY(param0->unk_1C8[1], param1, param3); } void sub_0206A8C4 (UnkStruct_0206A844 * param0, u16 param1, BOOL param2) diff --git a/src/unk_0206F314.c b/src/unk_0206F314.c index 770a40dadf..966553bbe3 100644 --- a/src/unk_0206F314.c +++ b/src/unk_0206F314.c @@ -24,7 +24,7 @@ #include "overlay005/struct_ov5_021D30A8.h" #include "overlay061/struct_ov61_0222C884.h" #include "overlay084/struct_ov84_02240FA8.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_02241308.h" #include "unk_0200112C.h" @@ -361,7 +361,7 @@ static int sub_0206F554 (UnkStruct_0206F7F8 * param0) if (param0->unk_28 > 0) { Sound_PlayEffect(1500); --param0->unk_28; - sub_0200D4C4(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); + SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); } } @@ -369,7 +369,7 @@ static int sub_0206F554 (UnkStruct_0206F7F8 * param0) if (param0->unk_28 < (param0->unk_21 - 1)) { Sound_PlayEffect(1500); ++param0->unk_28; - sub_0200D4C4(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); + SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + 16 * param0->unk_28); } } @@ -625,7 +625,7 @@ static void sub_0206FCC4 (UnkStruct_0206F7F8 * param0) UnkStruct_ov104_02241308 v1 = { 1, 1, 1, 1, 0, 0 }; - static const UnkStruct_ov104_0223F9E0 v2[] = { + static const SpriteTemplate v2[] = { { 0x7E, 0x10, @@ -745,7 +745,7 @@ static void sub_0206FF60 (UnkStruct_0200112C * param0, u32 param1, u8 param2) sub_020014DC(param0, &v0, &v1); v2 = sub_02001504(param0, 2); - sub_0200D4C4(v3->unk_2FC[0], 126, 16 + 16 * (v1 + v0)); + SpriteActor_SetSpritePositionXY(v3->unk_2FC[0], 126, 16 + 16 * (v1 + v0)); } static void sub_0206FFB4 (UnkStruct_0206F7F8 * param0) @@ -757,7 +757,7 @@ static void sub_0206FFB4 (UnkStruct_0206F7F8 * param0) static void sub_0206FFE4 (UnkStruct_0206F7F8 * param0) { sub_0206FFB4(param0); - sub_0200D4C4(param0->unk_2FC[0], 126, 16 + param0->unk_28 * 16); + SpriteActor_SetSpritePositionXY(param0->unk_2FC[0], 126, 16 + param0->unk_28 * 16); sub_0200D3F4(param0->unk_2FC[0], 1); } diff --git a/src/unk_0207C908.c b/src/unk_0207C908.c index 956378f925..e043017005 100644 --- a/src/unk_0207C908.c +++ b/src/unk_0207C908.c @@ -6,7 +6,7 @@ #include "struct_decls/struct_0200C704_decl.h" #include "struct_defs/struct_0200D0F4.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "unk_0200C6E4.h" #include "unk_0207C908.h" @@ -107,51 +107,51 @@ u32 sub_0207C944 (void) return 27; } -void sub_0207C948 (CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) +void sub_0207C948 (SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { sub_0200CBDC(param0, param1, sub_0207C944(), sub_0207C908(param3), 1, param2, param4); } -void sub_0207C97C (CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, u32 param3) +void sub_0207C97C (SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, u32 param3) { sub_0200CC9C(param0, param1, sub_0207C944(), sub_0207C920(), 0, 3, param2, param3); } -void sub_0207C9B0 (PaletteSys * param0, int param1, CellTransferStateData * param2, AnimationResourceCollection * param3, NNS_G2D_VRAM_TYPE param4, u32 param5) +void sub_0207C9B0 (PaletteData * param0, int param1, SpriteRenderer * param2, SpriteGfxHandler * param3, NNS_G2D_VRAM_TYPE param4, u32 param5) { sub_0200CD7C(param0, param1, param2, param3, sub_0207C944(), sub_0207C920(), 0, 3, param4, param5); } -void sub_0207C9EC (CellTransferStateData * param0, AnimationResourceCollection * param1, u32 param2, u32 param3) +void sub_0207C9EC (SpriteRenderer * param0, SpriteGfxHandler * param1, u32 param2, u32 param3) { sub_0200CE0C(param0, param1, sub_0207C944(), sub_0207C924(), 1, param2); sub_0200CE3C(param0, param1, sub_0207C944(), sub_0207C928(), 1, param3); } -void sub_0207CA34 (AnimationResourceCollection * param0, u32 param1) +void sub_0207CA34 (SpriteGfxHandler * param0, u32 param1) { - sub_0200D070(param0, param1); + SpriteGfxHandler_UnloadCharObjById(param0, param1); } -void sub_0207CA3C (AnimationResourceCollection * param0, u32 param1) +void sub_0207CA3C (SpriteGfxHandler * param0, u32 param1) { - sub_0200D080(param0, param1); + SpriteGfxHandler_UnloadPlttObjById(param0, param1); } -void sub_0207CA44 (AnimationResourceCollection * param0, u32 param1, u32 param2) +void sub_0207CA44 (SpriteGfxHandler * param0, u32 param1, u32 param2) { - sub_0200D090(param0, param1); - sub_0200D0A0(param0, param2); + SpriteGfxHandler_UnloadCellObjById(param0, param1); + SpriteGfxHandler_UnloadAnimObjById(param0, param2); } -CellActorData * sub_0207CA58 (CellTransferStateData * param0, AnimationResourceCollection * param1, int param2, const UnkStruct_ov104_0223F9E0 * param3) +CellActorData * sub_0207CA58 (SpriteRenderer * param0, SpriteGfxHandler * param1, int param2, const SpriteTemplate * param3) { CellActorData * v0; - UnkStruct_ov104_0223F9E0 v1; + SpriteTemplate v1; v1 = *param3; - v1.unk_0C = sub_0207C92C(param2); - v0 = sub_0200CE6C(param0, param1, &v1); + v1.plttIdx = sub_0207C92C(param2); + v0 = SpriteActor_LoadResources(param0, param1, &v1); return v0; } @@ -178,14 +178,14 @@ u32 sub_0207CAC0 (void) return 27; } -void sub_0207CAC4 (CellTransferStateData * param0, AnimationResourceCollection * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) +void sub_0207CAC4 (SpriteRenderer * param0, SpriteGfxHandler * param1, NNS_G2D_VRAM_TYPE param2, int param3, u32 param4) { sub_0200CBDC(param0, param1, sub_0207CAC0(), sub_0207CA90(param3), 1, param2, param4); } -void sub_0207CAF8 (AnimationResourceCollection * param0, u32 param1) +void sub_0207CAF8 (SpriteGfxHandler * param0, u32 param1) { - sub_0200D070(param0, param1); + SpriteGfxHandler_UnloadCharObjById(param0, param1); } void sub_0207CB00 (CellActorData * param0) diff --git a/src/unk_0207E0B8.c b/src/unk_0207E0B8.c index a739cd0b5c..35f40e4e9d 100644 --- a/src/unk_0207E0B8.c +++ b/src/unk_0207E0B8.c @@ -1017,7 +1017,7 @@ static void sub_0207EE14 (GameWindowLayout * param0) if ((param0->unk_5A4->unk_20 != 2) && (param0->unk_5A4->unk_20 != 17) && (param0->unk_5A4->unk_20 != 23) && (param0->unk_5A4->unk_20 != 22)) { sub_02021CAC(param0->unk_5B0[8], 0); - sub_02021D6C(param0->unk_5B0[9], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[9], 0); { s16 v1, v2; @@ -1402,7 +1402,7 @@ static void sub_0207F9A0 (GameWindowLayout * param0) u8 v0, v1; sub_0201E028(param0->unk_7F4, &v0, &v1, NULL, NULL, param0->unk_B11, 4); - sub_02021D6C(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); sub_0200D494(param0->unk_5B0[6], v0, v1); } @@ -1472,7 +1472,7 @@ static u8 sub_0207FA24 (GameWindowLayout * param0) if ((v0 == 6) || (v0 == 7)) { sub_02021CAC(param0->unk_5B0[6], 0); } else { - sub_02021D6C(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, v0)); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, v0)); sub_02021CAC(param0->unk_5B0[6], 1); sub_0200D494(param0->unk_5B0[6], v2, v3); } @@ -1560,7 +1560,7 @@ static u8 sub_0207FC94 (GameWindowLayout * param0) } sub_0201E028(param0->unk_7F4, &v1, &v2, NULL, NULL, param0->unk_B11, 4); - sub_02021D6C(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B11)); sub_02021CAC(param0->unk_5B0[6], 1); sub_0200D494(param0->unk_5B0[6], v1, v2); @@ -1587,7 +1587,7 @@ void sub_0207FD68 (GameWindowLayout * param0, u8 param1) u8 v0, v1; sub_0201E028(param0->unk_7F4, &v0, &v1, NULL, NULL, param0->unk_B11, 4); - sub_02021D6C(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); sub_02021CAC(param0->unk_5B0[6], 1); sub_0200D494(param0->unk_5B0[6], v0, v1); } @@ -1999,7 +1999,7 @@ static void sub_02080500 (GameWindowLayout * param0, u8 param1, u8 param2) v0 = (v0 & 2) + 1; } - sub_02021D6C(param0->unk_5B0[8], v0); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[8], v0); return; } @@ -2012,7 +2012,7 @@ static void sub_02080500 (GameWindowLayout * param0, u8 param1, u8 param2) v1 = (v1 & 2) + 1; } - sub_02021D6C(param0->unk_5B0[9], v1); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[9], v1); return; } @@ -2020,12 +2020,12 @@ static void sub_02080500 (GameWindowLayout * param0, u8 param1, u8 param2) param0->unk_704[param1].unk_16 -= 2; param0->unk_704[param1].unk_18 -= 2; - sub_02021D6C(param0->unk_5B0[0 + param1], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[0 + param1], 0); } else { param0->unk_704[param1].unk_16 += 2; param0->unk_704[param1].unk_18 += 2; - sub_02021D6C(param0->unk_5B0[0 + param1], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[0 + param1], 1); } sub_0207F8F8(param0, param1); diff --git a/src/unk_02082C2C.c b/src/unk_02082C2C.c index 1598025be4..dc73505a6d 100644 --- a/src/unk_02082C2C.c +++ b/src/unk_02082C2C.c @@ -214,7 +214,7 @@ void sub_02083014 (GameWindowLayout * param0, u8 param1, u8 param2) return; } - sub_02021D6C(*v0, param2); + SpriteActor_SetSpriteAnimActive(*v0, param2); sub_02021CAC(*v0, 1); } @@ -228,9 +228,9 @@ void sub_02083040 (GameWindowLayout * param0, u8 param1, u16 param2) } if (Item_IsMail(param2) == 1) { - sub_02021D6C(*v0, 1); + SpriteActor_SetSpriteAnimActive(*v0, 1); } else { - sub_02021D6C(*v0, 0); + SpriteActor_SetSpriteAnimActive(*v0, 0); } sub_02021CAC(*v0, 1); @@ -240,7 +240,7 @@ void sub_02083080 (GameWindowLayout * param0, u8 param1) { GraphicElementData ** v0 = ¶m0->unk_5B0[16 + param1]; - sub_02021D6C(*v0, 1); + SpriteActor_SetSpriteAnimActive(*v0, 1); sub_02021CAC(*v0, 1); } @@ -277,8 +277,8 @@ static void sub_02083138 (GraphicElementData * param0, u8 param1) return; } - sub_02021E50(param0, 0); - sub_02021D6C(param0, param1); + SpriteActor_SetAnimFrame(param0, 0); + SpriteActor_SetSpriteAnimActive(param0, param1); } static u8 sub_02083158 (StrBufWrapper * param0) @@ -346,7 +346,7 @@ void sub_0208327C (GameWindowLayout * param0, u8 param1, u8 param2) u8 v0, v1; sub_0201E010(¶m0->unk_7F4[param1], &v0, &v1); - sub_02021D6C(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[6], sub_020805D0(param0->unk_5A4->unk_21, param1)); sub_02021CAC(param0->unk_5B0[6], 1); sub_0200D494(param0->unk_5B0[6], v0, v1); sub_0200D414(param0->unk_5B0[6], param2); @@ -363,8 +363,8 @@ void sub_020832E4 (GameWindowLayout * param0, s16 param1, s16 param2) sub_02021C50(param0->unk_5B0[28], &v0); sub_02021CAC(param0->unk_5B0[28], 1); - sub_02021E50(param0->unk_5B0[28], 0); - sub_02021D6C(param0->unk_5B0[28], 0); + SpriteActor_SetAnimFrame(param0->unk_5B0[28], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[28], 0); } void sub_02083334 (GameWindowLayout * param0) diff --git a/src/unk_02083370.c b/src/unk_02083370.c index 34fc62a4ed..cc031fa20c 100644 --- a/src/unk_02083370.c +++ b/src/unk_02083370.c @@ -441,7 +441,7 @@ static void sub_02083AD0 (GameWindowLayout * param0, int * param1) sub_0200D414(param0->unk_5B0[6], 0); sub_0200D50C(param0->unk_5B0[6], &v0, &v1); sub_0200D494(param0->unk_5B0[7], v0, v1); - sub_02021D6C(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); sub_02021CAC(param0->unk_5B0[7], 1); sub_0207F8F8(param0, param0->unk_B0F_0); sub_0200E084(¶m0->unk_04[33], 1); @@ -1020,7 +1020,7 @@ static int sub_02084A18 (GameWindowLayout * param0) sub_0200D414(param0->unk_5B0[6], 0); sub_0200D50C(param0->unk_5B0[6], &v0, &v1); sub_0200D494(param0->unk_5B0[7], v0, v1); - sub_02021D6C(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); + SpriteActor_SetSpriteAnimActive(param0->unk_5B0[7], sub_020805D0(param0->unk_5A4->unk_21, param0->unk_B0F_0) + 2); sub_02021CAC(param0->unk_5B0[7], 1); sub_0207F8F8(param0, param0->unk_B0F_0); sub_020826E0(param0, 36, 1); diff --git a/src/unk_0208694C.c b/src/unk_0208694C.c index a8570671d9..3463ec0517 100644 --- a/src/unk_0208694C.c +++ b/src/unk_0208694C.c @@ -1635,7 +1635,7 @@ static void sub_02087A10 (UnkStruct_02087A10 * param0) param0->unk_390[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_390[v0], 1); - sub_02021D6C(param0->unk_390[v0], Unk_020F2984[v0][2]); + SpriteActor_SetSpriteAnimActive(param0->unk_390[v0], Unk_020F2984[v0][2]); sub_02021F58(param0->unk_390[v0], Unk_020F2984[v0][3]); } @@ -1660,7 +1660,7 @@ static void sub_02087A10 (UnkStruct_02087A10 * param0) param0->unk_3C8[v0] = sub_02021AA0(&v1); sub_02021CC8(param0->unk_3C8[v0], 1); - sub_02021D6C(param0->unk_3C8[v0], 43); + SpriteActor_SetSpriteAnimActive(param0->unk_3C8[v0], 43); } sub_02088E1C(param0->unk_3C8, param0->unk_158, param0->unk_0C); @@ -1682,29 +1682,29 @@ static void sub_02087BE4 (UnkStruct_02087A10 * param0, UnkStruct_ov115_02261520 switch (param0->unk_00) { case 0: if (param0->unk_04 == 0) { - sub_02021D6C(param0->unk_3F8[0], 48); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 48); } else { - sub_02021D6C(param0->unk_3F8[0], 49); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 49); } break; case 3: - sub_02021D6C(param0->unk_3F8[0], 51); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 51); break; case 6: - sub_02021D6C(param0->unk_3F8[0], 55); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 55); break; case 5: - sub_02021D6C(param0->unk_3F8[0], 54); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 54); break; case 4: case 7: - sub_02021D6C(param0->unk_3F8[0], 53); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 53); break; case 2: - sub_02021D6C(param0->unk_3F8[0], 47); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 47); break; case 1: - sub_02021D6C(param0->unk_3F8[0], 50); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[0], 50); if (param0->unk_10 != 2) { param1->unk_08.x = FX32_ONE * ((10 * 8) + param0->unk_0C * 13); @@ -1712,9 +1712,9 @@ static void sub_02087BE4 (UnkStruct_02087A10 * param0, UnkStruct_ov115_02261520 param0->unk_3F8[1] = sub_02021AA0(param1); if (param0->unk_10 == 0) { - sub_02021D6C(param0->unk_3F8[1], 45); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[1], 45); } else { - sub_02021D6C(param0->unk_3F8[1], 46); + SpriteActor_SetSpriteAnimActive(param0->unk_3F8[1], 46); } } break; @@ -2036,7 +2036,7 @@ static void sub_02088454 (UnkStruct_02087A10 * param0, int param1) VecFx32 v0; if ((param0->unk_1C.unk_0C == 0) && (param0->unk_1C.unk_0C != param0->unk_1C.unk_04)) { - sub_02021D6C(param0->unk_390[8], 39); + SpriteActor_SetSpriteAnimActive(param0->unk_390[8], 39); } v0.x = FX32_ONE * (26 + param0->unk_1C.unk_00 * 16); @@ -2049,13 +2049,13 @@ static void sub_02088454 (UnkStruct_02087A10 * param0, int param1) v1.x = FX32_ONE * Unk_020F251C[v2]; v1.y = FX32_ONE * (88 - 20); - sub_02021D6C(param0->unk_390[8], Unk_020F24E8[v2]); + SpriteActor_SetSpriteAnimActive(param0->unk_390[8], Unk_020F24E8[v2]); sub_02021C50(param0->unk_390[8], &v1); } param0->unk_38 = 180; - sub_02021E50(param0->unk_390[8], 0); + SpriteActor_SetAnimFrame(param0->unk_390[8], 0); param0->unk_1C.unk_08 = param0->unk_1C.unk_00; param0->unk_1C.unk_0C = param0->unk_1C.unk_04; @@ -2342,7 +2342,7 @@ static int sub_02088898 (UnkStruct_02087A10 * param0, u16 param1, int param2) sub_02021FE0(param0->unk_390[8], GX_OAM_MODE_XLU); G2_SetBlendAlpha(0, GX_BLEND_PLANEMASK_BG0 | GX_BLEND_PLANEMASK_BG1 | GX_BLEND_PLANEMASK_BG2, 8, 8); - sub_02021D6C(param0->unk_390[8], 60); + SpriteActor_SetSpriteAnimActive(param0->unk_390[8], 60); param0->unk_1C.unk_18 = 1; @@ -2448,11 +2448,11 @@ static void sub_02088E1C (GraphicElementData ** param0, int param1, int param2) int v0; for (v0 = 0; v0 < param2; v0++) { - sub_02021D6C(param0[v0], 43); + SpriteActor_SetSpriteAnimActive(param0[v0], 43); } if (param1 != param2) { - sub_02021D6C(param0[param1], 44); + SpriteActor_SetSpriteAnimActive(param0[param1], 44); } } @@ -2495,17 +2495,17 @@ static void sub_02088F40 (int param0[], GraphicElementData ** param1, int param2 for (v0 = 0; v0 < 3; v0++) { if (param0[v0]) { for (v1 = 0; v1 < 3; v1++) { - sub_02021D6C(param1[v1], Unk_020F2984[v1][2]); + SpriteActor_SetSpriteAnimActive(param1[v1], Unk_020F2984[v1][2]); } - sub_02021D6C(param1[v0], Unk_020F2984[v0][2] - 3); + SpriteActor_SetSpriteAnimActive(param1[v0], Unk_020F2984[v0][2] - 3); break; } } for (v0 = 5; v0 < 7; v0++) { if (param0[v0]) { - sub_02021D6C(param1[v0], Unk_020F2984[v0][2] + 1); + SpriteActor_SetSpriteAnimActive(param1[v0], Unk_020F2984[v0][2] + 1); } } @@ -2520,9 +2520,9 @@ static void sub_02088FD0 (UnkStruct_02087A10 * param0) if (param0->unk_158 == param0->unk_0C) { param0->unk_1C.unk_00 = 12; param0->unk_1C.unk_04 = 0; - sub_02021D6C(param0->unk_390[8], 39); + SpriteActor_SetSpriteAnimActive(param0->unk_390[8], 39); } else { - sub_02021D6C(param0->unk_390[8], 39); + SpriteActor_SetSpriteAnimActive(param0->unk_390[8], 39); } if (param0->unk_1C.unk_14 == 0) { diff --git a/src/unk_0208A3F4.c b/src/unk_0208A3F4.c index 1209f3aa1c..4f40364eb0 100644 --- a/src/unk_0208A3F4.c +++ b/src/unk_0208A3F4.c @@ -17,7 +17,7 @@ #include "struct_defs/struct_0205AA50.h" #include "struct_defs/struct_02089688.h" #include "struct_defs/struct_0208AF44.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "overlay104/struct_ov104_022412F4.h" #include "overlay104/struct_ov104_02241308.h" #include "overlay104/struct_ov104_0224133C.h" @@ -70,9 +70,9 @@ void sub_0208A490 (UnkStruct_02089688 * param0) { NARC * v0; BGL * v1; - CellTransferStateData * v2; - AnimationResourceCollection * v3; - PaletteSys * v4; + SpriteRenderer * v2; + SpriteGfxHandler * v3; + PaletteData * v4; v2 = param0->unk_2C0.unk_04; v3 = param0->unk_2C0.unk_08; @@ -88,20 +88,20 @@ void sub_0208A490 (UnkStruct_02089688 * param0) sub_0200710C(v0, 17, v1, 5, 0, 0, 0, 101); PaletteSys_LoadPalette(v4, 159, 16, 101, 1, 0x20 * 1, 0); - sub_0200CDC4(v4, 2, v2, v3, v0, 1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); - sub_0200CC3C(v2, v3, v0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); - sub_0200CE24(v2, v3, v0, 2, 0, 1000); - sub_0200CE54(v2, v3, v0, 3, 0, 1000); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 0, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1000); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 2, 0, 1000); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 3, 0, 1000); - sub_0200CDC4(v4, 2, v2, v3, v0, 5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); - sub_0200CC3C(v2, v3, v0, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); - sub_0200CE24(v2, v3, v0, 6, 0, 1001); - sub_0200CE54(v2, v3, v0, 7, 0, 1001); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 5, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1001); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 6, 0, 1001); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 7, 0, 1001); - sub_0200CDC4(v4, 2, v2, v3, v0, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); - sub_0200CC3C(v2, v3, v0, 8, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); - sub_0200CE24(v2, v3, v0, 10, 0, 1002); - sub_0200CE54(v2, v3, v0, 11, 0, 1002); + SpriteRenderer_LoadPalette(v4, 2, v2, v3, v0, 9, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); + SpriteRenderer_LoadCharResObjFromOpenNarc(v2, v3, v0, 8, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1002); + SpriteRenderer_LoadCellResObjFromOpenNarc(v2, v3, v0, 10, 0, 1002); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v2, v3, v0, 11, 0, 1002); { int v5 = sub_02027B50(param0->unk_38C.unk_20); @@ -235,7 +235,7 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [sp, #8] ldr r1, [sp, #4] add r2, sp, #0x10 - bl sub_0200CE6C + bl SpriteActor_LoadResources mov r1, #0x73 lsl r1, r1, #2 str r0, [r4, r1] @@ -244,7 +244,7 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [r4, r0] asr r1, r1, #0x10 mov r2, #0x18 - bl sub_0200D4C4 + bl SpriteActor_SetSpritePositionXY mov r0, #0x73 lsl r0, r0, #2 ldr r0, [r4, r0] @@ -263,12 +263,12 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) ldr r0, [sp, #8] ldr r1, [sp, #4] add r2, sp, #0x10 - bl sub_0200CE6C + bl SpriteActor_LoadResources lsl r1, r7, #0x10 str r0, [r5, #0xc] asr r1, r1, #0x10 mov r2, #0x18 - bl sub_0200D4C4 + bl SpriteActor_SetSpritePositionXY ldr r0, [r5, #0] ldr r1, [r5, #8] bl sub_0208AD98 @@ -302,34 +302,34 @@ asm void sub_0208A758 (UnkStruct_02089688 * param0) void sub_0208A8A0 (UnkStruct_02089688 * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteTemplate v0; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; v1 = param0->unk_2C0.unk_04; v2 = param0->unk_2C0.unk_08; v3 = param0->unk_2C0.unk_10; - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 0; - v0.unk_10 = 1; - v0.unk_2C = 0; - v0.unk_30 = 0; - v0.unk_0C = 0; - v0.unk_14[0] = 1001; - v0.unk_14[1] = 1001; - v0.unk_14[2] = 1001; - v0.unk_14[3] = 1001; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; - - param0->unk_1F0[0].unk_0C = sub_0200CE6C(v1, v2, &v0); - param0->unk_1F0[1].unk_0C = sub_0200CE6C(v1, v2, &v0); - param0->unk_1F0[2].unk_0C = sub_0200CE6C(v1, v2, &v0); + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 0; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 0; + v0.transferToVRAM = FALSE; + v0.plttIdx = 0; + v0.resources[0] = 1001; + v0.resources[1] = 1001; + v0.resources[2] = 1001; + v0.resources[3] = 1001; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; + + param0->unk_1F0[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_1F0[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + param0->unk_1F0[2].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); sub_0208AAE4(param0, param0->unk_3C4); sub_0200D364(param0->unk_1F0[0].unk_0C, 0); @@ -342,7 +342,7 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) sub_0208AB2C(param0, 0); sub_0200D364(param0->unk_1F0[1].unk_0C, param0->unk_1F0[1].unk_00); sub_0200D330(param0->unk_1F0[1].unk_0C); - sub_0200D810(param0->unk_1F0[1].unk_0C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_1F0[1].unk_0C, GX_OAM_MODE_XLU); param0->unk_1F0[2].unk_14.unk_00 = 0; param0->unk_1F0[2].unk_14.unk_02 = 0; @@ -351,41 +351,41 @@ void sub_0208A8A0 (UnkStruct_02089688 * param0) sub_0208AB2C(param0, 0); sub_0200D364(param0->unk_1F0[2].unk_0C, param0->unk_1F0[2].unk_00); sub_0200D330(param0->unk_1F0[2].unk_0C); - sub_0200D810(param0->unk_1F0[2].unk_0C, GX_OAM_MODE_XLU); + SpriteActor_SetOAMMode(param0->unk_1F0[2].unk_0C, GX_OAM_MODE_XLU); sub_0208AAB4(param0, 1, 0); sub_0208AAB4(param0, 2, 0); } void sub_0208A9BC (UnkStruct_02089688 * param0) { - UnkStruct_ov104_0223F9E0 v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteTemplate v0; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; v1 = param0->unk_2C0.unk_04; v2 = param0->unk_2C0.unk_08; v3 = param0->unk_2C0.unk_10; - v0.unk_00 = 0; - v0.unk_02 = 0; - v0.unk_04 = 0; - v0.unk_06 = 0; - v0.unk_08 = 10; - v0.unk_10 = 1; - v0.unk_2C = 0; - v0.unk_30 = 0; - v0.unk_0C = 0; - v0.unk_14[0] = 1002; - v0.unk_14[1] = 1002; - v0.unk_14[2] = 1002; - v0.unk_14[3] = 1002; - v0.unk_14[4] = 0xffffffff; - v0.unk_14[5] = 0xffffffff; - v0.unk_0C = 0; - param0->unk_240[0].unk_0C = sub_0200CE6C(v1, v2, &v0); - v0.unk_0C = 1; - param0->unk_240[1].unk_0C = sub_0200CE6C(v1, v2, &v0); + v0.x = 0; + v0.y = 0; + v0.z = 0; + v0.animIdx = 0; + v0.priority = 10; + v0.vramType = NNS_G2D_VRAM_TYPE_2DMAIN; + v0.bgPriority = 0; + v0.transferToVRAM = FALSE; + v0.plttIdx = 0; + v0.resources[0] = 1002; + v0.resources[1] = 1002; + v0.resources[2] = 1002; + v0.resources[3] = 1002; + v0.resources[4] = SPRITE_RESOURCE_NONE; + v0.resources[5] = SPRITE_RESOURCE_NONE; + v0.plttIdx = 0; + param0->unk_240[0].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); + v0.plttIdx = 1; + param0->unk_240[1].unk_0C = SpriteActor_LoadResources(v1, v2, &v0); { s16 v4, v5; @@ -393,14 +393,14 @@ void sub_0208A9BC (UnkStruct_02089688 * param0) v4 = (param0->unk_2C0.unk_18[26].val1.unk_02 + param0->unk_2C0.unk_18[26].val1.unk_03) / 2; v5 = (param0->unk_2C0.unk_18[26].val1.unk_00 + param0->unk_2C0.unk_18[26].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_240[0].unk_0C, v4, v5); + SpriteActor_SetSpritePositionXY(param0->unk_240[0].unk_0C, v4, v5); sub_0200D364(param0->unk_240[0].unk_0C, 0); sub_0200D330(param0->unk_240[0].unk_0C); v4 = (param0->unk_2C0.unk_18[27].val1.unk_02 + param0->unk_2C0.unk_18[27].val1.unk_03) / 2; v5 = (param0->unk_2C0.unk_18[27].val1.unk_00 + param0->unk_2C0.unk_18[27].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_240[1].unk_0C, v4, v5); + SpriteActor_SetSpritePositionXY(param0->unk_240[1].unk_0C, v4, v5); sub_0200D364(param0->unk_240[1].unk_0C, 0); sub_0200D330(param0->unk_240[1].unk_0C); } @@ -427,8 +427,8 @@ void sub_0208AAE4 (UnkStruct_02089688 * param0, int param1) v2 = param0->unk_00[param1].unk_0C; param0->unk_1F0[0].unk_00 = param1; - sub_0200D550(v2, &v0, &v1); - sub_0200D4C4(param0->unk_1F0[0].unk_0C, v0, v1 + 16); + SpriteActor_GetSpritePositionXY(v2, &v0, &v1); + SpriteActor_SetSpritePositionXY(param0->unk_1F0[0].unk_0C, v0, v1 + 16); } void sub_0208AB2C (UnkStruct_02089688 * param0, int param1) @@ -438,7 +438,7 @@ void sub_0208AB2C (UnkStruct_02089688 * param0, int param1) v0 = (param0->unk_2C0.unk_18[param1 + 16].val1.unk_02 + param0->unk_2C0.unk_18[param1 + 16].val1.unk_03) / 2; v1 = (param0->unk_2C0.unk_18[param1 + 16].val1.unk_00 + param0->unk_2C0.unk_18[param1 + 16].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_1F0[1].unk_0C, v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_1F0[1].unk_0C, v0, v1); } void sub_0208AB6C (UnkStruct_02089688 * param0, int param1, int param2) @@ -448,7 +448,7 @@ void sub_0208AB6C (UnkStruct_02089688 * param0, int param1, int param2) v0 = (param0->unk_2C0.unk_18[param1 + 16].val1.unk_02 + param0->unk_2C0.unk_18[param1 + 16].val1.unk_03) / 2; v1 = (param0->unk_2C0.unk_18[param1 + 16].val1.unk_00 + param0->unk_2C0.unk_18[param1 + 16].val1.unk_01) / 2; - sub_0200D4C4(param0->unk_1F0[param2].unk_0C, v0, v1); + SpriteActor_SetSpritePositionXY(param0->unk_1F0[param2].unk_0C, v0, v1); } void sub_0208ABB4 (UnkStruct_02089688 * param0) @@ -600,10 +600,10 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } } - sub_0200D550(param0->unk_00[v0].unk_0C, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_00[v0].unk_0C, &v3, &v4); if (param1 == 0) { - sub_0200D4C4(param0->unk_00[v0].unk_0C, v2, v4); + SpriteActor_SetSpritePositionXY(param0->unk_00[v0].unk_0C, v2, v4); } else { param0->unk_00[v0].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_00[v0].unk_14.unk_02 = 0; @@ -612,7 +612,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } if ((v0 == param0->unk_1A0[v1].unk_00) && (v1 != param0->unk_3C0)) { - sub_0200D550(param0->unk_1A0[v1].unk_0C, &v3, &v4); + SpriteActor_GetSpritePositionXY(param0->unk_1A0[v1].unk_0C, &v3, &v4); if (param0->unk_2B0 == param0->unk_2B4) { v2 += 8; @@ -625,7 +625,7 @@ void sub_0208ADE4 (UnkStruct_02089688 * param0, int param1) } if (param1 == 0) { - sub_0200D4C4(param0->unk_1A0[v1].unk_0C, v2, v4); + SpriteActor_SetSpritePositionXY(param0->unk_1A0[v1].unk_0C, v2, v4); } else { param0->unk_1A0[v1].unk_14.unk_00 = (v2 - v3) / 2; param0->unk_1A0[v1].unk_14.unk_02 = 0; @@ -644,7 +644,7 @@ static inline void inline_0208AF44 (UnkStruct_02089688 * param0, int param1, s16 v2 = ¶m0->unk_00[param1]; - sub_0200D550(v2->unk_0C, &v0, &v1); + SpriteActor_GetSpritePositionXY(v2->unk_0C, &v0, &v1); v2->unk_10->val1.unk_00 = v1 - param3; v2->unk_10->val1.unk_02 = v0 - param2; diff --git a/src/unk_0208B284.c b/src/unk_0208B284.c index c9382c89a6..6f6acd1e23 100644 --- a/src/unk_0208B284.c +++ b/src/unk_0208B284.c @@ -9,7 +9,7 @@ #include "struct_defs/struct_0208B284.h" #include "struct_defs/struct_0208B878.h" -#include "overlay104/struct_ov104_0223F9E0.h" +#include "struct_defs/sprite_template.h" #include "narc.h" #include "unk_0200C6E4.h" @@ -25,7 +25,7 @@ typedef struct { static BOOL sub_0208B2DC(s16 param0, s16 param1, f32 param2, f32 param3, f32 * param4, f32 * param5, f32 param6, s16 param7); static void sub_0208B3D4(SysTask * param0, void * param1); -UnkStruct_0208B878 * sub_0208B284(UnkStruct_0208B284 param0, CellTransferStateData * param1, AnimationResourceCollection * param2, PaletteSys * param3); +UnkStruct_0208B878 * sub_0208B284(UnkStruct_0208B284 param0, SpriteRenderer * param1, SpriteGfxHandler * param2, PaletteData * param3); void sub_0208B6B0(UnkStruct_0208B878 * param0, int param1); void sub_0208B7B4(UnkStruct_0208B878 * param0); void sub_0208B830(UnkStruct_0208B878 * param0); @@ -41,7 +41,7 @@ static const int Unk_020F2FB0[] = { 97, 98, 99, 100, 101, 128, 133, }; -UnkStruct_0208B878 * sub_0208B284 (UnkStruct_0208B284 param0, CellTransferStateData * param1, AnimationResourceCollection * param2, PaletteSys * param3) +UnkStruct_0208B878 * sub_0208B284 (UnkStruct_0208B284 param0, SpriteRenderer * param1, SpriteGfxHandler * param2, PaletteData * param3) { UnkStruct_0208B878 * v0; @@ -174,27 +174,27 @@ static void sub_0208B3D4 (SysTask * param0, void * param1) void sub_0208B63C (UnkStruct_0208B878 * param0, int param1) { NARC * v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; v1 = param0->unk_00.unk_04; v2 = param0->unk_00.unk_08; v3 = param0->unk_00.unk_0C; v0 = param0->unk_00.unk_00; - sub_0200D080(v2, 22222 + 1); - sub_0200D080(v2, 22222 + 2); - sub_0200CDC4(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 22222 + 1); - sub_0200CDC4(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 22222 + 2); + SpriteGfxHandler_UnloadPlttObjById(v2, 22222 + 1); + SpriteGfxHandler_UnloadPlttObjById(v2, 22222 + 2); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 22222 + 1); + SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 22222 + 2); } void sub_0208B6B0 (UnkStruct_0208B878 * param0, int param1) { NARC * v0; - CellTransferStateData * v1; - AnimationResourceCollection * v2; - PaletteSys * v3; + SpriteRenderer * v1; + SpriteGfxHandler * v2; + PaletteData * v3; int v4 = 22222 + param0->unk_10.unk_08; v1 = param0->unk_00.unk_04; @@ -204,59 +204,59 @@ void sub_0208B6B0 (UnkStruct_0208B878 * param0, int param1) if (param0->unk_10.unk_08 == 1) { if (param0->unk_10.unk_0C == 0) { - sub_0200CDC4(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } else { - sub_0200CDC4(v3, 2, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadPalette(v3, 2, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } - sub_0200CC3C(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v4); + SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DMAIN, v4); } else { if (param0->unk_10.unk_0C == 0) { - sub_0200CDC4(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); + SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, Unk_020F2FB0[param1], 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); } else { - sub_0200CDC4(v3, 3, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); + SpriteRenderer_LoadPalette(v3, 3, v1, v2, v0, 96, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, v4); } - sub_0200CC3C(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DSUB, v4); + SpriteRenderer_LoadCharResObjFromOpenNarc(v1, v2, v0, 95, 0, NNS_G2D_VRAM_TYPE_2DSUB, v4); } - sub_0200CE24(v1, v2, v0, 93, 0, v4); - sub_0200CE54(v1, v2, v0, 94, 0, v4); + SpriteRenderer_LoadCellResObjFromOpenNarc(v1, v2, v0, 93, 0, v4); + SpriteRenderer_LoadAnimResObjFromOpenNarc(v1, v2, v0, 94, 0, v4); } void sub_0208B7B4 (UnkStruct_0208B878 * param0) { int v0; - UnkStruct_ov104_0223F9E0 v1; - CellTransferStateData * v2; - AnimationResourceCollection * v3; - PaletteSys * v4; + SpriteTemplate v1; + SpriteRenderer * v2; + SpriteGfxHandler * v3; + PaletteData * v4; v2 = param0->unk_00.unk_04; v3 = param0->unk_00.unk_08; v4 = param0->unk_00.unk_0C; - v1.unk_00 = 128; - v1.unk_02 = 96; - v1.unk_04 = 0; - v1.unk_06 = 0; - v1.unk_08 = 0; - v1.unk_10 = param0->unk_10.unk_08; - v1.unk_2C = 0; - v1.unk_30 = 0; - v1.unk_0C = 0; - v1.unk_14[0] = 22222 + param0->unk_10.unk_08; - v1.unk_14[1] = 22222 + param0->unk_10.unk_08; - v1.unk_14[2] = 22222 + param0->unk_10.unk_08; - v1.unk_14[3] = 22222 + param0->unk_10.unk_08; - v1.unk_14[4] = 0xffffffff; - v1.unk_14[5] = 0xffffffff; + v1.x = 128; + v1.y = 96; + v1.z = 0; + v1.animIdx = 0; + v1.priority = 0; + v1.vramType = param0->unk_10.unk_08; + v1.bgPriority = 0; + v1.transferToVRAM = FALSE; + v1.plttIdx = 0; + v1.resources[0] = 22222 + param0->unk_10.unk_08; + v1.resources[1] = 22222 + param0->unk_10.unk_08; + v1.resources[2] = 22222 + param0->unk_10.unk_08; + v1.resources[3] = 22222 + param0->unk_10.unk_08; + v1.resources[4] = SPRITE_RESOURCE_NONE; + v1.resources[5] = SPRITE_RESOURCE_NONE; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - param0->unk_24[v0].unk_00 = sub_0200CE6C(v2, v3, &v1); + param0->unk_24[v0].unk_00 = SpriteActor_LoadResources(v2, v3, &v1); sub_0200D330(param0->unk_24[v0].unk_00); - sub_0200D4C4(param0->unk_24[v0].unk_00, 256 / 2, 192 / 2); + SpriteActor_SetSpritePositionXY(param0->unk_24[v0].unk_00, 256 / 2, 192 / 2); } } @@ -265,9 +265,9 @@ void sub_0208B830 (UnkStruct_0208B878 * param0) int v0; for (v0 = 0; v0 < param0->unk_10.unk_00; v0++) { - sub_0200D070(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); - sub_0200D090(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); - sub_0200D0A0(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); + SpriteGfxHandler_UnloadCharObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); + SpriteGfxHandler_UnloadCellObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); + SpriteGfxHandler_UnloadAnimObjById(param0->unk_00.unk_08, 22222 + param0->unk_10.unk_08); sub_0200D0F4(param0->unk_24[v0].unk_00); } } diff --git a/src/unk_0208C324.c b/src/unk_0208C324.c index 7007683843..4db2b8fde1 100644 --- a/src/unk_0208C324.c +++ b/src/unk_0208C324.c @@ -769,7 +769,7 @@ static int sub_0208CD44 (UnkStruct_0208D7BC * param0) if (param0->unk_6A5_0 != 4) { if ((Item_IsHMMove(param0->unk_250.unk_34[param0->unk_6A5_0]) == 1) && (param0->unk_24C->unk_18 != 0)) { - sub_0200D3EC(param0->unk_41C[18], 0); + SpriteActor_DrawSprite(param0->unk_41C[18], 0); sub_0208E46C(param0); sub_020914F8(param0); return 10; @@ -1650,11 +1650,11 @@ static u8 sub_0208DD8C (UnkStruct_0208D7BC * param0) } sub_0208DFF4(param0); - sub_0200D3EC(param0->unk_41C[11], 1); + SpriteActor_DrawSprite(param0->unk_41C[11], 1); sub_0208F7A4(param0); if (param0->unk_250.unk_10 != param0->unk_250.unk_11) { - sub_0200D3EC(param0->unk_41C[12], 1); + SpriteActor_DrawSprite(param0->unk_41C[12], 1); } sub_02021CAC(param0->unk_41C[9], 1); @@ -1668,10 +1668,10 @@ static u8 sub_0208DEA4 (UnkStruct_0208D7BC * param0) { switch (param0->unk_6A6) { case 0: - sub_0200D3EC(param0->unk_41C[11], 0); - sub_0200D3EC(param0->unk_41C[12], 0); - sub_0200D3EC(param0->unk_41C[18], 0); - sub_0200D3EC(param0->unk_41C[19], 0); + SpriteActor_DrawSprite(param0->unk_41C[11], 0); + SpriteActor_DrawSprite(param0->unk_41C[12], 0); + SpriteActor_DrawSprite(param0->unk_41C[18], 0); + SpriteActor_DrawSprite(param0->unk_41C[19], 0); sub_02021CAC(param0->unk_41C[9], 0); sub_0201AD10(¶m0->unk_04[35]); sub_0208F6DC(param0, NULL); @@ -1761,11 +1761,11 @@ static void sub_0208E07C (UnkStruct_0208D7BC * param0, u32 param1) { if (param1 == 0xffffffff) { sub_020913D8(param0); - sub_0200D3EC(param0->unk_41C[18], 0); + SpriteActor_DrawSprite(param0->unk_41C[18], 0); } else { sub_020912A4(param0, param1); sub_0208F294(param0, param1); - sub_0200D3EC(param0->unk_41C[18], 1); + SpriteActor_DrawSprite(param0->unk_41C[18], 1); } } @@ -1819,11 +1819,11 @@ static void sub_0208E190 (UnkStruct_0208D7BC * param0) sub_02091420(param0); sub_0208DFF4(param0); - sub_0200D3EC(param0->unk_41C[11], 1); + SpriteActor_DrawSprite(param0->unk_41C[11], 1); sub_0208F7A4(param0); if (param0->unk_250.unk_10 != param0->unk_250.unk_11) { - sub_0200D3EC(param0->unk_41C[12], 1); + SpriteActor_DrawSprite(param0->unk_41C[12], 1); } sub_02021CAC(param0->unk_41C[9], 1); @@ -1881,7 +1881,7 @@ static u8 sub_0208E308 (UnkStruct_0208D7BC * param0) switch (param0->unk_6A6) { case 0: sub_0208F964(param0); - sub_0200D3EC(param0->unk_41C[19], 0); + SpriteActor_DrawSprite(param0->unk_41C[19], 0); sub_0208E498(param0, 0xffffffff); sub_02021CAC(param0->unk_41C[9], 0); sub_0201AD10(¶m0->unk_04[35]); @@ -1971,10 +1971,10 @@ static void sub_0208E508 (UnkStruct_0208D7BC * param0) if (param0->unk_6A4 == 3) { sub_0208F964(param0); - sub_0200D3EC(param0->unk_41C[11], 1); + SpriteActor_DrawSprite(param0->unk_41C[11], 1); if (param0->unk_250.unk_10 != param0->unk_250.unk_11) { - sub_0200D3EC(param0->unk_41C[12], 1); + SpriteActor_DrawSprite(param0->unk_41C[12], 1); } sub_0201C63C(param0->unk_00, 2, 3, 0); diff --git a/src/unk_0208EA44.c b/src/unk_0208EA44.c index 67cbb12908..c6fe518593 100644 --- a/src/unk_0208EA44.c +++ b/src/unk_0208EA44.c @@ -263,11 +263,11 @@ void sub_0208ECF4 (UnkStruct_0208D7BC * param0) if (param0->unk_6A4 == v5) { if (v4 < 8) { - sub_02021D6C(v0[v5], v4 + 8); + SpriteActor_SetSpriteAnimActive(v0[v5], v4 + 8); } } else { if (v4 >= 8) { - sub_02021D6C(v0[v5], v4 - 8); + SpriteActor_SetSpriteAnimActive(v0[v5], v4 - 8); } } @@ -332,7 +332,7 @@ void sub_0208EE9C (UnkStruct_0208D7BC * param0) } else if (param0->unk_250.unk_50_0 != 0) { sub_02021CAC(param0->unk_41C[76], 0); sub_02021CAC(param0->unk_41C[20], 1); - sub_02021D6C(param0->unk_41C[20], param0->unk_250.unk_50_0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[20], param0->unk_250.unk_50_0); } else { sub_02021CAC(param0->unk_41C[76], 1); sub_02021CAC(param0->unk_41C[20], 0); @@ -361,18 +361,18 @@ void sub_0208EF58 (UnkStruct_0208D7BC * param0) u16 v0; for (v0 = 11; v0 <= 19; v0++) { - sub_0200D3EC(param0->unk_41C[v0], 0); + SpriteActor_DrawSprite(param0->unk_41C[v0], 0); } switch (param0->unk_6A4) { case 0: - sub_0200D3EC(param0->unk_41C[11], 1); + SpriteActor_DrawSprite(param0->unk_41C[11], 1); if (param0->unk_250.unk_10 == param0->unk_250.unk_11) { sub_0200D494(param0->unk_41C[11], 216, 80); } else { sub_0200D494(param0->unk_41C[11], 199, 80); - sub_0200D3EC(param0->unk_41C[12], 1); + SpriteActor_DrawSprite(param0->unk_41C[12], 1); sub_0200D494( param0->unk_41C[12], 233, 80); } @@ -384,13 +384,13 @@ void sub_0208EF58 (UnkStruct_0208D7BC * param0) } sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->unk_250.unk_34[v0], MOVEATTRIBUTE_TYPE)); - sub_0200D3EC(param0->unk_41C[13 + v0], 1); + SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); sub_0200D494(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); } if (param0->unk_24C->unk_18 != 0) { sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->unk_24C->unk_18, MOVEATTRIBUTE_TYPE)); - sub_0200D3EC(param0->unk_41C[13 + 4], 1); + SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); sub_0200D494(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); } @@ -405,13 +405,13 @@ void sub_0208EF58 (UnkStruct_0208D7BC * param0) } sub_0208F194(param0, 13 + v0, 5 + v0, MoveTable_LoadParam(param0->unk_250.unk_34[v0], MOVEATTRIBUTE_CONTEST_TYPE) + 18); - sub_0200D3EC(param0->unk_41C[13 + v0], 1); + SpriteActor_DrawSprite(param0->unk_41C[13 + v0], 1); sub_0200D494(param0->unk_41C[13 + v0], 151, 42 + v0 * 32); } if (param0->unk_24C->unk_18 != 0) { sub_0208F194(param0, 13 + 4, 5 + 4, MoveTable_LoadParam(param0->unk_24C->unk_18, MOVEATTRIBUTE_CONTEST_TYPE) + 18); - sub_0200D3EC(param0->unk_41C[13 + 4], 1); + SpriteActor_DrawSprite(param0->unk_41C[13 + 4], 1); sub_0200D494(param0->unk_41C[13 + 4], 151, 42 + 4 * 32); } @@ -501,7 +501,7 @@ void sub_0208F34C (UnkStruct_0208D7BC * param0) for (v0 = 29; v0 <= 40; v0++) { sub_02021CAC(param0->unk_41C[v0], 0); - sub_02021E50(param0->unk_41C[v0], 0); + SpriteActor_SetAnimFrame(param0->unk_41C[v0], 0); } } @@ -530,8 +530,8 @@ void sub_0208F3B0 (UnkStruct_0208D7BC * param0) case 1: if (param0->unk_6AB == 0) { sub_02021CAC(param0->unk_41C[29 + param0->unk_6AA], 1); - sub_02021E50(param0->unk_41C[29 + param0->unk_6AA], 0); - sub_02021D6C(param0->unk_41C[29 + param0->unk_6AA], 0); + SpriteActor_SetAnimFrame(param0->unk_41C[29 + param0->unk_6AA], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[29 + param0->unk_6AA], 0); param0->unk_6AA++; @@ -556,8 +556,8 @@ void sub_0208F3B0 (UnkStruct_0208D7BC * param0) if (param0->unk_6AB == 32) { for (v0 = 29; v0 < 29 + param0->unk_6A9; v0++) { sub_02021CAC(param0->unk_41C[v0], 1); - sub_02021E50(param0->unk_41C[v0], 0); - sub_02021D6C(param0->unk_41C[v0], 0); + SpriteActor_SetAnimFrame(param0->unk_41C[v0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[v0], 0); } param0->unk_6AB = 0; @@ -594,22 +594,22 @@ void sub_0208F574 (UnkStruct_0208D7BC * param0) for (v0 = 0; v0 < 6; v0++) { if (param0->unk_250.unk_4C & (1 << v0)) { - sub_02021D6C(param0->unk_41C[23 + v0], 1); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[23 + v0], 1); } else { - sub_02021D6C(param0->unk_41C[23 + v0], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[23 + v0], 0); } } if ((param0->unk_250.unk_50_29 == 1) && (param0->unk_250.unk_50_28 == 0)) { - sub_0200D3EC(param0->unk_41C[53], 1); + SpriteActor_DrawSprite(param0->unk_41C[53], 1); } else { - sub_0200D3EC(param0->unk_41C[53], 0); + SpriteActor_DrawSprite(param0->unk_41C[53], 0); } if (param0->unk_250.unk_50_30 == 2) { - sub_0200D3EC(param0->unk_41C[54], 1); + SpriteActor_DrawSprite(param0->unk_41C[54], 1); } else { - sub_0200D3EC(param0->unk_41C[54], 0); + SpriteActor_DrawSprite(param0->unk_41C[54], 0); } } @@ -618,8 +618,8 @@ void sub_0208F600 (UnkStruct_0208D7BC * param0) s16 v0, v1; sub_02021CAC(param0->unk_41C[41], 1); - sub_02021E50(param0->unk_41C[41], 0); - sub_02021D6C(param0->unk_41C[41], 0); + SpriteActor_SetAnimFrame(param0->unk_41C[41], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[41], 0); sub_02092368(param0, &v0, &v1); @@ -685,7 +685,7 @@ void sub_0208F7A4 (UnkStruct_0208D7BC * param0) sub_0200D494(param0->unk_41C[19], 32, 68); } - sub_0200D3EC(param0->unk_41C[19], 1); + SpriteActor_DrawSprite(param0->unk_41C[19], 1); } static s16 sub_0208F800 (u32 param0, s16 param1, s16 param2) @@ -758,7 +758,7 @@ void sub_0208FA04 (UnkStruct_0208D7BC * param0) } } - sub_02021D6C(param0->unk_41C[70], 0); + SpriteActor_SetSpriteAnimActive(param0->unk_41C[70], 0); } void sub_0208FAA4 (UnkStruct_0208D7BC * param0) @@ -855,8 +855,8 @@ static void sub_0208FC30 (GraphicElementData * param0, u32 param1, u32 param2, c } sub_0200D494(param0, v0, v1); - sub_02021E50(param0, 0); - sub_02021D6C(param0, 0); + SpriteActor_SetAnimFrame(param0, 0); + SpriteActor_SetSpriteAnimActive(param0, 0); } void sub_0208FCD4 (UnkStruct_0208D7BC * param0) diff --git a/src/unk_02098FFC.c b/src/unk_02098FFC.c index 28a60f4fce..2782e37df8 100644 --- a/src/unk_02098FFC.c +++ b/src/unk_02098FFC.c @@ -163,7 +163,7 @@ UnkStruct_0209916C * sub_0209916C (UnkStruct_0209903C * param0, int param1, u16 v4->unk_00 = sub_02021AA0(&v5); if (v4->unk_00 != NULL) { - sub_02021D6C(v4->unk_00, 0); + SpriteActor_SetSpriteAnimActive(v4->unk_00, 0); v2 = sub_0200A760( v6, v0); sub_02021E90(v4->unk_00, v2);