diff options
| author | TakaRikka <38417346+TakaRikka@users.noreply.github.com> | 2022-08-30 14:22:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-30 15:22:17 -0600 |
| commit | f8979749e3ef8e8cacf2ea8f474c7f23fc5cb6b3 (patch) | |
| tree | 69659df2105266e9b26a4d50b9a2d610b3e437a2 /include/JSystem | |
| parent | bc30d007e11458a198c5725626a10bb06a5da536 (diff) | |
j2d / map_path work, d_drawlist / d_attention cleanup (#208)
* work on fop actor / actor mng, daalink, d_a_obj_item
* d_a_title mostly decompiled
* daalink / d_event / JMessage / dmsg_out_font work
* msg_scrn_base / msg_scrn_boss
* some work on mDo machine, d_menu_save, d_tresure, and various
* remove asm
* progress
* finish d_menu_save / d_pane_class_alpha / d_pane_class / rename some data
* rename more data
* remove asm / progress
* match all of d_pane_class
* fixes / some dKankyo doc
* bunch of j2d work. d_drawlist / d_attention cleanup
* progress / asm
* cleanup wip
* decompile JStage
* setup some more JStudio structs
* set up d_demo classes
* some d_demo work
* cleanup dolphin os stuff
* some initial dEvent documentation
* some At collision documentation
* match JUTConsole::doDraw
* dbgs work / split up some of d_a_alink into .inc files
* d_a_alink_spinner work
Diffstat (limited to 'include/JSystem')
53 files changed, 1352 insertions, 311 deletions
diff --git a/include/JSystem/J2DGraph/J2DAnmLoader.h b/include/JSystem/J2DGraph/J2DAnmLoader.h index 398623d9c8..cb4501ce58 100644 --- a/include/JSystem/J2DGraph/J2DAnmLoader.h +++ b/include/JSystem/J2DGraph/J2DAnmLoader.h @@ -14,7 +14,8 @@ public: virtual void* load(void const*) = 0; virtual void setResource(J2DAnmBase*, void const*) = 0; /* 8030A410 */ virtual ~J2DAnmLoader() {} - void* _4; + + void* mpResource; }; struct J3DAnmTransformKeyData { diff --git a/include/JSystem/J2DGraph/J2DMatBlock.h b/include/JSystem/J2DGraph/J2DMatBlock.h index f2e20854d8..d9ed9f94b8 100644 --- a/include/JSystem/J2DGraph/J2DMatBlock.h +++ b/include/JSystem/J2DGraph/J2DMatBlock.h @@ -18,31 +18,31 @@ public: /* 802F2A40 */ virtual void initialize(); /* 802EB1D0 */ virtual void setGX(); /* 802F2A44 */ virtual void loadTexture(_GXTexMapID, u32); - virtual void getType() = 0; + virtual u32 getType() = 0; virtual s32 getMaxStage() = 0; /* 802EB1DC */ virtual void setTexNo(u32, u16); /* 802EA170 */ virtual u32 getTexNo(u32) const; /* 802F2A48 */ virtual void setFontNo(u16); /* 802EA164 */ virtual u32 getFontNo() const; /* 802F2A4C */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802EA144 */ virtual bool getTevOrder(u32); + /* 802EA144 */ virtual J2DTevOrder* getTevOrder(u32); /* 802EB1D8 */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802EA13C */ virtual bool getTevColor(u32); + /* 802EA13C */ virtual J2DGXColorS10* getTevColor(u32); /* 802EB1D4 */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802EA15C */ virtual bool getTevKColor(u32); + /* 802EA15C */ virtual JUtility::TColor* getTevKColor(u32); /* 802F2A50 */ virtual void setTevKColorSel(u32, u8); - /* 802EA154 */ virtual bool getTevKColorSel(u32); + /* 802EA154 */ virtual u8 getTevKColorSel(u32); /* 802F2A54 */ virtual void setTevKAlphaSel(u32, u8); - /* 802EA14C */ virtual bool getTevKAlphaSel(u32); + /* 802EA14C */ virtual u8 getTevKAlphaSel(u32); /* 802F2A58 */ virtual void setTevStageNum(u8); - /* 802EA17C */ virtual bool getTevStageNum() const; + /* 802EA17C */ virtual u8 getTevStageNum() const; /* 802F2A5C */ virtual void setTevStage(u32, J2DTevStage); - /* 802EA134 */ virtual bool getTevStage(u32); + /* 802EA134 */ virtual J2DTevStage* getTevStage(u32); /* 802F2A60 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F2A64 */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802EA12C */ virtual bool getTevSwapModeTable(u32); + /* 802EA12C */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F2A68 */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802EA184 */ virtual bool getIndTevStage(u32); + /* 802EA184 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F2A7C */ virtual bool insertTexture(u32, ResTIMG const*); /* 802F2A74 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802F2A6C */ virtual bool insertTexture(u32, JUTTexture*); @@ -53,13 +53,13 @@ public: /* 802F2A9C */ virtual bool setFont(JUTFont*); /* 802F2AAC */ virtual bool setPalette(u32, ResTLUT const*); /* 802F2AB4 */ virtual bool prepareTexture(u8); - /* 802EB87C */ virtual bool getTexture(u32); - /* 802EB884 */ virtual bool getPalette(u32); - /* 802F2ABC */ virtual bool getFont(); + /* 802EB87C */ virtual JUTTexture* getTexture(u32); + /* 802EB884 */ virtual JUTPalette* getPalette(u32); + /* 802F2ABC */ virtual JUTFont* getFont(); /* 802F2AC4 */ virtual void shiftDeleteFlag(u8, bool); /* 802F2AC8 */ virtual void setUndeleteFlag(u8); /* 802F2ACC */ virtual void setFontUndeleteFlag(); - /* 802EB184 */ virtual ~J2DTevBlock(); + /* 802EB184 */ virtual ~J2DTevBlock() {} }; class J2DTevBlock1 : public J2DTevBlock { @@ -69,31 +69,31 @@ public: /* 802EBA50 */ virtual void initialize(); /* 802EC328 */ virtual void setGX(); /* 802EC570 */ virtual void loadTexture(_GXTexMapID, u32); - /* 802F27A0 */ virtual void getType(); + /* 802F27A0 */ virtual u32 getType(); /* 802F27AC */ virtual s32 getMaxStage(); /* 802F27B4 */ virtual void setTexNo(u32, u16); /* 802F27C4 */ virtual u32 getTexNo(u32) const; /* 802F27D4 */ virtual void setFontNo(u16); /* 802F27DC */ virtual u32 getFontNo() const; /* 802F27E4 */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802F2808 */ virtual bool getTevOrder(u32); + /* 802F2808 */ virtual J2DTevOrder* getTevOrder(u32); /* 802F281C */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802F2848 */ virtual bool getTevColor(u32); + /* 802F2848 */ virtual J2DGXColorS10* getTevColor(u32); /* 802F285C */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802F2888 */ virtual bool getTevKColor(u32); + /* 802F2888 */ virtual JUtility::TColor* getTevKColor(u32); /* 802F289C */ virtual void setTevKColorSel(u32, u8); - /* 802F28A8 */ virtual bool getTevKColorSel(u32); + /* 802F28A8 */ virtual u8 getTevKColorSel(u32); /* 802F28B4 */ virtual void setTevKAlphaSel(u32, u8); - /* 802F28C0 */ virtual bool getTevKAlphaSel(u32); + /* 802F28C0 */ virtual u8 getTevKAlphaSel(u32); /* 802F28CC */ virtual void setTevStageNum(u8); - /* 802F28D0 */ virtual bool getTevStageNum() const; + /* 802F28D0 */ virtual u8 getTevStageNum() const; /* 802F28D8 */ virtual void setTevStage(u32, J2DTevStage); - /* 802F2914 */ virtual bool getTevStage(u32); + /* 802F2914 */ virtual J2DTevStage* getTevStage(u32); /* 802F2928 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F2960 */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802F2970 */ virtual bool getTevSwapModeTable(u32); + /* 802F2970 */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F2980 */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802F2994 */ virtual bool getIndTevStage(u32); + /* 802F2994 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F29A8 */ virtual bool insertTexture(u32, ResTIMG const*); /* 802EBCC0 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802EBDE4 */ virtual bool insertTexture(u32, JUTTexture*); @@ -104,9 +104,9 @@ public: /* 802EC1D8 */ virtual bool setFont(JUTFont*); /* 802EC258 */ virtual bool setPalette(u32, ResTLUT const*); /* 802EBC0C */ virtual bool prepareTexture(u8); - /* 802F29D8 */ virtual bool getTexture(u32); - /* 802F29F8 */ virtual bool getPalette(u32); - /* 802F2A18 */ virtual bool getFont(); + /* 802F29D8 */ virtual JUTTexture* getTexture(u32); + /* 802F29F8 */ virtual JUTPalette* getPalette(u32); + /* 802F2A18 */ virtual JUTFont* getFont(); /* 802EC318 */ virtual void shiftDeleteFlag(u8, bool); /* 802F2A20 */ virtual void setUndeleteFlag(u8); /* 802F2A30 */ virtual void setFontUndeleteFlag(); @@ -136,31 +136,31 @@ public: /* 802EC7A0 */ virtual void initialize(); /* 802ED584 */ virtual void setGX(); /* 802ED874 */ virtual void loadTexture(_GXTexMapID, u32); - /* 802F24FC */ virtual void getType(); + /* 802F24FC */ virtual u32 getType(); /* 802F2508 */ virtual s32 getMaxStage(); /* 802F2510 */ virtual void setTexNo(u32, u16); /* 802F2520 */ virtual u32 getTexNo(u32) const; /* 802F2530 */ virtual void setFontNo(u16); /* 802F2538 */ virtual u32 getFontNo() const; /* 802F2540 */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802F2564 */ virtual bool getTevOrder(u32); + /* 802F2564 */ virtual J2DTevOrder* getTevOrder(u32); /* 802F2578 */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802F25A4 */ virtual bool getTevColor(u32); + /* 802F25A4 */ virtual J2DGXColorS10* getTevColor(u32); /* 802F25B8 */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802F25E4 */ virtual bool getTevKColor(u32); + /* 802F25E4 */ virtual JUtility::TColor* getTevKColor(u32); /* 802F25F8 */ virtual void setTevKColorSel(u32, u8); - /* 802F2604 */ virtual bool getTevKColorSel(u32); + /* 802F2604 */ virtual u8 getTevKColorSel(u32); /* 802F2610 */ virtual void setTevKAlphaSel(u32, u8); - /* 802F261C */ virtual bool getTevKAlphaSel(u32); + /* 802F261C */ virtual u8 getTevKAlphaSel(u32); /* 802F2628 */ virtual void setTevStageNum(u8); - /* 802F2630 */ virtual bool getTevStageNum() const; + /* 802F2630 */ virtual u8 getTevStageNum() const; /* 802F2638 */ virtual void setTevStage(u32, J2DTevStage); - /* 802F2674 */ virtual bool getTevStage(u32); + /* 802F2674 */ virtual J2DTevStage* getTevStage(u32); /* 802F2688 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F26C0 */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802F26D0 */ virtual bool getTevSwapModeTable(u32); + /* 802F26D0 */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F26E0 */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802F26F4 */ virtual bool getIndTevStage(u32); + /* 802F26F4 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F2708 */ virtual bool insertTexture(u32, ResTIMG const*); /* 802ECAE8 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802ECDE8 */ virtual bool insertTexture(u32, JUTTexture*); @@ -171,9 +171,9 @@ public: /* 802ED3A4 */ virtual bool setFont(JUTFont*); /* 802ED424 */ virtual bool setPalette(u32, ResTLUT const*); /* 802ECA18 */ virtual bool prepareTexture(u8); - /* 802F2738 */ virtual bool getTexture(u32); - /* 802F2758 */ virtual bool getPalette(u32); - /* 802F2778 */ virtual bool getFont(); + /* 802F2738 */ virtual JUTTexture* getTexture(u32); + /* 802F2758 */ virtual JUTPalette* getPalette(u32); + /* 802F2778 */ virtual JUTFont* getFont(); /* 802ED4FC */ virtual void shiftDeleteFlag(u8, bool); /* 802F2780 */ virtual void setUndeleteFlag(u8); /* 802F2790 */ virtual void setFontUndeleteFlag(); @@ -186,6 +186,7 @@ private: /* 0x012 */ J2DGXColorS10 mTevColor[4]; /* 0x032 */ u8 mTevStageNum; /* 0x033 */ J2DTevStage mTevStage[2]; + /* 0x043 */ u8 field_0x43; /* 0x044 */ JUtility::TColor mTevKColor[4]; /* 0x054 */ u8 mTevKColorSel[2]; /* 0x056 */ u8 mTevKAlphaSel[2]; @@ -204,31 +205,31 @@ public: /* 802EDAC4 */ virtual void initialize(); /* 802EEA2C */ virtual void setGX(); /* 802EED1C */ virtual void loadTexture(_GXTexMapID, u32); - /* 802F2258 */ virtual void getType(); + /* 802F2258 */ virtual u32 getType(); /* 802F2264 */ virtual s32 getMaxStage(); /* 802F226C */ virtual void setTexNo(u32, u16); /* 802F227C */ virtual u32 getTexNo(u32) const; /* 802F228C */ virtual void setFontNo(u16); /* 802F2294 */ virtual u32 getFontNo() const; /* 802F229C */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802F22C0 */ virtual bool getTevOrder(u32); + /* 802F22C0 */ virtual J2DTevOrder* getTevOrder(u32); /* 802F22D4 */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802F2300 */ virtual bool getTevColor(u32); + /* 802F2300 */ virtual J2DGXColorS10* getTevColor(u32); /* 802F2314 */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802F2340 */ virtual bool getTevKColor(u32); + /* 802F2340 */ virtual JUtility::TColor* getTevKColor(u32); /* 802F2354 */ virtual void setTevKColorSel(u32, u8); - /* 802F2360 */ virtual bool getTevKColorSel(u32); + /* 802F2360 */ virtual u8 getTevKColorSel(u32); /* 802F236C */ virtual void setTevKAlphaSel(u32, u8); - /* 802F2378 */ virtual bool getTevKAlphaSel(u32); + /* 802F2378 */ virtual u8 getTevKAlphaSel(u32); /* 802F2384 */ virtual void setTevStageNum(u8); - /* 802F238C */ virtual bool getTevStageNum() const; + /* 802F238C */ virtual u8 getTevStageNum() const; /* 802F2394 */ virtual void setTevStage(u32, J2DTevStage); - /* 802F23D0 */ virtual bool getTevStage(u32); + /* 802F23D0 */ virtual J2DTevStage* getTevStage(u32); /* 802F23E4 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F241C */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802F242C */ virtual bool getTevSwapModeTable(u32); + /* 802F242C */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F243C */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802F2450 */ virtual bool getIndTevStage(u32); + /* 802F2450 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F2464 */ virtual bool insertTexture(u32, ResTIMG const*); /* 802EDE04 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802EE1D4 */ virtual bool insertTexture(u32, JUTTexture*); @@ -239,9 +240,9 @@ public: /* 802EE84C */ virtual bool setFont(JUTFont*); /* 802EE8CC */ virtual bool setPalette(u32, ResTLUT const*); /* 802EDD34 */ virtual bool prepareTexture(u8); - /* 802F2494 */ virtual bool getTexture(u32); - /* 802F24B4 */ virtual bool getPalette(u32); - /* 802F24D4 */ virtual bool getFont(); + /* 802F2494 */ virtual JUTTexture* getTexture(u32); + /* 802F24B4 */ virtual JUTPalette* getPalette(u32); + /* 802F24D4 */ virtual JUTFont* getFont(); /* 802EE9A4 */ virtual void shiftDeleteFlag(u8, bool); /* 802F24DC */ virtual void setUndeleteFlag(u8); /* 802F24EC */ virtual void setFontUndeleteFlag(); @@ -254,6 +255,7 @@ private: /* 0x01E */ J2DGXColorS10 mTevColor[4]; /* 0x03E */ u8 mTevStageNum; /* 0x03F */ J2DTevStage mTevStage[4]; + /* 0x05F */ u8 field_0x5f; /* 0x060 */ JUtility::TColor mTevKColor[4]; /* 0x070 */ u8 mTevKColorSel[4]; /* 0x074 */ u8 mTevKAlphaSel[4]; @@ -272,31 +274,31 @@ public: /* 802EEF6C */ virtual void initialize(); /* 802EFEAC */ virtual void setGX(); /* 802F019C */ virtual void loadTexture(_GXTexMapID, u32); - /* 802F1FB8 */ virtual void getType(); + /* 802F1FB8 */ virtual u32 getType(); /* 802F1FC4 */ virtual s32 getMaxStage(); /* 802F1FCC */ virtual void setTexNo(u32, u16); /* 802F1FDC */ virtual u32 getTexNo(u32) const; /* 802F1FEC */ virtual void setFontNo(u16); /* 802F1FF4 */ virtual u32 getFontNo() const; /* 802F1FFC */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802F2020 */ virtual bool getTevOrder(u32); + /* 802F2020 */ virtual J2DTevOrder* getTevOrder(u32); /* 802F2034 */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802F2060 */ virtual bool getTevColor(u32); + /* 802F2060 */ virtual J2DGXColorS10* getTevColor(u32); /* 802F2074 */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802F20A0 */ virtual bool getTevKColor(u32); + /* 802F20A0 */ virtual JUtility::TColor* getTevKColor(u32); /* 802F20B4 */ virtual void setTevKColorSel(u32, u8); - /* 802F20C0 */ virtual bool getTevKColorSel(u32); + /* 802F20C0 */ virtual u8 getTevKColorSel(u32); /* 802F20CC */ virtual void setTevKAlphaSel(u32, u8); - /* 802F20D8 */ virtual bool getTevKAlphaSel(u32); + /* 802F20D8 */ virtual u8 getTevKAlphaSel(u32); /* 802F20E4 */ virtual void setTevStageNum(u8); - /* 802F20EC */ virtual bool getTevStageNum() const; + /* 802F20EC */ virtual u8 getTevStageNum() const; /* 802F20F4 */ virtual void setTevStage(u32, J2DTevStage); - /* 802F2130 */ virtual bool getTevStage(u32); + /* 802F2130 */ virtual J2DTevStage* getTevStage(u32); /* 802F2144 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F217C */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802F218C */ virtual bool getTevSwapModeTable(u32); + /* 802F218C */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F219C */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802F21B0 */ virtual bool getIndTevStage(u32); + /* 802F21B0 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F21C4 */ virtual bool insertTexture(u32, ResTIMG const*); /* 802EF2B0 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802EF67C */ virtual bool insertTexture(u32, JUTTexture*); @@ -307,9 +309,9 @@ public: /* 802EFCEC */ virtual bool setFont(JUTFont*); /* 802EFD68 */ virtual bool setPalette(u32, ResTLUT const*); /* 802EF1E0 */ virtual bool prepareTexture(u8); - /* 802F21F4 */ virtual bool getTexture(u32); - /* 802F2214 */ virtual bool getPalette(u32); - /* 802F2234 */ virtual bool getFont(); + /* 802F21F4 */ virtual JUTTexture* getTexture(u32); + /* 802F2214 */ virtual JUTPalette* getPalette(u32); + /* 802F2234 */ virtual JUTFont* getFont(); /* 802EFE40 */ virtual void shiftDeleteFlag(u8, bool); /* 802F223C */ virtual void setUndeleteFlag(u8); /* 802F224C */ virtual void setFontUndeleteFlag(); @@ -322,6 +324,7 @@ private: /* 0x036 */ J2DGXColorS10 mTevColor[4]; /* 0x056 */ u8 mTevStageNum; /* 0x057 */ J2DTevStage mTevStage[8]; + /* 0x097 */ u8 field_0x97; /* 0x098 */ JUtility::TColor mTevKColor[4]; /* 0x0A8 */ u8 mTevKColorSel[8]; /* 0x0B0 */ u8 mTevKAlphaSel[8]; @@ -341,31 +344,31 @@ public: /* 802F03EC */ virtual void initialize(); /* 802F132C */ virtual void setGX(); /* 802F161C */ virtual void loadTexture(_GXTexMapID, u32); - /* 802F1D18 */ virtual void getType(); + /* 802F1D18 */ virtual u32 getType(); /* 802F1D24 */ virtual s32 getMaxStage(); /* 802F1D2C */ virtual void setTexNo(u32, u16); /* 802F1D3C */ virtual u32 getTexNo(u32) const; /* 802F1D4C */ virtual void setFontNo(u16); /* 802F1D54 */ virtual u32 getFontNo() const; /* 802F1D5C */ virtual void setTevOrder(u32, J2DTevOrder); - /* 802F1D80 */ virtual bool getTevOrder(u32); + /* 802F1D80 */ virtual J2DTevOrder* getTevOrder(u32); /* 802F1D94 */ virtual void setTevColor(u32, J2DGXColorS10); - /* 802F1DC0 */ virtual bool getTevColor(u32); + /* 802F1DC0 */ virtual J2DGXColorS10* getTevColor(u32); /* 802F1DD4 */ virtual void setTevKColor(u32, JUtility::TColor); - /* 802F1E00 */ virtual bool getTevKColor(u32); + /* 802F1E00 */ virtual JUtility::TColor* getTevKColor(u32); /* 802F1E14 */ virtual void setTevKColorSel(u32, u8); - /* 802F1E20 */ virtual bool getTevKColorSel(u32); + /* 802F1E20 */ virtual u8 getTevKColorSel(u32); /* 802F1E2C */ virtual void setTevKAlphaSel(u32, u8); - /* 802F1E38 */ virtual bool getTevKAlphaSel(u32); + /* 802F1E38 */ virtual u8 getTevKAlphaSel(u32); /* 802F1E44 */ virtual void setTevStageNum(u8); - /* 802F1E4C */ virtual bool getTevStageNum() const; + /* 802F1E4C */ virtual u8 getTevStageNum() const; /* 802F1E54 */ virtual void setTevStage(u32, J2DTevStage); - /* 802F1E90 */ virtual bool getTevStage(u32); + /* 802F1E90 */ virtual J2DTevStage* getTevStage(u32); /* 802F1EA4 */ virtual void setTevSwapModeInfo(u32, J2DTevSwapModeInfo); /* 802F1EDC */ virtual void setTevSwapModeTable(u32, J2DTevSwapModeTable); - /* 802F1EEC */ virtual bool getTevSwapModeTable(u32); + /* 802F1EEC */ virtual J2DTevSwapModeTable* getTevSwapModeTable(u32); /* 802F1EFC */ virtual void setIndTevStage(u32, J2DIndTevStage); - /* 802F1F10 */ virtual bool getIndTevStage(u32); + /* 802F1F10 */ virtual J2DIndTevStage* getIndTevStage(u32); /* 802F1F24 */ virtual bool insertTexture(u32, ResTIMG const*); /* 802F0730 */ virtual bool insertTexture(u32, ResTIMG const*, JUTPalette*); /* 802F0AFC */ virtual bool insertTexture(u32, JUTTexture*); @@ -376,9 +379,9 @@ public: /* 802F116C */ virtual bool setFont(JUTFont*); /* 802F11E8 */ virtual bool setPalette(u32, ResTLUT const*); /* 802F0660 */ virtual bool prepareTexture(u8); - /* 802F1F54 */ virtual bool getTexture(u32); - /* 802F1F74 */ virtual bool getPalette(u32); - /* 802F1F94 */ virtual bool getFont(); + /* 802F1F54 */ virtual JUTTexture* getTexture(u32); + /* 802F1F74 */ virtual JUTPalette* getPalette(u32); + /* 802F1F94 */ virtual JUTFont* getFont(); /* 802F12C0 */ virtual void shiftDeleteFlag(u8, bool); /* 802F1F9C */ virtual void setUndeleteFlag(u8); /* 802F1FAC */ virtual void setFontUndeleteFlag(); @@ -391,6 +394,7 @@ public: /* 0x056 */ J2DGXColorS10 mTevColor[4]; /* 0x076 */ u8 mTevStageNum; /* 0x077 */ J2DTevStage mTevStage[16]; + /* 0x0F7 */ u8 field_0xf7; /* 0x0F8 */ JUtility::TColor mTevKColor[4]; /* 0x108 */ u8 mTevKColorSel[16]; /* 0x118 */ u8 mTevKAlphaSel[16]; @@ -456,16 +460,16 @@ class J2DIndBlock { public: /* 802EB24C */ virtual void initialize(); /* 802EB1CC */ virtual void setGX(); - virtual void getType() = 0; + virtual u32 getType() = 0; /* 802EB250 */ virtual void setIndTexStageNum(u8); - /* 802EA1A4 */ virtual bool getIndTexStageNum() const; + /* 802EA1A4 */ virtual u8 getIndTexStageNum() const; /* 802EB254 */ virtual void setIndTexOrder(u32, J2DIndTexOrder); - /* 802EA19C */ virtual bool getIndTexOrder(u32); + /* 802EA19C */ virtual J2DIndTexOrder* getIndTexOrder(u32); /* 802EB258 */ virtual void setIndTexMtx(u32, J2DIndTexMtx); - /* 802EA194 */ virtual bool getIndTexMtx(u32); + /* 802EA194 */ virtual J2DIndTexMtx* getIndTexMtx(u32); /* 802EB25C */ virtual void setIndTexCoordScale(u32, J2DIndTexCoordScale); - /* 802EA18C */ virtual bool getIndTexCoordScale(u32); - /* 802EB13C */ virtual ~J2DIndBlock(); + /* 802EA18C */ virtual J2DIndTexCoordScale* getIndTexCoordScale(u32); + /* 802EB13C */ virtual ~J2DIndBlock() {} }; class J2DIndBlockFull : public J2DIndBlock { @@ -474,15 +478,15 @@ public: /* 802F1664 */ virtual void initialize(); /* 802F1730 */ virtual void setGX(); - /* 802F1B94 */ virtual void getType(); + /* 802F1B94 */ virtual u32 getType(); /* 802F1BA0 */ virtual void setIndTexStageNum(u8); - /* 802F1BA8 */ virtual bool getIndTexStageNum() const; + /* 802F1BA8 */ virtual u8 getIndTexStageNum() const; /* 802F1BB0 */ virtual void setIndTexOrder(u32, J2DIndTexOrder); - /* 802F1BCC */ virtual bool getIndTexOrder(u32); + /* 802F1BCC */ virtual J2DIndTexOrder* getIndTexOrder(u32); /* 802F1BE0 */ virtual void setIndTexMtx(u32, J2DIndTexMtx); - /* 802F1C38 */ virtual bool getIndTexMtx(u32); + /* 802F1C38 */ virtual J2DIndTexMtx* getIndTexMtx(u32); /* 802F1C4C */ virtual void setIndTexCoordScale(u32, J2DIndTexCoordScale); - /* 802F1C68 */ virtual bool getIndTexCoordScale(u32); + /* 802F1C68 */ virtual J2DIndTexCoordScale* getIndTexCoordScale(u32); /* 802F1C7C */ virtual ~J2DIndBlockFull(); private: @@ -497,7 +501,7 @@ public: J2DIndBlockNull() {} /* 802EB1E0 */ virtual void setGX(); - /* 802EB1E4 */ virtual void getType(); + /* 802EB1E4 */ virtual u32 getType(); /* 802EB1F0 */ virtual ~J2DIndBlockNull(); }; @@ -515,6 +519,8 @@ public: /* 802EB6A4 */ void setTexMtx(u32, J2DTexMtx&); /* 802EB7E0 */ void getTexMtx(u32, J2DTexMtx&); + u32 getTexGenNum() const { return mTexGenNum; } + /* 802EB620 */ virtual ~J2DTexGenBlock(); }; // Size: 0x48 @@ -526,6 +532,8 @@ class J2DColorChan { public: /* 802EB280 */ J2DColorChan(); + u16 getMatSrc() const { return mColorChanInfo.field_0x0 & 1; } + private: /* 0x0 */ J2DColorChanInfo mColorChanInfo; }; @@ -544,6 +552,10 @@ public: /* 802EB424 */ void setGX(); /* 802EB0F4 */ virtual ~J2DColorBlock(); + + JUtility::TColor* getMatColor(u32 i) { return &mMatColor[i]; } + J2DColorChan* getColorChan(u32 i) { return &mColorChan[i]; } + void setCullMode(u8 mode) { mCullMode = mode; } }; #endif /* J2DMATBLOCK_H */ diff --git a/include/JSystem/J2DGraph/J2DMaterial.h b/include/JSystem/J2DGraph/J2DMaterial.h index ebea34bec8..e30143379f 100644 --- a/include/JSystem/J2DGraph/J2DMaterial.h +++ b/include/JSystem/J2DGraph/J2DMaterial.h @@ -41,9 +41,11 @@ public: J2DPEBlock* getPEBlock() { return &mPEBlock; } J2DTevBlock* getTevBlock() { return mTevBlock; } J2DIndBlock* getIndBlock() { return mIndBlock; } + bool isVisible() const { return mVisible; } + int getMaterialAlphaCalc() const { return mMaterialAlphaCalc; } -private: - /* 0x04 */ int field_0x4; +// private: + /* 0x04 */ void* field_0x4; /* 0x08 */ int field_0x8; /* 0x0C */ u16 mIndex; /* 0x0E */ bool mVisible; diff --git a/include/JSystem/J2DGraph/J2DPane.h b/include/JSystem/J2DGraph/J2DPane.h index 6653617fc8..04cbb143cd 100644 --- a/include/JSystem/J2DGraph/J2DPane.h +++ b/include/JSystem/J2DGraph/J2DPane.h @@ -23,48 +23,78 @@ enum J2DRotateAxis { enum J2DBasePosition {}; +struct J2DPaneHeader { + /* 0x0 */ u32 mKind; + /* 0x4 */ u32 mSize; +}; + class J2DPane { public: J2DPane(); J2DPane(J2DPane*, bool, u64, const JGeometry::TBox2<f32>&); J2DPane(u64, const JGeometry::TBox2<f32>&); J2DPane(J2DPane* other, JSURandomInputStream* stream, u8 arg3); + void initiate(); + void initialize(J2DPane*, bool, u64, const JGeometry::TBox2<f32>&); + void initialize(u64 tag, const JGeometry::TBox2<f32>& dim); + void makePaneStream(J2DPane* other, JSURandomInputStream* stream); + void changeUseTrans(J2DPane* other); + bool appendChild(J2DPane* child); + bool insertChild(J2DPane* before, J2DPane* child); + void draw(f32 a1, f32 a2, const J2DGrafContext* ctx, bool a4, bool a5); + void place(const JGeometry::TBox2<f32>& dim); + JGeometry::TBox2<f32>& getBounds(); + void rotate(f32 offsetX, f32 offsetY, J2DRotateAxis axis, f32 angle); + void rotate(f32 angle); + void clip(const JGeometry::TBox2<f32>& bounds); + void setBasePosition(J2DBasePosition position); + void setInfluencedAlpha(bool arg1, bool arg2); + JGeometry::TVec3<f32> getGlbVtx(u8 arg1) const; + J2DPane* getFirstChildPane(); + J2DPane* getNextChildPane(); + J2DPane* getParentPane(); + void makePaneExStream(J2DPane* other, JSURandomInputStream* stream); + void* getPointer(JSURandomInputStream* stream, u32 size, JKRArchive* archive); + void animationTransform(); + void updateTransform(const J2DAnmTransform* transform); + virtual ~J2DPane(); - /* 0x0c */ virtual s32 getTypeID() const { return 16; } - /* 0x10 */ virtual void move(f32 x, f32 y); - /* 0x14 */ virtual void add(f32 x, f32 y); - /* 0x18 */ virtual void resize(f32 x, f32 y); - /* 0x1c */ virtual void setCullBack(bool cull); - /* 0x20 */ virtual void setCullBack(_GXCullMode cmode); - /* 0x24 */ virtual void setAlpha(u8); - /* 0x28 */ virtual bool setConnectParent(bool connected); - /* 0x2c */ virtual void calcMtx(); - /* 0x30 */ virtual void update(); - /* 0x34 */ virtual void drawSelf(f32 arg1, f32 arg2); - /* 0x38 */ virtual void drawSelf(f32 arg1, f32 arg2, Mtx* mtx); - /* 0x3c */ virtual J2DPane* search(u64 tag); - /* 0x40 */ virtual J2DPane* searchUserInfo(u64 tag); - /* 0x44 */ virtual void makeMatrix(f32, f32); - /* 0x48 */ virtual void makeMatrix(f32 a, f32 b, f32 c, f32 d); - /* 0x4c */ virtual bool isUsed(const ResTIMG* timg); - /* 0x50 */ virtual bool isUsed(const ResFONT* font); - /* 0x54 */ virtual void clearAnmTransform(); - /* 0x58 */ virtual void rewriteAlpha(); - /* 0x5c */ virtual void setAnimation(J2DAnmBase* anm); - /* 0x60 */ virtual void setAnimation(J2DAnmTransform* anm); - /* 0x64 */ virtual void setAnimation(J2DAnmColor* anm) {} - /* 0x68 */ virtual void setAnimation(J2DAnmTexPattern* anm) {} - /* 0x6c */ virtual void setAnimation(J2DAnmTextureSRTKey* anm) {} - /* 0x70 */ virtual void setAnimation(J2DAnmTevRegKey* anm) {} - /* 0x74 */ virtual void setAnimation(J2DAnmVisibilityFull* anm) {} - /* 0x78 */ virtual void setAnimation(J2DAnmVtxColor* anm) {} - /* 0x7c */ virtual const J2DAnmTransform* animationTransform(const J2DAnmTransform* transform); - /* 0x80 */ virtual void setVisibileAnimation(J2DAnmVisibilityFull* visibility); - /* 0x84 */ virtual void setAnimationVF(J2DAnmVisibilityFull* visibility); - /* 0x88 */ virtual void setVtxColorAnimation(J2DAnmVtxColor* vtx_color); - /* 0x8c */ virtual void setAnimationVC(J2DAnmVtxColor* vtx_color); - /* 0x90 */ virtual const J2DAnmTransform* animationPane(const J2DAnmTransform* transform); + /* vt 0x0C */ virtual s32 getTypeID() const { return 16; } + /* vt 0x10 */ virtual void move(f32 x, f32 y); + /* vt 0x14 */ virtual void add(f32 x, f32 y); + /* vt 0x18 */ virtual void resize(f32 x, f32 y); + /* vt 0x1C */ virtual void setCullBack(bool cull); + /* vt 0x20 */ virtual void setCullBack(_GXCullMode cmode); + /* vt 0x24 */ virtual void setAlpha(u8); + /* vt 0x28 */ virtual bool setConnectParent(bool connected); + /* vt 0x2C */ virtual void calcMtx(); + /* vt 0x30 */ virtual void update(); + /* vt 0x34 */ virtual void drawSelf(f32 arg1, f32 arg2); + /* vt 0x38 */ virtual void drawSelf(f32 arg1, f32 arg2, Mtx* mtx); + /* vt 0x3C */ virtual J2DPane* search(u64 tag); + /* vt 0x40 */ virtual J2DPane* searchUserInfo(u64 tag); + /* vt 0x44 */ virtual void makeMatrix(f32, f32); + /* vt 0x48 */ virtual void makeMatrix(f32 a, f32 b, f32 c, f32 d); + /* vt 0x4C */ virtual bool isUsed(const ResTIMG* timg); + /* vt 0x50 */ virtual bool isUsed(const ResFONT* font); + /* vt 0x54 */ virtual void clearAnmTransform(); + /* vt 0x58 */ virtual void rewriteAlpha(); + /* vt 0x5C */ virtual void setAnimation(J2DAnmBase* anm); + /* vt 0x60 */ virtual void setAnimation(J2DAnmTransform* anm); + /* vt 0x64 */ virtual void setAnimation(J2DAnmColor* anm) {} + /* vt 0x68 */ virtual void setAnimation(J2DAnmTexPattern* anm) {} + /* vt 0x6C */ virtual void setAnimation(J2DAnmTextureSRTKey* anm) {} + /* vt 0x70 */ virtual void setAnimation(J2DAnmTevRegKey* anm) {} + /* vt 0x74 */ virtual void setAnimation(J2DAnmVisibilityFull* anm) {} + /* vt 0x78 */ virtual void setAnimation(J2DAnmVtxColor* anm) {} + /* vt 0x7C */ virtual const J2DAnmTransform* + animationTransform(const J2DAnmTransform* transform); + /* vt 0x80 */ virtual void setVisibileAnimation(J2DAnmVisibilityFull* visibility); + /* vt 0x84 */ virtual void setAnimationVF(J2DAnmVisibilityFull* visibility); + /* vt 0x88 */ virtual void setVtxColorAnimation(J2DAnmVtxColor* vtx_color); + /* vt 0x8C */ virtual void setAnimationVC(J2DAnmVtxColor* vtx_color); + /* vt 0x90 */ virtual const J2DAnmTransform* animationPane(const J2DAnmTransform* transform); f32 getHeight() const { return mBounds.getHeight(); } f32 getWidth() const { return mBounds.getWidth(); } @@ -102,47 +132,23 @@ public: calcMtx(); } - int getKind() const { return id; } + int getKind() const { return mKind; } bool isVisible() const { return mVisible; } void show() { mVisible = true; } void hide() { mVisible = false; } - void initiate(); - void initialize(J2DPane*, bool, u64, const JGeometry::TBox2<f32>&); - void initialize(u64 tag, const JGeometry::TBox2<f32>& dim); - void makePaneStream(J2DPane* other, JSURandomInputStream* stream); - void changeUseTrans(J2DPane* other); - bool appendChild(J2DPane* child); - bool insertChild(J2DPane* before, J2DPane* child); - void draw(f32 a1, f32 a2, const J2DGrafContext* ctx, bool a4, bool a5); - void place(const JGeometry::TBox2<f32>& dim); - JGeometry::TBox2<f32>& getBounds(); - void rotate(f32 offsetX, f32 offsetY, J2DRotateAxis axis, f32 angle); - void rotate(f32 angle); - void clip(const JGeometry::TBox2<f32>& bounds); - void setBasePosition(J2DBasePosition position); - void setInfluencedAlpha(bool arg1, bool arg2); - JGeometry::TVec3<f32> getGlbVtx(u8 arg1) const; - J2DPane* getFirstChildPane(); - J2DPane* getNextChildPane(); - J2DPane* getParentPane(); - void makePaneExStream(J2DPane* other, JSURandomInputStream* stream); - static s16 J2DCast_F32_to_S16(f32 value, u8 arg2); - void* getPointer(JSURandomInputStream* stream, u32 size, JKRArchive* archive); - void animationTransform(); - void updateTransform(const J2DAnmTransform* transform); void setUserInfo(u64 info) { mUserInfoTag = info; } const Mtx* getMtx() const { return &mPositionMtx; } + static s16 J2DCast_F32_to_S16(f32 value, u8 arg2); + static JGeometry::TBox2<f32> static_mBounds; public: - /* 0x04 */ u16 _4; - /* 0x06 */ u8 _6[2]; - /* 0x08 */ int id; - /* 0x0C */ u8 _c[4]; + /* 0x04 */ u16 field_0x4; + /* 0x08 */ int mKind; /* 0x10 */ u64 mInfoTag; /* 0x18 */ u64 mUserInfoTag; /* 0x20 */ JGeometry::TBox2<f32> mBounds; diff --git a/include/JSystem/J2DGraph/J2DPicture.h b/include/JSystem/J2DGraph/J2DPicture.h index d75a2b2f2e..b28e74fd83 100644 --- a/include/JSystem/J2DGraph/J2DPicture.h +++ b/include/JSystem/J2DGraph/J2DPicture.h @@ -14,6 +14,20 @@ enum J2DBinding { /* 0xF */ BIND15 = 15, // temp, figure out later }; +struct J2DPicHeader { + /* 0x0 */ u32 mTag; + /* 0x4 */ u32 mSize; +}; + +struct J2DScrnBlockPictureParameter { + /* 0x00 */ u16 field_0x0; + /* 0x02 */ u16 mMaterialNum; + /* 0x04 */ u16 field_0x4; + /* 0x04 */ u8 field_0x6[10]; + /* 0x10 */ JGeometry::TVec2<s16> field_0x10[4]; + /* 0x20 */ u32 mCornerColor[4]; +}; // Size: 0x30 + class J2DPicture : public J2DPane { public: /* 802FCFF0 */ virtual ~J2DPicture(); @@ -103,7 +117,7 @@ private: /* 0x109 */ u8 field_0x109; /* 0x10A */ JGeometry::TVec2<s16> field_0x10a[4]; /* 0x11C */ f32 field_0x11c[4]; - /* 0x12C */ JUTPalette* field_0x12c; + /* 0x12C */ JUTPalette* mPalette; /* 0x130 */ JUtility::TColor mWhite; /* 0x134 */ JUtility::TColor mBlack; /* 0x138 */ JUtility::TColor mCornerColor[4]; diff --git a/include/JSystem/J2DGraph/J2DPrint.h b/include/JSystem/J2DGraph/J2DPrint.h index d3a929b176..dfc68a463b 100644 --- a/include/JSystem/J2DGraph/J2DPrint.h +++ b/include/JSystem/J2DGraph/J2DPrint.h @@ -30,6 +30,24 @@ public: /* 802F4420 */ virtual ~J2DPrint(); + void setFontSize(f32 sizeX, f32 sizeY) { + f32 x; + if (sizeX > 0.0f) { + x = sizeX; + } else { + x = 0.0f; + } + mFontSizeX = x; + + f32 y; + if (sizeY > 0.0f) { + y = sizeY; + } else { + y = 0.0f; + } + mFontSizeY = y; + } + static const u8* mStrBuff; static size_t mStrBuffSize; diff --git a/include/JSystem/J2DGraph/J2DTevs.h b/include/JSystem/J2DGraph/J2DTevs.h index e5a18e9c1e..087e9d5396 100644 --- a/include/JSystem/J2DGraph/J2DTevs.h +++ b/include/JSystem/J2DGraph/J2DTevs.h @@ -112,6 +112,24 @@ private: GXIndTexAlphaSel getAlphaSel() const { return (GXIndTexAlphaSel)((mFlags >> 22) & 0x03); } }; +struct J2DIndTevStageInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; + /* 0x4 */ u8 field_0x4; + /* 0x5 */ u8 field_0x5; + /* 0x6 */ u8 field_0x6; + /* 0x7 */ u8 field_0x7; + /* 0x8 */ int field_0x8; +}; + +inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) { + return (info.field_0x8 << 22) | (info.field_0x7 << 21) | (info.field_0x6 << 20) | + (info.field_0x3 << 16) | (info.field_0x5 << 11) | (info.field_0x4 << 8) | + (info.field_0x2 << 4) | (info.field_0x1 << 2) | info.field_0x0; +} + struct J2DTexCoordInfo { /* 0x0 */ u8 mTexGenType; /* 0x1 */ u8 mTexGenSrc; @@ -137,8 +155,12 @@ class J2DTevOrder { public: /* 802F1B70 */ J2DTevOrder(); -private: + GXChannelID getColor() const { return (GXChannelID)mTevOrderInfo.mColor; } + GXTexMapID getTexMap() const { return (GXTexMapID)mTevOrderInfo.mTexMap; } + GXTexCoordID getTexCoord() const { return (GXTexCoordID)mTevOrderInfo.mTexCoord; } + /* 0x0 */ J2DTevOrderInfo mTevOrderInfo; + /* 0x4 */ u8 field_0x4; }; struct J2DTevStageInfo { @@ -163,12 +185,41 @@ struct J2DTevStageInfo { /* 0x12 */ u8 field_0x12; }; +struct J2DTevSwapModeInfo { + /* 0x0 */ u8 field_0x0; + /* 0x1 */ u8 field_0x1; + /* 0x2 */ u8 field_0x2; + /* 0x3 */ u8 field_0x3; +}; + class J2DTevStage { public: /* 802F4110 */ J2DTevStage(J2DTevStageInfo const&); /* 802F1940 */ J2DTevStage(); /* 802F19A8 */ void setTevStageInfo(J2DTevStageInfo const&); + void setTevSwapModeInfo(const J2DTevSwapModeInfo& swapInfo) { + setTexSel(swapInfo.field_0x1); + setRasSel(swapInfo.field_0x0); + } + + void setTexSel(u8 param_0) { + field_0x7 = (field_0x7 & ~12) | (param_0 * 4); + } + + void setRasSel(u8 param_0) { + field_0x7 = (field_0x7 & ~3) | param_0; + } + + void operator=(J2DTevStage const& other) { + field_0x1 = other.field_0x1; + field_0x2 = other.field_0x2; + field_0x3 = other.field_0x3; + field_0x5 = other.field_0x5; + field_0x6 = other.field_0x6; + field_0x7 = other.field_0x7; + } + private: /* 0x0 */ u8 field_0x0; /* 0x1 */ u8 field_0x1; @@ -180,13 +231,6 @@ private: /* 0x7 */ u8 field_0x7; }; -struct J2DTevSwapModeInfo { - /* 0x0 */ u8 mR; - /* 0x1 */ u8 mG; - /* 0x2 */ u8 mB; - /* 0x3 */ u8 mA; -}; - class J2DTevSwapModeTable { public: /* 802F1934 */ J2DTevSwapModeTable(); diff --git a/include/JSystem/J2DGraph/J2DTextBox.h b/include/JSystem/J2DGraph/J2DTextBox.h index 6535cfc1eb..67d1d663d3 100644 --- a/include/JSystem/J2DGraph/J2DTextBox.h +++ b/include/JSystem/J2DGraph/J2DTextBox.h @@ -17,6 +17,29 @@ enum J2DTextBoxHBinding { /* 0x2 */ HBIND_LEFT }; +struct J2DTbxBlockHeader { + /* 0x00 */ u32 mTag; + /* 0x04 */ s32 mSize; +}; + +struct J2DTextBoxInfo { + /* 0x00 */ u16 field_0x0; + /* 0x02 */ u16 field_0x2; + /* 0x04 */ u16 mMaterialNum; + /* 0x06 */ s16 mCharSpace; + /* 0x08 */ s16 mLineSpace; + /* 0x0A */ u16 mFontSizeX; + /* 0x0C */ u16 mFontSizeY; + /* 0x0E */ u8 mHBind; + /* 0x0F */ u8 mVBind; + /* 0x10 */ u32 mCharColor; + /* 0x14 */ u32 mGradColor; + /* 0x18 */ u8 mConnected; + /* 0x19 */ char field_0x19[3]; + /* 0x1C */ u16 field_0x1c; + /* 0x1E */ u16 field_0x1e; +}; // Size: 0x20 + class J2DTextBox : public J2DPane { public: struct TFontSize { @@ -33,13 +56,13 @@ public: /* 80300C70 */ virtual bool isUsed(ResTIMG const*); /* 80300BFC */ virtual bool isUsed(ResFONT const*); /* 80300C90 */ virtual void rewriteAlpha(); - /* 80300490 */ virtual void draw(f32, f32, f32, J2DTextBoxHBinding); /* 803002E8 */ virtual void draw(f32, f32); + /* 80300490 */ virtual void draw(f32, f32, f32, J2DTextBoxHBinding); /* 80300278 */ virtual void setFont(JUTFont*); /* 8021C7F4 */ virtual JUTFont* getFont() const; /* 80254408 */ virtual bool setBlack(JUtility::TColor); - /* 80186C84 */ virtual void setWhite(JUtility::TColor); - /* 8019230C */ virtual void setBlackWhite(JUtility::TColor, JUtility::TColor); + /* 80186C84 */ virtual bool setWhite(JUtility::TColor); + /* 8019230C */ virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor); /* 801DFA34 */ virtual JUtility::TColor getBlack() const; /* 801DFA28 */ virtual JUtility::TColor getWhite() const; /* 8025602C */ virtual bool getMaterial() const; @@ -63,7 +86,7 @@ public: } else { x = 0.0f; } - field_0x11c = x; + mFontSizeX = x; f32 y; if (sizeY > 0.0f) { @@ -71,13 +94,13 @@ public: } else { y = 0.0f; } - field_0x120 = y; + mFontSizeY = y; } void setFontSize(TFontSize size) { setFontSize(size.mSizeX, size.mSizeY); } void getFontSize(TFontSize& size) const { - size.mSizeX = field_0x11c; - size.mSizeY = field_0x120; + size.mSizeX = mFontSizeX; + size.mSizeY = mFontSizeY; } void setCharSpace(f32 space) { mCharSpacing = space; } @@ -85,7 +108,15 @@ public: void setLineSpace(f32 space) { mLineSpacing = space; } f32 getLineSpace() const { return mLineSpacing; } -private: + J2DTextBoxVBinding getVBinding() const { + return (J2DTextBoxVBinding)(mFlags & 3); + } + + J2DTextBoxHBinding getHBinding() const { + return (J2DTextBoxHBinding)((mFlags >> 2) & 3); + } + +// private: /* 0x0100 */ JUTFont* mFont; /* 0x0104 */ JUtility::TColor mCharColor; /* 0x0108 */ JUtility::TColor mGradientColor; @@ -93,14 +124,15 @@ private: /* 0x0110 */ f32 field_0x110; /* 0x0114 */ f32 mCharSpacing; /* 0x0118 */ f32 mLineSpacing; - /* 0x011C */ f32 field_0x11c; - /* 0x0120 */ f32 field_0x120; + /* 0x011C */ f32 mFontSizeX; + /* 0x0120 */ f32 mFontSizeY; /* 0x0124 */ char* mStringPtr; /* 0x0128 */ JUtility::TColor mWhiteColor; /* 0x012C */ JUtility::TColor mBlackColor; /* 0x0130 */ u8 mFlags; /* 0x0131 */ bool mTextFontOwned; /* 0x0132 */ s16 mStringLength; -}; + /* 0x0134 */ u8 field_0x134[4]; +}; // Size: 0x138 #endif /* J2DTEXTBOX_H */ diff --git a/include/JSystem/J2DGraph/J2DTextBoxEx.h b/include/JSystem/J2DGraph/J2DTextBoxEx.h index d9b8a725a1..98f6c44c10 100644 --- a/include/JSystem/J2DGraph/J2DTextBoxEx.h +++ b/include/JSystem/J2DGraph/J2DTextBoxEx.h @@ -8,22 +8,26 @@ class J2DTextBoxEx : public J2DTextBox { public: - enum stage_enum {}; + enum stage_enum { + STAGE_0, + STAGE_1, + STAGE_2, + }; /* 803071E4 */ J2DTextBoxEx(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*); /* 80307E0C */ void setTevOrder(bool); /* 80307EF0 */ void setTevStage(bool); /* 80307F94 */ void setStage(J2DTevStage*, J2DTextBoxEx::stage_enum); - /* 803084CC */ void getBlackWhite(JUtility::TColor*, JUtility::TColor*) const; - /* 80308668 */ void isSetBlackWhite(JUtility::TColor, JUtility::TColor) const; + /* 803084CC */ bool getBlackWhite(JUtility::TColor*, JUtility::TColor*) const; + /* 80308668 */ bool isSetBlackWhite(JUtility::TColor, JUtility::TColor) const; /* 8030751C */ virtual ~J2DTextBoxEx(); /* 803089EC */ virtual void setCullBack(bool); /* 803087DC */ virtual void setCullBack(_GXCullMode); /* 803087BC */ virtual void setAlpha(u8); /* 803075AC */ virtual void drawSelf(f32, f32, f32 (*)[3][4]); - /* 80308A28 */ virtual void isUsed(ResTIMG const*); - /* 80308828 */ virtual void isUsed(ResFONT const*); + /* 80308A28 */ virtual bool isUsed(ResTIMG const*); + /* 80308828 */ virtual bool isUsed(ResFONT const*); /* 80308810 */ virtual void rewriteAlpha(); /* 80308A4C */ virtual void setAnimation(J2DAnmBase*); /* 80256044 */ virtual void setAnimation(J2DAnmTransform*); @@ -33,24 +37,24 @@ public: /* 80308938 */ virtual void setAnimation(J2DAnmTevRegKey*); /* 80308964 */ virtual void setAnimation(J2DAnmVisibilityFull*); /* 80308A48 */ virtual void setAnimation(J2DAnmVtxColor*); - /* 8030896C */ virtual void animationPane(J2DAnmTransform const*); + /* 8030896C */ virtual const J2DAnmTransform* animationPane(J2DAnmTransform const*); /* 803078AC */ virtual void draw(f32, f32); /* 80307AF0 */ virtual void draw(f32, f32, f32, J2DTextBoxHBinding); /* 80307D5C */ virtual void setFont(JUTFont*); /* 80307DC0 */ virtual JUTFont* getFont() const; - /* 8030823C */ virtual void setBlack(JUtility::TColor); - /* 803082C4 */ virtual void setWhite(JUtility::TColor); - /* 8030834C */ virtual void setBlackWhite(JUtility::TColor, JUtility::TColor); - /* 803086FC */ virtual void getBlack() const; - /* 8030875C */ virtual void getWhite() const; - /* 80256024 */ virtual void getMaterial() const; + /* 8030823C */ virtual bool setBlack(JUtility::TColor); + /* 803082C4 */ virtual bool setWhite(JUtility::TColor); + /* 8030834C */ virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor); + /* 803086FC */ virtual JUtility::TColor getBlack() const; + /* 8030875C */ virtual JUtility::TColor getWhite() const; + /* 80256024 */ virtual bool getMaterial() const; private: - /* 0x134 */ u8 field_0x134[4]; /* 0x138 */ J2DMaterial* mMaterial; /* 0x13C */ u16 field_0x13c; /* 0x13E */ u16 field_0x13e; /* 0x140 */ u8 field_0x140; -}; // Size: 0x144 + /* 0x144 */ J2DAnmVisibilityFull* mVisibilityAnm; +}; // Size: 0x148 #endif /* J2DTEXTBOXEX_H */ diff --git a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h index 86d0af9720..38cc0e08c2 100644 --- a/include/JSystem/J3DGraphBase/J3DDrawBuffer.h +++ b/include/JSystem/J3DGraphBase/J3DDrawBuffer.h @@ -32,17 +32,19 @@ public: void drawTail() const; inline void calcZRatio(); + void setNonSort() { mSortType = 5; } + void setZSort() { mSortType = 2; } public: - J3DPacket** mpBuf; - u32 mBufSize; - u32 mDrawType; - u32 mSortType; - float mZNear; - float mZFar; - float mZRatio; - Mtx* mpZMtx; - J3DPacket* mpCallBackPacket; + /* 0x00 */ J3DPacket** mpBuf; + /* 0x04 */ u32 mBufSize; + /* 0x08 */ u32 mDrawType; + /* 0x0C */ u32 mSortType; + /* 0x10 */ f32 mZNear; + /* 0x14 */ f32 mZFar; + /* 0x18 */ f32 mZRatio; + /* 0x1C */ Mtx* mpZMtx; + /* 0x20 */ J3DPacket* mpCallBackPacket; static u8 sortFuncTable[72]; static u8 drawFuncTable[24]; diff --git a/include/JSystem/JAudio2/JAISoundStarter.h b/include/JSystem/JAudio2/JAISoundStarter.h index 040d144f90..d891a8b416 100644 --- a/include/JSystem/JAudio2/JAISoundStarter.h +++ b/include/JSystem/JAudio2/JAISoundStarter.h @@ -2,5 +2,13 @@ #define JAISOUNDSTARTER_H #include "dolphin/types.h" +#include "JSystem/JAudio2/JAISound.h" + +struct JAISoundStarter { + /* 802A2F6C */ JAISoundStarter(bool); + /* 802A2FEC */ void startLevelSound(JAISoundID, JAISoundHandle*, JGeometry::TVec3<f32> const*); + + virtual ~JAISoundStarter(); +}; #endif /* JAISOUNDSTARTER_H */ diff --git a/include/JSystem/JGadget/binary.h b/include/JSystem/JGadget/binary.h index abbe3f7995..ebb0f87299 100644 --- a/include/JSystem/JGadget/binary.h +++ b/include/JSystem/JGadget/binary.h @@ -23,7 +23,7 @@ struct TParseData { const void* getRaw() const { return raw; } void setRaw(const void* p) { raw = p; } - const void* raw; + /* 0x0 */ const void* raw; }; template <int T> @@ -46,6 +46,10 @@ struct TParse_header_block { virtual bool parseBlock_next(const void** ppData_inout, u32* puData_out, u32 arg2) = 0; bool parse_next(const void** ppData_inout, u32 a2); + + bool parse(const void* ppData_inout, u32 a2) { + return parse_next(&ppData_inout, a2); + } }; } // namespace binary diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h index f1f92f4fe1..d8be365b23 100644 --- a/include/JSystem/JGadget/linklist.h +++ b/include/JSystem/JGadget/linklist.h @@ -10,9 +10,9 @@ struct TLinkListNode { mPrev = NULL; } - TLinkListNode* mNext; - TLinkListNode* mPrev; -}; + /* 0x0 */ TLinkListNode* mNext; + /* 0x4 */ TLinkListNode* mPrev; +}; // Size: 0x8 struct TNodeLinkList { struct iterator { diff --git a/include/JSystem/JKernel/JKRExpHeap.h b/include/JSystem/JKernel/JKRExpHeap.h index 8ee16b87f0..d0ae61b76e 100644 --- a/include/JSystem/JKernel/JKRExpHeap.h +++ b/include/JSystem/JKernel/JKRExpHeap.h @@ -10,11 +10,13 @@ public: friend class JKRExpHeap; public: - void initiate(CMemBlock*, CMemBlock*, u32, u8, u8); - JKRExpHeap::CMemBlock* allocFore(u32, u8, u8, u8, u8); - JKRExpHeap::CMemBlock* allocBack(u32, u8, u8, u8, u8); - int free(JKRExpHeap*); - static CMemBlock* getHeapBlock(void*); + void initiate(CMemBlock* prev, CMemBlock* next, u32 size, u8 groupId, u8 alignment); + JKRExpHeap::CMemBlock* allocFore(u32 size, u8 groupId1, u8 alignment1, u8 groupId2, + u8 alignment2); + JKRExpHeap::CMemBlock* allocBack(u32 size, u8 groupId1, u8 alignment1, u8 groupId2, + u8 alignment2); + int free(JKRExpHeap* heap); + static CMemBlock* getHeapBlock(void* ptr); void newGroupId(u8 groupId) { this->mGroupId = groupId; } bool isValid() const { return this->mMagic == 'HM'; } @@ -38,46 +40,46 @@ public: friend class CMemBlock; protected: - JKRExpHeap(void*, u32, JKRHeap*, bool); + JKRExpHeap(void* data, u32 size, JKRHeap* parent, bool errorFlag); virtual ~JKRExpHeap(); - void* allocFromHead(u32, int); - void* allocFromHead(u32); - void* allocFromTail(u32, int); - void* allocFromTail(u32); - void appendUsedList(CMemBlock*); - void setFreeBlock(CMemBlock*, CMemBlock*, CMemBlock*); - void removeFreeBlock(CMemBlock*); - void removeUsedBlock(CMemBlock*); - void recycleFreeBlock(CMemBlock*); - void joinTwoBlocks(CMemBlock*); + void* allocFromHead(u32 size, int align); + void* allocFromHead(u32 size); + void* allocFromTail(u32 size, int align); + void* allocFromTail(u32 size); + void appendUsedList(CMemBlock* newblock); + void setFreeBlock(CMemBlock* block, CMemBlock* prev, CMemBlock* next); + void removeFreeBlock(CMemBlock* block); + void removeUsedBlock(CMemBlock* block); + void recycleFreeBlock(CMemBlock* block); + void joinTwoBlocks(CMemBlock* block); public: - s32 getUsedSize(u8) const; + s32 getUsedSize(u8 groupId) const; s32 getTotalUsedSize(void) const; CMemBlock* getHeadUsedList() const { return mHeadUsedList; } public: - /* vt[04] */ virtual u32 getHeapType(); /* override */ - /* vt[05] */ virtual bool check(); /* override */ - /* vt[06] */ virtual bool dump_sort(); /* override */ - /* vt[07] */ virtual bool dump(); /* override */ - /* vt[08] */ virtual void do_destroy(); /* override */ - /* vt[09] */ virtual void* do_alloc(u32 size, int alignment); /* override */ - /* vt[10] */ virtual void do_free(void* ptr); /* override */ - /* vt[11] */ virtual void do_freeAll(); /* override */ - /* vt[12] */ virtual void do_freeTail(); /* override */ - /* vt[13] */ virtual void do_fillFreeArea(); /* override */ - /* vt[14] */ virtual s32 do_resize(void* ptr, u32 size); /* override */ - /* vt[15] */ virtual s32 do_getSize(void* ptr); /* override */ - /* vt[16] */ virtual s32 do_getFreeSize(); /* override */ - /* vt[17] */ virtual void* do_getMaxFreeBlock(); /* override */ - /* vt[18] */ virtual s32 do_getTotalFreeSize(); /* override */ - /* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID); /* override */ - /* vt[20] */ virtual u8 do_getCurrentGroupId(); /* override */ - /* vt[21] */ virtual void state_register(JKRHeap::TState*, u32) const; /* override */ - /* vt[22] */ virtual bool state_compare(JKRHeap::TState const&, - JKRHeap::TState const&) const; /* override */ + /* vt[04] */ virtual u32 getHeapType(); /* override */ + /* vt[05] */ virtual bool check(); /* override */ + /* vt[06] */ virtual bool dump_sort(); /* override */ + /* vt[07] */ virtual bool dump(); /* override */ + /* vt[08] */ virtual void do_destroy(); /* override */ + /* vt[09] */ virtual void* do_alloc(u32 size, int alignment); /* override */ + /* vt[10] */ virtual void do_free(void* ptr); /* override */ + /* vt[11] */ virtual void do_freeAll(); /* override */ + /* vt[12] */ virtual void do_freeTail(); /* override */ + /* vt[13] */ virtual void do_fillFreeArea(); /* override */ + /* vt[14] */ virtual s32 do_resize(void* ptr, u32 size); /* override */ + /* vt[15] */ virtual s32 do_getSize(void* ptr); /* override */ + /* vt[16] */ virtual s32 do_getFreeSize(); /* override */ + /* vt[17] */ virtual void* do_getMaxFreeBlock(); /* override */ + /* vt[18] */ virtual s32 do_getTotalFreeSize(); /* override */ + /* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID); /* override */ + /* vt[20] */ virtual u8 do_getCurrentGroupId(); /* override */ + /* vt[21] */ virtual void state_register(JKRHeap::TState* p, u32 id) const; /* override */ + /* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1, + JKRHeap::TState const& r2) const; /* override */ u8 field_0x6c; u8 mCurrentGroupId; @@ -92,9 +94,9 @@ private: CMemBlock* mTailUsedList; public: - static JKRExpHeap* createRoot(int, bool); - static JKRExpHeap* create(u32, JKRHeap*, bool); - static JKRExpHeap* create(void*, u32, JKRHeap*, bool); + static JKRExpHeap* createRoot(int maxHeaps, bool errorFlag); + static JKRExpHeap* create(u32 size, JKRHeap* parent, bool errorFlag); + static JKRExpHeap* create(void* ptr, u32 size, JKRHeap* parent, bool errorFlag); }; inline JKRExpHeap* JKRCreateExpHeap(u32 size, JKRHeap* parent, bool errorFlag) { diff --git a/include/JSystem/JKernel/JKRHeap.h b/include/JSystem/JKernel/JKRHeap.h index bd12375650..38aba619a0 100644 --- a/include/JSystem/JKernel/JKRHeap.h +++ b/include/JSystem/JKernel/JKRHeap.h @@ -29,7 +29,7 @@ public: }; public: - JKRHeap(void*, u32, JKRHeap*, bool); + JKRHeap(void* data, u32 size, JKRHeap* parent, bool errorFlag); virtual ~JKRHeap(); JKRHeap* becomeSystemHeap(); @@ -77,9 +77,9 @@ public: /* vt[18] */ virtual s32 do_getTotalFreeSize() = 0; /* vt[19] */ virtual s32 do_changeGroupID(u8 newGroupID); /* vt[20] */ virtual u8 do_getCurrentGroupId(); - /* vt[21] */ virtual void state_register(JKRHeap::TState*, unsigned long) const; - /* vt[22] */ virtual bool state_compare(JKRHeap::TState const&, JKRHeap::TState const&) const; - /* vt[23] */ virtual void state_dump(JKRHeap::TState const&) const; + /* vt[21] */ virtual void state_register(JKRHeap::TState* p, u32 id) const; + /* vt[22] */ virtual bool state_compare(JKRHeap::TState const& r1, JKRHeap::TState const& r2) const; + /* vt[23] */ virtual void state_dump(JKRHeap::TState const& p) const; void setDebugFill(bool debugFill) { mDebugFill = debugFill; } bool getDebugFill() const { return mDebugFill; } @@ -123,7 +123,7 @@ protected: /* 0x6A */ u8 padding_0x6a[2]; public: - static bool initArena(char**, u32*, int); + static bool initArena(char** memory, u32* size, int maxHeaps); static void* alloc(u32 size, int alignment, JKRHeap* heap); static void free(void* ptr, JKRHeap* heap); static s32 resize(void* ptr, u32 size, JKRHeap* heap); @@ -212,7 +212,7 @@ inline void JKRFreeToSysHeap(void* ptr) { systemHeap->free(ptr); } -inline void JKRFree(void* ptr) { +inline void i_JKRFree(void* ptr) { JKRHeap::free(ptr, NULL); } diff --git a/include/JSystem/JMessage/control.h b/include/JSystem/JMessage/control.h index e695c8c35d..58465c7317 100644 --- a/include/JSystem/JMessage/control.h +++ b/include/JSystem/JMessage/control.h @@ -1,5 +1,5 @@ -#ifndef CONTROL_H -#define CONTROL_H +#ifndef JMESSAGE_CONTROL_H +#define JMESSAGE_CONTROL_H #include "dolphin/types.h" #include "JSystem/JMessage/processor.h" @@ -36,4 +36,4 @@ struct jmessage_tControl : public JMessage::TControl { /* 80039B0C */ virtual ~jmessage_tControl(); }; -#endif /* CONTROL_H */ +#endif /* JMESSAGE_CONTROL_H */ diff --git a/include/JSystem/JMessage/data.h b/include/JSystem/JMessage/data.h index ef1791c89e..57d65a2c6d 100644 --- a/include/JSystem/JMessage/data.h +++ b/include/JSystem/JMessage/data.h @@ -1,5 +1,5 @@ -#ifndef DATA_H -#define DATA_H +#ifndef JMESSAGE_DATA_H +#define JMESSAGE_DATA_H #include "dolphin/types.h" @@ -9,4 +9,4 @@ struct data { }; }; // namespace JMessage -#endif /* DATA_H */ +#endif /* JMESSAGE_DATA_H */ diff --git a/include/JSystem/JMessage/locale.h b/include/JSystem/JMessage/locale.h index eebedb6fd4..984b2a3f52 100644 --- a/include/JSystem/JMessage/locale.h +++ b/include/JSystem/JMessage/locale.h @@ -1,5 +1,5 @@ -#ifndef LOCALE_H -#define LOCALE_H +#ifndef JMESSAGE_LOCALE_H +#define JMESSAGE_LOCALE_H #include "dolphin/types.h" @@ -12,4 +12,4 @@ struct locale { }; }; // namespace JMessage -#endif /* LOCALE_H */ +#endif /* JMESSAGE_LOCALE_H */ diff --git a/include/JSystem/JMessage/processor.h b/include/JSystem/JMessage/processor.h index a4e3cbe14d..c436032734 100644 --- a/include/JSystem/JMessage/processor.h +++ b/include/JSystem/JMessage/processor.h @@ -1,5 +1,5 @@ -#ifndef PROCESSOR_H -#define PROCESSOR_H +#ifndef JMESSAGE_PROCESSOR_H +#define JMESSAGE_PROCESSOR_H #include "SSystem/SComponent/c_xyz.h" #include "dolphin/types.h" @@ -298,4 +298,4 @@ struct jmessage_tRenderingProcessor : public JMessage::TRenderingProcessor { /* 8022D74C */ virtual void do_tag(u32, void const*, u32); }; -#endif /* PROCESSOR_H */ +#endif /* JMESSAGE_PROCESSOR_H */ diff --git a/include/JSystem/JMessage/resource.h b/include/JSystem/JMessage/resource.h index 891075a14d..487f2d26df 100644 --- a/include/JSystem/JMessage/resource.h +++ b/include/JSystem/JMessage/resource.h @@ -1,5 +1,5 @@ -#ifndef RESOURCE_H -#define RESOURCE_H +#ifndef JMESSAGE_RESOURCE_H +#define JMESSAGE_RESOURCE_H #include "dolphin/types.h" #include "JSystem/JGadget/linklist.h" @@ -34,4 +34,4 @@ struct TParse { }; }; // namespace JMessage -#endif /* RESOURCE_H */ +#endif /* JMESSAGE_RESOURCE_H */ diff --git a/include/JSystem/JStage/JSGActor.h b/include/JSystem/JStage/JSGActor.h index 05033d4fb2..ac43705fa6 100644 --- a/include/JSystem/JStage/JSGActor.h +++ b/include/JSystem/JStage/JSGActor.h @@ -2,5 +2,33 @@ #define JSGACTOR_H #include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" + +namespace JStage { + struct TActor : public TObject { + /* 80280A48 */ virtual ~TActor() = 0; + /* 80280AA8 */ virtual s32 JSGFGetType() const; + /* 80280AB0 */ virtual void JSGGetTranslation(Vec*) const; + /* 80280AB4 */ virtual void JSGSetTranslation(Vec const&); + /* 80280AB8 */ virtual void JSGGetScaling(Vec*) const; + /* 80280ABC */ virtual void JSGSetScaling(Vec const&); + /* 80280AC0 */ virtual void JSGGetRotation(Vec*) const; + /* 80280AC4 */ virtual void JSGSetRotation(Vec const&); + /* 80280AC8 */ virtual s32 JSGGetShape() const; + /* 80280AD0 */ virtual void JSGSetShape(u32); + /* 80280AD4 */ virtual s32 JSGGetAnimation() const; + /* 80280ADC */ virtual void JSGSetAnimation(u32); + /* 80280AE0 */ virtual f32 JSGGetAnimationFrame() const; + /* 80280AE8 */ virtual void JSGSetAnimationFrame(f32); + /* 80280AEC */ virtual f32 JSGGetAnimationFrameMax() const; + /* 80280AF4 */ virtual f32 JSGGetAnimationTransition() const; + /* 80280AFC */ virtual void JSGSetAnimationTransition(f32); + /* 80280B00 */ virtual s32 JSGGetTextureAnimation() const; + /* 80280B08 */ virtual void JSGSetTextureAnimation(u32); + /* 80280B0C */ virtual f32 JSGGetTextureAnimationFrame() const; + /* 80280B14 */ virtual void JSGSetTextureAnimationFrame(f32); + /* 80280B18 */ virtual f32 JSGGetTextureAnimationFrameMax() const; + }; +}; #endif /* JSGACTOR_H */ diff --git a/include/JSystem/JStage/JSGAmbientLight.h b/include/JSystem/JStage/JSGAmbientLight.h index fe58fb69c8..7d0d183501 100644 --- a/include/JSystem/JStage/JSGAmbientLight.h +++ b/include/JSystem/JStage/JSGAmbientLight.h @@ -1,6 +1,16 @@ #ifndef JSGAMBIENTLIGHT_H #define JSGAMBIENTLIGHT_H -#include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" +#include "dolphin/gx/GX.h" + +namespace JStage { + struct TAmbientLight : public TObject { + /* 80280B20 */ virtual ~TAmbientLight() = 0; + /* 80280B80 */ virtual s32 JSGFGetType() const; + /* 80280B88 */ virtual GXColor JSGGetColor() const; + /* 80280B9C */ virtual void JSGSetColor(GXColor); + }; +}; #endif /* JSGAMBIENTLIGHT_H */ diff --git a/include/JSystem/JStage/JSGCamera.h b/include/JSystem/JStage/JSGCamera.h index 0e928ba95a..bc8d6880b5 100644 --- a/include/JSystem/JStage/JSGCamera.h +++ b/include/JSystem/JStage/JSGCamera.h @@ -1,6 +1,39 @@ #ifndef JSGCAMERA_H #define JSGCAMERA_H -#include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" + +namespace JStage { + struct TECameraProjection {}; + + struct TECameraView {}; + + struct TCamera : public TObject { + /* 80280BA0 */ virtual ~TCamera() = 0; + /* 80280C00 */ virtual s32 JSGFGetType() const; + /* 80280C08 */ virtual bool JSGGetProjectionType() const; + /* 80280C10 */ virtual void JSGSetProjectionType(JStage::TECameraProjection); + /* 80280C14 */ virtual f32 JSGGetProjectionNear() const; + /* 80280C1C */ virtual void JSGSetProjectionNear(f32); + /* 80280C20 */ virtual f32 JSGGetProjectionFar() const; + /* 80280C2C */ virtual void JSGSetProjectionFar(f32); + /* 80280C30 */ virtual f32 JSGGetProjectionFovy() const; + /* 80280C38 */ virtual void JSGSetProjectionFovy(f32); + /* 80280C3C */ virtual f32 JSGGetProjectionAspect() const; + /* 80280C44 */ virtual void JSGSetProjectionAspect(f32); + /* 80280C48 */ virtual void JSGGetProjectionField(f32*) const; + /* 80280C4C */ virtual void JSGSetProjectionField(f32 const*); + /* 80280C50 */ virtual bool JSGGetViewType() const; + /* 80280C58 */ virtual void JSGSetViewType(JStage::TECameraView); + /* 80280C5C */ virtual void JSGGetViewPosition(Vec*) const; + /* 80280C60 */ virtual void JSGSetViewPosition(Vec const&); + /* 80280C64 */ virtual void JSGGetViewUpVector(Vec*) const; + /* 80280C68 */ virtual void JSGSetViewUpVector(Vec const&); + /* 80280C6C */ virtual void JSGGetViewTargetPosition(Vec*) const; + /* 80280C70 */ virtual void JSGSetViewTargetPosition(Vec const&); + /* 80280C74 */ virtual f32 JSGGetViewRoll() const; + /* 80280C7C */ virtual void JSGSetViewRoll(f32); + }; +}; #endif /* JSGCAMERA_H */ diff --git a/include/JSystem/JStage/JSGFog.h b/include/JSystem/JStage/JSGFog.h index 99ba5abfc1..beb8f761df 100644 --- a/include/JSystem/JStage/JSGFog.h +++ b/include/JSystem/JStage/JSGFog.h @@ -1,6 +1,22 @@ #ifndef JSGFOG_H #define JSGFOG_H -#include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" +#include "dolphin/gx/GX.h" + +namespace JStage { + struct TFog : public TObject { + /* 80280C80 */ virtual ~TFog() = 0; + /* 80280CE0 */ virtual s32 JSGFGetType() const; + /* 80280CE8 */ virtual bool JSGGetFogFunction() const; + /* 80280CF0 */ virtual void JSGSetFogFunction(GXFogType); + /* 80280CF4 */ virtual f32 JSGGetStartZ() const; + /* 80280CFC */ virtual void JSGSetStartZ(f32); + /* 80280D00 */ virtual f32 JSGGetEndZ() const; + /* 80280D0C */ virtual void JSGSetEndZ(f32); + /* 80280D10 */ virtual GXColor JSGGetColor() const; + /* 80280D24 */ virtual void JSGSetColor(GXColor); + }; +}; #endif /* JSGFOG_H */ diff --git a/include/JSystem/JStage/JSGLight.h b/include/JSystem/JStage/JSGLight.h index 0447776861..7317c8845f 100644 --- a/include/JSystem/JStage/JSGLight.h +++ b/include/JSystem/JStage/JSGLight.h @@ -1,6 +1,28 @@ #ifndef JSGLIGHT_H #define JSGLIGHT_H -#include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" +#include "dolphin/gx/GX.h" + +namespace JStage { + enum TELight {}; + + struct TLight : public TObject { + /* 80280D28 */ virtual ~TLight() = 0; + /* 80280D88 */ virtual s32 JSGFGetType() const; + /* 80280D90 */ virtual bool JSGGetLightType() const; + /* 80280D98 */ virtual void JSGSetLightType(JStage::TELight); + /* 80280DC4 */ virtual void JSGGetPosition(Vec*) const; + /* 80280DC8 */ virtual void JSGSetPosition(Vec const&); + /* 80280D9C */ virtual GXColor JSGGetColor() const; + /* 80280DB0 */ virtual void JSGSetColor(GXColor); + /* 80280DB4 */ virtual void JSGGetDistanceAttenuation(f32*, f32*, GXDistAttnFn*) const; + /* 80280DB8 */ virtual void JSGSetDistanceAttenuation(f32, f32, GXDistAttnFn); + /* 80280DBC */ virtual void JSGGetAngleAttenuation(f32*, GXSpotFn*) const; + /* 80280DC0 */ virtual void JSGSetAngleAttenuation(f32, GXSpotFn); + /* 80280DCC */ virtual void JSGGetDirection(Vec*) const; + /* 80280DD0 */ virtual void JSGSetDirection(Vec const&); + }; +}; #endif /* JSGLIGHT_H */ diff --git a/include/JSystem/JStage/JSGObject.h b/include/JSystem/JStage/JSGObject.h index 2ad83c97c5..06410cf138 100644 --- a/include/JSystem/JStage/JSGObject.h +++ b/include/JSystem/JStage/JSGObject.h @@ -2,5 +2,24 @@ #define JSGOBJECT_H #include "dolphin/types.h" +#include "dolphin/mtx/mtxvec.h" + +namespace JStage { + struct TObject { + /* 80280DD4 */ virtual ~TObject() = 0; + virtual s32 JSGFGetType() const = 0; + /* 80280E1C */ virtual bool JSGGetName() const; + /* 80280E24 */ virtual void JSGUpdate(); + /* 80280E28 */ virtual bool JSGGetFlag() const; + /* 80280E30 */ virtual void JSGSetFlag(u32); + /* 80280E34 */ virtual bool JSGGetData(u32, void*, u32) const; + /* 80280E3C */ virtual void JSGSetData(u32, void const*, u32); + /* 80280E40 */ virtual void JSGGetParent(JStage::TObject**, u32*) const; + /* 80280E44 */ virtual void JSGSetParent(JStage::TObject*, u32); + /* 80280E48 */ virtual void JSGSetRelation(bool, JStage::TObject*, u32); + /* 80280E4C */ virtual s32 JSGFindNodeID(char const*) const; + /* 80280E54 */ virtual int JSGGetNodeTransformation(u32, f32 (*)[4]) const; + }; +}; #endif /* JSGOBJECT_H */ diff --git a/include/JSystem/JStage/JSGSystem.h b/include/JSystem/JStage/JSGSystem.h index be77b80e04..2ced8fb898 100644 --- a/include/JSystem/JStage/JSGSystem.h +++ b/include/JSystem/JStage/JSGSystem.h @@ -2,5 +2,28 @@ #define JSGSYSTEM_H #include "dolphin/types.h" +#include "JSystem/JStage/JSGObject.h" + +namespace JStage { + enum TEObject { + /* 0x0 */ TOBJ_ACTOR_UNK, + /* 0x1 */ TOBJ_UNK1, + /* 0x2 */ TOBJ_ACTOR, + /* 0x3 */ TOBJ_CAMERA, + /* 0x4 */ TOBJ_AMBIENT, + /* 0x5 */ TOBJ_LIGHT, + /* 0x6 */ TOBJ_FOG, + }; + + struct TSystem : public TObject { + /* 80280E90 */ virtual ~TSystem() = 0; + /* 80280EF0 */ virtual s32 JSGFGetType() const; + /* 80280EF8 */ virtual bool JSGFindObject(JStage::TObject**, char const*, JStage::TEObject) const; + /* 80280F00 */ virtual bool JSGCreateObject(char const*, JStage::TEObject, u32); + /* 80280F08 */ virtual void JSGDestroyObject(JStage::TObject*); + /* 80280F0C */ virtual bool JSGGetSystemData(u32); + /* 80280F14 */ virtual void JSGSetSystemData(u32, u32); + }; +}; #endif /* JSGSYSTEM_H */ diff --git a/include/JSystem/JStudio/JStudio/ctb.h b/include/JSystem/JStudio/JStudio/ctb.h index 26202dcefd..aab0f7681f 100644 --- a/include/JSystem/JStudio/JStudio/ctb.h +++ b/include/JSystem/JStudio/JStudio/ctb.h @@ -2,5 +2,65 @@ #define CTB_H #include "dolphin/types.h" +#include "JSystem/JGadget/binary.h" +#include "JSystem/JGadget/linklist.h" +#include "JSystem/JStudio/JStudio/object-id.h" + +namespace JStudio { +namespace ctb { +struct TObject : public object::TObject_ID { + /* 80280F18 */ virtual ~TObject() = 0; + + /* 0x08 vtable */ + /* 0x0C */ JGadget::TLinkListNode field_0xc; + /* 0x14 */ void* pData_; +}; + +struct data { + struct TParse_TBlock : public JGadget::binary::TParseData_aligned<4> {}; + + static u32 ga4cSignature; +}; + +struct TObject_TxyzRy : public TObject { + /* 80280F60 */ TObject_TxyzRy(JStudio::ctb::data::TParse_TBlock const&); + + /* 80281554 */ virtual ~TObject_TxyzRy(); + /* 80280FBC */ virtual bool getScheme() const; +}; + +struct TFactory { + TFactory() {} + + /* 80281274 */ virtual ~TFactory(); + /* 802812BC */ virtual void create(JStudio::ctb::data::TParse_TBlock const&); + /* 80281320 */ virtual void destroy(JStudio::ctb::TObject*); +}; + +struct TControl { + /* 80280FC4 */ TControl(); + /* 80280FF4 */ virtual ~TControl(); + /* 80281060 */ void appendObject(JStudio::ctb::TObject*); + /* 802810AC */ void removeObject(JStudio::ctb::TObject*); + /* 802810DC */ void destroyObject(JStudio::ctb::TObject*); + /* 8028112C */ void destroyObject_all(); + /* 80281190 */ void getObject(void const*, u32); + /* 80281230 */ void getObject_index(u32); + + /* 0x4 */ TFactory* pFactory_; + /* 0x8 */ JGadget::TLinkList<TObject, 2> mList; +}; + +struct TParse : public JGadget::binary::TParse_header_block { + /* 8028135C */ TParse(JStudio::ctb::TControl*); + /* 8028137C */ virtual ~TParse(); + /* 802813DC */ virtual void parseHeader_next(void const**, u32*, u32); + /* 80281470 */ virtual void parseBlock_next(void const**, u32*, u32); + + /* 0x4 */ TControl* pControl_; +}; + +}; // namespace ctb +}; // namespace JStudio #endif /* CTB_H */ diff --git a/include/JSystem/JStudio/JStudio/fvb-data.h b/include/JSystem/JStudio/JStudio/fvb-data.h index bbc3a5d313..6469a31645 100644 --- a/include/JSystem/JStudio/JStudio/fvb-data.h +++ b/include/JSystem/JStudio/JStudio/fvb-data.h @@ -10,7 +10,7 @@ namespace JStudio { namespace fvb { namespace data { -extern f32 ga4cSignature[1 + 1 /* padding */]; +extern const char ga4cSignature[4]; const int PARAGRAPH_DATA = 1; diff --git a/include/JSystem/JStudio/JStudio/fvb.h b/include/JSystem/JStudio/JStudio/fvb.h index 4303b96c14..59f9951479 100644 --- a/include/JSystem/JStudio/JStudio/fvb.h +++ b/include/JSystem/JStudio/JStudio/fvb.h @@ -49,8 +49,9 @@ private: class TFactory { public: - /* 80284918 */ virtual ~TFactory(); + TFactory() {} + /* 80284918 */ virtual ~TFactory(); /* 80284960 */ virtual TObject* create(JStudio::fvb::data::TParse_TBlock const&); /* 80284AA0 */ virtual void destroy(JStudio::fvb::TObject*); }; @@ -70,9 +71,9 @@ public: TFactory* getFactory() const { return pFactory; } private: - TFactory* pFactory; - JGadget::TLinkList<TObject, 12> ocObject_; -}; + /* 0x4 */ TFactory* pFactory; + /* 0x8 */ JGadget::TLinkList<TObject, 12> ocObject_; +}; // Size: 0x14 class TObject_composite : public TObject { public: diff --git a/include/JSystem/JStudio/JStudio/jstudio-control.h b/include/JSystem/JStudio/JStudio/jstudio-control.h index c5e1db09ed..b2cd99f6b8 100644 --- a/include/JSystem/JStudio/JStudio/jstudio-control.h +++ b/include/JSystem/JStudio/JStudio/jstudio-control.h @@ -1,6 +1,96 @@ #ifndef JSTUDIO_CONTROL_H #define JSTUDIO_CONTROL_H -#include "dolphin/types.h" +#include "JSystem/JGadget/binary.h" +#include "JSystem/JStudio/JStudio/fvb.h" +#include "JSystem/JStudio/JStudio/stb.h" +#include "JSystem/JStudio/JStudio/ctb.h" +#include "dolphin/gx/GX.h" + +namespace JStudio { +struct TCreateObject { + TCreateObject() {} + /* 80285488 */ virtual ~TCreateObject() = 0; + + /* 0x4 */ JGadget::TLinkListNode mNode; +}; // Size: 0xC + +struct TFactory : public stb::TFactory { + TFactory() {} + + /* 802854D0 */ virtual ~TFactory(); + /* 802855AC */ virtual void create(JStudio::stb::data::TParse_TBlock_object const&); + + /* 80285560 */ void appendCreateObject(JStudio::TCreateObject*); + + /* 0x04 */ JGadget::TLinkList<TCreateObject, -4> mList; + /* 0x10 */ fvb::TFactory fvb_Factory; + /* 0x14 */ ctb::TFactory ctb_Factory; +}; + +class TControl : public stb::TControl { +public: + struct TTransform_translation_rotation_scaling {}; + struct TTransform_position {}; + + /* 80285114 */ TControl(); + /* 802851AC */ virtual ~TControl(); + /* 80285228 */ void setFactory(JStudio::TFactory*); + /* 80285250 */ void transformOnSet_setOrigin_TxyzRy(Vec const&, f32); + /* 802852D0 */ void transformOnGet_setOrigin_TxyzRy(Vec const&, f32); + /* 80285368 */ void transform_setOrigin_ctb(JStudio::ctb::TObject const&); + /* 8028543C */ void transform_setOrigin_ctb_index(u32); + + void stb_destroyObject_all() { stb::TControl::destroyObject_all(); } + void fvb_destroyObject_all() { fvb_Control.destroyObject_all(); } + void ctb_destroyObject_all() { ctb_Control.destroyObject_all(); } + + void destroyObject_all() { + stb_destroyObject_all(); + fvb_destroyObject_all(); + ctb_destroyObject_all(); + } + + void transformOnSet_enable(bool param_0) { mTransformOnSet = param_0; } + void transformOnGet_enable(bool param_0) { mTransformOnGet = param_0; } + + void transform_enable(bool param_0) { + transformOnSet_enable(param_0); + transformOnGet_enable(param_0); + } + + void transform_setOrigin_TxyzRy(const Vec& xyz, f32 rotY) { + transformOnSet_setOrigin_TxyzRy(xyz, rotY); + transformOnGet_setOrigin_TxyzRy(xyz, rotY); + } + + void transform_setOrigin(const Vec& xyz, f32 rotY) { + transform_setOrigin_TxyzRy(xyz, rotY); + } + + /* 0x58 */ f64 mSecondPerFrame; + /* 0x60 */ fvb::TControl fvb_Control; + /* 0x74 */ ctb::TControl ctb_Control; + /* 0x88 */ bool mTransformOnSet; + /* 0x89 */ bool mTransformOnGet; + /* 0x8C */ Vec field_0x8c; + /* 0x98 */ Vec field_0x98; + /* 0xA4 */ f32 mTransformOnSet_RotationY; + /* 0xA8 */ u8 field_0xa8[4]; + /* 0xAC */ Mtx mTransformOnSet_Matrix; + /* 0xDC */ Mtx mTransformOnGet_Matrix; +}; + +struct TParse : public stb::TParse { + /* 8028566C */ TParse(JStudio::TControl*); + /* 80285844 */ void parseBlock_block_fvb_(JStudio::stb::data::TParse_TBlock const&, u32); + /* 802858F0 */ void parseBlock_block_ctb_(JStudio::stb::data::TParse_TBlock const&, u32); + + /* 802856A8 */ virtual ~TParse(); + /* 80285708 */ virtual void parseHeader(JStudio::stb::data::TParse_THeader const&, u32); + /* 802857E4 */ virtual void parseBlock_block(JStudio::stb::data::TParse_TBlock const&, u32); +}; + +}; // namespace JStudio #endif /* JSTUDIO_CONTROL_H */ diff --git a/include/JSystem/JStudio/JStudio/jstudio-data.h b/include/JSystem/JStudio/JStudio/jstudio-data.h index 9b7e9a92d8..b9e998e3b9 100644 --- a/include/JSystem/JStudio/JStudio/jstudio-data.h +++ b/include/JSystem/JStudio/JStudio/jstudio-data.h @@ -3,4 +3,10 @@ #include "dolphin/types.h" +namespace JStudio { +namespace data { + extern const char ga8cSignature[8]; +} // namespace data +} // namespace JStudio + #endif /* JSTUDIO_DATA_H */ diff --git a/include/JSystem/JStudio/JStudio/jstudio-math.h b/include/JSystem/JStudio/JStudio/jstudio-math.h index f95dd0ac5f..6dea237a5b 100644 --- a/include/JSystem/JStudio/JStudio/jstudio-math.h +++ b/include/JSystem/JStudio/JStudio/jstudio-math.h @@ -2,5 +2,14 @@ #define JSTUDIO_MATH_H #include "dolphin/types.h" +#include "dolphin/mtx/mtxvec.h" + +namespace JStudio { +namespace math { + /* 802859DC */ void getRotation_xyz(MtxP, f32, f32, f32); + /* 80285B44 */ void getTransformation_SRxyzT(MtxP, Vec const&, Vec const&, Vec const&); + /* 80285BCC */ void getFromTransformation_SRxyzT(Vec*, Vec*, Vec*, CMtxP); +}; +}; // namespace JStudio #endif /* JSTUDIO_MATH_H */ diff --git a/include/JSystem/JStudio/JStudio/jstudio-object.h b/include/JSystem/JStudio/JStudio/jstudio-object.h index 19976cead8..9f78474e13 100644 --- a/include/JSystem/JStudio/JStudio/jstudio-object.h +++ b/include/JSystem/JStudio/JStudio/jstudio-object.h @@ -1,6 +1,237 @@ #ifndef JSTUDIO_OBJECT_H #define JSTUDIO_OBJECT_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio/fvb.h" +#include "JSystem/JStudio/JStudio/stb.h" +#include "JSystem/JStudio/JStudio/ctb.h" +#include "JSystem/JStudio/JStudio/jstudio-control.h" +#include "dolphin/gx/GX.h" + +namespace JStudio { +namespace data { + struct TEOperationData {}; +}; + +struct TAdaptor; +struct TVariableValue { + struct TOutput { + /* 80285E0C */ ~TOutput(); + }; + + struct TOutput_none_ { + /* 80285F6C */ ~TOutput_none_(); + /* 80285FCC */ void operator()(f32, JStudio::TAdaptor*) const; + }; + + /* 80285E54 */ void update(f64, JStudio::TAdaptor*); + /* 80285EB8 */ void update_immediate_(JStudio::TVariableValue*, f64); + /* 80285ECC */ void update_time_(JStudio::TVariableValue*, f64); + /* 80285F08 */ void update_functionValue_(JStudio::TVariableValue*, f64); + /* 8028B568 */ TVariableValue(); + + static u8 soOutput_none_[4 + 4 /* padding */]; + + /* 0x00 */ f32 mValue; + /* 0x04 */ u32 field_0x4; + /* 0x08 */ void (*field_0x8)(TVariableValue*, double); + /* 0x0C */ TFunctionValue* field_0xc; + /* 0x10 */ TOutput* pOutput_; +}; // Size: 0x14 + +class TObject : public stb::TObject { +public: + /* 80286864 */ TObject(JStudio::stb::data::TParse_TBlock_object const&, JStudio::TAdaptor*); + /* 80286734 */ void forward_value(u32); + + /* 802866B0 */ virtual ~TObject() = 0; + /* 8028679C */ virtual void do_begin(); + /* 802867D4 */ virtual void do_end(); + virtual void do_paragraph(u32, void const*, u32) = 0; + /* 8028680C */ virtual void do_wait(u32); + /* 8028682C */ virtual void do_data(void const*, u32, void const*, u32); + + /* 0x34 */ TAdaptor* mpAdaptor; +}; + +struct TAdaptor { + struct TSetVariableValue_immediate {}; + + /* 80285FD0 */ virtual ~TAdaptor() = 0; + /* 80286018 */ virtual void adaptor_do_prepare(); + /* 8028601C */ virtual void adaptor_do_begin(); + /* 80286020 */ virtual void adaptor_do_end(); + /* 80286024 */ virtual void adaptor_do_update(u32); + /* 80286028 */ virtual void adaptor_do_data(void const*, u32, void const*, u32); + + /* 8028602C */ void adaptor_setVariableValue(JStudio::TControl*, u32, + JStudio::data::TEOperationData, void const*, u32); + /* 802860CC */ void adaptor_setVariableValue_n(JStudio::TControl*, u32 const*, u32, + JStudio::data::TEOperationData, void const*, + u32); + /* 802861C0 */ void + adaptor_setVariableValue_immediate(JStudio::TAdaptor::TSetVariableValue_immediate const*); + /* 80286204 */ void adaptor_setVariableValue_Vec(u32 const*, Vec const&); + /* 80286274 */ void adaptor_getVariableValue_Vec(Vec*, u32 const*) const; + /* 802862AC */ void adaptor_setVariableValue_GXColor(u32 const*, GXColor const&); + /* 8028638C */ void adaptor_getVariableValue_GXColor(GXColor*, u32 const*) const; + /* 802864D8 */ void adaptor_updateVariableValue(JStudio::TControl*, u32); + /* 8028656C */ void adaptor_setVariableValue_VOID_(JStudio::TAdaptor*, JStudio::TControl*, u32, + void const*, u32); + /* 80286584 */ void adaptor_setVariableValue_IMMEDIATE_(JStudio::TAdaptor*, JStudio::TControl*, + u32, void const*, u32); + /* 802865B0 */ void adaptor_setVariableValue_TIME_(JStudio::TAdaptor*, JStudio::TControl*, u32, + void const*, u32); + /* 802865DC */ void adaptor_setVariableValue_FVR_NAME_(JStudio::TAdaptor*, JStudio::TControl*, + u32, void const*, u32); + /* 80286648 */ void adaptor_setVariableValue_FVR_INDEX_(JStudio::TAdaptor*, JStudio::TControl*, + u32, void const*, u32); + + /* 0x4 */ TObject* pObject_; + /* 0x8 */ TVariableValue* pValue_; + /* 0xC */ u32 u; +}; + +struct TAdaptor_actor : public TAdaptor { + /* 802868B0 */ virtual ~TAdaptor_actor() = 0; + + /* 0x10 */ TVariableValue mValue[14]; + + static u8 const sauVariableValue_3_TRANSLATION_XYZ[12]; + static u8 const sauVariableValue_3_ROTATION_XYZ[12]; + static u8 const sauVariableValue_3_SCALING_XYZ[12]; +}; // Size: 0x128 + +struct TObject_actor : public TObject { + /* 80286910 */ TObject_actor(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_actor*); + + /* 802881A4 */ virtual ~TObject_actor(); + /* 8028694C */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_ambientLight : public TAdaptor { + /* 80286C9C */ virtual ~TAdaptor_ambientLight() = 0; + + /* 0x10 */ TVariableValue mValue[4]; + + static u8 const sauVariableValue_3_COLOR_RGB[12]; + static u8 const sauVariableValue_4_COLOR_RGBA[16]; +}; + +struct TObject_ambientLight : public TObject { + /* 80286CFC */ TObject_ambientLight(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_ambientLight*); + + /* 80288144 */ virtual ~TObject_ambientLight(); + /* 80286D38 */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_camera : public TAdaptor { + /* 80286E1C */ virtual ~TAdaptor_camera() = 0; + + /* 0x10 */ TVariableValue mValue[12]; + + static u8 const sauVariableValue_3_POSITION_XYZ[12]; + static u8 const sauVariableValue_3_TARGET_POSITION_XYZ[12]; + static u8 sauVariableValue_2_DISTANCE_NEAR_FAR[8]; +}; + +struct TObject_camera : public TObject { + /* 80286E7C */ TObject_camera(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_camera*); + + /* 802880E4 */ virtual ~TObject_camera(); + /* 80286EB8 */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_fog : public TAdaptor { + /* 8028717C */ virtual ~TAdaptor_fog() = 0; + + /* 0x10 */ TVariableValue mValue[6]; + + static u8 const sauVariableValue_3_COLOR_RGB[12]; + static u8 const sauVariableValue_4_COLOR_RGBA[16]; + static u8 sauVariableValue_2_RANGE_BEGIN_END[8]; +}; + +struct TObject_fog : public TObject { + /* 802871DC */ TObject_fog(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_fog*); + + /* 80288084 */ virtual ~TObject_fog(); + /* 80287218 */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_light : public TAdaptor { + /* 80287308 */ virtual ~TAdaptor_light() = 0; + + /* 0x10 */ TVariableValue mValue[13]; + + static u8 const sauVariableValue_3_COLOR_RGB[12]; + static u8 const sauVariableValue_4_COLOR_RGBA[16]; + static u8 const sauVariableValue_3_POSITION_XYZ[12]; + static u8 const sauVariableValue_3_TARGET_POSITION_XYZ[12]; + static u8 sauVariableValue_2_DIRECTION_THETA_PHI[8]; +}; + +struct TObject_light : public TObject { + /* 80287368 */ TObject_light(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_light*); + + /* 80288024 */ virtual ~TObject_light(); + /* 802873A4 */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_message : public TAdaptor { + /* 802875E0 */ virtual ~TAdaptor_message() = 0; +}; + +struct TObject_message : public TObject { + /* 80287640 */ TObject_message(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_message*); + + /* 80287FC4 */ virtual ~TObject_message(); + /* 8028767C */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_particle : public TAdaptor { + /* 8028770C */ virtual ~TAdaptor_particle() = 0; + + /* 0x10 */ TVariableValue mValue[20]; + + static u8 const sauVariableValue_3_TRANSLATION_XYZ[12]; + static u8 const sauVariableValue_3_ROTATION_XYZ[12]; + static u8 const sauVariableValue_3_SCALING_XYZ[12]; + static u8 const sauVariableValue_3_COLOR_RGB[12]; + static u8 const sauVariableValue_4_COLOR_RGBA[16]; + static u8 const sauVariableValue_3_COLOR1_RGB[12]; + static u8 const sauVariableValue_4_COLOR1_RGBA[16]; +}; + +struct TObject_particle : public TObject { + /* 8028776C */ TObject_particle(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_particle*); + + /* 80287F64 */ virtual ~TObject_particle(); + /* 802877A8 */ virtual void do_paragraph(u32, void const*, u32); +}; + +struct TAdaptor_sound : public TAdaptor { + /* 80287B3C */ virtual ~TAdaptor_sound() = 0; + + /* 0x10 */ TVariableValue mValue[13]; + + static u8 const sauVariableValue_3_POSITION_XYZ[12]; +}; // Size: 0x114 + +struct TObject_sound : public TObject { + /* 80287B9C */ TObject_sound(JStudio::stb::data::TParse_TBlock_object const&, + JStudio::TAdaptor_sound*); + + /* 80287F04 */ virtual ~TObject_sound(); + /* 80287BD8 */ virtual void do_paragraph(u32, void const*, u32); +}; + +}; // namespace JStudio #endif /* JSTUDIO_OBJECT_H */ diff --git a/include/JSystem/JStudio/JStudio/object-id.h b/include/JSystem/JStudio/JStudio/object-id.h index 28864fc5dc..7a536762a4 100644 --- a/include/JSystem/JStudio/JStudio/object-id.h +++ b/include/JSystem/JStudio/JStudio/object-id.h @@ -15,8 +15,8 @@ public: /* 80288988 */ void isEqual(JStudio::object::TIDData const&, JStudio::object::TIDData const&); private: - const void* mID; - u32 mID_size; + /* 0x00 */ const void* mID; + /* 0x04 */ u32 mID_size; }; struct TObject_ID : public TIDData { diff --git a/include/JSystem/JStudio/JStudio/stb-data.h b/include/JSystem/JStudio/JStudio/stb-data.h index fde46c96de..178154d70c 100644 --- a/include/JSystem/JStudio/JStudio/stb-data.h +++ b/include/JSystem/JStudio/JStudio/stb-data.h @@ -21,8 +21,8 @@ const int BLOCK_NONE = -1; // Used to expand a signed 24 int to a signed 32 int const u32 gu32Mask_TSequence_value_signExpansion = 0xFF000000; -extern const u32 ga4cSignature; // 'STB/0' -extern const u8 gauDataSize_TEParagraph_data[32]; +extern u32 ga4cSignature; // 'STB/0' +extern const s32 gauDataSize_TEParagraph_data[8]; inline void toString_block(char* a5c, u32 arg1) { // from debug, todo diff --git a/include/JSystem/JStudio/JStudio/stb.h b/include/JSystem/JStudio/JStudio/stb.h index e4e0188cc6..e54ddb4b83 100644 --- a/include/JSystem/JStudio/JStudio/stb.h +++ b/include/JSystem/JStudio/JStudio/stb.h @@ -107,6 +107,8 @@ private: class TFactory { public: + TFactory() {} + /* 802895B4 */ virtual ~TFactory(); /* 802895FC */ virtual TObject* create(data::TParse_TBlock_object const&); /* 80289604 */ virtual void destroy(TObject*); @@ -130,13 +132,15 @@ public: /* 80289300 */ void destroyObject_all(); /* 80289364 */ TObject* getObject(void const*, u32); /* 80289404 */ void reset(); - /* 802894B4 */ void forward(u32); + /* 802894B4 */ u8 forward(u32); void setStatus_(u32 status) { mStatus = status; } void resetStatus_() { setStatus_(0); } bool isSuspended() const { return _54 > 0; } TFactory* getFactory() const { return pFactory; } TObject_control& referObject_control() { return mObject_control; } + int getSuspend() const { return _54; } + void setSuspend(s32 suspend) { mObject_control.setSuspend(suspend); } private: /* 0x04 */ u32 _4; @@ -145,7 +149,7 @@ private: /* 0x10 */ JGadget::TLinkList<TObject, 12> mObjectContainer; /* 0x1C */ u32 mStatus; /* 0x20 */ TObject_control mObject_control; - /* 0x54 */ s32 _54; // "second per frame"? + /* 0x54 */ s32 _54; }; } // namespace stb diff --git a/include/JSystem/JStudio/JStudio_JAudio2/control.h b/include/JSystem/JStudio/JStudio_JAudio2/control.h index 17c271167c..439ac2de19 100644 --- a/include/JSystem/JStudio/JStudio_JAudio2/control.h +++ b/include/JSystem/JStudio/JStudio_JAudio2/control.h @@ -1,6 +1,81 @@ -#ifndef CONTROL_H -#define CONTROL_H +#ifndef JSTUDIO_JAUDIO2_CONTROL_H +#define JSTUDIO_JAUDIO2_CONTROL_H #include "dolphin/types.h" +#include "JSystem/JAudio2/JAISoundHandles.h" +#include "JSystem/JAudio2/JAISoundStarter.h" +#include "JSystem/JStage/JSGSystem.h" +#include "JSystem/JStudio/JStudio/jstudio-object.h" -#endif /* CONTROL_H */ +namespace JStudio_JAudio2 { +struct TCreateObject : public JStudio::TCreateObject { + TCreateObject(JAISoundStarter* p_soundStarter, const JStage::TSystem* p_system) { + pJAISoundStarter_ = p_soundStarter; + pJSGSystem_ = p_system; + mPermit_onExit_notEnd = false; + } + + /* 8028D550 */ virtual ~TCreateObject(); + /* 8028D5B0 */ virtual void create(JStudio::TObject**, + JStudio::stb::data::TParse_TBlock_object const&); + /* 8028D624 */ void createObject_JAI_SOUND_(JStudio::stb::data::TParse_TBlock_object const&, + JStudio_JAudio2::TCreateObject*); + + /* 0x0C */ JAISoundStarter* pJAISoundStarter_; + /* 0x10 */ const JStage::TSystem* pJSGSystem_; + /* 0x14 */ bool mPermit_onExit_notEnd; +}; + +struct TAdaptor_sound : public JStudio::TAdaptor_sound { + struct TVVOSetValue_ { + /* 8028DECC */ void operator()(f32, JStudio::TAdaptor*) const; + /* 8028E094 */ ~TVVOSetValue_(); + }; + + /* 8028D828 */ TAdaptor_sound(JStudio_JAudio2::TCreateObject*); + /* 8028DF04 */ void prepareSound_(); + /* 8028DFA4 */ void beginSound_fadeIn_(); + /* 8028E054 */ void endSound_fadeOut_(u32); + + /* 8028D8F4 */ virtual ~TAdaptor_sound(); + /* 8028D9A4 */ virtual void adaptor_do_prepare(); + /* 8028DA74 */ virtual void adaptor_do_end(); + /* 8028DA78 */ virtual void adaptor_do_update(u32); + /* 8028DC20 */ virtual void adaptor_do_SOUND(JStudio::data::TEOperationData, void const*, u32); + /* 8028DC54 */ virtual void adaptor_do_BEGIN(JStudio::data::TEOperationData, void const*, u32); + /* 8028DC88 */ virtual void adaptor_do_BEGIN_FADE_IN(JStudio::data::TEOperationData, void const*, + u32); + /* 8028DCD0 */ virtual void adaptor_do_END(JStudio::data::TEOperationData, void const*, u32); + /* 8028DD00 */ virtual void adaptor_do_END_FADE_OUT(JStudio::data::TEOperationData, void const*, + u32); + /* 8028DD48 */ virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, void const*, u32); + /* 8028DDB4 */ virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028DE34 */ virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028DE50 */ virtual void adaptor_do_REPEAT(JStudio::data::TEOperationData, void const*, u32); + /* 8028DE6C */ virtual void adaptor_do_CONTINUOUS(JStudio::data::TEOperationData, void const*, u32); + /* 8028DE88 */ virtual void adaptor_do_LOCATED(JStudio::data::TEOperationData, void const*, u32); + /* 8028DEB0 */ virtual void adaptor_do_ON_EXIT_NOT_END(JStudio::data::TEOperationData, void const*, + u32); + + static u8 saoVVOSetValue_[72]; + + /* 0x114 */ TCreateObject* pCreateObject_; + /* 0x118 */ JAISoundHandle opJAISoundHandle_; + /* 0x11C */ u8 field_0x11c; + /* 0x11D */ u8 field_0x11d; + /* 0x11E */ u8 field_0x11e; + /* 0x11F */ u8 field_0x11f; + /* 0x120 */ u8 field_0x120; + /* 0x124 */ u32 field_0x124; + /* 0x128 */ u32 field_0x128; + /* 0x12C */ u32 field_0x12c; + /* 0x130 */ JGeometry::TVec3<f32> field_0x130; + /* 0x13C */ u32 field_0x13c; + /* 0x140 */ u32 field_0x140; + /* 0x144 */ u8 field_0x144; +}; +}; // namespace JStudio_JAudio2 + +#endif /* JSTUDIO_JAUDIO2_CONTROL_H */ diff --git a/include/JSystem/JStudio/JStudio_JParticle/control.h b/include/JSystem/JStudio/JStudio_JParticle/control.h index 17c271167c..93f628b268 100644 --- a/include/JSystem/JStudio/JStudio_JParticle/control.h +++ b/include/JSystem/JStudio/JStudio_JParticle/control.h @@ -1,6 +1,69 @@ -#ifndef CONTROL_H -#define CONTROL_H +#ifndef JSTUDIO_JPARTICLE_CONTROL_H +#define JSTUDIO_JPARTICLE_CONTROL_H +#include "JSystem/JParticle/JPAParticle.h" +#include "JSystem/JStage/JSGSystem.h" +#include "JSystem/JStudio/JStudio/jstudio-object.h" #include "dolphin/types.h" -#endif /* CONTROL_H */ +namespace JStudio_JParticle { +struct TCreateObject : public JStudio::TCreateObject { + TCreateObject(JPAEmitterManager* p_emitMgr, const JStage::TSystem* p_system) { + pJPAEmitterManager_ = p_emitMgr; + pJSGSystem_ = p_system; + mPermit_onExit_notEnd = false; + } + + /* 8028E3A0 */ virtual ~TCreateObject(); + /* 8028E400 */ virtual void create(JStudio::TObject**, + JStudio::stb::data::TParse_TBlock_object const&); + /* 8028E474 */ virtual void emitter_create(u32); + /* 8028E4E4 */ virtual void emitter_destroy(JPABaseEmitter*); + + /* 8028E508 */ void createObject_JPA_PARTICLE_(JStudio::stb::data::TParse_TBlock_object const&, + JStudio_JParticle::TCreateObject*); + + /* 0x0C */ JPAEmitterManager* pJPAEmitterManager_; + /* 0x10 */ const JStage::TSystem* pJSGSystem_; + /* 0x14 */ bool mPermit_onExit_notEnd; +}; + +struct TAdaptor_particle : public JStudio::TAdaptor_particle { + struct TJPACallback_emitter_ { + /* 8028E700 */ ~TJPACallback_emitter_(); + /* 8028ECC0 */ void execute(JPABaseEmitter*); + /* 8028F060 */ void executeAfter(JPABaseEmitter*); + /* 8028F098 */ void draw(JPABaseEmitter*); + /* 8028F0D0 */ void drawAfter(JPABaseEmitter*); + }; + + /* 8028E60C */ TAdaptor_particle(JStudio_JParticle::TCreateObject*); + /* 8028F108 */ void beginParticle_fadeIn_(); + /* 8028F1C0 */ void endParticle_fadeOut_(u32); + + /* 8028E760 */ virtual ~TAdaptor_particle(); + /* 8028E850 */ virtual void adaptor_do_prepare(); + /* 8028E97C */ virtual void adaptor_do_end(); + /* 8028E980 */ virtual void adaptor_do_update(u32); + /* 8028EA68 */ virtual void adaptor_do_PARTICLE(JStudio::data::TEOperationData, void const*, u32); + /* 8028EA7C */ virtual void adaptor_do_BEGIN(JStudio::data::TEOperationData, void const*, u32); + /* 8028EAB0 */ virtual void adaptor_do_BEGIN_FADE_IN(JStudio::data::TEOperationData, void const*, + u32); + /* 8028EAF8 */ virtual void adaptor_do_END(JStudio::data::TEOperationData, void const*, u32); + /* 8028EB24 */ virtual void adaptor_do_END_FADE_OUT(JStudio::data::TEOperationData, void const*, + u32); + /* 8028EB6C */ virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, void const*, u32); + /* 8028EBD8 */ virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028EC58 */ virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028EC74 */ virtual void adaptor_do_PARENT_FUNCTION(JStudio::data::TEOperationData, void const*, + u32); + /* 8028EC88 */ virtual void adaptor_do_REPEAT(JStudio::data::TEOperationData, void const*, u32); + /* 8028ECA4 */ virtual void adaptor_do_ON_EXIT_NOT_END(JStudio::data::TEOperationData, void const*, + u32); +}; + +}; // namespace JStudio_JParticle + +#endif /* JSTUDIO_JPARTICLE_CONTROL_H */ diff --git a/include/JSystem/JStudio/JStudio_JParticle/object-particle.h b/include/JSystem/JStudio/JStudio_JParticle/object-particle.h index 948c6c6203..c887a183ee 100644 --- a/include/JSystem/JStudio/JStudio_JParticle/object-particle.h +++ b/include/JSystem/JStudio/JStudio_JParticle/object-particle.h @@ -1,6 +1,6 @@ #ifndef OBJECT_PARTICLE_H #define OBJECT_PARTICLE_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JParticle/control.h" #endif /* OBJECT_PARTICLE_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/control.h b/include/JSystem/JStudio/JStudio_JStage/control.h index 17c271167c..0ffd4c83fa 100644 --- a/include/JSystem/JStudio/JStudio_JStage/control.h +++ b/include/JSystem/JStudio/JStudio_JStage/control.h @@ -1,6 +1,174 @@ -#ifndef CONTROL_H -#define CONTROL_H +#ifndef JSTUDIO_JSTAGE_CONTROL_H +#define JSTUDIO_JSTAGE_CONTROL_H -#include "dolphin/types.h" +#include "JSystem/JStage/JSGActor.h" +#include "JSystem/JStage/JSGAmbientLight.h" +#include "JSystem/JStage/JSGCamera.h" +#include "JSystem/JStage/JSGFog.h" +#include "JSystem/JStage/JSGLight.h" +#include "JSystem/JStage/JSGSystem.h" +#include "JSystem/JStudio/JStudio/jstudio-object.h" -#endif /* CONTROL_H */ +namespace JStudio_JStage { +struct TCreateObject : public JStudio::TCreateObject { + TCreateObject(const JStage::TSystem* pSystem) { + pJSGSystem_ = pSystem; + } + + /* 80289B00 */ virtual ~TCreateObject(); + /* 80289B60 */ virtual void create(JStudio::TObject**, + JStudio::stb::data::TParse_TBlock_object const&); + + /* 0x0C */ const JStage::TSystem* pJSGSystem_; +}; + +struct TAdaptor_object_ { + /* 8028A470 */ void adaptor_object_data_(void const*, u32, void const*, u32); + /* 8028A4BC */ void adaptor_object_findJSGObject_(char const*); + /* 8028A50C */ void adaptor_object_findJSGObjectNode_(JStage::TObject const*, char const*); + /* 8028A550 */ void adaptor_object_ENABLE_(JStudio::data::TEOperationData, void const*, u32); + + /* 0x0 */ JStudio::TAdaptor* field_0x0; + /* 0x4 */ JStage::TSystem* pJSGSystem_; + /* 0x8 */ JStage::TObject* pJSGObject_; +}; + +struct TAdaptor_actor : public JStudio::TAdaptor_actor, public JStudio_JStage::TAdaptor_object_ { + struct TVVOutput_ANIMATION_FRAME_ { + /* 8028B064 */ void operator()(f32, JStudio::TAdaptor*) const; + /* 8028B138 */ ~TVVOutput_ANIMATION_FRAME_(); + }; + + /* 8028A5F0 */ TAdaptor_actor(JStage::TSystem const*, JStage::TActor*); + + /* 8028A6B4 */ virtual ~TAdaptor_actor(); + /* 8028A728 */ virtual void adaptor_do_prepare(); + /* 8028A7B4 */ virtual void adaptor_do_begin(); + /* 8028A8D8 */ virtual void adaptor_do_end(); + /* 8028A92C */ virtual void adaptor_do_update(u32); + /* 8028A974 */ virtual void adaptor_do_data(void const*, u32, void const*, u32); + /* 8028AAC8 */ virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, void const*, u32); + /* 8028AB0C */ virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028AB68 */ virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028ABF0 */ virtual void adaptor_do_PARENT_FUNCTION(JStudio::data::TEOperationData, void const*, + u32); + /* 8028AC04 */ virtual void adaptor_do_RELATION(JStudio::data::TEOperationData, void const*, u32); + /* 8028AC48 */ virtual void adaptor_do_RELATION_NODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028ACA4 */ virtual void adaptor_do_RELATION_ENABLE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028A998 */ virtual void adaptor_do_SHAPE(JStudio::data::TEOperationData, void const*, u32); + /* 8028A9F0 */ virtual void adaptor_do_ANIMATION(JStudio::data::TEOperationData, void const*, u32); + /* 8028AA48 */ virtual void adaptor_do_ANIMATION_MODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028AA5C */ virtual void adaptor_do_TEXTURE_ANIMATION(JStudio::data::TEOperationData, + void const*, u32); + /* 8028AAB4 */ virtual void adaptor_do_TEXTURE_ANIMATION_MODE(JStudio::data::TEOperationData, + void const*, u32); + + /* 8028ACFC */ void setJSG_ID_(void (JStage::TActor::*)(u32), + JStudio::data::TEOperationData, void const*, u32); + /* 8028AD38 */ void setJSG_SRT_(JStudio::TControl const*); + /* 8028AECC */ void getJSG_SRT_(JStudio::TControl const*); + + static u8 saoVVOutput_[64]; + static u8 saoVVOutput_ANIMATION_FRAME_[144 + 4 /* padding */]; + + /* 0x134 */ u32 field_0x134; + /* 0x138 */ u32 field_0x138; + /* 0x13C */ u32 field_0x13c; + /* 0x140 */ u32 field_0x140; + /* 0x144 */ u32 field_0x144; + /* 0x148 */ u8 field_0x148; + /* 0x14C */ u32 field_0x14c; + /* 0x150 */ u32 field_0x150; +}; + +struct TAdaptor_ambientLight : public JStudio::TAdaptor_ambientLight { + /* 8028B610 */ TAdaptor_ambientLight(JStage::TSystem const*, JStage::TAmbientLight*); + + /* 8028B6AC */ virtual ~TAdaptor_ambientLight(); + /* 8028B720 */ virtual void adaptor_do_prepare(); + /* 8028B724 */ virtual void adaptor_do_begin(); + /* 8028B7B0 */ virtual void adaptor_do_end(); + /* 8028B804 */ virtual void adaptor_do_update(u32); + /* 8028B87C */ virtual void adaptor_do_data(void const*, u32, void const*, u32); +}; + +struct TAdaptor_camera : public JStudio::TAdaptor_camera { + /* 8028B8A0 */ TAdaptor_camera(JStage::TSystem const*, JStage::TCamera*); + /* 8028B960 */ virtual ~TAdaptor_camera(); + /* 8028B9D4 */ virtual void adaptor_do_prepare(); + /* 8028BA1C */ virtual void adaptor_do_begin(); + /* 8028BAF8 */ virtual void adaptor_do_end(); + /* 8028BB4C */ virtual void adaptor_do_update(u32); + /* 8028BBAC */ virtual void adaptor_do_data(void const*, u32, void const*, u32); + /* 8028BBD0 */ virtual void adaptor_do_PARENT(JStudio::data::TEOperationData, void const*, u32); + /* 8028BC14 */ virtual void adaptor_do_PARENT_NODE(JStudio::data::TEOperationData, void const*, u32); + /* 8028BC70 */ virtual void adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData, void const*, u32); + /* 8028BCEC */ virtual void adaptor_do_PARENT_FUNCTION(JStudio::data::TEOperationData, void const*, + u32); + /* 8028BD00 */ virtual void adaptor_do_TARGET_PARENT(JStudio::data::TEOperationData, void const*, u32); + /* 8028BD44 */ virtual void adaptor_do_TARGET_PARENT_NODE(JStudio::data::TEOperationData, void const*, + u32); + /* 8028BDA0 */ virtual void adaptor_do_TARGET_PARENT_ENABLE(JStudio::data::TEOperationData, void const*, + u32); + + /* 8028BDBC */ void setJSG_position_(JStudio::TControl const*); + /* 8028BEB8 */ void getJSG_position_(JStudio::TControl const*); + /* 8028BFBC */ void setJSG_targetPosition_(JStudio::TControl const*); + /* 8028C09C */ void getJSG_targetPosition_(JStudio::TControl const*); + + static u8 saoVVOutput_[160 + 4 /* padding */]; +}; + +struct TAdaptor_fog : public JStudio::TAdaptor_fog { + /* 8028C574 */ TAdaptor_fog(JStage::TSystem const*, JStage::TFog*); + /* 8028C610 */ virtual ~TAdaptor_fog(); + /* 8028C684 */ virtual void adaptor_do_prepare(); + /* 8028C6CC */ virtual void adaptor_do_begin(); + /* 8028C7B4 */ virtual void adaptor_do_end(); + /* 8028C808 */ virtual void adaptor_do_update(u32); + /* 8028C880 */ virtual void adaptor_do_data(void const*, u32, void const*, u32); + + static u8 saoVVOutput_[96 + 4 /* padding */]; +}; + +struct TAdaptor_light : public JStudio::TAdaptor_light { + struct TVVOutput_direction_ { + /* 8028D24C */ void operator()(f32, JStudio::TAdaptor*) const; + /* 8028D258 */ ~TVVOutput_direction_(); + }; + + /* 8028CB50 */ TAdaptor_light(JStage::TSystem const*, JStage::TLight*); + /* 8028CBF4 */ virtual ~TAdaptor_light(); + /* 8028CC68 */ virtual void adaptor_do_prepare(); + /* 8028CCB0 */ virtual void adaptor_do_begin(); + /* 8028CF68 */ virtual void adaptor_do_end(); + /* 8028CFBC */ virtual void adaptor_do_update(u32); + /* 8028D18C */ virtual void adaptor_do_data(void const*, u32, void const*, u32); + /* 8028D228 */ virtual void adaptor_do_ENABLE(JStudio::data::TEOperationData, void const*, u32); + /* 8028D1B0 */ virtual void adaptor_do_FACULTY(JStudio::data::TEOperationData, void const*, u32); + + static u8 saoVVOutput_direction_[72]; +}; + +/* 8028A1F8 */ void + transform_toGlobalFromLocal(f32 (*)[4], + JStudio::TControl::TTransform_translation_rotation_scaling const&, + JStage::TObject const*, u32); +/* 8028A290 */ void transform_toGlobalFromLocal(f32 (*)[4], + JStudio::TControl::TTransform_position const&, + JStage::TObject const*, u32); +/* 8028A328 */ void + transform_toLocalFromGlobal(f32 (*)[4], + JStudio::TControl::TTransform_translation_rotation_scaling const&, + JStage::TObject const*, u32); +/* 8028A3CC */ void transform_toLocalFromGlobal(f32 (*)[4], + JStudio::TControl::TTransform_position const&, + JStage::TObject const*, u32); +}; // namespace JStudio_JStage + +#endif /* JSTUDIO_JSTAGE_CONTROL_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object-actor.h b/include/JSystem/JStudio/JStudio_JStage/object-actor.h index 8933a3d7fe..09332fbfef 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object-actor.h +++ b/include/JSystem/JStudio/JStudio_JStage/object-actor.h @@ -1,6 +1,6 @@ #ifndef OBJECT_ACTOR_H #define OBJECT_ACTOR_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_ACTOR_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object-ambientlight.h b/include/JSystem/JStudio/JStudio_JStage/object-ambientlight.h index 65211a6713..237e598abc 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object-ambientlight.h +++ b/include/JSystem/JStudio/JStudio_JStage/object-ambientlight.h @@ -1,6 +1,6 @@ #ifndef OBJECT_AMBIENTLIGHT_H #define OBJECT_AMBIENTLIGHT_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_AMBIENTLIGHT_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object-camera.h b/include/JSystem/JStudio/JStudio_JStage/object-camera.h index ba0337a40b..a9fa7e8d67 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object-camera.h +++ b/include/JSystem/JStudio/JStudio_JStage/object-camera.h @@ -1,6 +1,6 @@ #ifndef OBJECT_CAMERA_H #define OBJECT_CAMERA_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_CAMERA_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object-fog.h b/include/JSystem/JStudio/JStudio_JStage/object-fog.h index 9bc0166870..9e80d01388 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object-fog.h +++ b/include/JSystem/JStudio/JStudio_JStage/object-fog.h @@ -1,6 +1,6 @@ #ifndef OBJECT_FOG_H #define OBJECT_FOG_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_FOG_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object-light.h b/include/JSystem/JStudio/JStudio_JStage/object-light.h index 1f408f064b..dec73e88d5 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object-light.h +++ b/include/JSystem/JStudio/JStudio_JStage/object-light.h @@ -1,6 +1,6 @@ #ifndef OBJECT_LIGHT_H #define OBJECT_LIGHT_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_LIGHT_H */ diff --git a/include/JSystem/JStudio/JStudio_JStage/object.h b/include/JSystem/JStudio/JStudio_JStage/object.h index 9b5239f024..4c04fdcc2a 100644 --- a/include/JSystem/JStudio/JStudio_JStage/object.h +++ b/include/JSystem/JStudio/JStudio_JStage/object.h @@ -1,6 +1,6 @@ #ifndef OBJECT_H #define OBJECT_H -#include "dolphin/types.h" +#include "JSystem/JStudio/JStudio_JStage/control.h" #endif /* OBJECT_H */ diff --git a/include/JSystem/JSupport/JSUInputStream.h b/include/JSystem/JSupport/JSUInputStream.h index 5bb0f4f98e..888179bab2 100644 --- a/include/JSystem/JSupport/JSUInputStream.h +++ b/include/JSystem/JSupport/JSUInputStream.h @@ -25,6 +25,12 @@ public: return val; } + s32 readS32() { + s32 val; + this->read(&val, sizeof(val)); + return val; + } + s16 readS16() { s16 val; this->read(&val, sizeof(val)); @@ -43,6 +49,18 @@ public: return val; } + u8 read8b() { + u8 val; + this->read(&val, sizeof(val)); + return val; + } + + u16 read16b() { + u16 val; + this->read(&val, sizeof(val)); + return val; + } + // TODO: return value probably wrong /* 802DC298 */ s32 read(void*, s32); }; // Size = 0x8 diff --git a/include/JSystem/JUtility/JUTConsole.h b/include/JSystem/JUtility/JUTConsole.h index e18fc11bf4..8ed869395d 100644 --- a/include/JSystem/JUtility/JUTConsole.h +++ b/include/JSystem/JUtility/JUTConsole.h @@ -68,7 +68,7 @@ public: void setVisible(bool visible) { mVisible = visible; } void setLineAttr(int param_0, u8 param_1) { mBuf[(field_0x20 + 2) * param_0] = param_1; } - u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0 + 1]; } + u8* getLinePtr(int param_0) const { return &mBuf[(field_0x20 + 2) * param_0] + 1; } int diffIndex(int param_0, int param_1) const { int diff = param_1 - param_0; if (diff >= 0) { diff --git a/include/JSystem/JUtility/JUTFont.h b/include/JSystem/JUtility/JUTFont.h index a6d7904493..f297f75b6b 100644 --- a/include/JSystem/JUtility/JUTFont.h +++ b/include/JSystem/JUtility/JUTFont.h @@ -68,7 +68,7 @@ public: /* 0x0C */ virtual void setGX() = 0; /* 0x10 */ virtual void setGX(JUtility::TColor col1, JUtility::TColor col2); /* 0x14 */ virtual f32 drawChar_scale(f32 a1, f32 a2, f32 a3, f32 a4, int a5, bool a6) = 0; - /* 0x18 */ virtual u16 getLeading() const = 0; + /* 0x18 */ virtual int getLeading() const = 0; /* 0x1C */ virtual u16 getAscent() const = 0; /* 0x20 */ virtual u16 getDescent() const = 0; /* 0x24 */ virtual s32 getHeight() const = 0; diff --git a/include/JSystem/JUtility/JUTPalette.h b/include/JSystem/JUtility/JUTPalette.h index f269bed464..329ca6ff2e 100644 --- a/include/JSystem/JUtility/JUTPalette.h +++ b/include/JSystem/JUtility/JUTPalette.h @@ -17,6 +17,11 @@ public: JUTPalette(_GXTlut p1, _GXTlutFmt p2, JUTTransparency p3, u16 p4, void* p5) { this->storeTLUT(p1, p2, p3, p4, p5); } + + JUTPalette(GXTlut tlutNo, ResTLUT* p_tlutRes) { + storeTLUT(tlutNo, p_tlutRes); + } + /* 802DE890 */ void storeTLUT(_GXTlut, ResTLUT*); /* 802DE91C */ void storeTLUT(_GXTlut, _GXTlutFmt, JUTTransparency, u16, void*); /* 802DE95C */ bool load(); diff --git a/include/JSystem/JUtility/JUTResFont.h b/include/JSystem/JUtility/JUTResFont.h index 91861e6539..3135738314 100644 --- a/include/JSystem/JUtility/JUTResFont.h +++ b/include/JSystem/JUtility/JUTResFont.h @@ -11,7 +11,7 @@ public: /* 802DF48C */ virtual void setGX(); /* 802DF584 */ virtual void setGX(JUtility::TColor, JUtility::TColor); /* 802DF7C4 */ virtual f32 drawChar_scale(f32, f32, f32, f32, int, bool); - /* 802DDFEC */ virtual u16 getLeading() const; + /* 802DDFEC */ virtual int getLeading() const; /* 802DE004 */ virtual u16 getAscent() const; /* 802DE010 */ virtual u16 getDescent() const; /* 802DE01C */ virtual s32 getHeight() const; diff --git a/include/JSystem/JUtility/JUTTexture.h b/include/JSystem/JUtility/JUTTexture.h index d2832d81d7..9dcd5cb859 100644 --- a/include/JSystem/JUtility/JUTTexture.h +++ b/include/JSystem/JUtility/JUTTexture.h @@ -4,22 +4,25 @@ #include "JSystem/JUtility/JUTPalette.h" #include "dolphin/types.h" -struct ResTIMG { /* Acts as the header to image data. Usually texture data immediately follows it, - so any pointer arithmetic to go past the end of this structure is so that a - variable sized allocated buffer can be accessed. */ +/* + * Acts as the header to image data. Usually texture data immediately follows it, + * so any pointer arithmetic to go past the end of this structure is so that a + * variable sized allocated buffer can be accessed. + */ +struct ResTIMG { /* 0x00 */ u8 format; - /* 0x01 */ bool alphaEnabled; + /* 0x01 */ u8 alphaEnabled; /* 0x02 */ u16 width; /* 0x04 */ u16 height; /* 0x06 */ u8 wrapS; /* 0x07 */ u8 wrapT; - /* 0x08 */ bool palettesEnabled; + /* 0x08 */ u8 palettesEnabled; /* 0x09 */ u8 paletteFormat; /* 0x0A */ u16 paletteCount; /* 0x0C */ u32 paletteOffset; - /* 0x10 */ bool mipmapEnabled; - /* 0x11 */ bool doEdgeLOD; - /* 0x12 */ bool biasClamp; + /* 0x10 */ u8 mipmapEnabled; + /* 0x11 */ u8 doEdgeLOD; + /* 0x12 */ u8 biasClamp; /* 0x13 */ u8 maxAnisotropy; /* 0x14 */ u8 minFilter; /* 0x15 */ u8 magFilter; @@ -38,6 +41,13 @@ public: mEmbPalette = NULL; mTexInfo = NULL; } + + JUTTexture(const ResTIMG* p_timg, u8 param_1) { + mEmbPalette = NULL; + storeTIMG(p_timg, param_1); + setCaptureFlag(false); + } + ~JUTTexture(); void storeTIMG(ResTIMG const*, JUTPalette*, _GXTlut); void storeTIMG(ResTIMG const*, u8); @@ -52,9 +62,10 @@ public: void setCaptureFlag(bool flag) { mFlags &= 2 | flag; } u8 getCaptureFlag() const { return mFlags & 1; } u8 getEmbPaletteDelFlag() const { return mFlags & 2; } + u8 getTlutName() const { return mTlutName; } private: - /* 0x00 */ _GXTexObj mTexObj; + /* 0x00 */ GXTexObj mTexObj; /* 0x20 */ const ResTIMG* mTexInfo; /* 0x24 */ void* mTexData; /* 0x28 */ JUTPalette* mEmbPalette; |
