move J2D / JUTResFont (#144)

* move some JSystem and meter2_info stuff

* more J2D / JUTTexture / JUTPalette

* setup dScnKy_env_light_c
This commit is contained in:
TakaRikka
2021-08-28 07:25:03 -07:00
committed by GitHub
parent e14b04c54a
commit daf45f768d
167 changed files with 3800 additions and 5691 deletions
+81
View File
@@ -1,6 +1,87 @@
#ifndef J2DANIMATION_H
#define J2DANIMATION_H
#include "dolphin/gx/GXTexture.h"
#include "dolphin/types.h"
struct J3DTransformInfo;
struct J3DTextureSRTInfo;
class J2DScreen;
struct J2DAnmVtxColorKey {
/* 8030B704 */ void getColor(u8, u16, _GXColor*) const;
/* 8030CC20 */ ~J2DAnmVtxColorKey();
};
struct J2DAnmVtxColorFull {
/* 8030B4C4 */ void getColor(u8, u16, _GXColor*) const;
/* 8030CC8C */ ~J2DAnmVtxColorFull();
};
struct J2DAnmVisibilityFull {
/* 8030C048 */ void getVisibility(u16, u8*) const;
};
struct J2DAnmTransformKey {
/* 801959C0 */ ~J2DAnmTransformKey();
/* 8030AAFC */ void calcTransform(f32, u16, J3DTransformInfo*) const;
/* 8030CD7C */ void getTransform(u16, J3DTransformInfo*) const;
};
struct J2DAnmTransformFull {
/* 8030A590 */ void getTransform(u16, J3DTransformInfo*) const;
/* 8030CDAC */ ~J2DAnmTransformFull();
};
struct J2DAnmTextureSRTKey {
/* 80184274 */ ~J2DAnmTextureSRTKey();
/* 8030B9F0 */ void calcTransform(f32, u16, J3DTextureSRTInfo*) const;
/* 8030BC60 */ void searchUpdateMaterialID(J2DScreen*);
};
struct J2DAnmTexPattern {
struct J2DAnmTexPatternTIMGPointer {
/* 8030CB2C */ J2DAnmTexPatternTIMGPointer();
/* 8030CB3C */ ~J2DAnmTexPatternTIMGPointer();
};
/* 8030BD10 */ void searchUpdateMaterialID(J2DScreen*);
/* 8030BEE8 */ void getTexNo(u16, u16*) const;
/* 8030BF9C */ void getResTIMG(u16) const;
/* 8030BFF0 */ void getPalette(u16) const;
/* 8030CB90 */ ~J2DAnmTexPattern();
};
struct J2DAnmTevRegKey {
/* 801841EC */ ~J2DAnmTevRegKey();
/* 8030C0F0 */ void getTevColorReg(u16, _GXColorS10*) const;
/* 8030C3B4 */ void getTevKonstReg(u16, _GXColor*) const;
/* 8030C678 */ void searchUpdateMaterialID(J2DScreen*);
};
struct J2DAnmColorKey {
/* 80239BE0 */ ~J2DAnmColorKey();
/* 8030B200 */ void getColor(u16, _GXColor*) const;
};
struct J2DAnmColorFull {
/* 8030AFC8 */ void getColor(u16, _GXColor*) const;
/* 8030CCF8 */ ~J2DAnmColorFull();
};
struct J2DAnmColor {
/* 801842FC */ ~J2DAnmColor();
/* 802EB390 */ void getColor(u16, _GXColor*) const;
/* 8030AF24 */ void searchUpdateMaterialID(J2DScreen*);
};
struct J2DAnmBase {
/* 80053C94 */ ~J2DAnmBase();
/* 800569B0 */ void searchUpdateMaterialID(J2DScreen*);
};
struct J2DAnmVtxColor {};
struct J2DAnmTransform {};
#endif /* J2DANIMATION_H */
+22
View File
@@ -1,6 +1,28 @@
#ifndef J2DGRAFCONTEXT_H
#define J2DGRAFCONTEXT_H
#include "JSystem/JGeometry.h"
#include "JSystem/JUtility.h"
#include "dolphin/types.h"
struct J2DGrafContext {
/* 802E8B08 */ J2DGrafContext(f32, f32, f32, f32);
/* 802E8BB4 */ void setPort();
/* 802E8C44 */ void setup2D();
/* 802E8E20 */ void setScissor();
/* 802E90C0 */ void scissor(JGeometry::TBox2<f32> const&);
/* 802E90E4 */ void place(JGeometry::TBox2<f32> const&);
/* 802E961C */ void place(f32, f32, f32, f32);
/* 802E9118 */ void setColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
JUtility::TColor);
/* 802E9234 */ void setLineWidth(u8);
/* 802E9260 */ void fillBox(JGeometry::TBox2<f32> const&);
/* 802E9368 */ void drawFrame(JGeometry::TBox2<f32> const&);
/* 802E9488 */ void line(JGeometry::TVec2<f32>, JGeometry::TVec2<f32>);
/* 802E9564 */ void lineTo(JGeometry::TVec2<f32>);
/* 802E95D4 */ ~J2DGrafContext();
/* 802E9664 */ bool getGrafType() const;
/* 802E966C */ void setLookat();
};
#endif /* J2DGRAFCONTEXT_H */
+12
View File
@@ -1,6 +1,18 @@
#ifndef J2DMANAGE_H
#define J2DMANAGE_H
#include "JSystem/JSupport/JSUInputStream.h"
#include "dolphin/types.h"
struct J2DResReference {
/* 8030CF10 */ void getResReference(u16) const;
/* 8030CF44 */ void getName(u16) const;
};
class J2DDataManage {
public:
/* 8030CE18 */ void get(char const*);
/* 8030CE7C */ void get(JSUInputStream*);
};
#endif /* J2DMANAGE_H */
+19
View File
@@ -1,6 +1,25 @@
#ifndef J2DMATERIAL_H
#define J2DMATERIAL_H
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "dolphin/types.h"
struct J2DMaterial {
struct J2DMaterialAnmPointer {
/* 802EA79C */ J2DMaterialAnmPointer();
};
/* 802EA1AC */ J2DMaterial();
/* 802EA2CC */ ~J2DMaterial();
/* 802EA38C */ void setGX();
/* 802EA410 */ void createTevBlock(int, bool);
/* 802EA5C4 */ void createIndBlock(int, bool);
/* 802EA84C */ void makeAnmPointer();
/* 802EA94C */ void setAnimation(J2DAnmTextureSRTKey*);
/* 802EAA2C */ void setAnimation(J2DAnmTexPattern*);
/* 802EAB0C */ void setAnimation(J2DAnmTevRegKey*);
/* 802EA89C */ void setAnimation(J2DAnmColor*);
/* 802EAC78 */ void animation();
};
#endif /* J2DMATERIAL_H */
+129
View File
@@ -1,6 +1,135 @@
#ifndef J2DPANE_H
#define J2DPANE_H
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "JSystem/JGeometry.h"
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JSupport/JSUList.h"
#include "JSystem/JSupport/JSURandomInputStream.h"
#include "JSystem/JUtility/JUTFont.h"
#include "JSystem/JUtility/JUTResFont.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/types.h"
class J2DScreen;
enum J2DRotateAxis {
/* 0x78 */ ROTATE_X = 'x',
/* 0x79 */ ROTATE_Y = 'y',
/* 0x7A */ ROTATE_Z = 'z'
};
enum J2DBasePosition {};
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);
virtual ~J2DPane();
/* 0x0c */ virtual s32 getTypeID() const;
/* 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 const J2DPane* search(u64 tag);
/* 0x40 */ virtual const 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);
f32 getHeight() const { return mBounds.getHeight(); }
f32 getWidth() const { return mBounds.getWidth(); }
JSUTree<J2DPane>* getFirstChild() { return mPaneTree.getFirstChild(); }
const JSUTree<J2DPane>* getPaneTree() { return &mPaneTree; }
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);
void getGlbVtx(u8 arg1) const;
const J2DPane* getFirstChildPane();
const J2DPane* getNextChildPane();
const 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);
static f32 static_mBounds[4];
public:
/* 0x04 */ u16 _4;
/* 0x06 */ u8 _6[2];
/* 0x08 */ int id;
/* 0x0C */ u8 _c[4];
/* 0x10 */ u64 mInfoTag;
/* 0x18 */ u64 mUserInfoTag;
/* 0x20 */ JGeometry::TBox2<f32> mBounds;
/* 0x30 */ JGeometry::TBox2<f32> mGlobalBounds;
/* 0x40 */ JGeometry::TBox2<f32> mClipRect;
/* 0x50 */ Mtx mPositionMtx;
/* 0x80 */ Mtx mGlobalMtx;
/* 0xB0 */ bool mVisible;
/* 0xB1 */ u8 mCullMode;
/* 0xB2 */ u8 mAlpha;
/* 0xB3 */ u8 mColorAlpha;
/* 0xB4 */ bool mIsInfluencedAlpha;
/* 0xB5 */ bool mConnected;
/* 0xB6 */ char mRotAxis;
/* 0xB7 */ u8 mBasePosition;
/* 0xB8 */ f32 mRotateX;
/* 0xBC */ f32 mRotateY;
/* 0xC0 */ f32 mRotateZ;
/* 0xC4 */ f32 mRotateOffsetX;
/* 0xC8 */ f32 mRotateOffsetY;
/* 0xCC */ f32 mScaleX;
/* 0xD0 */ f32 mScaleY;
/* 0xD4 */ f32 mTranslateX;
/* 0xD8 */ f32 mTranslateY;
/* 0xDC */ JSUTree<J2DPane> mPaneTree;
/* 0xF8 */ const J2DAnmTransform* mTransform;
/* 0xFC */ u32 _fc;
};
#endif /* J2DPANE_H */
+108
View File
@@ -1,6 +1,114 @@
#ifndef J2DPICTURE_H
#define J2DPICTURE_H
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/types.h"
enum J2DMirror {
/* 0x0 */ MIRROR0, // temp, figure out later
};
enum J2DBinding {
/* 0xF */ BIND15 = 15, // temp, figure out later
};
class J2DPicture : public J2DPane {
public:
/* 802FCFF0 */ virtual ~J2DPicture();
/* 802FF2E8 */ virtual s32 getTypeID() const;
/* 802FDB28 */ virtual void drawSelf(f32, f32);
/* 802FDB90 */ virtual void drawSelf(f32, f32, Mtx*);
/* 802FF09C */ virtual bool isUsed(ResTIMG const*);
/* 802FF63C */ virtual bool isUsed(ResFONT const*);
/* 802FF65C */ virtual void rewriteAlpha();
/* 802FCCDC */ virtual void initiate(ResTIMG const*, ResTLUT const*);
/* 802FD098 */ virtual bool prepareTexture(u8);
/* 801BDD40 */ virtual void append(ResTIMG const*, f32);
/* 802FF238 */ virtual void append(ResTIMG const*, JUTPalette*, f32);
/* 80020338 */ virtual void append(char const*, f32);
/* 802FF2F0 */ virtual void append(char const*, JUTPalette*, f32);
/* 802FF208 */ virtual void append(JUTTexture*, f32);
/* 802FF3E0 */ virtual void prepend(ResTIMG const*, f32);
/* 802FF3B0 */ virtual void prepend(ResTIMG const*, JUTPalette*, f32);
/* 802FF380 */ virtual void prepend(char const*, f32);
/* 802FF350 */ virtual void prepend(char const*, JUTPalette*, f32);
/* 802FF320 */ virtual void prepend(JUTTexture*, f32);
/* 801BDD70 */ virtual void insert(ResTIMG const*, u8, f32);
/* 802FD168 */ virtual void insert(ResTIMG const*, JUTPalette*, u8, f32);
/* 80020368 */ virtual void insert(char const*, u8, f32);
/* 802FD4B4 */ virtual void insert(char const*, JUTPalette*, u8, f32);
/* 802FD524 */ virtual void insert(JUTTexture*, u8, f32);
/* 802FD6F4 */ virtual int remove(u8);
/* 802FF410 */ virtual int remove();
/* 802FD814 */ virtual void remove(JUTTexture*);
/* 802FF4E0 */ virtual void draw(f32, f32, bool, bool, bool);
/* 802FF448 */ virtual void draw(f32, f32, u8, bool, bool, bool);
/* 802FDC70 */ virtual void draw(f32, f32, f32, f32, bool, bool, bool);
/* 802FF588 */ virtual void drawOut(f32, f32, f32, f32, f32, f32);
/* 802FF524 */ virtual void drawOut(f32, f32, f32, f32, f32, f32, f32, f32);
/* 802FDF88 */ virtual void drawOut(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
/* 802FF29C */ virtual void load(_GXTexMapID, u8);
/* 802FF268 */ virtual void load(u8);
/* 800202CC */ virtual void setBlendRatio(f32, f32);
/* 802FEA74 */ virtual void setBlendColorRatio(f32, f32);
/* 802FEA9C */ virtual void setBlendAlphaRatio(f32, f32);
/* 802FD874 */ virtual void changeTexture(ResTIMG const*, u8);
/* 802FD964 */ virtual void changeTexture(char const*, u8);
/* 802FD9BC */ virtual void changeTexture(ResTIMG const*, u8, JUTPalette*);
/* 802FDAC8 */ virtual void changeTexture(char const*, u8, JUTPalette*);
/* 800539DC */ virtual void getTexture(u8) const;
/* 802FF634 */ virtual u8 getTextureCount() const;
/* 80053C6C */ virtual void setBlack(JUtility::TColor);
/* 80053C44 */ virtual void setWhite(JUtility::TColor);
/* 8018BEE0 */ virtual void setBlackWhite(JUtility::TColor, JUtility::TColor);
/* 801DFA4C */ virtual void getBlack() const;
/* 801DFA40 */ virtual void getWhite() const;
/* 8025603C */ virtual bool getMaterial() const;
/* 802FDBFC */ virtual void drawFullSet(f32, f32, f32, f32, Mtx*);
/* 802FE380 */ virtual void drawTexCoord(f32, f32, f32, f32, s16, s16, s16, s16, s16, s16, s16,
s16, Mtx*);
/* 802FF100 */ virtual void getUsableTlut(u8);
/* 802FC800 */ J2DPicture(u64, JGeometry::TBox2<f32> const&, ResTIMG const*, ResTLUT const*);
/* 802FC708 */ J2DPicture(ResTIMG const*);
/* 802FC118 */ J2DPicture(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 802FC050 */ J2DPicture();
/* 802FC1D4 */ J2DPicture(J2DPane*, JSURandomInputStream*, J2DMaterial*);
/* 802FC8E8 */ void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 802FCD70 */ void private_initiate(ResTIMG const*, ResTLUT const*);
/* 802FCE9C */ void initinfo();
/* 802FE5D0 */ void setTevMode();
/* 802FEA60 */ static void swap(f32&, f32&);
/* 802FEAC4 */ void setBlendKonstColor();
/* 802FEB94 */ void setBlendKonstAlpha();
/* 802FEC64 */ void getNewColor(JUtility::TColor*);
/* 802FED84 */ void setTexCoord(JGeometry::TVec2<s16>*, JUTTexture const*, J2DBinding,
J2DMirror, bool);
/* 802FED44 */ void setTexCoord(JUTTexture const*, J2DBinding, J2DMirror, bool);
/* 802FF1D0 */ u8 getTlutID(ResTIMG const*, u8);
void setCornerColor(JUtility::TColor c0, JUtility::TColor c1, JUtility::TColor c2,
JUtility::TColor c3) {
mCornerColor[0] = c0;
mCornerColor[1] = c1;
mCornerColor[2] = c2;
mCornerColor[3] = c3;
}
private:
/* 0x100 */ JUTTexture* mTexture[2];
/* 0x108 */ u8 mTextureCount;
/* 0x109 */ u8 field_0x109;
/* 0x10A */ JGeometry::TVec2<s16> field_0x10a[4];
/* 0x11C */ f32 field_0x11c[4];
/* 0x12C */ JUTPalette* field_0x12c;
/* 0x130 */ JUtility::TColor mWhite;
/* 0x134 */ JUtility::TColor mBlack;
/* 0x138 */ JUtility::TColor mCornerColor[4];
/* 0x148 */ JUtility::TColor field_0x148;
/* 0x14C */ JUtility::TColor field_0x14c;
};
#endif /* J2DPICTURE_H */
+58
View File
@@ -1,6 +1,64 @@
#ifndef J2DSCREEN_H
#define J2DSCREEN_H
#include "JSystem/J2DGraph/J2DManage.h"
#include "JSystem/J2DGraph/J2DMaterial.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/JUtility/JUTNameTab.h"
#include "dolphin/types.h"
struct J2DScrnBlockHeader {};
class J2DScreen : public J2DPane {
public:
/* 802F8540 */ virtual ~J2DScreen();
/* 802F9A18 */ virtual s32 getTypeID() const;
/* 802F9A20 */ virtual void calcMtx();
/* 802F9120 */ virtual void drawSelf(f32, f32, Mtx*);
/* 802F90A0 */ virtual const J2DPane* search(u64);
/* 802F90E0 */ virtual const J2DPane* searchUserInfo(u64);
/* 802F9600 */ virtual bool isUsed(ResTIMG const*);
/* 802F9620 */ virtual bool isUsed(ResFONT const*);
/* 80053BA0 */ virtual void clearAnmTransform();
/* 802F9704 */ virtual void setAnimation(J2DAnmColor*);
/* 80192414 */ virtual void setAnimation(J2DAnmTransform*);
/* 802F9798 */ virtual void setAnimation(J2DAnmTextureSRTKey*);
/* 802F99A8 */ virtual void setAnimation(J2DAnmVtxColor*);
/* 802F9838 */ virtual void setAnimation(J2DAnmTexPattern*);
/* 802F99C8 */ virtual void setAnimation(J2DAnmVisibilityFull*);
/* 802F98CC */ virtual void setAnimation(J2DAnmTevRegKey*);
/* 802F9A54 */ virtual void setAnimation(J2DAnmBase*);
/* 802F9A74 */ virtual void setAnimationVF(J2DAnmVisibilityFull*);
/* 802F9A78 */ virtual void setAnimationVC(J2DAnmVtxColor*);
/* 802F99E8 */ virtual void createPane(J2DScrnBlockHeader const&, JSURandomInputStream*,
J2DPane*, u32);
/* 802F8B98 */ virtual void createPane(J2DScrnBlockHeader const&, JSURandomInputStream*,
J2DPane*, u32, JKRArchive*);
/* 802F8498 */ J2DScreen();
/* 802F85A8 */ void clean();
/* 802F8648 */ void setPriority(char const*, u32, JKRArchive*);
/* 802F8748 */ bool setPriority(JSURandomInputStream*, u32, JKRArchive*);
/* 802F8778 */ bool private_set(JSURandomInputStream*, u32, JKRArchive*);
/* 802F8834 */ bool checkSignature(JSURandomInputStream*);
/* 802F8894 */ void getScreenInformation(JSURandomInputStream*);
/* 802F8990 */ void makeHierarchyPanes(J2DPane*, JSURandomInputStream*, u32, JKRArchive*);
/* 802F8ED4 */ void draw(f32, f32, J2DGrafContext const*);
/* 802F9280 */ void getResReference(JSURandomInputStream*, u32);
/* 802F937C */ void createMaterial(JSURandomInputStream*, u32, JKRArchive*);
/* 802F9640 */ static void* getNameResource(char const*);
/* 802F9690 */ void animation();
static J2DDataManage* mDataManage;
private:
/* 0x100 */ bool mScissor;
/* 0x102 */ u16 mMaterialNum;
/* 0x104 */ J2DMaterial* mMaterials;
/* 0x108 */ J2DResReference* field_0x108;
/* 0x10C */ J2DResReference* field_0x10c;
/* 0x110 */ JUTNameTab* mNameTable;
/* 0x114 */ u32 field_0x114;
};
#endif /* J2DSCREEN_H */
+66
View File
@@ -1,6 +1,72 @@
#ifndef J2DTEXTBOX_H
#define J2DTEXTBOX_H
#include "JSystem/J2DGraph/J2DMaterial.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "dolphin/types.h"
enum J2DTextBoxVBinding {
/* 0x0 */ VBIND_CENTER,
/* 0x1 */ VBIND_BOTTOM,
/* 0x2 */ VBIND_TOP
};
enum J2DTextBoxHBinding {
/* 0x0 */ HBIND_CENTER,
/* 0x1 */ HBIND_RIGHT,
/* 0x2 */ HBIND_LEFT
};
class J2DTextBox : public J2DPane {
public:
/* 803001E0 */ virtual ~J2DTextBox();
/* 80300C68 */ virtual s32 getTypeID() const;
/* 80300AF8 */ virtual void resize(f32, f32);
/* 80300870 */ virtual bool setConnectParent(bool);
/* 80300950 */ virtual void drawSelf(f32, f32, Mtx*);
/* 803008E8 */ virtual void drawSelf(f32, f32);
/* 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);
/* 80300278 */ virtual void setFont(JUTFont*);
/* 8021C7F4 */ virtual void getFont() const;
/* 80254408 */ virtual void setBlack(JUtility::TColor);
/* 80186C84 */ virtual void setWhite(JUtility::TColor);
/* 8019230C */ virtual void setBlackWhite(JUtility::TColor, JUtility::TColor);
/* 801DFA34 */ virtual void getBlack() const;
/* 801DFA28 */ virtual void getWhite() const;
/* 8025602C */ virtual bool getMaterial() const;
/* 802FFBC4 */ J2DTextBox(u64, JGeometry::TBox2<f32> const&, ResFONT const*, char const*, s16,
J2DTextBoxHBinding, J2DTextBoxVBinding);
/* 802FF6D8 */ J2DTextBox(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 802FF75C */ J2DTextBox(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
/* 802FF660 */ J2DTextBox();
/* 802FFC58 */ void initiate(ResFONT const*, char const*, s16, J2DTextBoxHBinding,
J2DTextBoxVBinding);
/* 802FFE88 */ void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
/* 80300658 */ char* getStringPtr() const;
/* 8030074C */ s32 setString(s16, char const*, ...);
/* 80300660 */ s32 setString(char const*, ...);
private:
/* 0x0100 */ JUTFont* mFont;
/* 0x0104 */ JUtility::TColor mCharColor;
/* 0x0108 */ JUtility::TColor mGradientColor;
/* 0x010C */ f32 field_0x10c;
/* 0x0110 */ f32 field_0x110;
/* 0x0114 */ f32 mCharSpacing;
/* 0x0118 */ f32 mLineSpacing;
/* 0x011C */ f32 field_0x11c;
/* 0x0120 */ f32 field_0x120;
/* 0x0124 */ char* mStringPtr;
/* 0x0128 */ JUtility::TColor mWhiteColor;
/* 0x012C */ JUtility::TColor mBlackColor;
/* 0x0130 */ u8 mFlags;
/* 0x0131 */ bool mTextFontOwned;
/* 0x0132 */ s16 mStringLength;
};
#endif /* J2DTEXTBOX_H */
+5
View File
@@ -3,4 +3,9 @@
#include "dolphin/types.h"
struct JAISoundInfo {
/* 802A2D34 */ JAISoundInfo(bool);
/* 802A2D50 */ ~JAISoundInfo();
};
#endif /* JAISOUNDINFO_H */
+15
View File
@@ -3,4 +3,19 @@
#include "dolphin/types.h"
struct JASAudioReseter {
/* 8029D0B4 */ JASAudioReseter();
/* 8029D0FC */ ~JASAudioReseter();
/* 8029D138 */ void start(u32, bool);
/* 8029D1D4 */ void resume();
/* 8029D1F8 */ void checkDone() const;
/* 8029D200 */ void calc();
/* 8029D2D4 */ void callback(void*);
/* 0x0 */ u32 field_0x0;
/* 0x4 */ f32 mDSPLevel;
/* 0x8 */ s32 mIsDone;
/* 0xC */ bool field_0xc;
}; // Size: 0x10
#endif /* JASAUDIORESETER_H */
+14
View File
@@ -0,0 +1,14 @@
#ifndef JASGADGET_H
#define JASGADGET_H
#include "dolphin/types.h"
template <class T>
class JASGlobalInstance {
public:
// T* getInstance() { return sInstance; }
// static T* sInstance;
};
#endif /* JASGADGET_H */
+2 -1
View File
@@ -1,12 +1,13 @@
#ifndef JPAPARTICLE_H
#define JPAPARTICLE_H
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
class JPABaseParticle;
struct _GXTexMapID {};
struct JPABaseEmitter {
/* 8027EC60 */ void deleteAllParticle();
/* 8027EB60 */ void createChild(JPABaseParticle*);
/* 8027EA40 */ void createParticle();
/* 8027EF30 */ void getCurrentCreateNumber() const;
+30
View File
@@ -0,0 +1,30 @@
#ifndef JUTILITY_H
#define JUTILITY_H
#include "dolphin/gx/GXTexture.h"
#include "dolphin/types.h"
namespace JUtility {
struct TColor : _GXColor {
TColor() { set(-1); }
TColor(u32 raw) { *(u32*)&r = raw; }
void set(u32 col) { *(u32*)&r = col; }
void set(u8 oR, u8 oG, u8 oB, u8 oA) {
r = oR;
g = oG;
b = oB;
a = oA;
}
u32 toUInt32() const { return *(u32*)&r; }
operator u32() const { return toUInt32(); }
void operator=(const TColor& rhs) { ((_GXColor*)this)->operator=(rhs); }
};
} // namespace JUtility
#endif /* JUTILITY_H */
+64 -29
View File
@@ -1,46 +1,82 @@
#ifndef JUTFONT_H
#define JUTFONT_H
#include "JSystem/JUtility.h"
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
namespace JUtility {
struct ResFONT {
struct INF1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 fontType;
/* 0x0A */ u16 ascent;
/* 0x0C */ u16 descent;
/* 0x0E */ u16 width;
/* 0x10 */ u16 leading;
/* 0x12 */ u16 defaultCode;
};
struct TColor : _GXColor {
TColor() { set(-1); }
struct WID1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 startCode;
/* 0x0A */ u16 endCode;
};
TColor(u32 raw) { *(u32*)&r = raw; }
struct MAP1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 mappingMethod;
/* 0x0A */ u16 startCode;
/* 0x0C */ u16 endCode;
/* 0x0E */ u16 numEntries;
};
void set(u32 col) { *(u32*)&r = col; }
struct GLY1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u16 startCode;
/* 0x0A */ u16 endCode;
/* 0x0C */ u16 cellWidth;
/* 0x0E */ u16 cellHeight;
/* 0x10 */ u32 textureSize;
/* 0x14 */ u16 textureFormat;
/* 0x16 */ u16 numRows;
/* 0x18 */ u16 numColumns;
/* 0x1A */ u16 textureWidth;
/* 0x1C */ u16 textureHeight;
};
u32 toUInt32() const { return *(u32*)&r; }
operator u32() const { return toUInt32(); }
void operator=(const TColor& rhs) { ((_GXColor*)this)->operator=(rhs); }
/* 0x00 */ u64 magic;
/* 0x08 */ u32 filesize;
/* 0x0C */ u32 numBlocks;
/* 0x10 */ u8 padding[0x10];
};
} // namespace JUtility
class JUTFont {
public:
JUTFont();
virtual ~JUTFont() {}
struct TWidth {};
struct TWidth {
u8 field_0x0;
u8 field_0x1;
};
/* 0x0c */ virtual void setGX() = 0;
/* 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;
/* 0x1c */ virtual u16 getAscent() const = 0;
/* 0x1C */ virtual u16 getAscent() const = 0;
/* 0x20 */ virtual u16 getDescent() const = 0;
/* 0x24 */ virtual u32 getHeight() const = 0;
/* 0x28 */ virtual u32 getWidth() const = 0;
/* 0x2c */ virtual void getWidthEntry(int i_no, TWidth* width) const;
/* 0x30 */ virtual u32 getCellWidth() const;
/* 0x34 */ virtual u32 getCellHeight() const;
/* 0x38 */ virtual u32 getFontType() const = 0;
/* 0x3c */ virtual void getResFont() const = 0;
/* 0x24 */ virtual u16 getHeight() const = 0;
/* 0x28 */ virtual u16 getWidth() const = 0;
/* 0x2C */ virtual void getWidthEntry(int i_no, TWidth* width) const;
/* 0x30 */ virtual u16 getCellWidth() const;
/* 0x34 */ virtual u16 getCellHeight() const;
/* 0x38 */ virtual u16 getFontType() const = 0;
/* 0x3C */ virtual ResFONT* getResFont() const = 0;
/* 0x40 */ virtual bool isLeadByte(int a1) const = 0;
static bool isLeadByte_1Byte(int b);
@@ -52,14 +88,13 @@ public:
void setGradColor(JUtility::TColor col1, JUtility::TColor col2);
f32 drawString_size_scale(f32 a1, f32 a2, f32 a3, f32 a4, const char* a5, u32 usz, bool a7);
u8 unk4;
bool unk5;
int unk8;
JUtility::TColor mColor1;
JUtility::TColor mColor2;
JUtility::TColor mColor3;
JUtility::TColor mColor4;
int unk1C;
/* 0x04 */ bool mValid;
/* 0x05 */ bool mFixed;
/* 0x08 */ int mFixedWidth;
/* 0x0C */ JUtility::TColor mColor1;
/* 0x10 */ JUtility::TColor mColor2;
/* 0x14 */ JUtility::TColor mColor3;
/* 0x18 */ JUtility::TColor mColor4;
};
#endif /* JUTFONT_H */
+1
View File
@@ -26,6 +26,7 @@ public:
s32 getIndex(char const*) const;
const char* getName(u16 index) const;
u16 calcKeyCode(char const* pName) const;
const ResNTAB* getResNameTable() const { return mpNameTable; }
private:
const ResNTAB* mpNameTable;
+53
View File
@@ -1,6 +1,59 @@
#ifndef JUTPALETTE_H
#define JUTPALETTE_H
#include "dolphin/gx/GX.h"
#include "dolphin/types.h"
enum JUTTransparency { UNK0, UNK1 };
enum _GXTlut {
/* 0x00 */ GX_TLUT0,
/* 0x01 */ GX_TLUT1,
/* 0x02 */ GX_TLUT2,
/* 0x03 */ GX_TLUT3,
/* 0x04 */ GX_TLUT4,
/* 0x05 */ GX_TLUT5,
/* 0x06 */ GX_TLUT6,
/* 0x07 */ GX_TLUT7,
/* 0x08 */ GX_TLUT8,
/* 0x09 */ GX_TLUT9,
/* 0x0A */ GX_TLUT10,
/* 0x0B */ GX_TLUT11,
/* 0x0C */ GX_TLUT12,
/* 0x0D */ GX_TLUT13,
/* 0x0E */ GX_TLUT14,
/* 0x0F */ GX_TLUT15,
/* 0x10 */ GX_BIGTLUT0,
/* 0x11 */ GX_BIGTLUT1,
/* 0x12 */ GX_BIGTLUT2,
/* 0x13 */ GX_BIGTLUT3,
};
enum _GXTlutFmt {
/* 0x00 */ UNK,
};
struct ResTLUT {
u8 format;
u8 transparency;
u16 numColors;
};
class JUTPalette {
public:
/* 802DE890 */ void storeTLUT(_GXTlut, ResTLUT*);
/* 802DE91C */ void storeTLUT(_GXTlut, _GXTlutFmt, JUTTransparency, u16, void*);
/* 802DE95C */ bool load();
u8 getTlutName() const { return mTlutName; }
private:
/* 0x00 */ _GXTlutObj mTlutObj;
/* 0x0C */ u8 mTlutName;
/* 0x0D */ u8 mFormat;
/* 0x10 */ ResTLUT* mColorTable;
/* 0x14 */ u16 mNumColors;
/* 0x16 */ u8 mTransparency;
};
#endif /* JUTPALETTE_H */
+59
View File
@@ -1,6 +1,65 @@
#ifndef JUTRESFONT_H
#define JUTRESFONT_H
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTFont.h"
#include "dolphin/types.h"
class JUTResFont : public JUTFont {
public:
/* 802DF000 */ virtual ~JUTResFont();
/* 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;
/* 802DE004 */ virtual u16 getAscent() const;
/* 802DE010 */ virtual u16 getDescent() const;
/* 802DE01C */ virtual u16 getHeight() const;
/* 802DDFF8 */ virtual u16 getWidth() const;
/* 802DFC64 */ virtual void getWidthEntry(int, JUTFont::TWidth*) const;
/* 802DFD0C */ virtual u16 getCellWidth() const;
/* 802DFD58 */ virtual u16 getCellHeight() const;
/* 802DDFE0 */ virtual u16 getFontType() const;
/* 802DDFD8 */ virtual ResFONT* getResFont() const;
/* 802DFDA4 */ virtual bool isLeadByte(int) const;
/* 802DFF60 */ virtual void loadImage(int, _GXTexMapID);
/* 802DF344 */ virtual void setBlock();
/* 802DEF94 */ JUTResFont(ResFONT const*, JKRHeap*);
/* 802DEF48 */ JUTResFont();
/* 802DF08C */ void deleteMemBlocks_ResFont();
/* 802DF0B0 */ void initialize_state();
/* 802DF0DC */ bool initiate(ResFONT const*, JKRHeap*);
/* 802DF13C */ bool protected_initiate(ResFONT const*, JKRHeap*);
/* 802DF248 */ void countBlock();
/* 802DFBE8 */ void loadFont(int, _GXTexMapID, JUTFont::TWidth*);
/* 802DFDD8 */ int getFontCode(int) const;
/* 802E00C4 */ void convertSjis(int, u16*) const;
inline void delete_and_initialize() {
deleteMemBlocks_ResFont();
initialize_state();
}
static void* const saoAboutEncoding_[3];
// some types uncertain, may need to be fixed
/* 0x1C */ void* field_0x1c;
/* 0x20 */ void* field_0x20;
/* 0x24 */ _GXTexObj field_0x24;
/* 0x44 */ int field_0x44;
/* 0x48 */ const ResFONT* mResFont;
/* 0x4C */ ResFONT::INF1* mInf1Ptr;
/* 0x50 */ void* field_0x50;
/* 0x54 */ ResFONT::WID1* mWid1Ptr;
/* 0x58 */ ResFONT::GLY1* mGly1Ptr;
/* 0x5C */ ResFONT::MAP1* mMap1Ptr;
/* 0x60 */ u16 mWid1BlockNum;
/* 0x62 */ u16 mGly1BlockNum;
/* 0x64 */ u16 mMap1BlockNum;
/* 0x66 */ u16 field_0x66;
/* 0x68 */ u16 field_0x68;
/* 0x6C */ void* field_0x6c;
};
#endif /* JUTRESFONT_H */
+62 -21
View File
@@ -1,33 +1,74 @@
#ifndef JUTTEXTURE_H
#define JUTTEXTURE_H
#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. */
u8 texture_format;
bool is_alpha_enabled;
u16 texture_width;
u16 texture_height;
u8 wrap_s;
u8 wrap_t;
bool is_palettes_enabled;
u8 palette_format;
u16 palette_count;
u32 palette_offset;
bool is_mip_map_enabled;
bool do_edge_lod;
bool bias_clamp;
u8 max_anisotropy;
u8 min_filter;
u8 mag_filter;
u8 min_lod;
u8 max_lod;
u8 num_mipmaps;
u8 format;
bool alphaEnabled;
u16 width;
u16 height;
u8 wrapS;
u8 wrapT;
bool palettesEnabled;
u8 paletteFormat;
u16 paletteCount;
u32 paletteOffset;
bool mipmapEnabled;
bool doEdgeLOD;
bool biasClamp;
u8 maxAnisotropy;
u8 minFilter;
u8 magFilter;
u8 minLOD;
u8 maxLOD;
u8 mipmapCount;
u8 unknown;
u16 lod_bias;
u32 texture_data_offset;
s16 LODBias;
u32 texDataOffset;
};
class JUTTexture {
public:
JUTTexture() {
setCaptureFlag(false);
mEmbPalette = NULL;
mTexInfo = NULL;
}
~JUTTexture();
void storeTIMG(ResTIMG const*, JUTPalette*, _GXTlut);
void storeTIMG(ResTIMG const*, u8);
void storeTIMG(ResTIMG const*, JUTPalette*);
void attachPalette(JUTPalette*);
void init();
void initTexObj(_GXTlut);
void initTexObj();
void load(_GXTexMapID);
const ResTIMG* getTexInfo() const { return mTexInfo; }
void setCaptureFlag(bool flag) { mFlags &= 2 | flag; }
u8 getCaptureFlag() const { return mFlags & 1; }
u8 getEmbPaletteDelFlag() const { return mFlags & 2; }
private:
/* 0x00 */ _GXTexObj mTexObj;
/* 0x20 */ const ResTIMG* mTexInfo;
/* 0x24 */ void* mTexData;
/* 0x28 */ JUTPalette* mEmbPalette;
/* 0x2C */ JUTPalette* field_0x2c;
/* 0x30 */ u8 mWrapS;
/* 0x31 */ u8 mWrapT;
/* 0x32 */ u8 mMinFilter;
/* 0x33 */ u8 mMagFilter;
/* 0x34 */ s16 mMinLOD;
/* 0x36 */ s16 mMaxLOD;
/* 0x38 */ s16 mLODBias;
/* 0x3A */ u8 mTlutName;
/* 0x3B */ u8 mFlags;
/* 0x3C */ void* field_0x3c;
};
#endif /* JUTTEXTURE_H */