Reorganize library code into libs/ (#3119)

* Reorganize files into libs/{dolphin,JSystem,PowerPC_EABI_Support,revolution,TRK_MINNOW_DOLPHIN}

* Update configure.py and project.py for new libs structure

* Refactor `#include <dolphin/x.h>` -> `<x.h>`

* Remove `__REVOLUTION_SDK__` forwards from dolphin

* Fix dolphin/ references in revolution

* Wrap `#include <dolphin.h>` in `!__REVOLUTION_SDK__`

* Always build TRK against dolphin headers

* Resolve revolution SDK header resolution issues
This commit is contained in:
Luke Street
2026-03-01 15:35:36 -07:00
committed by GitHub
parent c9a46bd65b
commit 4df8ccc871
1740 changed files with 583 additions and 825 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef DYNAMICLINK_H
#define DYNAMICLINK_H
#include <dolphin/os.h>
#include <os.h>
#include "JSystem/JKernel/JKRHeap.h"
#include "global.h"
-533
View File
@@ -1,533 +0,0 @@
#ifndef J2DANIMATION_H
#define J2DANIMATION_H
#include "JSystem/JMath/JMath.h"
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;
class J2DScreen;
class JUTPalette;
struct ResTIMG;
enum J2DAnmKind {
KIND_TRANSFORM = 0,
KIND_COLOR = 1,
KIND_TEX_PATTERN = 2,
KIND_TEXTURE_SRT = 4,
KIND_TEV_REG = 5,
KIND_VISIBILITY = 6,
KIND_VTX_COLOR = 7
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmBase {
public:
J2DAnmBase() {
mFrame = 0.0f;
mFrameMax = 0;
}
J2DAnmBase(s16 frameMax) {
mFrame = 0.0f;
mFrameMax = frameMax;
}
virtual ~J2DAnmBase() {}
virtual void searchUpdateMaterialID(J2DScreen*) {}
s16 getFrameMax() const { return mFrameMax; }
void setFrame(f32 frame) { mFrame = frame; }
f32 getFrame() const { return mFrame; }
J2DAnmKind getKind() const { return mKind; }
/* 0x0 */ // vtable
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ s16 mFrameMax;
/* 0x8 */ f32 mFrame;
/* 0xC */ J2DAnmKind mKind;
}; // Size: 0x10
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmVtxColor : public J2DAnmBase {
public:
J2DAnmVtxColor() {
mKind = KIND_VTX_COLOR;
for (int i = 0; i < ARRAY_SIZE(mAnmTableNum); i++) {
mAnmTableNum[i] = 0;
}
for (int i = 0; i < ARRAY_SIZE(mVtxColorIndexData); i++) {
mVtxColorIndexData[i] = NULL;
}
}
virtual ~J2DAnmVtxColor() {}
virtual void getColor(u8, u16, _GXColor*) const {}
u16 getAnmTableNum(u8 param_0) const {
J3D_PANIC(342, param_0 < 2, "Error : range over.");
return mAnmTableNum[param_0];
}
J3DAnmVtxColorIndexData* getAnmVtxColorIndexData(u8 param_1, u16 param_2) const {
J3D_PANIC(344, param_1 < 2, "Error : range over.");
J3D_PANIC(345, param_2 < mAnmTableNum[param_1], "Error : range over.");
return &mVtxColorIndexData[param_1][param_2];
}
u16* getVtxColorIndexPointer(u8 param_0) const {
J3D_PANIC(351, param_0 < 2, "Error : range over.");
return mVtxColorIndexPointer[param_0];
}
/* 0x10 */ u16 mAnmTableNum[2];
/* 0x14 */ J3DAnmVtxColorIndexData* mVtxColorIndexData[2];
/* 0x1C */ u16* mVtxColorIndexPointer[2];
}; // Size: 0x24
struct J3DTransformInfo;
struct J3DTextureSRTInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmVtxColorKey : public J2DAnmVtxColor {
public:
J2DAnmVtxColorKey() {
for (int i = 0; i < ARRAY_SIZE(mInfoTable); i++) {
mInfoTable[i] = NULL;
}
}
virtual ~J2DAnmVtxColorKey() {}
virtual void getColor(u8, u16, _GXColor*) const;
/* 0x24 */ J3DAnmColorKeyTable* mInfoTable[2];
/* 0x2C */ s16* mRValues;
/* 0x30 */ s16* mGValues;
/* 0x34 */ s16* mBValues;
/* 0x38 */ s16* mAValues;
}; // Size: 0x3C
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmVtxColorFull : public J2DAnmVtxColor {
public:
J2DAnmVtxColorFull() {
for (int i = 0; i < ARRAY_SIZE(mInfoTable); i++) {
mInfoTable[i] = NULL;
}
}
virtual ~J2DAnmVtxColorFull() {}
virtual void getColor(u8, u16, _GXColor*) const;
/* 0x24 */ J3DAnmColorFullTable* mInfoTable[2];
/* 0x2C */ u8* mRValues;
/* 0x30 */ u8* mGValues;
/* 0x34 */ u8* mBValues;
/* 0x38 */ u8* mAValues;
}; // Size: 0x3C
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmVisibilityFull : public J2DAnmBase {
public:
J2DAnmVisibilityFull() {
field_0x10 = 0;
mTable = NULL;
field_0x12 = 0;
mValues = NULL;
mKind = KIND_VISIBILITY;
}
virtual ~J2DAnmVisibilityFull() {}
void getVisibility(u16, u8*) const;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ J3DAnmVisibilityFullTable* mTable;
/* 0x18 */ u8* mValues;
}; // Size: 0x1C
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTransform : public J2DAnmBase {
public:
J2DAnmTransform(s16 frameMax, f32* pScaleValues, s16* pRotationValues, f32* pTranslateValues) : J2DAnmBase(frameMax) {
mScaleValues = pScaleValues;
mRotationValues = pRotationValues;
mTranslateValues = pTranslateValues;
mKind = KIND_TRANSFORM;
}
virtual ~J2DAnmTransform() {}
virtual void getTransform(u16, J3DTransformInfo*) const {}
/* 0x10 */ f32* mScaleValues;
/* 0x14 */ s16* mRotationValues;
/* 0x18 */ f32* mTranslateValues;
}; // Size: 0x1C
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTransformKey : public J2DAnmTransform {
public:
J2DAnmTransformKey() : J2DAnmTransform(0, NULL, NULL, NULL) {
field_0x24 = 0;
mInfoTable = NULL;
}
virtual ~J2DAnmTransformKey() {}
virtual void getTransform(u16 p1, J3DTransformInfo* pInfo) const {
this->calcTransform(mFrame, p1, pInfo);
}
virtual void calcTransform(f32, u16, J3DTransformInfo*) const;
/* 0x1C */ u8 field_0x1c[6];
/* 0x22 */ u16 field_0x22;
/* 0x24 */ u32 field_0x24;
/* 0x28 */ J3DAnmTransformKeyTable* mInfoTable;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTransformFull : public J2DAnmTransform {
public:
J2DAnmTransformFull() : J2DAnmTransform(0, NULL, NULL, NULL) { mTableInfo = NULL; }
virtual ~J2DAnmTransformFull() {}
virtual void getTransform(u16, J3DTransformInfo*) const;
/* 0x1C */ u8 field_0x1c[6];
/* 0x22 */ u16 field_0x22;
/* 0x24 */ J3DAnmTransformFullTable* mTableInfo;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTextureSRTKey : public J2DAnmBase {
public:
J2DAnmTextureSRTKey() {
field_0x10 = 0;
mUpdateMaterialNum = field_0x1a = field_0x1c = field_0x1e = 0;
mInfoTable = NULL;
mScaleValues = mTranslationValues = NULL;
mRotationValues = NULL;
field_0x4e = field_0x48 = field_0x4a = field_0x4c = 0;
field_0x5c = NULL;
field_0x50 = field_0x58 = NULL;
field_0x54 = NULL;
field_0x7c = 0;
mKind = KIND_TEXTURE_SRT;
}
void calcTransform(f32, u16, J3DTextureSRTInfo*) const;
virtual ~J2DAnmTextureSRTKey() {}
virtual void searchUpdateMaterialID(J2DScreen*);
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum / 3; }
u16 getUpdateMaterialID(u16 i) const {
J3D_PANIC(514, i < mUpdateMaterialNum / 3 && i >= 0, "Error : range over.");
return mUpdateMaterialID[i];
}
u8 getUpdateTexMtxID(u16 i) const {
J3D_PANIC(513, i < mUpdateMaterialNum / 3 && i >= 0, "Error : range over.");
return mUpdateTexMtxID[i];
}
void getTransform(u16 param_1, J3DTextureSRTInfo* param_2) const {
calcTransform(mFrame, param_1, param_2);
}
/* 0x10 */ int field_0x10;
/* 0x14 */ J3DAnmTransformKeyTable* mInfoTable;
/* 0x18 */ u16 mUpdateMaterialNum;
/* 0x1A */ u16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
/* 0x20 */ f32* mScaleValues;
/* 0x24 */ s16* mRotationValues;
/* 0x28 */ f32* mTranslationValues;
/* 0x2C */ u8* mUpdateTexMtxID;
/* 0x30 */ u16* mUpdateMaterialID;
/* 0x34 */ JUTNameTab field_0x34;
/* 0x44 */ Vec* field_0x44;
/* 0x48 */ u16 field_0x48;
/* 0x4A */ u16 field_0x4a;
/* 0x4C */ u16 field_0x4c;
/* 0x4E */ u16 field_0x4e;
/* 0x50 */ f32* field_0x50;
/* 0x54 */ s16* field_0x54;
/* 0x58 */ f32* field_0x58;
/* 0x5C */ J3DAnmTransformKeyTable* field_0x5c;
/* 0x60 */ u8* field_0x60;
/* 0x64 */ u16* field_0x64;
/* 0x68 */ JUTNameTab field_0x68;
/* 0x78 */ Vec* field_0x78;
/* 0x7C */ int field_0x7c;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTexPattern : public J2DAnmBase {
public:
struct J2DAnmTexPatternTIMGPointer {
J2DAnmTexPatternTIMGPointer() {
mRes = NULL;
mPalette = NULL;
}
~J2DAnmTexPatternTIMGPointer() {
delete mPalette;
}
/* 0x0 */ ResTIMG* mRes;
/* 0x4 */ JUTPalette* mPalette;
}; // Size: 0x8
J2DAnmTexPattern() {
mValues = NULL;
mAnmTable = NULL;
mKind = KIND_TEX_PATTERN;
mUpdateMaterialNum = 0;
mUpdateMaterialID = NULL;
mTIMGPtrArray = NULL;
}
void getTexNo(u16, u16*) const;
ResTIMG* getResTIMG(u16) const;
JUTPalette* getPalette(u16) const;
virtual ~J2DAnmTexPattern() { delete[] mTIMGPtrArray; }
virtual void searchUpdateMaterialID(J2DScreen*);
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
u16 getUpdateMaterialID(u16 i) const {
J3D_PANIC(619, i < mUpdateMaterialNum, "Error : range over.");
return mUpdateMaterialID[i];
}
J3DAnmTexPatternFullTable* getAnmTable() const { return mAnmTable; }
/* 0x10 */ u16* mValues;
/* 0x14 */ J3DAnmTexPatternFullTable* mAnmTable;
/* 0x18 */ u16 field_0x18;
/* 0x1A */ u16 mUpdateMaterialNum;
/* 0x1C */ u16* mUpdateMaterialID;
/* 0x20 */ JUTNameTab field_0x20;
/* 0x30 */ J2DAnmTexPatternTIMGPointer* mTIMGPtrArray;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmTevRegKey : public J2DAnmBase {
public:
J2DAnmTevRegKey() {
mCRegUpdateMaterialNum = mKRegUpdateMaterialNum = 0;
field_0x14 = field_0x16 = field_0x18 = field_0x1a = 0;
field_0x1c = field_0x1e = field_0x20 = field_0x22 = 0;
mCRegUpdateMaterialID = mKRegUpdateMaterialID = NULL;
mCRValues = mCGValues = mCBValues = mCAValues = NULL;
mKRValues = mKGValues = mKBValues = mKAValues = NULL;
mKind = KIND_TEV_REG;
}
void getTevColorReg(u16, GXColorS10*) const;
void getTevKonstReg(u16, GXColor*) const;
virtual ~J2DAnmTevRegKey() {}
virtual void searchUpdateMaterialID(J2DScreen* pScreen);
u16 getCRegUpdateMaterialNum() const { return mCRegUpdateMaterialNum; }
u16 getCRegUpdateMaterialID(u16 i) const {
J3D_PANIC(770, i < mCRegUpdateMaterialNum, "Error : range over.");
return mCRegUpdateMaterialID[i];
}
u16 getKRegUpdateMaterialNum() const { return mKRegUpdateMaterialNum; }
u16 getKRegUpdateMaterialID(u16 i) const {
J3D_PANIC(778, i < mKRegUpdateMaterialNum, "Error : range over.");
return mKRegUpdateMaterialID[i];
}
J3DAnmCRegKeyTable* getAnmCRegKeyTable() const { return mAnmCRegKeyTable; }
J3DAnmKRegKeyTable* getAnmKRegKeyTable() const { return mAnmKRegKeyTable; }
/* 0x10 */ u16 mCRegUpdateMaterialNum;
/* 0x12 */ u16 mKRegUpdateMaterialNum;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ u16 field_0x18;
/* 0x1A */ u16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
/* 0x20 */ u16 field_0x20;
/* 0x22 */ u16 field_0x22;
/* 0x24 */ u16* mCRegUpdateMaterialID;
/* 0x28 */ JUTNameTab mCRegNameTab;
/* 0x38 */ u16* mKRegUpdateMaterialID;
/* 0x3C */ JUTNameTab mKRegNameTab;
/* 0x4C */ J3DAnmCRegKeyTable* mAnmCRegKeyTable;
/* 0x50 */ J3DAnmKRegKeyTable* mAnmKRegKeyTable;
/* 0x54 */ s16* mCRValues;
/* 0x58 */ s16* mCGValues;
/* 0x5C */ s16* mCBValues;
/* 0x60 */ s16* mCAValues;
/* 0x64 */ s16* mKRValues;
/* 0x68 */ s16* mKGValues;
/* 0x6C */ s16* mKBValues;
/* 0x70 */ s16* mKAValues;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmColor : public J2DAnmBase {
public:
J2DAnmColor() {
field_0x10 = field_0x12 = field_0x14 = field_0x16 = 0;
mUpdateMaterialNum = 0;
mUpdateMaterialID = NULL;
mKind = KIND_COLOR;
}
virtual ~J2DAnmColor() {}
virtual void searchUpdateMaterialID(J2DScreen*);
virtual void getColor(u16, _GXColor*) const {}
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
u16 getUpdateMaterialID(u16 i) const {
J3D_PANIC(224, i < mUpdateMaterialNum, "Error : range over.");
return mUpdateMaterialID[i];
}
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ u16 mUpdateMaterialNum;
/* 0x1C */ u16* mUpdateMaterialID;
/* 0x20 */ JUTNameTab field_0x20;
}; // Size: 0x30
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmColorKey : public J2DAnmColor {
public:
J2DAnmColorKey() {
mRValues = NULL;
mGValues = NULL;
mBValues = NULL;
mAValues = NULL;
mInfoTable = NULL;
}
virtual ~J2DAnmColorKey() {}
virtual void getColor(u16, _GXColor*) const;
/* 0x30 */ s16* mRValues;
/* 0x34 */ s16* mGValues;
/* 0x38 */ s16* mBValues;
/* 0x3C */ s16* mAValues;
/* 0x40 */ J3DAnmColorKeyTable* mInfoTable;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DAnmColorFullInfo {
/* 0x00 */ u16 mRMaxFrame;
/* 0x02 */ u16 mROffset;
/* 0x04 */ u16 mGMaxFrame;
/* 0x06 */ u16 mGOffset;
/* 0x08 */ u16 mBMaxFrame;
/* 0x0A */ u16 mBOffset;
/* 0x0C */ u16 mAMaxFrame;
/* 0x0E */ u16 mAOffset;
}; // Size = 0x10
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmColorFull : public J2DAnmColor {
public:
J2DAnmColorFull() {
mRValues = NULL;
mGValues = NULL;
mBValues = NULL;
mAValues = NULL;
mInfoTable = NULL;
}
virtual ~J2DAnmColorFull() {}
virtual void getColor(u16, _GXColor*) const;
/* 0x30 */ u8* mRValues;
/* 0x34 */ u8* mGValues;
/* 0x38 */ u8* mBValues;
/* 0x3C */ u8* mAValues;
/* 0x40 */ J3DAnmColorFullTable* mInfoTable;
};
inline f32 J2DHermiteInterpolation(f32 f1, const f32* f2, const f32* f3, const f32* f4, const f32* f5, const f32* f6,
const f32* f7) {
return JMAHermiteInterpolation(f1, *f2, *f3, *f4, *f5, *f6, *f7);
}
inline f32 J2DHermiteInterpolation(__REGISTER f32 pp1, __REGISTER s16* pp2, __REGISTER s16* pp3,
__REGISTER s16* pp4, __REGISTER s16* pp5, __REGISTER s16* pp6,
__REGISTER s16* pp7) {
#ifdef __MWERKS__
__REGISTER f32 p1 = pp1;
__REGISTER f32 ff8;
__REGISTER f32 ff7;
__REGISTER f32 ff6;
__REGISTER f32 ff5;
__REGISTER f32 ff4;
__REGISTER f32 ff3;
__REGISTER f32 ff2;
__REGISTER f32 ff0;
__REGISTER f32 fout;
__REGISTER s16* p2 = pp2;
__REGISTER s16* p3 = pp3;
__REGISTER s16* p4 = pp4;
__REGISTER s16* p5 = pp5;
__REGISTER s16* p6 = pp6;
__REGISTER s16* p7 = pp7;
// clang-format off
asm {
psq_l ff2, 0(p2), 0x1, 5
psq_l ff0, 0(p5), 0x1, 5
psq_l ff7, 0(p3), 0x1, 5
fsubs ff5, ff0, ff2
psq_l ff6, 0(p6), 0x1, 5
fsubs ff3, p1, ff2
psq_l ff0, 0(p7), 0x1, 5
fsubs ff4, ff6, ff7
fdivs ff3, ff3, ff5
psq_l fout, 0(p4), 0x1, 5
fmadds ff0, ff0, ff5, ff7
fmuls ff2, ff3, ff3
fnmsubs ff4, ff5, fout, ff4
fsubs ff0, ff0, ff6
fsubs ff0, ff0, ff4
fmuls ff0, ff2, ff0
fmadds fout, ff5, fout, ff0
fmadds fout, fout, ff3, ff7
fmadds fout, ff4, ff2, fout
fsubs fout, fout, ff0
}
// clang-format on
return fout;
#endif
}
#endif /* J2DANIMATION_H */
-88
View File
@@ -1,88 +0,0 @@
#ifndef J2DANMLOADER_H
#define J2DANMLOADER_H
#include "JSystem/J2DGraph/J2DAnimation.h"
/**
* @ingroup jsystem-j2d
*
*/
struct J2DAnmLoaderDataBase {
static J2DAnmBase* load(void const*);
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmLoader {
public:
virtual void* load(void const*) = 0;
virtual void setResource(J2DAnmBase*, void const*) = 0;
virtual ~J2DAnmLoader() {}
void* mpResource;
};
struct J3DAnmTextureSRTKeyData;
struct J3DAnmColorKeyData;
struct J3DAnmVtxColorKeyData;
struct J3DAnmTevRegKeyData;
struct J3DAnmTransformFullData;
struct J3DAnmColorFullData;
struct J3DAnmTexPatternFullData;
struct J3DAnmVisibilityFullData;
struct J3DAnmVtxColorFullData;
struct J3DAnmTransformKeyData;
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmKeyLoader_v15 : public J2DAnmLoader {
public:
J2DAnmKeyLoader_v15();
void readAnmTransform(J3DAnmTransformKeyData const*);
void setAnmTransform(J2DAnmTransformKey*, J3DAnmTransformKeyData const*);
void readAnmTextureSRT(J3DAnmTextureSRTKeyData const*);
void setAnmTextureSRT(J2DAnmTextureSRTKey*, J3DAnmTextureSRTKeyData const*);
void readAnmColor(J3DAnmColorKeyData const*);
void setAnmColor(J2DAnmColorKey*, J3DAnmColorKeyData const*);
void readAnmVtxColor(J3DAnmVtxColorKeyData const*);
void setAnmVtxColor(J2DAnmVtxColorKey*, J3DAnmVtxColorKeyData const*);
void readAnmTevReg(J3DAnmTevRegKeyData const*);
void setAnmTevReg(J2DAnmTevRegKey*, J3DAnmTevRegKeyData const*);
virtual void* load(void const*);
virtual void setResource(J2DAnmBase*, void const*);
virtual ~J2DAnmKeyLoader_v15();
// /* 0x04 */ void* _4;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DAnmFullLoader_v15 : public J2DAnmLoader {
public:
J2DAnmFullLoader_v15();
void readAnmTransform(J3DAnmTransformFullData const*);
void setAnmTransform(J2DAnmTransformFull*, J3DAnmTransformFullData const*);
void readAnmColor(J3DAnmColorFullData const*);
void setAnmColor(J2DAnmColorFull*, J3DAnmColorFullData const*);
void readAnmTexPattern(J3DAnmTexPatternFullData const*);
void setAnmTexPattern(J2DAnmTexPattern*, J3DAnmTexPatternFullData const*);
void readAnmVisibility(J3DAnmVisibilityFullData const*);
void setAnmVisibility(J2DAnmVisibilityFull*, J3DAnmVisibilityFullData const*);
void readAnmVtxColor(J3DAnmVtxColorFullData const*);
void setAnmVtxColor(J2DAnmVtxColorFull*, J3DAnmVtxColorFullData const*);
virtual void* load(void const*);
virtual void setResource(J2DAnmBase*, void const*);
virtual ~J2DAnmFullLoader_v15();
// void* _4;
};
#endif /* J2DANMLOADER_H */
-70
View File
@@ -1,70 +0,0 @@
#ifndef J2DGRAFCONTEXT_H
#define J2DGRAFCONTEXT_H
#include "JSystem/JGeometry.h"
#include "JSystem/JUtility/TColor.h"
#include <dolphin/mtx.h>
/**
* @ingroup jsystem-j2d
*
*/
class J2DGrafContext {
public:
struct Blend {
/* 0x0 */ u8 mType;
/* 0x1 */ u8 mSrcFactor;
/* 0x2 */ u8 mDstFactor;
};
J2DGrafContext(f32 x, f32 y, f32 width, f32 height);
void scissor(JGeometry::TBox2<f32> const& bounds);
void scissor(f32 x, f32 y, f32 width, f32 height) {
scissor(JGeometry::TBox2<f32>(x, y, x + width, y + height));
}
void setColor(JUtility::TColor c) { this->setColor(c, c, c, c); }
void setColor(JUtility::TColor colorTL, JUtility::TColor colorTR,
JUtility::TColor colorBR, JUtility::TColor colorBL);
void setLineWidth(u8);
void fillBox(JGeometry::TBox2<f32> const& box);
void drawFrame(JGeometry::TBox2<f32> const& box);
void line(JGeometry::TVec2<f32> start, JGeometry::TVec2<f32> end);
void lineTo(JGeometry::TVec2<f32> pos);
void lineTo(f32 x, f32 y) { this->lineTo(JGeometry::TVec2<f32>(x, y)); }
void moveTo(f32 x, f32 y) { this->moveTo(JGeometry::TVec2<f32>(x, y)); }
void moveTo(JGeometry::TVec2<f32> pos) { mPrevPos = pos; }
virtual ~J2DGrafContext() {}
virtual void place(JGeometry::TBox2<f32> const& bounds);
virtual void place(f32 x, f32 y, f32 width, f32 height) {
JGeometry::TBox2<f32> box(x, y, x + width, y + height);
this->place(box);
}
virtual void setPort();
virtual void setup2D();
virtual void setScissor();
virtual s32 getGrafType() const { return 0; }
virtual void setLookat() {}
JGeometry::TBox2<f32>* getBounds() { return &mBounds; }
public:
/* 0x04 */ JGeometry::TBox2<f32> mBounds;
/* 0x14 */ JGeometry::TBox2<f32> mScissorBounds;
/* 0x24 */ JUtility::TColor mColorTL;
/* 0x28 */ JUtility::TColor mColorTR;
/* 0x2C */ JUtility::TColor mColorBR;
/* 0x30 */ JUtility::TColor mColorBL;
/* 0x34 */ u8 mLineWidth;
/* 0x38 */ JGeometry::TVec2<f32> mPrevPos;
/* 0x40 */ Mtx44 mMtx44;
/* 0x80 */ Mtx mPosMtx;
/* 0xB0 */ Blend field_0xb0;
/* 0xB3 */ Blend mLinePart;
/* 0xB6 */ Blend mBoxPart;
};
#endif /* J2DGRAFCONTEXT_H */
-43
View File
@@ -1,43 +0,0 @@
#ifndef J2DMANAGE_H
#define J2DMANAGE_H
#include <dolphin/types.h>
class JSUInputStream;
/**
* @ingroup jsystem-j2d
*
*/
struct J2DResReference {
/* 0x00 */ u16 mCount;
/* 0x02 */ u16 mOffsets[1];
char* getResReference(u16) const;
char* getName(u16) const;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DataManageLink {
/* 0x00 */ void* mData;
/* 0x04 */ char* mName;
/* 0x08 */ J2DataManageLink* mNext;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DDataManage {
private:
/* 0x00 */ J2DataManageLink* mList;
public:
void* get(char const*);
void* get(JSUInputStream*);
};
#endif /* J2DMANAGE_H */
File diff suppressed because it is too large Load Diff
-63
View File
@@ -1,63 +0,0 @@
#ifndef J2DMATERIAL_H
#define J2DMATERIAL_H
#include "JSystem/J2DGraph/J2DAnimation.h"
#include "JSystem/J2DGraph/J2DMatBlock.h"
/**
* @ingroup jsystem-j2d
*
*/
class J2DMaterial {
public:
struct J2DMaterialAnmPointer {
J2DMaterialAnmPointer();
/* 0x00 */ J2DAnmColor* mColorAnm;
/* 0x04 */ J2DAnmTextureSRTKey* mSRTAnm;
/* 0x08 */ J2DAnmTexPattern* mPatternAnm;
/* 0x0C */ J2DAnmTevRegKey* mTevAnm;
/* 0x10 */ u16 mColorIds;
/* 0x12 */ u16 mSRTIds[8];
/* 0x22 */ u16 mPatternIds[8];
/* 0x32 */ u16 mTevCRegIds[4];
/* 0x3A */ u16 mTevKRegIds[4];
}; // Size: 0x44
J2DMaterial();
void setGX();
static J2DTevBlock* createTevBlock(int, bool);
static J2DIndBlock* createIndBlock(int, bool);
void makeAnmPointer();
void setAnimation(J2DAnmTextureSRTKey*);
void setAnimation(J2DAnmTexPattern*);
void setAnimation(J2DAnmTevRegKey*);
void setAnimation(J2DAnmColor*);
void animation();
virtual ~J2DMaterial();
u16 getIndex() const { return mIndex; }
J2DColorBlock* getColorBlock() { return &mColorBlock; }
J2DTexGenBlock* getTexGenBlock() { return &mTexGenBlock; }
J2DPEBlock* getPEBlock() { return &mPEBlock; }
J2DTevBlock* getTevBlock() { return mTevBlock; }
J2DIndBlock* getIndBlock() { return mIndBlock; }
bool isVisible() const { return mVisible; }
int getMaterialAlphaCalc() const { return mMaterialAlphaCalc; }
// private:
/* 0x04 */ void* field_0x4;
/* 0x08 */ int field_0x8;
/* 0x0C */ u16 mIndex;
/* 0x0E */ bool mVisible;
/* 0x0F */ u8 mMaterialAlphaCalc;
/* 0x10 */ J2DColorBlock mColorBlock;
/* 0x28 */ J2DTexGenBlock mTexGenBlock;
/* 0x70 */ J2DTevBlock* mTevBlock;
/* 0x74 */ J2DIndBlock* mIndBlock;
/* 0x78 */ J2DPEBlock mPEBlock;
/* 0x84 */ J2DMaterialAnmPointer* mAnmPointer;
};
#endif /* J2DMATERIAL_H */
@@ -1,171 +0,0 @@
#ifndef J2DMATERIALFACTORY_H
#define J2DMATERIALFACTORY_H
#include "JSystem/J2DGraph/J2DManage.h"
#include "JSystem/J2DGraph/J2DMatBlock.h"
/**
* @ingroup jsystem-j2d
*
*/
struct J2DMaterialBlock {
u32 field_0x0;
u32 field_0x4;
u16 field_0x8;
u16 field_0xa;
u32 field_0xc;
u32 field_0x10;
u32 field_0x14;
u32 field_0x18;
u32 field_0x1c;
u32 field_0x20;
u32 field_0x24;
u32 field_0x28;
u32 field_0x2c;
u32 field_0x30;
u32 field_0x34;
u32 field_0x38;
u32 field_0x3c;
u32 field_0x40;
u32 field_0x44;
u32 field_0x48;
u32 field_0x4c;
u32 field_0x50;
u32 field_0x54;
u32 field_0x58;
u32 field_0x5c;
u32 field_0x60;
u32 field_0x64;
};
typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;
struct J2DAlphaCompInfo;
struct J2DBlendInfo;
struct J2DColorChanInfo;
class J2DMaterial;
/**
* @ingroup jsystem-j2d
*
*/
struct J2DIndInitData {
u8 field_0x0;
u8 field_0x1;
u8 field_0x2[2];
J2DIndTexOrderInfo field_0x4[4];
J2DIndTexMtxInfo field_0xc[3];
J2DIndTexCoordScaleInfo field_0x60[4];
J2DIndTevStageInfo field_0x68[4];
u8 field_0xac[0x90];
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DMaterialInitData {
u8 field_0x0;
u8 field_0x1;
u8 field_0x2;
u8 field_0x3;
u8 field_0x4;
u8 field_0x5;
u8 field_0x6;
u8 field_0x7;
u16 field_0x8[2];
u16 field_0xc[4];
u16 field_0x14[8];
u16 field_0x24[0xa];
u16 field_0x38[8];
u16 field_0x48;
u16 field_0x4a[4];
u8 field_0x52[0x10];
u8 field_0x62[0x10];
u16 field_0x72[0x10];
u16 field_0x92[0x4];
u16 field_0x9a[0x10];
u16 field_0xba[0x10];
u16 field_0xda[0x4];
u16 field_0xe2;
u16 field_0xe4;
u16 field_0xe6;
};
struct J2DTevStageInfo;
struct J2DTevSwapModeTableInfo;
struct J2DTevSwapModeInfo;
struct J2DTevOrderInfo;
struct J2DTexCoordInfo;
struct J2DTexMtxInfo;
class JKRArchive;
/**
* @ingroup jsystem-j2d
*
*/
class J2DMaterialFactory {
public:
J2DMaterialFactory(J2DMaterialBlock const&);
u32 countStages(int) const;
J2DMaterial* create(J2DMaterial*, int, u32, J2DResReference*, J2DResReference*,
JKRArchive*) const;
JUtility::TColor newMatColor(int, int) const;
u8 newColorChanNum(int) const;
J2DColorChan newColorChan(int, int) const;
u32 newTexGenNum(int) const;
J2DTexCoord newTexCoord(int, int) const;
J2DTexMtx* newTexMtx(int, int) const;
u8 newCullMode(int) const;
u16 newTexNo(int, int) const;
u16 newFontNo(int) const;
J2DTevOrder newTevOrder(int, int) const;
J2DGXColorS10 newTevColor(int, int) const;
JUtility::TColor newTevKColor(int, int) const;
u8 newTevStageNum(int) const;
J2DTevStage newTevStage(int, int) const;
J2DTevSwapModeTable newTevSwapModeTable(int, int) const;
u8 newIndTexStageNum(int) const;
J2DIndTexOrder newIndTexOrder(int, int) const;
J2DIndTexMtx newIndTexMtx(int, int) const;
J2DIndTevStage newIndTevStage(int, int) const;
J2DIndTexCoordScale newIndTexCoordScale(int, int) const;
J2DAlphaComp newAlphaComp(int) const;
J2DBlend newBlend(int) const;
u8 newDither(int) const;
u8 getMaterialMode(int idx) const {
return field_0x4[field_0x8[idx]].field_0x0;
}
u8 getMaterialAlphaCalc(int idx) const {
return field_0x4[field_0x8[idx]].field_0x6;
}
private:
/* 0x00 */ u16 field_0x0;
/* 0x02 */ u16 field_0x2;
/* 0x04 */ J2DMaterialInitData* field_0x4;
/* 0x08 */ u16* field_0x8;
/* 0x0C */ J2DIndInitData* field_0xc;
/* 0x10 */ GXColor* field_0x10;
/* 0x14 */ u8* field_0x14;
/* 0x18 */ J2DColorChanInfo* field_0x18;
/* 0x1C */ u8* field_0x1c;
/* 0x20 */ J2DTexCoordInfo* field_0x20;
/* 0x24 */ J2DTexMtxInfo* field_0x24;
/* 0x28 */ u16* field_0x28;
/* 0x2C */ u16* field_0x2c;
/* 0x30 */ _GXCullMode* field_0x30;
/* 0x34 */ J2DTevOrderInfo* field_0x34;
/* 0x38 */ _GXColorS10* field_0x38;
/* 0x3C */ GXColor* field_0x3c;
/* 0x40 */ u8* field_0x40;
/* 0x44 */ J2DTevStageInfo* field_0x44;
/* 0x48 */ J2DTevSwapModeInfo* field_0x48;
/* 0x4C */ J2DTevSwapModeTableInfo* field_0x4c;
/* 0x50 */ J2DAlphaCompInfo* field_0x50;
/* 0x54 */ J2DBlendInfo* field_0x54;
/* 0x58 */ u8* field_0x58;
};
#endif /* J2DMATERIALFACTORY_H */
-43
View File
@@ -1,43 +0,0 @@
#ifndef J2DORTHOGRAPH_H
#define J2DORTHOGRAPH_H
#include "JSystem/J2DGraph/J2DGrafContext.h"
/**
* @ingroup jsystem-j2d
*
*/
class J2DOrthoGraph : public J2DGrafContext {
public:
J2DOrthoGraph();
J2DOrthoGraph(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near);
void setOrtho(JGeometry::TBox2<f32> const& bounds, f32 far, f32 near);
void scissorBounds(JGeometry::TBox2<f32>*, JGeometry::TBox2<f32> const*);
virtual ~J2DOrthoGraph() {}
virtual void setPort();
virtual s32 getGrafType() const { return 1; }
virtual void setLookat();
f32 getWidthPower() { return mBounds.getWidth() / mOrtho.getWidth(); }
f32 getHeightPower() { return mBounds.getHeight() / mOrtho.getHeight(); }
const JGeometry::TBox2<f32>* getOrtho() const { return &mOrtho; }
void setOrtho(f32 x, f32 y, f32 width, f32 height, f32 far, f32 near) {
setOrtho(JGeometry::TBox2<f32>(x, y, x + width, y + height), far, near);
}
private:
/* 0xBC */ JGeometry::TBox2<f32> mOrtho;
/* 0xCC */ f32 mNear;
/* 0xD0 */ f32 mFar;
};
void J2DDrawLine(f32 x1, f32 y1, f32 x2, f32 y2, JUtility::TColor color,
int line_width);
void J2DFillBox(f32 x, f32 y, f32 width, f32 height, JUtility::TColor color);
void J2DFillBox(JGeometry::TBox2<f32> const& box, JUtility::TColor color);
void J2DDrawFrame(f32 x, f32 y, f32 width, f32 height, JUtility::TColor color, u8 line_width);
void J2DDrawFrame(JGeometry::TBox2<f32> const& box, JUtility::TColor color, u8 line_width);
#endif /* J2DORTHOGRAPH_H */
-240
View File
@@ -1,240 +0,0 @@
#ifndef J2DPANE_H
#define J2DPANE_H
#include "JSystem/JGeometry.h"
#include "JSystem/JSupport/JSUList.h"
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
class J2DAnmBase;
class J2DAnmColor;
class J2DAnmTransform;
class J2DAnmTevRegKey;
class J2DAnmTextureSRTKey;
class J2DAnmVisibilityFull;
class J2DAnmVtxColor;
class J2DGrafContext;
class J2DScreen;
class J2DAnmTexPattern;
class JKRArchive;
class JSURandomInputStream;
struct ResFONT;
struct ResTIMG;
enum J2DRotateAxis {
/* 0x78 */ ROTATE_X = 'x',
/* 0x79 */ ROTATE_Y = 'y',
/* 0x7A */ ROTATE_Z = 'z'
};
enum J2DBasePosition {
J2DBasePosition_0,
J2DBasePosition_1,
J2DBasePosition_2,
J2DBasePosition_3,
J2DBasePosition_4,
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DPaneHeader {
/* 0x0 */ u32 mKind;
/* 0x4 */ u32 mSize;
};
/**
* @ingroup jsystem-j2d
*
*/
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);
Vec 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();
/* vt 0x0C */ virtual u16 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) {
GXCullMode mode;
if (cull) {
mode = GX_CULL_BACK;
} else {
mode = GX_CULL_NONE;
}
setCullBack(mode);
}
/* vt 0x20 */ virtual void setCullBack(_GXCullMode cmode);
/* vt 0x24 */ virtual void setAlpha(u8 alpha) {
mAlpha = alpha;
};
/* vt 0x28 */ virtual bool setConnectParent(bool connected) {
mConnected = false;
return false;
}
/* vt 0x2C */ virtual void calcMtx() {
if (mPaneTree.getParent() != NULL) {
makeMatrix(mTranslateX, mTranslateY);
}
}
/* 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 a, f32 b) {
makeMatrix(a, b, -mBounds.i.x, -mBounds.i.y);
}
/* 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* p_visibility) {
setAnimation(p_visibility);
}
/* vt 0x88 */ virtual void setVtxColorAnimation(J2DAnmVtxColor* vtx_color);
/* vt 0x8C */ virtual void setAnimationVC(J2DAnmVtxColor* p_vtxColor) {
setAnimation(p_vtxColor);
}
/* vt 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(); }
JSUTree<J2DPane>* getEndChild() { return mPaneTree.getEndChild(); }
const JSUTree<J2DPane>* getPaneTree() { return &mPaneTree; }
u8 getAlpha() const { return mAlpha; }
f32 getScaleX() const { return mScaleX; }
f32 getScaleY() const { return mScaleY; }
f32 getTranslateX() const { return mTranslateX; }
f32 getTranslateY() const { return mTranslateY; }
f32 getRotateZ() const { return mRotateZ; }
f32 getRotOffsetX() const { return mRotateOffsetX; }
f32 getRotOffsetY() const { return mRotateOffsetY; }
MtxP getGlbMtx() { return mGlobalMtx; }
const JGeometry::TBox2<f32>& getGlbBounds() const { return mGlobalBounds; }
void setMtx(Mtx m) { MTXCopy(m, mPositionMtx); }
void translate(f32 transX, f32 transY) {
mTranslateX = transX;
mTranslateY = transY;
calcMtx();
}
void scale(f32 scaleH, f32 scaleV) {
mScaleX = scaleH;
mScaleY = scaleV;
calcMtx();
}
void rotateY(f32 rotate) {
mRotateY = rotate;
calcMtx();
}
int getKind() const { return mKind; }
bool isVisible() const { return mVisible; }
void show() { mVisible = true; }
void hide() { mVisible = false; }
bool isInfluencedAlpha() const { return mIsInfluencedAlpha; }
bool isConnectParent() const { return mConnected; }
u64 getUserInfo() const { return mUserInfoTag; }
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 field_0x4;
/* 0x08 */ int mKind;
/* 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;
#if !(PLATFORM_WII || PLATFORM_SHIELD)
/* 0xFC */ u32 _fc;
#endif
};
#endif /* J2DPANE_H */
-230
View File
@@ -1,230 +0,0 @@
#ifndef J2DPICTURE_H
#define J2DPICTURE_H
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "JSystem/JUtility/TColor.h"
class J2DMaterial;
class JUTPalette;
struct ResTIMG;
struct ResTLUT;
enum J2DMirror {
/* 0 */ MIRROR0, // temp, figure out later
/* 1 */ J2DMirror_Y = (1 << 0),
/* 2 */ J2DMirror_X = (1 << 1),
};
enum J2DBinding {
/* 0 */ J2DBind_None = 0,
/* 1 */ J2DBind_Bottom = (1 << 0),
/* 2 */ J2DBind_Top = (1 << 1),
/* 4 */ J2DBind_Right = (1 << 2),
/* 8 */ J2DBind_Left = (1 << 3),
/* 0xF */ BIND15 = 15, // temp, figure out later
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DPicHeader {
/* 0x0 */ u32 mTag;
/* 0x4 */ u32 mSize;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DScrnBlockPictureParameter {
/* 0x00 */ u16 field_0x0;
/* 0x02 */ u16 mMaterialNum;
/* 0x04 */ u16 field_0x4;
/* 0x06 */ u16 field_0x6;
/* 0x08 */ u16 field_0x8[4];
/* 0x10 */ JGeometry::TVec2<s16> field_0x10[4];
/* 0x20 */ u32 mCornerColor[4];
}; // Size: 0x30
/**
* @ingroup jsystem-j2d
*
*/
class J2DPicture : public J2DPane {
public:
virtual ~J2DPicture();
virtual u16 getTypeID() const { return 18; }
virtual void drawSelf(f32, f32);
virtual void drawSelf(f32, f32, Mtx*);
virtual void initiate(ResTIMG const*, ResTLUT const*);
virtual bool prepareTexture(u8);
virtual bool append(ResTIMG const* param_0, f32 param_1) {
return insert(param_0, mTextureNum, param_1);
}
virtual bool append(ResTIMG const* param_0, JUTPalette* param_1, f32 param_2) {
return insert(param_0, param_1, mTextureNum, param_2);
}
virtual bool append(char const* param_0, f32 param_1) {
return insert(param_0, mTextureNum, param_1);
}
virtual bool append(char const* param_0, JUTPalette* param_1, f32 param_2) {
return insert(param_0, param_1, mTextureNum, param_2);
}
virtual bool append(JUTTexture* param_0, f32 param_1) {
return insert(param_0, mTextureNum, param_1);
}
virtual void prepend(ResTIMG const* param_0, f32 param_1) {
insert(param_0, 0, param_1);
}
virtual void prepend(ResTIMG const* param_0, JUTPalette* param_1, f32 param_2) {
insert(param_0, param_1, 0, param_2);
}
virtual void prepend(char const* param_0, f32 param_1) {
insert(param_0, 0, param_1);
}
virtual void prepend(char const* param_0, JUTPalette* param_1, f32 param_2) {
insert(param_0, param_1, 0, param_2);
}
virtual void prepend(JUTTexture* param_0, f32 param_1) {
insert(param_0, 0, param_1);
}
virtual bool insert(ResTIMG const* param_0, u8 param_1, f32 param_2) {
return insert(param_0, NULL, param_1, param_2);
}
virtual bool insert(ResTIMG const*, JUTPalette*, u8, f32);
virtual bool insert(char const* param_0, u8 param_1, f32 param_2) {
return insert(param_0, NULL, param_1, param_2);
}
virtual bool insert(char const*, JUTPalette*, u8, f32);
virtual bool insert(JUTTexture*, u8, f32);
virtual bool remove(u8);
virtual bool remove() { return remove(mTextureNum - 1); }
virtual bool remove(JUTTexture*);
virtual void draw(f32 param_0, f32 param_1, bool param_2, bool param_3,
bool param_4) {
draw(param_0, param_1, 0, param_2, param_3, param_4);
}
virtual void draw(f32 param_0, f32 param_1, u8 param_2, bool param_3,
bool param_4, bool param_5) {
if (param_2 < mTextureNum && mTexture[param_2] != NULL) {
draw(param_0, param_1, mTexture[param_2]->getWidth(), mTexture[param_2]->getHeight(),
param_3, param_4, param_5);
}
}
virtual void draw(f32, f32, f32, f32, bool, bool, bool);
virtual void drawOut(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
f32 param_4, f32 param_5) {
if (mTexture[0] != NULL) {
drawOut(JGeometry::TBox2<f32>(param_0, param_1, param_0 + param_2, param_1 + param_3),
JGeometry::TBox2<f32>(param_4, param_5, param_4 + mTexture[0]->getWidth(),
param_5 + mTexture[0]->getHeight()));
}
}
virtual void drawOut(f32 param_0, f32 param_1, f32 param_2, f32 param_3,
f32 param_4, f32 param_5, f32 param_6, f32 param_7) {
drawOut(JGeometry::TBox2<f32>(param_0, param_1, param_0 + param_2, param_1 + param_3),
JGeometry::TBox2<f32>(param_4, param_5, param_4 + param_6, param_5 + param_7));
}
virtual void drawOut(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
virtual void load(_GXTexMapID param_0, u8 param_1) {
if (param_1 < mTextureNum && param_1 < 2 && mTexture[param_1] != NULL) {
mTexture[param_1]->load(param_0);
}
}
virtual void load(u8 param_0) { load((_GXTexMapID)param_0, param_0); }
virtual void setBlendRatio(f32 param_0, f32 param_1) {
setBlendColorRatio(param_0, param_1);
setBlendAlphaRatio(param_0, param_1);
}
virtual void setBlendColorRatio(f32, f32);
virtual void setBlendAlphaRatio(f32, f32);
virtual const ResTIMG* changeTexture(ResTIMG const*, u8);
virtual const ResTIMG* changeTexture(char const*, u8);
virtual const ResTIMG* changeTexture(ResTIMG const*, u8, JUTPalette*);
virtual const ResTIMG* changeTexture(char const*, u8, JUTPalette*);
virtual JUTTexture* getTexture(u8 param_0) const {
if (param_0 < 2) {
return mTexture[param_0];
}
return NULL;
}
virtual u8 getTextureCount() const { return mTextureNum; }
/* vt 0x128 */ virtual bool setBlack(JUtility::TColor i_black) {
mBlack = i_black;
return true;
}
/* vt 0x12C */ virtual bool setWhite(JUtility::TColor i_white) {
mWhite = i_white;
return true;
}
virtual bool setBlackWhite(JUtility::TColor i_black, JUtility::TColor i_white) {
mBlack = i_black;
mWhite = i_white;
return true;
}
virtual JUtility::TColor getBlack() const {
return mBlack;
}
virtual JUtility::TColor getWhite() const {
return mWhite;
}
virtual J2DMaterial* getMaterial() const { return NULL; }
virtual void drawFullSet(f32, f32, f32, f32, Mtx*);
virtual void drawTexCoord(f32, f32, f32, f32, s16, s16, s16, s16, s16, s16, s16,
s16, Mtx*);
virtual u8 getUsableTlut(u8);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const* param_0) { return J2DPane::isUsed(param_0); }
virtual void rewriteAlpha() {}
J2DPicture(u64, JGeometry::TBox2<f32> const&, ResTIMG const*, ResTLUT const*);
J2DPicture(ResTIMG const*);
J2DPicture(J2DPane*, JSURandomInputStream*, JKRArchive*);
J2DPicture();
J2DPicture(J2DPane*, JSURandomInputStream*, J2DMaterial*);
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
void private_initiate(ResTIMG const*, ResTLUT const*);
void initinfo();
void setTevMode();
static void swap(f32&, f32&);
J2DBinding getBinding() const;
void setMirror(J2DMirror);
bool isTumble() const;
void setBlendKonstColor();
void setBlendKonstAlpha();
void getNewColor(JUtility::TColor*);
void setTexCoord(JGeometry::TVec2<s16>*, JUTTexture const*, J2DBinding,
J2DMirror, bool);
void setTexCoord(JUTTexture const*, J2DBinding, J2DMirror, bool);
GXTlut 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;
}
void setCornerColor(JUtility::TColor c0) {
setCornerColor(c0, c0, c0, c0);
}
protected:
/* 0x100 */ JUTTexture* mTexture[2];
/* 0x108 */ u8 mTextureNum;
/* 0x109 */ u8 field_0x109;
/* 0x10A */ JGeometry::TVec2<s16> field_0x10a[4];
/* 0x11C */ f32 field_0x11c[2];
/* 0x124 */ f32 field_0x124[2];
/* 0x12C */ JUTPalette* mPalette;
/* 0x130 */ JUtility::TColor mWhite;
/* 0x134 */ JUtility::TColor mBlack;
/* 0x138 */ JUtility::TColor mCornerColor[4];
/* 0x148 */ JUtility::TColor mBlendKonstColor;
/* 0x14C */ JUtility::TColor mBlendKonstAlpha;
};
#endif /* J2DPICTURE_H */
-117
View File
@@ -1,117 +0,0 @@
#ifndef J2DPICTUREEX_H
#define J2DPICTUREEX_H
#include "JSystem/J2DGraph/J2DPicture.h"
#include "JSystem/J2DGraph/J2DTevs.h"
class J2DMaterial;
/**
* @ingroup jsystem-j2d
*
*/
class J2DPictureEx : public J2DPicture {
public:
enum stage_enum {
STAGE_0,
STAGE_1,
STAGE_2,
STAGE_3,
STAGE_4,
STAGE_5,
STAGE_6,
STAGE_7,
};
J2DPictureEx(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
void insertCommon(u8, f32);
bool isInsert(u8) const;
bool isRemove(u8) const;
void setTevOrder(u8, u8, bool);
void setTevStage(u8, u8, bool);
void setStage(J2DTevStage*, J2DPictureEx::stage_enum);
void setTevKColor(u8);
void setTevKColorSel(u8);
void setTevKAlphaSel(u8);
void shiftSetBlendRatio(u8, f32, bool, bool);
bool getBlackWhite(JUtility::TColor*, JUtility::TColor*) const;
bool isSetBlackWhite(JUtility::TColor, JUtility::TColor) const;
virtual ~J2DPictureEx();
virtual void setCullBack(bool);
virtual void setCullBack(_GXCullMode);
virtual void setAlpha(u8);
virtual void drawSelf(f32, f32, f32 (*)[3][4]);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const*);
virtual void rewriteAlpha();
virtual void setAnimation(J2DAnmBase*);
virtual void setAnimation(J2DAnmTransform* transform) { J2DPane::setAnimation(transform); }
virtual void setAnimation(J2DAnmColor*);
virtual void setAnimation(J2DAnmTexPattern*);
virtual void setAnimation(J2DAnmTextureSRTKey*);
virtual void setAnimation(J2DAnmTevRegKey*);
virtual void setAnimation(J2DAnmVisibilityFull*);
virtual void setAnimation(J2DAnmVtxColor*);
virtual const J2DAnmTransform* animationPane(J2DAnmTransform const*);
virtual void initiate(ResTIMG const*, ResTLUT const*);
virtual bool prepareTexture(u8);
virtual bool append(ResTIMG const*, f32);
virtual bool append(ResTIMG const*, JUTPalette*, f32);
virtual bool append(char const*, f32);
virtual bool append(char const*, JUTPalette*, f32);
virtual bool append(JUTTexture*, f32);
virtual void prepend(ResTIMG const*, f32);
virtual void prepend(ResTIMG const*, JUTPalette*, f32);
virtual void prepend(char const*, f32);
virtual void prepend(char const*, JUTPalette*, f32);
virtual void prepend(JUTTexture*, f32);
virtual bool insert(ResTIMG const*, u8, f32);
virtual bool insert(ResTIMG const*, JUTPalette*, u8, f32);
virtual bool insert(char const*, u8, f32);
virtual bool insert(char const*, JUTPalette*, u8, f32);
virtual bool insert(JUTTexture*, u8, f32);
virtual bool remove(u8);
virtual bool remove();
virtual bool remove(JUTTexture*);
virtual void draw(f32, f32, bool, bool, bool);
virtual void draw(f32, f32, u8, bool, bool, bool);
virtual void draw(f32, f32, f32, f32, bool, bool, bool);
virtual void drawOut(f32, f32, f32, f32, f32, f32);
virtual void drawOut(f32, f32, f32, f32, f32, f32, f32, f32);
virtual void drawOut(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
virtual void load(_GXTexMapID, u8);
virtual void load(u8);
virtual void setBlendColorRatio(f32, f32);
virtual void setBlendAlphaRatio(f32, f32);
virtual const ResTIMG* changeTexture(ResTIMG const*, u8);
virtual const ResTIMG* changeTexture(char const*, u8);
virtual const ResTIMG* changeTexture(ResTIMG const*, u8, JUTPalette*);
virtual const ResTIMG* changeTexture(char const*, u8, JUTPalette*);
virtual JUTTexture* getTexture(u8) const;
virtual u8 getTextureCount() const;
virtual bool setBlack(JUtility::TColor);
virtual bool setWhite(JUtility::TColor);
virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor);
virtual JUtility::TColor getBlack() const;
virtual JUtility::TColor getWhite() const;
virtual J2DMaterial* getMaterial() const { return mMaterial; }
virtual void drawFullSet(f32, f32, f32, f32, f32 (*)[3][4]);
virtual void drawTexCoord(f32, f32, f32, f32, s16, s16, s16, s16, s16, s16, s16,
s16, f32 (*)[3][4]);
virtual u8 getUsableTlut(u8);
private:
/* 0x150 */ J2DMaterial* mMaterial;
/* 0x154 */ u16 field_0x154;
/* 0x156 */ u16 field_0x156;
/* 0x158 */ u16 field_0x158[4];
/* 0x160 */ f32 field_0x160[6]; // related to blend color ratio
/* 0x178 */ f32 field_0x178[6]; // related to blend alpha ratio
/* 0x190 */ u8 field_0x190;
/* 0x194 */ J2DAnmVisibilityFull* field_0x194;
/* 0x198 */ J2DAnmVtxColor* field_0x198;
/* 0x19C */ u8 field_0x19c;
};
#endif /* J2DPICTUREEX_H */
-103
View File
@@ -1,103 +0,0 @@
#ifndef J2DPRINT_H
#define J2DPRINT_H
#include "JSystem/J2DGraph/J2DTextBox.h"
#include <cstdarg>
class JUTFont;
class J2DPrint;
extern "C" f32 J2DPrint_print_alpha_va(J2DPrint*, u8, const char*, va_list);
/**
* @ingroup jsystem-j2d
*
*/
class J2DPrint {
public:
struct TSize {
/* 0x0 */ f32 field_0x0;
/* 0x4 */ f32 field_0x4;
};
J2DPrint(JUTFont*, JUtility::TColor, JUtility::TColor);
void initiate();
J2DPrint(JUTFont*, f32, f32, JUtility::TColor, JUtility::TColor, JUtility::TColor, JUtility::TColor);
static u8* setBuffer(size_t);
void setFontSize();
void locate(f32, f32);
f32 print(f32, f32, u8, char const*, ...);
void printReturn(char const*, f32, f32, J2DTextBoxHBinding, J2DTextBoxVBinding,
f32, f32, u8);
f32 parse(u8 const*, int, int, u16*, J2DPrint::TSize&, u8, bool);
void doCtrlCode(int);
u16 doEscapeCode(u8 const**, u8);
void initchar();
s32 getNumberS32(u8 const**, s32, s32, int);
f32 getNumberF32(u8 const**, f32, f32, int);
virtual ~J2DPrint();
JUTFont* getFont() const { return mFont; }
f32 getCursorV() const { return mCursorV; }
void setCharColor(JUtility::TColor color) { mCharColor = color; }
void setGradColor(JUtility::TColor color) { mGradColor = color; }
f32 print_va(u8 alpha, const char* fmt, va_list args) {
return J2DPrint_print_alpha_va(this, alpha, fmt, args);
}
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 char* mStrBuff;
static size_t mStrBuffSize;
private:
void private_initiate(JUTFont*, f32, f32, JUtility::TColor, JUtility::TColor,
JUtility::TColor, JUtility::TColor, bool);
/* 0x04 */ JUTFont* mFont;
/* 0x08 */ JUtility::TColor field_0x8;
/* 0x0C */ JUtility::TColor field_0xc;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ f32 field_0x14;
/* 0x18 */ f32 mScaleX;
/* 0x1C */ f32 mScaleY;
/* 0x20 */ s16 field_0x20;
/* 0x22 */ bool field_0x22;
/* 0x24 */ f32 field_0x24;
/* 0x28 */ f32 field_0x28;
/* 0x2C */ f32 mCursorH;
/* 0x30 */ f32 mCursorV;
/* 0x34 */ f32 field_0x34;
/* 0x38 */ JUtility::TColor mBlackColor;
/* 0x3C */ JUtility::TColor mWhiteColor;
/* 0x40 */ JUtility::TColor mCharColor;
/* 0x44 */ JUtility::TColor mGradColor;
/* 0x48 */ f32 mCharSpacing;
/* 0x4C */ f32 mLineSpacing;
/* 0x50 */ f32 mFontSizeX;
/* 0x54 */ f32 mFontSizeY;
/* 0x58 */ s16 field_0x58;
/* 0x5A */ bool field_0x5a;
}; // Size: 0x5C
#endif /* J2DPRINT_H */
-103
View File
@@ -1,103 +0,0 @@
#ifndef J2DSCREEN_H
#define J2DSCREEN_H
#include "JSystem/J2DGraph/J2DManage.h"
#include "JSystem/J2DGraph/J2DPane.h"
#include "JSystem/JUtility/TColor.h"
class J2DMaterial;
class JUTNameTab;
/**
* @ingroup jsystem-j2d
*
*/
struct J2DScrnHeader {
/* 0x00 */ u32 mTag;
/* 0x04 */ u32 mType;
/* 0x08 */ u32 mFileSize;
/* 0x0C */ u32 mBlockNum;
/* 0x10 */ u8 padding[0x10];
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DScrnInfoHeader {
/* 0x0 */ u32 mTag;
/* 0x4 */ u32 mSize;
/* 0x8 */ u16 mWidth;
/* 0xA */ u16 mHeight;
/* 0xC */ u32 mColor;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DScrnBlockHeader {
/* 0x00 */ u32 mTag;
/* 0x04 */ s32 mSize;
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DScreen : public J2DPane {
public:
virtual ~J2DScreen();
virtual u16 getTypeID() const;
virtual void calcMtx();
virtual void drawSelf(f32, f32, Mtx*);
virtual J2DPane* search(u64);
virtual J2DPane* searchUserInfo(u64);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const*);
virtual void clearAnmTransform() { J2DPane::clearAnmTransform(); }
virtual void setAnimation(J2DAnmColor*);
virtual void setAnimation(J2DAnmTransform* i_bck) { J2DPane::setAnimation(i_bck); }
virtual void setAnimation(J2DAnmTextureSRTKey*);
virtual void setAnimation(J2DAnmVtxColor*);
virtual void setAnimation(J2DAnmTexPattern*);
virtual void setAnimation(J2DAnmVisibilityFull*);
virtual void setAnimation(J2DAnmTevRegKey*);
virtual void setAnimation(J2DAnmBase*);
virtual void setAnimationVF(J2DAnmVisibilityFull*);
virtual void setAnimationVC(J2DAnmVtxColor*);
virtual J2DPane* createPane(J2DScrnBlockHeader const&, JSURandomInputStream*,
J2DPane*, u32);
virtual J2DPane* createPane(J2DScrnBlockHeader const&, JSURandomInputStream*,
J2DPane*, u32, JKRArchive*);
J2DScreen();
void clean();
bool setPriority(char const*, u32, JKRArchive*);
bool setPriority(JSURandomInputStream*, u32, JKRArchive*);
bool private_set(JSURandomInputStream*, u32, JKRArchive*);
bool checkSignature(JSURandomInputStream*);
bool getScreenInformation(JSURandomInputStream*);
s32 makeHierarchyPanes(J2DPane*, JSURandomInputStream*, u32, JKRArchive*);
void draw(f32, f32, J2DGrafContext const*);
J2DResReference* getResReference(JSURandomInputStream*, u32);
bool createMaterial(JSURandomInputStream*, u32, JKRArchive*);
static void* getNameResource(char const*);
void animation();
void setScissor(bool i_scissor) { mScissor = i_scissor; }
static J2DDataManage* getDataManage() { return mDataManage; }
static J2DDataManage* mDataManage;
/* 0x100 */ bool mScissor;
/* 0x102 */ u16 mMaterialNum;
/* 0x104 */ J2DMaterial* mMaterials;
/* 0x108 */ J2DResReference* mTexRes;
/* 0x10C */ J2DResReference* mFontRes;
/* 0x110 */ JUTNameTab* mNameTable;
/* 0x114 */ JUtility::TColor mColor;
};
#endif /* J2DSCREEN_H */
-654
View File
@@ -1,654 +0,0 @@
#ifndef J2DTEVS_H
#define J2DTEVS_H
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
#include "global.h"
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTextureSRTInfo {
/* 0x00 */ f32 mScaleX;
/* 0x04 */ f32 mScaleY;
/* 0x08 */ f32 mRotationDeg;
/* 0x0C */ f32 mTranslationX;
/* 0x10 */ f32 mTranslationY;
}; // Size: 0x14
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTexMtxInfo {
enum {
/* 0x0 */ DCC_NONE,
/* 0x1 */ DCC_MAYA,
};
/* 0x00 */ u8 mTexMtxType;
/* 0x01 */ u8 mTexMtxDCC;
/* 0x02 */ u8 field_0x2; // padding ?
/* 0x03 */ u8 field_0x3; // padding ?
/* 0x04 */ Vec mCenter;
/* 0x10 */ J2DTextureSRTInfo mTexSRTInfo;
GXTexMtxType getTexMtxType() const { return (GXTexMtxType)mTexMtxType; }
J2DTexMtxInfo& operator=(const J2DTexMtxInfo& other) {
mCenter = other.mCenter;
mTexMtxType = other.mTexMtxType;
mTexMtxDCC = other.mTexMtxDCC;
mTexSRTInfo = other.mTexSRTInfo;
return *this;
}
}; // Size: 0x24
extern J2DTexMtxInfo const j2dDefaultTexMtxInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DTexMtx {
public:
J2DTexMtx() { mInfo = j2dDefaultTexMtxInfo; }
~J2DTexMtx() {}
J2DTexMtx(const J2DTexMtxInfo& info) { mInfo = info; }
void load(u32);
void calc();
void getTextureMtx(J2DTextureSRTInfo const&, Vec, Mtx);
void getTextureMtxMaya(J2DTextureSRTInfo const&, Mtx);
J2DTexMtxInfo& getTexMtxInfo() { return mInfo; }
void setTexMtxInfo(J2DTexMtxInfo info) { mInfo = info; }
private:
/* 0x00 */ J2DTexMtxInfo mInfo;
/* 0x24 */ Mtx mTexMtx;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DIndTexOrderInfo {
/* 0x0 */ u8 mTexCoordID;
/* 0x1 */ u8 mTexMapID;
J2DIndTexOrderInfo& operator=(const J2DIndTexOrderInfo& other) {
mTexCoordID = other.mTexCoordID;
mTexMapID = other.mTexMapID;
return *this;
}
GXTexCoordID getTexCoordID() const { return (GXTexCoordID)mTexCoordID; }
GXTexMapID getTexMapID() const { return (GXTexMapID)mTexMapID; }
};
extern const J2DIndTexOrderInfo j2dDefaultIndTexOrderNull;
/**
* @ingroup jsystem-j2d
*
*/
class J2DIndTexOrder {
public:
J2DIndTexOrder() {
mInfo = j2dDefaultIndTexOrderNull;
}
J2DIndTexOrder(const J2DIndTexOrderInfo& info) {
mInfo = info;
}
J2DIndTexOrder& operator=(const J2DIndTexOrderInfo& info) {
mInfo = info;
return *this;
}
void setIndTexOrderInfo(const J2DIndTexOrderInfo& info) { mInfo = info; }
void load(u8);
private:
/* 0x0 */ J2DIndTexOrderInfo mInfo;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DIndTexMtxInfo {
/* 0x00 */ Mtx23 mMtx;
/* 0x18 */ s8 mScaleExp;
J2DIndTexMtxInfo& operator=(const J2DIndTexMtxInfo& other) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 3; j++) {
mMtx[i][j] = other.mMtx[i][j];
}
}
mScaleExp = other.mScaleExp;
return *this;
}
};
extern J2DIndTexMtxInfo const j2dDefaultIndTexMtxInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DIndTexMtx {
public:
~J2DIndTexMtx() {}
J2DIndTexMtx() {
mIndTexMtxInfo = j2dDefaultIndTexMtxInfo;
}
J2DIndTexMtx(const J2DIndTexMtxInfo& info) {
mIndTexMtxInfo = info;
}
J2DIndTexMtx& operator=(const J2DIndTexMtxInfo& info) {
mIndTexMtxInfo = info;
return *this;
}
void setIndTexMtxInfo(const J2DIndTexMtxInfo& info) { mIndTexMtxInfo = info; }
void load(u8);
void load(u32);
void calc();
private:
/* 0x0 */ J2DIndTexMtxInfo mIndTexMtxInfo;
}; // Size: 0x1C
/**
* @ingroup jsystem-j2d
*
*/
struct J2DIndTexCoordScaleInfo {
/* 0x0 */ u8 mScaleS;
/* 0x1 */ u8 mScaleT;
J2DIndTexCoordScaleInfo& operator=(const J2DIndTexCoordScaleInfo& other) {
mScaleS = other.mScaleS;
mScaleT = other.mScaleT;
return *this;
}
GXIndTexScale getScaleS() const { return (GXIndTexScale)mScaleS; }
GXIndTexScale getScaleT() const { return (GXIndTexScale)mScaleT; }
};
extern const J2DIndTexCoordScaleInfo j2dDefaultIndTexCoordScaleInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DIndTexCoordScale {
public:
~J2DIndTexCoordScale() {}
J2DIndTexCoordScale() {
mInfo = j2dDefaultIndTexCoordScaleInfo;
}
J2DIndTexCoordScale(const J2DIndTexCoordScaleInfo& info) {
mInfo = info;
}
J2DIndTexCoordScale& operator=(const J2DIndTexCoordScaleInfo& info) {
mInfo = info;
return *this;
}
void setIndTexCoordScaleInfo(const J2DIndTexCoordScaleInfo& info) { mInfo = info; }
void load(u8);
private:
/* 0x0 */ J2DIndTexCoordScaleInfo mInfo;
}; // Size: 0x2
/**
* @ingroup jsystem-j2d
*
*/
struct J2DIndTevStageInfo {
/* 0x0 */ u8 mIndStage;
/* 0x1 */ u8 mIndFormat;
/* 0x2 */ u8 mBiasSel;
/* 0x3 */ u8 mMtxSel;
/* 0x4 */ u8 mWrapS;
/* 0x5 */ u8 mWrapT;
/* 0x6 */ u8 mPrev;
/* 0x7 */ u8 mLod;
/* 0x8 */ u8 mAlphaSel;
/* 0x9 */ u8 field_0x9;
/* 0xa */ u8 field_0xa;
/* 0xb */ u8 field_0xb;
J2DIndTevStageInfo& operator=(const J2DIndTevStageInfo& other) {
mIndStage = other.mIndStage;
mIndFormat = other.mIndFormat;
mBiasSel = other.mBiasSel;
mMtxSel = other.mMtxSel;
mWrapS = other.mWrapS;
mWrapT = other.mWrapT;
mPrev = other.mPrev;
mLod = other.mLod;
mAlphaSel = other.mAlphaSel;
return *this;
}
};
inline u32 J2DCalcIndTevStage(J2DIndTevStageInfo info) {
return (info.mAlphaSel << 22) | (info.mLod << 21) | (info.mPrev << 20) |
(info.mMtxSel << 16) | (info.mWrapT << 11) | (info.mWrapS << 8) |
(info.mBiasSel << 4) | (info.mIndFormat << 2) | (info.mIndStage);
}
extern const J2DIndTevStageInfo j2dDefaultIndTevStageInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DIndTevStage {
public:
void load(u8);
J2DIndTevStage() {
mFlags = J2DCalcIndTevStage(j2dDefaultIndTevStageInfo);
}
J2DIndTevStage(const J2DIndTevStageInfo& info) {
mFlags = J2DCalcIndTevStage(info);
}
void setIndTevStageInfo(const J2DIndTevStageInfo& info) { mFlags = J2DCalcIndTevStage(info); }
private:
/* 0x0 */ u32 mFlags;
u8 getIndStage() const { return (mFlags & 0x03); }
u8 getIndFormat() const { return (mFlags >> 2) & 0x03; }
u8 getBiasSel() const { return (mFlags >> 4) & 0x07; }
u8 getWrapS() const { return (mFlags >> 8) & 0x07; }
u8 getWrapT() const { return (mFlags >> 11) & 0x07; }
u8 getMtxSel() const { return (mFlags >> 16) & 0x0F; }
u8 getPrev() const { return (mFlags >> 20) & 0x01; }
u8 getLod() const { return (mFlags >> 21) & 0x01; }
u8 getAlphaSel() const { return (mFlags >> 22) & 0x03; }
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTexCoordInfo {
/* 0x0 */ u8 mTexGenType;
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
u8 padding; // ?
J2DTexCoordInfo& operator=(const J2DTexCoordInfo& other) {
mTexGenType = other.mTexGenType;
mTexGenSrc = other.mTexGenSrc;
mTexGenMtx = other.mTexGenMtx;
return *this;
}
};
extern J2DTexCoordInfo const j2dDefaultTexCoordInfo[8];
/**
* @ingroup jsystem-j2d
*
*/
class J2DTexCoord {
public:
inline J2DTexCoord() {
mTexCoordInfo = j2dDefaultTexCoordInfo[0];
}
J2DTexCoord(const J2DTexCoordInfo& info) {
mTexCoordInfo = info;
}
void setTexCoordInfo(const J2DTexCoordInfo& info) { mTexCoordInfo = info; }
void setTexGenMtx(u8 texGenMtx) { mTexCoordInfo.mTexGenMtx = texGenMtx; }
u8 getTexGenType() const { return mTexCoordInfo.mTexGenType; }
u8 getTexGenSrc() const { return mTexCoordInfo.mTexGenSrc; }
u8 getTexGenMtx() const { return mTexCoordInfo.mTexGenMtx; }
private:
/* 0x0 */ J2DTexCoordInfo mTexCoordInfo;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTevOrderInfo {
/* 0x0 */ u8 mTexCoord;
/* 0x1 */ u8 mTexMap;
/* 0x2 */ u8 mColor;
/* 0x3 */ u8 field_0x3;
J2DTevOrderInfo& operator=(const J2DTevOrderInfo& other) {
mTexCoord = other.mTexCoord;
mTexMap = other.mTexMap;
mColor = other.mColor;
return *this;
}
};
extern const J2DTevOrderInfo j2dDefaultTevOrderInfoNull;
/**
* @ingroup jsystem-j2d
*
*/
class J2DTevOrder {
public:
J2DTevOrder() {
mTevOrderInfo = j2dDefaultTevOrderInfoNull;
}
J2DTevOrder(const J2DTevOrderInfo& info) {
*(J2DTevOrderInfo*)this = info;
}
void setTevOrderInfo(const J2DTevOrderInfo& info) {mTevOrderInfo = info; }
u8 getColor() const { return mTevOrderInfo.mColor; }
u8 getTexMap() const { return mTevOrderInfo.mTexMap; }
u8 getTexCoord() const { return mTevOrderInfo.mTexCoord; }
/* 0x0 */ J2DTevOrderInfo mTevOrderInfo;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTevStageInfo {
/* 0x00 */ u8 field_0x0;
/* 0x01 */ u8 mColorA;
/* 0x02 */ u8 mColorB;
/* 0x03 */ u8 mColorC;
/* 0x04 */ u8 mColorD;
/* 0x05 */ u8 mCOp;
/* 0x06 */ u8 mCBias;
/* 0x07 */ u8 mCScale;
/* 0x08 */ u8 mCClamp;
/* 0x09 */ u8 mCReg;
/* 0x0A */ u8 mAlphaA;
/* 0x0B */ u8 mAlphaB;
/* 0x0C */ u8 mAlphaC;
/* 0x0D */ u8 mAlphaD;
/* 0x0E */ u8 mAOp;
/* 0x0F */ u8 mABias;
/* 0x10 */ u8 mAScale;
/* 0x11 */ u8 mAClamp;
/* 0x12 */ u8 mAReg;
/* 0x13 */ u8 field_0x13;
};
extern J2DTevStageInfo const j2dDefaultTevStageInfo;
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTevSwapModeInfo {
/* 0x0 */ u8 mRasSel;
/* 0x1 */ u8 mTexSel;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
};
extern const J2DTevSwapModeInfo j2dDefaultTevSwapMode;
/**
* @ingroup jsystem-j2d
*
*/
class J2DTevStage {
public:
J2DTevStage(J2DTevStageInfo const& param_0) {
setTevStageInfo(param_0);
setTevSwapModeInfo(j2dDefaultTevSwapMode);
}
J2DTevStage() {
setTevStageInfo(j2dDefaultTevStageInfo);
setTevSwapModeInfo(j2dDefaultTevSwapMode);
}
void setTevStageInfo(J2DTevStageInfo const& info) {
setColorABCD(info.mColorA, info.mColorB, info.mColorC, info.mColorD);
setTevColorOp(info.mCOp, info.mCBias, info.mCScale, info.mCClamp, info.mCReg);
setAlphaABCD(info.mAlphaA, info.mAlphaB, info.mAlphaC, info.mAlphaD);
setTevAlphaOp(info.mAOp, info.mABias, info.mAScale, info.mAClamp, info.mAReg);
}
void setStageNo(u32 param_0) {
field_0x0 = (param_0 << 1) + 0xc0;
field_0x4 = (param_0 << 1) + 0xc1;
}
void setTevSwapModeInfo(const J2DTevSwapModeInfo& swapInfo) {
setTexSel(swapInfo.mTexSel);
setRasSel(swapInfo.mRasSel);
}
void setTexSel(u8 param_0) {
field_0x7 = (field_0x7 & ~0x0c) | (param_0 << 2);
}
void setRasSel(u8 param_0) {
field_0x7 = (field_0x7 & ~0x03) | param_0;
}
void setColorABCD(u8 a, u8 b, u8 c, u8 d) {
setTevColorAB(a, b);
setTevColorCD(c, d);
}
void setTevColorAB(u8 a, u8 b) { field_0x2 = a << 4 | b; }
void setTevColorCD(u8 c, u8 d) { field_0x3 = c << 4 | d; }
void setTevColorOp(u8 op, u8 bias, u8 scale, u8 clamp, u8 reg) {
field_0x1 = field_0x1 & ~0x04 | op << 2;
if (op <= 1) {
field_0x1 = field_0x1 & ~0x30 | scale << 4;
field_0x1 = field_0x1 & ~0x03 | bias;
} else {
field_0x1 = field_0x1 & ~0x30 | (op >> 1 & 3) << 4;
field_0x1 = field_0x1 & ~0x03 | 3;
}
field_0x1 = field_0x1 & ~0x08 | clamp << 3;
field_0x1 = field_0x1 & ~0xc0 | reg << 6;
}
void setAlphaABCD(u8 a, u8 b, u8 c, u8 d) {
setAlphaA(a);
setAlphaB(b);
setAlphaC(c);
setAlphaD(d);
}
void setAlphaA(u8 a) {
field_0x6 = field_0x6 & ~0xe0 | a << 5;
}
void setAlphaB(u8 b) {
field_0x6 = field_0x6 & ~0x1c | b << 2;
}
void setAlphaC(u8 c) {
field_0x6 = field_0x6 & ~0x03 | c >> 1;
field_0x7 = field_0x7 & ~0x80 | c << 7;
}
void setAlphaD(u8 d) {
field_0x7 = field_0x7 & ~0x70 | d << 4;
}
void setTevAlphaOp(u8 op, u8 bias, u8 scale, u8 clamp, u8 reg) {
field_0x5 = field_0x5 & ~0x04 | op << 2;
if (op <= 1) {
field_0x5 = field_0x5 & ~0x03 | bias;
field_0x5 = field_0x5 & ~0x30 | scale << 4;
} else {
field_0x5 = field_0x5 & ~0x30 | (op >> 1 & 3) << 4;
field_0x5 = field_0x5 & ~0x03 | 3;
}
field_0x5 = field_0x5 & ~0x08 | clamp << 3;
field_0x5 = field_0x5 & ~0xc0 | reg << 6;
}
u8 getColorA() const { return (field_0x2 & 0xf0) >> 4; }
u8 getColorB() const { return field_0x2 & 0x0f; }
u8 getColorC() const { return (field_0x3 & 0xf0) >> 4; }
u8 getColorD() const { return field_0x3 & 0x0f; }
u8 getAlphaA() const { return (field_0x6 & 0xe0) >> 5; }
u8 getAlphaB() const { return (field_0x6 & 0x1c) >> 2; }
u8 getAlphaC() const { return (field_0x6 & 0x03) << 1 | (field_0x7 & 0x80) >> 7; }
u8 getAlphaD() const { return (field_0x7 & 0x70) >> 4; }
u8 getCOp() const {
if (getCBias() != 3) {
return (field_0x1 & 4) >> 2;
}
return ((field_0x1 & 4) >> 2) + 8 + ((field_0x1 & 0x30) >> 3);
}
u8 getCBias() const { return field_0x1 & 0x03; }
u8 getCScale() const { return (field_0x1 & 0x30) >> 4; }
u8 getCClamp() const { return (field_0x1 & 0x08) >> 3; }
u8 getCReg() const { return (field_0x1 & 0xc0) >> 6; }
u8 getAOp() const {
if (getABias() != 3) {
return (field_0x5 & 4) >> 2;
}
return ((field_0x5 & 4) >> 2) + 8 + ((field_0x5 & 0x30) >> 3);
}
u8 getABias() const { return field_0x5 & 0x03; }
u8 getAScale() const { return (field_0x5 & 0x30) >> 4; }
u8 getAClamp() const { return (field_0x5 & 0x08) >> 3; }
u8 getAReg() const { return (field_0x5 & 0xc0) >> 6; }
u8 getRasSel() const { return field_0x7 & 3; }
u8 getTexSel() const { return (field_0x7 & 0x0c) >> 2; }
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;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTevSwapModeTableInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
J2DTevSwapModeTableInfo& operator=(const J2DTevSwapModeTableInfo& other) {
field_0x0 = other.field_0x0;
field_0x1 = other.field_0x1;
field_0x2 = other.field_0x2;
field_0x3 = other.field_0x3;
return *this;
}
};
inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
return (param_0 << 6) + (param_1 << 4) + (param_2 << 2) + param_3;
}
extern const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable;
extern const u8 j2dDefaultTevSwapTableID;
/**
* @ingroup jsystem-j2d
*
*/
class J2DTevSwapModeTable {
public:
J2DTevSwapModeTable() { mIdx = j2dDefaultTevSwapTableID; }
J2DTevSwapModeTable(const J2DTevSwapModeTableInfo& info) {
mIdx = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
}
void operator=(const J2DTevSwapModeTable& other) {
mIdx = other.mIdx;
}
void setTevSwapModeTableInfo(const J2DTevSwapModeTableInfo& info) {
mIdx = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
}
u8 getR() const { return mIdx >> 6 & 3; }
u8 getG() const { return mIdx >> 4 & 3; }
u8 getB() const { return mIdx >> 2 & 3; }
u8 getA() const { return mIdx & 3; }
private:
/* 0x0 */ u8 mIdx;
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DColorChanInfo {
/* 0x0 */ u8 field_0x0;
/* 0x0 */ u8 field_0x1;
/* 0x0 */ u8 field_0x2;
/* 0x0 */ u8 field_0x3;
J2DColorChanInfo& operator=(const J2DColorChanInfo& other) {
field_0x0 = other.field_0x0;
field_0x1 = other.field_0x1;
field_0x2 = other.field_0x2;
field_0x3 = other.field_0x3;
return *this;
}
};
inline u16 J2DCalcColorChanID(u8 param_0) { return param_0; }
extern const J2DColorChanInfo j2dDefaultColorChanInfo;
/**
* @ingroup jsystem-j2d
*
*/
class J2DColorChan {
public:
J2DColorChan() {
setColorChanInfo(j2dDefaultColorChanInfo);
}
J2DColorChan(const J2DColorChanInfo& info) {
mColorChan = J2DCalcColorChanID(info.field_0x1);
}
void setColorChanInfo(const J2DColorChanInfo& info) {
mColorChan = J2DCalcColorChanID(info.field_0x1);
}
u8 getMatSrc() const { return mColorChan & 1; }
void operator=(const J2DColorChan& other) {
mColorChan = other.mColorChan;
}
private:
/* 0x0 */ u16 mColorChan;
};
extern const GXColor j2dDefaultColInfo;
extern const GXColorS10 j2dDefaultTevColor;
extern const GXColor j2dDefaultTevKColor;
extern const J2DTevOrderInfo j2dDefaultTevOrderInfoNull;
extern const u8 j2dDefaultPEBlockDither;
extern const u8 j2dDefaultTevSwapTableID;
extern const u16 j2dDefaultAlphaCmp;
#endif /* J2DTEVS_H */
-179
View File
@@ -1,179 +0,0 @@
#ifndef J2DTEXTBOX_H
#define J2DTEXTBOX_H
#include "JSystem/J2DGraph/J2DMaterial.h"
#include "JSystem/J2DGraph/J2DPane.h"
class J2DMaterial;
class JUTFont;
enum J2DTextBoxVBinding {
/* 0x0 */ VBIND_CENTER,
/* 0x1 */ VBIND_BOTTOM,
/* 0x2 */ VBIND_TOP
};
enum J2DTextBoxHBinding {
/* 0x0 */ HBIND_CENTER,
/* 0x1 */ HBIND_RIGHT,
/* 0x2 */ HBIND_LEFT
};
/**
* @ingroup jsystem-j2d
*
*/
struct J2DTbxBlockHeader {
/* 0x00 */ u32 mTag;
/* 0x04 */ s32 mSize;
};
/**
* @ingroup jsystem-j2d
*
*/
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
/**
* @ingroup jsystem-j2d
*
*/
class J2DTextBox : public J2DPane {
public:
struct TFontSize {
/* 0x0 */ f32 mSizeX;
/* 0x4 */ f32 mSizeY;
};
virtual ~J2DTextBox();
virtual u16 getTypeID() const;
virtual void resize(f32, f32);
virtual bool setConnectParent(bool);
virtual void drawSelf(f32, f32, Mtx*);
virtual void drawSelf(f32, f32);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const*);
virtual void rewriteAlpha();
virtual void draw(f32, f32);
virtual void draw(f32, f32, f32, J2DTextBoxHBinding);
virtual void setFont(JUTFont*);
virtual JUTFont* getFont() const { return mFont; }
virtual bool setBlack(JUtility::TColor);
virtual bool setWhite(JUtility::TColor white) { mWhiteColor = white; return true; }
virtual bool setBlackWhite(JUtility::TColor black, JUtility::TColor white) {
mBlackColor = black;
mWhiteColor = white;
return true;
}
virtual JUtility::TColor getBlack() const {
return mBlackColor;
}
virtual JUtility::TColor getWhite() const {
return mWhiteColor;
}
virtual J2DMaterial* getMaterial() const { return NULL; }
J2DTextBox(u64, JGeometry::TBox2<f32> const&, ResFONT const*, char const*, s16,
J2DTextBoxHBinding, J2DTextBoxVBinding);
J2DTextBox(J2DPane*, JSURandomInputStream*, JKRArchive*);
J2DTextBox(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
J2DTextBox();
void initiate(ResFONT const*, char const*, s16, J2DTextBoxHBinding,
J2DTextBoxVBinding);
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
char* getStringPtr() const;
s32 setString(s16, char const*, ...);
s32 setString(char const*, ...);
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;
}
void setFontSize(TFontSize size) { setFontSize(size.mSizeX, size.mSizeY); }
void getFontSize(TFontSize& size) const {
size.mSizeX = mFontSizeX;
size.mSizeY = mFontSizeY;
}
void setFontColor(JUtility::TColor i_charColor, JUtility::TColor i_GradientColor) {
mCharColor = i_charColor;
mGradientColor = i_GradientColor;
}
void setCharColor(JUtility::TColor i_charColor) {
mCharColor.set(i_charColor);
}
void setGradColor(JUtility::TColor i_GradientColor) {
mGradientColor.set(i_GradientColor);
}
void setCharSpace(f32 space) { mCharSpacing = space; }
f32 getCharSpace() const { return mCharSpacing; }
void setLineSpace(f32 space) { mLineSpacing = space; }
f32 getLineSpace() const { return mLineSpacing; }
J2DTextBoxVBinding getVBinding() const {
return (J2DTextBoxVBinding)(mFlags & 3);
}
J2DTextBoxHBinding getHBinding() const {
return (J2DTextBoxHBinding)((mFlags >> 2) & 3);
}
JUtility::TColor getCharColor() { return mCharColor; }
JUtility::TColor getGradColor() { return mGradientColor; }
u16 getStringAllocByte() const { return mStringLength; }
// 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 mFontSizeX;
/* 0x0120 */ f32 mFontSizeY;
/* 0x0124 */ char* mStringPtr;
/* 0x0128 */ JUtility::TColor mWhiteColor;
/* 0x012C */ JUtility::TColor mBlackColor;
/* 0x0130 */ u8 mFlags;
/* 0x0131 */ bool mTextFontOwned;
/* 0x0132 */ u16 mStringLength;
#if PLATFORM_GCN
/* 0x0134 */ u8 field_0x134[4];
#endif
}; // Size: 0x138
#endif /* J2DTEXTBOX_H */
-63
View File
@@ -1,63 +0,0 @@
#ifndef J2DTEXTBOXEX_H
#define J2DTEXTBOXEX_H
#include "JSystem/J2DGraph/J2DTextBox.h"
class J2DMaterial;
/**
* @ingroup jsystem-j2d
*
*/
class J2DTextBoxEx : public J2DTextBox {
public:
enum stage_enum {
STAGE_0,
STAGE_1,
STAGE_2,
};
J2DTextBoxEx(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
void setTevOrder(bool);
void setTevStage(bool);
void setStage(J2DTevStage*, J2DTextBoxEx::stage_enum);
bool getBlackWhite(JUtility::TColor*, JUtility::TColor*) const;
bool isSetBlackWhite(JUtility::TColor, JUtility::TColor) const;
virtual ~J2DTextBoxEx();
virtual void setCullBack(bool);
virtual void setCullBack(_GXCullMode);
virtual void setAlpha(u8);
virtual void drawSelf(f32, f32, f32 (*)[3][4]);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const*);
virtual void rewriteAlpha();
virtual void setAnimation(J2DAnmBase*);
virtual void setAnimation(J2DAnmTransform* transform) { J2DPane::setAnimation(transform); }
virtual void setAnimation(J2DAnmColor*);
virtual void setAnimation(J2DAnmTexPattern*);
virtual void setAnimation(J2DAnmTextureSRTKey*);
virtual void setAnimation(J2DAnmTevRegKey*);
virtual void setAnimation(J2DAnmVisibilityFull*);
virtual void setAnimation(J2DAnmVtxColor*);
virtual const J2DAnmTransform* animationPane(J2DAnmTransform const*);
virtual void draw(f32, f32);
virtual void draw(f32, f32, f32, J2DTextBoxHBinding);
virtual void setFont(JUTFont*);
virtual JUTFont* getFont() const;
virtual bool setBlack(JUtility::TColor);
virtual bool setWhite(JUtility::TColor);
virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor);
virtual JUtility::TColor getBlack() const;
virtual JUtility::TColor getWhite() const;
virtual J2DMaterial* getMaterial() const { return mMaterial; }
private:
/* 0x138 */ J2DMaterial* mMaterial;
/* 0x13C */ u16 field_0x13c;
/* 0x13E */ u16 field_0x13e;
/* 0x140 */ u8 field_0x140;
/* 0x144 */ J2DAnmVisibilityFull* mVisibilityAnm;
}; // Size: 0x148
#endif /* J2DTEXTBOXEX_H */
-129
View File
@@ -1,129 +0,0 @@
#ifndef J2DWINDOW_H
#define J2DWINDOW_H
#include "JSystem/J2DGraph/J2DMaterial.h"
#include "JSystem/J2DGraph/J2DPane.h"
class JSURandomInputStream;
class JUTTexture;
enum J2DTextureBase {
TEXTUREBASE_0 = 0,
TEXTUREBASE_1 = 1,
TEXTUREBASE_2 = 2,
TEXTUREBASE_3 = 3,
};
enum J2DWindowMirror {
WINDOWMIRROR_39 = 39,
WINDOWMIRROR_114 = 114,
WINDOWMIRROR_141 = 141,
WINDOWMIRROR_216 = 216,
};
/**
* @ingroup jsystem-j2d
*
*/
class J2DWindow : public J2DPane {
public:
struct TMaterial {
/* 0x00 */ J2DMaterial* field_0x0;
/* 0x04 */ J2DMaterial* field_0x4;
/* 0x08 */ J2DMaterial* field_0x8;
/* 0x0C */ J2DMaterial* field_0xc;
/* 0x10 */ J2DMaterial* field_0x10;
}; // Size: 0x14
struct TContentsColor {
TContentsColor() {}
/* 0x0 */ JUtility::TColor field_0x0;
/* 0x4 */ JUtility::TColor field_0x4;
/* 0x8 */ JUtility::TColor field_0x8;
/* 0xC */ JUtility::TColor field_0xc;
}; // Size: 0x10
J2DWindow(J2DPane*, JSURandomInputStream*, J2DMaterial*);
J2DWindow(J2DPane*, JSURandomInputStream*, JKRArchive*);
J2DWindow();
J2DWindow(u64, const JGeometry::TBox2<f32>&, const char*, J2DTextureBase, const ResTLUT*);
void initiate(const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTIMG*, const ResTLUT*, J2DWindowMirror, const JGeometry::TBox2<f32>&);
void private_readStream(J2DPane*, JSURandomInputStream*, JKRArchive*);
void initinfo();
void initinfo2();
static J2DWindowMirror convertMirror(J2DTextureBase);
void draw_private(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
void setContentsColor(JUtility::TColor, JUtility::TColor, JUtility::TColor,
JUtility::TColor);
void drawFrameTexture(JUTTexture*, f32, f32, f32, f32, u16, u16, u16, u16, bool);
void drawFrameTexture(JUTTexture*, f32, f32, bool, bool, bool);
void drawContentsTexture(f32, f32, f32, f32);
void setTevMode(JUTTexture*, JUtility::TColor, JUtility::TColor);
virtual ~J2DWindow();
/* vt 0x0C */ virtual u16 getTypeID() const { return 17; }
/* vt 0x18 */ virtual void resize(f32, f32);
/* vt 0x34 */ virtual void drawSelf(f32, f32);
/* vt 0x38 */ virtual void drawSelf(f32, f32, Mtx*);
/* vt 0x94 */ virtual void draw(JGeometry::TBox2<f32> const&);
/* vt 0x98 */ virtual void draw(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
/* vt 0x9C */ virtual void draw(f32 left, f32 top, f32 width, f32 height) { draw(JGeometry::TBox2<f32>(left, top, left + width, top + height)); }
/* vt 0xA0 */ virtual bool setBlack(JUtility::TColor);
/* vt 0xA4 */ virtual bool setWhite(JUtility::TColor);
/* vt 0xA8 */ virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor);
/* vt 0xAC */ virtual JUtility::TColor getBlack() const;
/* vt 0xB0 */ virtual JUtility::TColor getWhite() const;
/* vt 0xB4 */ virtual JUTTexture* getFrameTexture(u8, u8) const;
/* vt 0xB8 */ virtual JUTTexture* getContentsTexture(u8 param_1) const {
if (param_1 != 0) {
return NULL;
}
return field_0x110;
}
/* vt 0xBC */ virtual void getMaterial(J2DWindow::TMaterial& mat) const {
mat.field_0x0 = NULL;
mat.field_0x4 = NULL;
mat.field_0x8 = NULL;
mat.field_0xc = NULL;
mat.field_0x10 = NULL;
}
/* vt 0xC0 */ virtual J2DMaterial* getFrameMaterial(u8) const { return NULL; }
/* vt 0xC4 */ virtual J2DMaterial* getContentsMaterial() const { return NULL; }
/* vt 0xC8 */ virtual void drawContents(JGeometry::TBox2<f32> const&);
/* vt 0x4C */ virtual bool isUsed(const ResTIMG*);
/* vt 0x50 */ virtual bool isUsed(const ResFONT* font) { return J2DPane::isUsed(font); }
/* vt 0x58 */ virtual void rewriteAlpha() {}
bool isField0x145Set(u8 flag) { return field_0x145 & flag; }
void getContentsColor(TContentsColor& param_0) const {
param_0.field_0x0 = field_0x128;
param_0.field_0x4 = field_0x12C;
param_0.field_0x8 = field_0x130;
param_0.field_0xc = field_0x134;
}
void setContentsColor(JUtility::TColor param_0) {
setContentsColor(param_0, param_0, param_0, param_0);
}
protected:
/* 0x100 */ JUTTexture* field_0x100;
/* 0x104 */ JUTTexture* field_0x104;
/* 0x108 */ JUTTexture* field_0x108;
/* 0x10C */ JUTTexture* field_0x10c;
/* 0x110 */ JUTTexture* field_0x110;
/* 0x114 */ JGeometry::TBox2<f32> field_0x114;
/* 0x124 */ JUTPalette* mPalette;
/* 0x128 */ JUtility::TColor field_0x128;
/* 0x12C */ JUtility::TColor field_0x12C;
/* 0x130 */ JUtility::TColor field_0x130;
/* 0x134 */ JUtility::TColor field_0x134;
/* 0x138 */ JUtility::TColor mWhite;
/* 0x13C */ JUtility::TColor mBlack;
/* 0x140 */ s16 field_0x140;
/* 0x142 */ s16 field_0x142;
/* 0x144 */ u8 field_0x144;
/* 0x145 */ u8 field_0x145;
}; // Size: 0x148
#endif /* J2DWINDOW_H */
-77
View File
@@ -1,77 +0,0 @@
#ifndef J2DWINDOWEX_H
#define J2DWINDOWEX_H
#include "JSystem/J2DGraph/J2DWindow.h"
/**
* @ingroup jsystem-j2d
*
*/
class J2DWindowEx : public J2DWindow {
public:
enum stage_enum {
STAGE_ENUM_0,
STAGE_ENUM_1,
STAGE_ENUM_2,
STAGE_ENUM_3,
STAGE_ENUM_4,
};
J2DWindowEx(J2DPane*, JSURandomInputStream*, u32, J2DMaterial*);
void setMinSize();
void draw_private(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
void drawFrameTexture(f32, f32, f32, f32, u16, u16, u16, u16, J2DMaterial*,
bool);
void setTevOrder(bool);
void setTevStage(bool);
void setStage(J2DTevStage*, J2DWindowEx::stage_enum);
bool getBlackWhite(JUtility::TColor*, JUtility::TColor*) const;
bool isSetBlackWhite(JUtility::TColor, JUtility::TColor) const;
bool isNeedSetAnm(u8);
virtual ~J2DWindowEx();
virtual void setCullBack(bool);
virtual void setCullBack(_GXCullMode);
virtual void setAlpha(u8);
virtual void drawSelf(f32, f32, f32 (*)[3][4]);
virtual bool isUsed(ResTIMG const*);
virtual bool isUsed(ResFONT const*);
virtual void rewriteAlpha();
virtual void setAnimation(J2DAnmBase*);
virtual void setAnimation(J2DAnmTransform* transform) { J2DPane::setAnimation(transform); }
virtual void setAnimation(J2DAnmColor*);
virtual void setAnimation(J2DAnmTexPattern*);
virtual void setAnimation(J2DAnmTextureSRTKey*);
virtual void setAnimation(J2DAnmTevRegKey*);
virtual void setAnimation(J2DAnmVisibilityFull*);
virtual void setAnimation(J2DAnmVtxColor*);
virtual const J2DAnmTransform* animationPane(J2DAnmTransform const*);
virtual void draw(JGeometry::TBox2<f32> const&);
virtual void draw(JGeometry::TBox2<f32> const&, JGeometry::TBox2<f32> const&);
virtual void draw(f32, f32, f32, f32);
virtual bool setBlack(JUtility::TColor);
virtual bool setWhite(JUtility::TColor);
virtual bool setBlackWhite(JUtility::TColor, JUtility::TColor);
virtual JUtility::TColor getBlack() const;
virtual JUtility::TColor getWhite() const;
virtual JUTTexture* getFrameTexture(u8, u8) const;
virtual JUTTexture* getContentsTexture(u8) const;
virtual void getMaterial(J2DWindow::TMaterial&) const;
virtual J2DMaterial* getFrameMaterial(u8) const;
virtual J2DMaterial* getContentsMaterial() const;
virtual void drawContents(JGeometry::TBox2<f32> const&);
private:
/* 0x148 */ J2DMaterial* mFrameMaterial[4];
/* 0x158 */ u16 field_0x158[4];
/* 0x160 */ J2DMaterial* mContentsMaterial;
/* 0x164 */ u16 field_0x164;
/* 0x166 */ u16 field_0x166;
/* 0x168 */ u16 field_0x168[4];
/* 0x170 */ u8 field_0x170;
/* 0x174 */ J2DAnmVisibilityFull* mAnmVisibilityFull;
/* 0x178 */ J2DAnmVtxColor* mAnmVtxColor;
/* 0x17C */ u8 field_0x17c;
};
#endif /* J2DWINDOWEX_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef J3DASSERT_H
#define J3DASSERT_H
#include "JSystem/JUtility/JUTAssert.h"
#define J3D_ASSERT_NULLPTR(LINE, COND) JUT_ASSERT_MSG(LINE, (COND) != 0, "Error : null pointer.")
#define J3D_ASSERT_RANGE(LINE, COND) JUT_ASSERT_MSG(LINE, (COND) != 0, "Error : range over.")
#define J3D_ASSERT_NONZEROARG(LINE, COND) JUT_ASSERT_MSG(LINE, (COND) != 0, "Error : non-zero argument is specified 0.")
#define J3D_ASSERT_ALLOCMEM(LINE, COND) JUT_ASSERT_MSG(LINE, (COND) != 0, "Error : allocate memory.")
#endif /* J3DASSERT_H */
@@ -1,982 +0,0 @@
#ifndef J3DANIMATION_H
#define J3DANIMATION_H
#include "JSystem/J3DAssert.h"
#include "JSystem/JUtility/JUTNameTab.h"
#include <dolphin/mtx.h>
#include "global.h"
struct J3DTransformInfo;
struct JUTDataBlockHeader {
/* 0x0 */ u32 mType;
/* 0x4 */ u32 mSize;
const JUTDataBlockHeader* getNext() const { // fake inline
return reinterpret_cast<const JUTDataBlockHeader*>(reinterpret_cast<const u8*>(this) +
mSize);
}
};
struct JUTDataFileHeader { // actual struct name unknown
/* 0x00 */ u32 mMagic;
/* 0x04 */ u32 mType;
/* 0x08 */ u32 mFileSize;
/* 0x0C */ u32 mBlockNum;
/* 0x10 */ u8 _10[0x1C - 0x10];
/* 0x1C */ u32 mSeAnmOffset; // Only exists for some BCKs
/* 0x20 */ JUTDataBlockHeader mFirstBlock;
};
// unknown name. refers to ANK1 chunk of BCK files
struct J3DAnmTransform_ANK1 {
/* 0x00 */ u32 magic;
/* 0x04 */ u32 size;
/* 0x08 */ u8 attribute;
/* 0x09 */ u8 rotation_frac;
/* 0x0A */ s16 duration;
/* 0x0C */ s16 keyframe_num;
/* 0x0E */ s16 scale_entries;
/* 0x10 */ s16 rotation_entries;
/* 0x12 */ s16 translation_entries;
/* 0x14 */ u32 anm_data_offset;
/* 0x18 */ u32 scale_data_offset;
/* 0x1C */ u32 rotation_data_offset;
/* 0x20 */ u32 translation_data_offset;
};
typedef struct _GXColor GXColor;
typedef struct _GXColorS10 GXColorS10;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmKeyTableBase {
/* 0x00 */ u16 mMaxFrame;
/* 0x02 */ u16 mOffset;
/* 0x04 */ u16 mType;
}; // Size = 0x6
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmColorKeyTable {
J3DAnmKeyTableBase mRInfo;
J3DAnmKeyTableBase mGInfo;
J3DAnmKeyTableBase mBInfo;
J3DAnmKeyTableBase mAInfo;
}; // Size = 0x18
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmVtxColorIndexData {
/* 0x00 */ u16 mNum;
/* 0x04 */ void* mpData;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmColorFullTable {
/* 0x00 */ u16 mRMaxFrame;
/* 0x02 */ u16 mROffset;
/* 0x04 */ u16 mGMaxFrame;
/* 0x06 */ u16 mGOffset;
/* 0x08 */ u16 mBMaxFrame;
/* 0x0A */ u16 mBOffset;
/* 0x0C */ u16 mAMaxFrame;
/* 0x0E */ u16 mAOffset;
}; // Size = 0x10
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmVisibilityFullTable {
u16 _0;
u16 _2;
}; // Size = 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTransformKeyTable {
J3DAnmKeyTableBase mScaleInfo;
J3DAnmKeyTableBase mRotationInfo;
J3DAnmKeyTableBase mTranslateInfo;
}; // Size = 0x12
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTransformFullTable {
/* 0x00 */ u16 mScaleMaxFrame;
/* 0x02 */ u16 mScaleOffset;
/* 0x04 */ u16 mRotationMaxFrame;
/* 0x06 */ u16 mRotationOffset;
/* 0x08 */ u16 mTranslateMaxFrame;
/* 0x0A */ u16 mTranslateOffset;
}; // Size = 0xC
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTexPatternFullTable {
/* 0x00 */ u16 mMaxFrame;
/* 0x02 */ u16 mOffset;
/* 0x04 */ u8 mTexNo;
/* 0x06 */ u16 _6;
}; // Size = 0x8
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmCRegKeyTable {
/* 0x00 */ J3DAnmKeyTableBase mRTable;
/* 0x06 */ J3DAnmKeyTableBase mGTable;
/* 0x0C */ J3DAnmKeyTableBase mBTable;
/* 0x12 */ J3DAnmKeyTableBase mATable;
/* 0x18 */ u8 mColorId;
u8 padding[3];
}; // Size = 0x1C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmKRegKeyTable {
/* 0x00 */ J3DAnmKeyTableBase mRTable;
/* 0x06 */ J3DAnmKeyTableBase mGTable;
/* 0x0C */ J3DAnmKeyTableBase mBTable;
/* 0x12 */ J3DAnmKeyTableBase mATable;
/* 0x18 */ u8 mColorId;
u8 padding[3];
}; // Size = 0x1C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmDataBlockHeader { // actual name unknown
/* 0x0 */ u32 mType;
/* 0x4 */ u32 mNextOffset;
}; // Size = 0x8
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmDataHeader { // actual name unknown
/* 0x00 */ u32 mMagic;
/* 0x04 */ u32 mType;
/* 0x08 */ u8 _8[4];
/* 0x0C */ u32 mCount;
/* 0x10 */ u8 _10[0x20 - 0x10];
/* 0x20 */ J3DAnmDataBlockHeader mFirst;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmVtxColorFullData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9; // padding?
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 mAnmTableNum[2];
/* 0x10 */ u8 field_0x10[0x18 - 0x10];
/* 0x18 */ void* mTableOffsets[2];
/* 0x20 */ void* mVtxColorIndexDataOffsets[2];
/* 0x28 */ void* mVtxColorIndexPointerOffsets[2];
/* 0x30 */ void* mRValuesOffset;
/* 0x34 */ void* mGValuesOffset;
/* 0x38 */ void* mBValuesOffset;
/* 0x3C */ void* mAValuesOffset;
}; // Size = 0x40
STATIC_ASSERT(sizeof(J3DAnmVtxColorFullData) == 0x40);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmVisibilityFullData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9; // padding?
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 field_0xc;
/* 0x0E */ u16 field_0xe;
/* 0x10 */ void* mTableOffset;
/* 0x14 */ void* mValuesOffset;
}; // Size = 0x18
STATIC_ASSERT(sizeof(J3DAnmVisibilityFullData) == 0x18);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTransformFullData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 field_0xc;
/* 0x0E */ u8 field_0xe[0x14 - 0xe];
/* 0x14 */ void* mTableOffset;
/* 0x18 */ void* mScaleValOffset;
/* 0x1C */ void* mRotValOffset;
/* 0x20 */ void* mTransValOffset;
}; // Size = 0x24
STATIC_ASSERT(sizeof(J3DAnmTransformFullData) == 0x24);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmColorKeyData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9[3];
/* 0x0C */ s16 mFrameMax;
/* 0x0E */ u16 mUpdateMaterialNum;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ void* mTableOffset;
/* 0x1C */ void* mUpdateMaterialIDOffset;
/* 0x20 */ void* mNameTabOffset;
/* 0x24 */ void* mRValOffset;
/* 0x28 */ void* mGValOffset;
/* 0x2C */ void* mBValOffset;
/* 0x30 */ void* mAValOffset;
}; // Size = 0x34
STATIC_ASSERT(sizeof(J3DAnmColorKeyData) == 0x34);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTextureSRTKeyData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9;
/* 0x0A */ s16 field_0xa;
/* 0x0C */ u16 field_0xc;
/* 0x0E */ u16 field_0xe;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ void* mTableOffset;
/* 0x18 */ void* mUpdateMatIDOffset;
/* 0x1C */ void* mNameTab1Offset;
/* 0x20 */ void* mUpdateTexMtxIDOffset;
/* 0x24 */ void* unkOffset;
/* 0x28 */ void* mScaleValOffset;
/* 0x2C */ void* mRotValOffset;
/* 0x30 */ void* mTransValOffset;
/* 0x34 */ u16 field_0x34;
/* 0x36 */ u16 field_0x36;
/* 0x38 */ u16 field_0x38;
/* 0x3A */ u16 field_0x3a;
/* 0x3C */ void* mInfoTable2Offset;
/* 0x40 */ void* field_0x40;
/* 0x44 */ void* mNameTab2Offset;
/* 0x48 */ void* field_0x48;
/* 0x4C */ void* field_0x4c;
/* 0x50 */ void* field_0x50;
/* 0x54 */ void* field_0x54;
/* 0x58 */ void* field_0x58;
/* 0x5C */ s32 field_0x5c;
}; // Size = 0x60
STATIC_ASSERT(sizeof(J3DAnmTextureSRTKeyData) == 0x60);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmVtxColorKeyData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 mAnmTableNum[2];
/* 0x10 */ u8 field_0x10[0x18 - 0x10];
/* 0x18 */ void* mTableOffsets[2];
/* 0x20 */ void* mVtxColoIndexDataOffset[2];
/* 0x28 */ void* mVtxColoIndexPointerOffset[2];
/* 0x30 */ void* mRValOffset;
/* 0x34 */ void* mGValOffset;
/* 0x38 */ void* mBValOffset;
/* 0x3C */ void* mAValOffset;
}; // Size = 0x40
STATIC_ASSERT(sizeof(J3DAnmVtxColorKeyData) == 0x40);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTexPatternFullData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 field_0xc;
/* 0x0E */ u16 field_0xe;
/* 0x10 */ void* mTableOffset;
/* 0x14 */ void* mValuesOffset;
/* 0x18 */ void* mUpdateMaterialIDOffset;
/* 0x1C */ void* mNameTabOffset;
}; // Size = 0x20
STATIC_ASSERT(sizeof(J3DAnmTexPatternFullData) == 0x20);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTevRegKeyData {
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9; // maybe padding
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 mCRegUpdateMaterialNum;
/* 0x0E */ u16 mKRegUpdateMaterialNum;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ u16 field_0x18;
/* 0x1A */ u16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
/* 0x20 */ void* mCRegTableOffset;
/* 0x24 */ void* mKRegTableOffset;
/* 0x28 */ void* mCRegUpdateMaterialIDOffset;
/* 0x2C */ void* mKRegUpdateMaterialIDOffset;
/* 0x30 */ void* mCRegNameTabOffset;
/* 0x34 */ void* mKRegNameTabOffset;
/* 0x38 */ void* mCRValuesOffset;
/* 0x3C */ void* mCGValuesOffset;
/* 0x40 */ void* mCBValuesOffset;
/* 0x44 */ void* mCAValuesOffset;
/* 0x48 */ void* mKRValuesOffset;
/* 0x4C */ void* mKGValuesOffset;
/* 0x50 */ void* mKBValuesOffset;
/* 0x54 */ void* mKAValuesOffset;
}; // Size = 0x58
STATIC_ASSERT(sizeof(J3DAnmTevRegKeyData) == 0x58);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmColorFullData { /* PlaceHolder Structure */
/* 0x00 */ J3DAnmDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9[3];
/* 0x0C */ s16 mFrameMax;
/* 0x0E */ u16 mUpdateMaterialNum;
/* 0x10 */ u8 field_0x10[0x18 - 0x10];
/* 0x18 */ void* mTableOffset;
/* 0x1C */ void* mUpdateMaterialIDOffset;
/* 0x20 */ void* mNameTabOffset;
/* 0x24 */ void* mRValuesOffset;
/* 0x28 */ void* mGValuesOffset;
/* 0x2C */ void* mBValuesOffset;
/* 0x30 */ void* mAValuesOffset;
}; // Size = 0x34
STATIC_ASSERT(sizeof(J3DAnmColorFullData) == 0x34);
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmClusterKeyTable {
/* 0x00 */ J3DAnmKeyTableBase mWeightTable;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmTransformKeyData {
/* 0x00 */ JUTDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x09 */ u8 field_0x9;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ u16 field_0xc;
/* 0x10 */ int field_0x10;
/* 0x14 */ void* mTableOffset;
/* 0x18 */ void* field_0x18;
/* 0x1c */ void* field_0x1c;
/* 0x20 */ void* field_0x20;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmClusterKeyData {
/* 0x00 */ JUTDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ s32 field_0xc;
/* 0x10 */ void* mTableOffset;
/* 0x14 */ void* mWeightOffset;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmClusterFullData {
/* 0x00 */ JUTDataBlockHeader mHeader;
/* 0x08 */ u8 field_0x8;
/* 0x0A */ s16 mFrameMax;
/* 0x0C */ s32 field_0xc;
/* 0x10 */ void* mTableOffset;
/* 0x14 */ void* mWeightOffset;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmClusterFullTable {
u16 mMaxFrame;
u16 mOffset;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmBase {
public:
J3DAnmBase() {
mAttribute = 0;
field_0x5 = 0;
mFrameMax = 0;
mFrame = 0.0f;
}
J3DAnmBase(s16 frameMax) {
mAttribute = 0;
field_0x5 = 0;
mFrameMax = frameMax;
mFrame = 0.0f;
}
virtual ~J3DAnmBase() {}
virtual s32 getKind() const = 0;
u8 getAttribute() const { return mAttribute; }
s16 getFrameMax() const { return mFrameMax; }
f32 getFrame() const { return mFrame; }
void setFrame(f32 frame) { mFrame = frame; }
/* 0x4 */ u8 mAttribute;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ s16 mFrameMax;
/* 0x8 */ f32 mFrame;
}; // Size: 0xC
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTransform : public J3DAnmBase {
public:
J3DAnmTransform(s16, f32*, s16*, f32*);
virtual ~J3DAnmTransform() {}
virtual s32 getKind() const { return 0; }
virtual void getTransform(u16, J3DTransformInfo*) const = 0;
/* 0x0C */ f32* mScaleData;
/* 0x10 */ s16* mRotData;
/* 0x14 */ f32* mTransData;
/* 0x18 */ s16 field_0x18;
/* 0x1A */ s16 field_0x1a;
/* 0x1C */ u16 field_0x1c;
/* 0x1E */ u16 field_0x1e;
}; // Size: 0x20
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTransformKey : public J3DAnmTransform {
public:
J3DAnmTransformKey() : J3DAnmTransform(0, NULL, NULL, NULL) {
mDecShift = 0;
mAnmTable = 0;
}
void calcTransform(f32, u16, J3DTransformInfo*) const;
virtual ~J3DAnmTransformKey() {}
virtual s32 getKind() const { return 8; }
virtual void getTransform(u16 jointNo, J3DTransformInfo* pTransform) const {
calcTransform(getFrame(), jointNo, pTransform);
}
/* 0x20 */ int mDecShift;
/* 0x24 */ J3DAnmTransformKeyTable* mAnmTable;
}; // Size: 0x28
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTransformFull : public J3DAnmTransform {
public:
J3DAnmTransformFull() : J3DAnmTransform(0, NULL, NULL, NULL) { mAnmTable = NULL; }
virtual ~J3DAnmTransformFull() {}
virtual s32 getKind() const { return 9; }
virtual void getTransform(u16, J3DTransformInfo*) const;
/* 0x20 */ J3DAnmTransformFullTable* mAnmTable;
}; // Size: 0x24
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTransformFullWithLerp : public J3DAnmTransformFull {
public:
virtual ~J3DAnmTransformFullWithLerp() {}
virtual s32 getKind() const { return 16; }
virtual void getTransform(u16, J3DTransformInfo*) const;
}; // Size: 0x24
struct J3DTextureSRTInfo;
class J3DModelData;
class J3DMaterialTable;
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTextureSRTKey : public J3DAnmBase {
public:
J3DAnmTextureSRTKey();
void calcTransform(f32, u16, J3DTextureSRTInfo*) const;
void searchUpdateMaterialID(J3DMaterialTable*);
void searchUpdateMaterialID(J3DModelData*);
virtual ~J3DAnmTextureSRTKey() {}
virtual s32 getKind() const { return 4; }
void getTransform(u16 jointNo, J3DTextureSRTInfo* pSRTInfo) const {
calcTransform(getFrame(), jointNo, pSRTInfo);
}
u16 getUpdateMaterialID(u16 idx) const {
J3D_ASSERT_RANGE(1029, idx < mTrackNum / 3);
return mUpdateMaterialID[idx];
}
u16 getUpdateMaterialNum() const { return mTrackNum / 3; }
u16 getPostUpdateMaterialNum() const { return field_0x4a / 3; }
int getUpdateTexMtxID(u16 idx) const {
J3D_ASSERT_RANGE(1017, idx < mTrackNum / 3);
return mUpdateTexMtxID[idx];
}
bool isValidUpdateMaterialID(u16 idx) const { return mUpdateMaterialID[idx] != 0xffff; }
u32 getTexMtxCalcType() { return mTexMtxCalcType; }
Vec* getSRTCenter(u16 idx) {
J3D_ASSERT_RANGE(1047, idx < mTrackNum / 3);
return &mSRTCenter[idx];
}
/* 0x0C */ int mDecShift;
/* 0x10 */ J3DAnmTransformKeyTable* mAnmTable;
/* 0x14 */ u16 mTrackNum;
/* 0x16 */ u16 mScaleNum;
/* 0x18 */ u16 mRotNum;
/* 0x1A */ u16 mTransNum;
/* 0x1C */ f32* mScaleData;
/* 0x20 */ s16* mRotData;
/* 0x24 */ f32* mTransData;
/* 0x28 */ u8* mUpdateTexMtxID;
/* 0x2C */ u16* mUpdateMaterialID;
/* 0x30 */ JUTNameTab mUpdateMaterialName;
/* 0x40 */ Vec* mSRTCenter;
/* 0x44 */ u16 field_0x44;
/* 0x46 */ u16 field_0x46;
/* 0x48 */ u16 field_0x48;
/* 0x4A */ u16 field_0x4a;
/* 0x4C */ void* field_0x4c;
/* 0x50 */ void* field_0x50;
/* 0x54 */ void* field_0x54;
/* 0x58 */ void* field_0x58;
/* 0x5C */ u8* mPostUpdateTexMtxID;
/* 0x60 */ u16* mPostUpdateMaterialID;
/* 0x64 */ JUTNameTab mPostUpdateMaterialName;
/* 0x74 */ Vec* mPostSRTCenter;
/* 0x78 */ u32 mTexMtxCalcType;
}; // Size: 0x7C
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmCluster : public J3DAnmBase {
public:
J3DAnmCluster(s16 frameMax, f32* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
virtual ~J3DAnmCluster() {}
virtual s32 getKind() const { return 3; }
virtual f32 getWeight(u16) const { return 1.0f; }
/* 0x0C */ f32* mWeight;
}; // Size: 0x10
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmClusterFull : public J3DAnmCluster {
public:
J3DAnmClusterFull() : J3DAnmCluster(0, NULL) { mAnmTable = NULL; }
virtual ~J3DAnmClusterFull() {}
virtual s32 getKind() const { return 12; }
virtual f32 getWeight(u16) const;
/* 0x10 */ J3DAnmClusterFullTable* mAnmTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmClusterKey : public J3DAnmCluster {
public:
J3DAnmClusterKey() : J3DAnmCluster(0, NULL) { mAnmTable = NULL; }
virtual ~J3DAnmClusterKey() {}
virtual s32 getKind() const { return 13; }
virtual f32 getWeight(u16) const;
/* 0x10 */ J3DAnmClusterKeyTable* mAnmTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmVtxColor : public J3DAnmBase {
public:
J3DAnmVtxColor();
virtual ~J3DAnmVtxColor() {}
virtual s32 getKind() const { return 7; }
virtual void getColor(u8, u16, GXColor*) const {}
u16 getAnmTableNum(u8 idx) {
J3D_ASSERT_RANGE(1333, idx < 2);
return mAnmTableNum[idx];
}
J3DAnmVtxColorIndexData* getAnmVtxColorIndexData(u8 p1, u16 p2) {
J3D_ASSERT_RANGE(1339, p1 < 2);
J3D_ASSERT_RANGE(1340, p2 < mAnmTableNum[p1]);
return mAnmVtxColorIndexData[p1] + p2;
}
/* 0x0C */ u16 mAnmTableNum[2];
/* 0x10 */ J3DAnmVtxColorIndexData* mAnmVtxColorIndexData[2];
}; // Size: 0x18
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmVtxColorFull : public J3DAnmVtxColor {
public:
J3DAnmVtxColorFull();
virtual ~J3DAnmVtxColorFull() {}
virtual s32 getKind() const { return 14; }
virtual void getColor(u8, u16, GXColor*) const;
/* 0x18 */ J3DAnmColorFullTable* mpTable[2];
/* 0x20 */ u8* mColorR;
/* 0x24 */ u8* mColorG;
/* 0x28 */ u8* mColorB;
/* 0x2C */ u8* mColorA;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmVtxColorKey : public J3DAnmVtxColor {
public:
J3DAnmVtxColorKey();
virtual ~J3DAnmVtxColorKey() {}
virtual s32 getKind() const { return 15; }
virtual void getColor(u8, u16, GXColor*) const;
/* 0x18 */ J3DAnmColorKeyTable* mpTable[2];
/* 0x20 */ s16* mColorR;
/* 0x24 */ s16* mColorG;
/* 0x28 */ s16* mColorB;
/* 0x2C */ s16* mColorA;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmColor : public J3DAnmBase {
public:
J3DAnmColor();
void searchUpdateMaterialID(J3DMaterialTable*);
virtual ~J3DAnmColor() {}
virtual s32 getKind() const { return 1; }
virtual void getColor(u16, GXColor*) const {}
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
u16 getUpdateMaterialID(u16 idx) const {
J3D_ASSERT_RANGE(1578, idx < mUpdateMaterialNum);
return mUpdateMaterialID[idx];
}
/* 0x0C */ u16 field_0xc;
/* 0x0E */ u16 field_0xe;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
/* 0x14 */ u16 mUpdateMaterialNum;
/* 0x18 */ u16* mUpdateMaterialID;
/* 0x1C */ JUTNameTab mUpdateMaterialName;
}; // Size: 0x2C
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmColorFull : public J3DAnmColor {
public:
J3DAnmColorFull();
virtual ~J3DAnmColorFull() {}
virtual s32 getKind() const { return 10; }
virtual void getColor(u16, GXColor*) const;
/* 0x2C */ u8* mColorR;
/* 0x30 */ u8* mColorG;
/* 0x34 */ u8* mColorB;
/* 0x38 */ u8* mColorA;
/* 0x3C */ J3DAnmColorFullTable* mAnmTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmColorKey : public J3DAnmColor {
public:
J3DAnmColorKey();
virtual ~J3DAnmColorKey() {}
virtual s32 getKind() const { return 11; }
virtual void getColor(u16, GXColor*) const;
/* 0x2C */ s16* mColorR;
/* 0x30 */ s16* mColorG;
/* 0x34 */ s16* mColorB;
/* 0x38 */ s16* mColorA;
/* 0x3C */ J3DAnmColorKeyTable* mAnmTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTevRegKey : public J3DAnmBase {
public:
J3DAnmTevRegKey();
void getTevColorReg(u16, _GXColorS10*) const;
void getTevKonstReg(u16, _GXColor*) const;
void searchUpdateMaterialID(J3DMaterialTable*);
void searchUpdateMaterialID(J3DModelData*);
virtual ~J3DAnmTevRegKey() {}
virtual s32 getKind() const { return 5; }
u16 getCRegUpdateMaterialNum() const { return mCRegUpdateMaterialNum; }
u16 getKRegUpdateMaterialNum() const { return mKRegUpdateMaterialNum; }
u16 getCRegUpdateMaterialID(u16 idx) const {
J3D_ASSERT_RANGE(2100, idx < mCRegUpdateMaterialNum);
return mCRegUpdateMaterialID[idx];
}
u16 getKRegUpdateMaterialID(u16 idx) const {
J3D_ASSERT_RANGE(2140, idx < mKRegUpdateMaterialNum);
return mKRegUpdateMaterialID[idx];
}
const J3DAnmCRegKeyTable* getAnmCRegKeyTable() { return mAnmCRegKeyTable; }
const J3DAnmKRegKeyTable* getAnmKRegKeyTable() { return mAnmKRegKeyTable; }
bool isValidCRegUpdateMaterialID(u16 idx) const { return mCRegUpdateMaterialID[idx] != 0xffff; }
bool isValidKRegUpdateMaterialID(u16 idx) const { return mKRegUpdateMaterialID[idx] != 0xffff; }
/* 0x0C */ u16 mCRegUpdateMaterialNum;
/* 0x0E */ u16 mKRegUpdateMaterialNum;
/* 0x10 */ u16 mCRegDataCountR;
/* 0x12 */ u16 mCRegDataCountG;
/* 0x14 */ u16 mCRegDataCountB;
/* 0x16 */ u16 mCRegDataCountA;
/* 0x18 */ u16 mKRegDataCountR;
/* 0x1A */ u16 mKRegDataCountG;
/* 0x1C */ u16 mKRegDataCountB;
/* 0x1E */ u16 mKRegDataCountA;
/* 0x20 */ u16* mCRegUpdateMaterialID;
/* 0x24 */ JUTNameTab mCRegUpdateMaterialName;
/* 0x34 */ u16* mKRegUpdateMaterialID;
/* 0x38 */ JUTNameTab mKRegUpdateMaterialName;
/* 0x48 */ J3DAnmCRegKeyTable* mAnmCRegKeyTable;
/* 0x4C */ J3DAnmKRegKeyTable* mAnmKRegKeyTable;
/* 0x50 */ s16* mAnmCRegDataR;
/* 0x54 */ s16* mAnmCRegDataG;
/* 0x58 */ s16* mAnmCRegDataB;
/* 0x5C */ s16* mAnmCRegDataA;
/* 0x60 */ s16* mAnmKRegDataR;
/* 0x64 */ s16* mAnmKRegDataG;
/* 0x68 */ s16* mAnmKRegDataB;
/* 0x6C */ s16* mAnmKRegDataA;
}; // Size: 0x70
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmTexPattern : public J3DAnmBase {
public:
J3DAnmTexPattern();
void getTexNo(u16, u16*) const;
void searchUpdateMaterialID(J3DMaterialTable*);
void searchUpdateMaterialID(J3DModelData*);
virtual ~J3DAnmTexPattern() {}
virtual s32 getKind() const { return 2; }
u16 getUpdateMaterialID(u16 idx) const {
J3D_ASSERT_RANGE(2288, idx < mUpdateMaterialNum);
return mUpdateMaterialID[idx];
}
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
bool isValidUpdateMaterialID(u16 id) const { return mUpdateMaterialID[id] != 0xFFFF; }
J3DAnmTexPatternFullTable* getAnmTable() { return mAnmTable; }
/* 0x0C */ u16* mTextureIndex;
/* 0x10 */ J3DAnmTexPatternFullTable* mAnmTable;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 mUpdateMaterialNum;
/* 0x18 */ u16* mUpdateMaterialID;
/* 0x1C */ JUTNameTab mUpdateMaterialName;
}; // Size: 0x2C
/**
* @ingroup jsystem-j3d
*
*/
class J3DAnmVisibilityFull : public J3DAnmBase {
public:
J3DAnmVisibilityFull() : J3DAnmBase() {
mUpdateMaterialNum = 0;
field_0xe = 0;
mAnmTable = NULL;
mVisibility = NULL;
}
virtual ~J3DAnmVisibilityFull() {}
virtual s32 getKind() const { return 6; }
/* 0x0C */ u16 mUpdateMaterialNum;
/* 0x0E */ u16 field_0xe;
/* 0x10 */ J3DAnmVisibilityFullTable* mAnmTable;
/* 0x14 */ u8* mVisibility;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DFrameCtrl {
public:
enum Attribute_e {
/* -1 */ EMode_NULL = -1,
/* 0x0 */ EMode_NONE,
/* 0x1 */ EMode_RESET,
/* 0x2 */ EMode_LOOP,
/* 0x3 */ EMode_REVERSE,
/* 0x4 */ EMode_LOOP_REVERSE,
};
J3DFrameCtrl() { this->init(0); }
void init(s16);
void init(int endFrame) { init((s16)endFrame); }
BOOL checkPass(f32);
void update();
virtual ~J3DFrameCtrl() {}
u8 getAttribute() const { return mAttribute; }
void setAttribute(u8 attr) { mAttribute = attr; }
u8 getState() const { return mState; }
bool checkState(u8 state) const { return mState & state ? true : false; }
s16 getStart() const { return mStart; }
void setStart(s16 start) {
mStart = start;
mFrame = start;
}
s16 getEnd() const { return mEnd; }
void setEnd(s16 end) { mEnd = end; }
s16 getLoop() const { return mLoop; }
void setLoop(s16 loop) { mLoop = loop; }
f32 getRate() const { return mRate; }
void setRate(f32 rate) { mRate = rate; }
f32 getFrame() const { return mFrame; }
void setFrame(f32 frame) { mFrame = frame; }
void reset() {
mFrame = mStart;
mRate = 1.0f;
mState = 0;
}
/* 0x04 */ u8 mAttribute;
/* 0x05 */ u8 mState;
/* 0x06 */ s16 mStart;
/* 0x08 */ s16 mEnd;
/* 0x0A */ s16 mLoop;
/* 0x0C */ f32 mRate;
/* 0x10 */ f32 mFrame;
}; // Size: 0x14
#endif /* J3DANIMATION_H */
@@ -1,129 +0,0 @@
#ifndef J3DCLUSTER_H
#define J3DCLUSTER_H
#include "JSystem/J3DAssert.h"
class J3DDeformer;
class J3DClusterKey;
class J3DClusterVertex;
class J3DVertexBuffer;
class J3DModel;
class J3DAnmCluster;
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
class J3DCluster {
public:
void operator=(const J3DCluster& other) {
mMaxAngle = other.mMaxAngle;
mMinAngle = other.mMinAngle;
mClusterKey = other.mClusterKey;
mFlags = other.mFlags;
mKeyNum = other.mKeyNum;
mPosNum = other.mPosNum;
field_0x14 = other.field_0x14;
field_0x16 = other.field_0x16;
field_0x18 = other.field_0x18;
mClusterVertex = other.mClusterVertex;
mDeformer = other.mDeformer;
}
J3DDeformer* getDeformer() { return mDeformer; }
void setDeformer(J3DDeformer* deformer) {
J3D_ASSERT_NULLPTR(111, deformer);
mDeformer = deformer;
}
/* 0x00 */ f32 mMaxAngle;
/* 0x04 */ f32 mMinAngle;
/* 0x08 */ J3DClusterKey* mClusterKey;
/* 0x0C */ u8 mFlags;
/* 0x0E */ u8 field_0xe[0x10 - 0xD];
/* 0x10 */ u16 mKeyNum;
/* 0x12 */ u16 mPosNum;
/* 0x14 */ u16 field_0x14;
/* 0x16 */ u16 field_0x16;
/* 0x18 */ u16* field_0x18;
/* 0x1C */ J3DClusterVertex* mClusterVertex;
/* 0x20 */ J3DDeformer* mDeformer;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DClusterKey {
public:
void operator=(const J3DClusterKey& other) {
mPosNum = other.mPosNum;
mNrmNum = other.mNrmNum;
field_0x4 = other.field_0x4;
field_0x8 = other.field_0x8;
}
/* 0x00 */ u16 mPosNum;
/* 0x02 */ u16 mNrmNum;
/* 0x04 */ void* field_0x4;
/* 0x08 */ void* field_0x8;
}; // Size: 0x0C
/**
* @ingroup jsystem-j3d
*
*/
class J3DDeformData {
public:
J3DDeformData();
void offAllFlag(u32);
void deform(J3DVertexBuffer*);
void deform(J3DModel*);
void setAnm(J3DAnmCluster*);
J3DCluster* getClusterPointer(u16 index) {
J3D_ASSERT_RANGE(186, (index < mClusterNum));
return &mClusterPointer[index];
}
u16 getClusterNum() const { return mClusterNum; }
u16 getClusterKeyNum() const { return mClusterKeyNum; }
J3DClusterKey* getClusterKeyPointer(u16 i) {
J3D_ASSERT_RANGE(199, (i < mClusterKeyNum));
return &mClusterKeyPointer[i];
}
f32* getVtxPos() { return mVtxPos; }
f32* getVtxNrm() { return mVtxNrm; }
/* 0x00 */ u16 mClusterNum;
/* 0x02 */ u16 mClusterKeyNum;
/* 0x04 */ u16 mClusterVertexNum;
/* 0x08 */ J3DCluster* mClusterPointer;
/* 0x0C */ J3DClusterKey* mClusterKeyPointer;
/* 0x10 */ J3DClusterVertex* mClusterVertex;
/* 0x14 */ u16 mVtxPosNum;
/* 0x16 */ u16 mVtxNrmNum;
/* 0x18 */ f32* mVtxPos;
/* 0x1C */ f32* mVtxNrm;
/* 0x20 */ JUTNameTab* mClusterName;
/* 0x24 */ JUTNameTab* mClusterKeyName;
}; // Size: 0x28
/**
* @ingroup jsystem-j3d
*
*/
class J3DClusterVertex {
public:
void operator=(const J3DClusterVertex& other) {
mNum = other.mNum;
field_0x4 = other.field_0x4;
field_0x8 = other.field_0x8;
}
/* 0x00 */ u16 mNum;
/* 0x04 */ u16* field_0x4;
/* 0x08 */ u16* field_0x8;
}; // Size: 0x0C
#endif /* J3DCLUSTER_H */
-248
View File
@@ -1,248 +0,0 @@
#ifndef J3DJOINT_H
#define J3DJOINT_H
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
#include "JSystem/J3DGraphBase/J3DTransform.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
class J3DAnmTransform;
class J3DJoint;
class J3DMaterial;
class J3DMtxBuffer;
/**
* @ingroup jsystem-j3d
*
*/
class J3DMtxCalc {
public:
static void setMtxBuffer(J3DMtxBuffer*);
virtual ~J3DMtxCalc() {}
virtual void setAnmTransform(J3DAnmTransform*) {
JUT_ASSERT_MSG(127, FALSE, "You cannot use this method");
}
virtual J3DAnmTransform* getAnmTransform() {
JUT_ASSERT_MSG(131, FALSE, "You cannot use this method");
return NULL;
}
virtual void setAnmTransform(u8, J3DAnmTransform*) {
JUT_ASSERT_MSG(137, FALSE, "You cannot use this method");
}
virtual J3DAnmTransform* getAnmTransform(u8) {
JUT_ASSERT_MSG(141, FALSE, "You cannot use this method");
return NULL;
}
virtual void setWeight(u8, f32) {
JUT_ASSERT_MSG(147, FALSE, "You cannot use this method");
}
virtual f32 getWeight(u8) const {
JUT_ASSERT_MSG(152, FALSE, "You cannot use this method");
return 0.0f;
}
virtual void init(const Vec& param_0, const Mtx&) = 0;
virtual void calc() = 0;
static J3DMtxBuffer* getMtxBuffer() {
J3D_ASSERT_NULLPTR(174, mMtxBuffer != NULL)
return mMtxBuffer;
}
static J3DJoint* getJoint() {
J3D_ASSERT_NULLPTR(185, mJoint != NULL)
return mJoint;
}
static void setJoint(J3DJoint* joint) { mJoint = joint; }
static J3DMtxBuffer* mMtxBuffer;
static J3DJoint* mJoint;
}; // Size: 0x4
typedef int (*J3DJointCallBack)(J3DJoint*, int);
/**
* @ingroup jsystem-j3d
*
*/
class J3DJoint {
public:
void appendChild(J3DJoint*);
J3DJoint();
void entryIn();
void recursiveCalc();
u32 getType() const { return 'NJNT'; }
J3DMaterial* getMesh() { return mMesh; }
void addMesh(J3DMaterial* pMesh) {
if (mMesh != NULL) {
pMesh->setNext(mMesh);
}
mMesh = pMesh;
}
u16 getJntNo() const { return mJntNo; }
u8 getScaleCompensate() const { return mScaleCompensate; }
J3DJoint* getYounger() { return mYounger; }
void setYounger(J3DJoint* pYounger) { mYounger = pYounger; }
void setCurrentMtxCalc(J3DMtxCalc* pMtxCalc) { mCurrentMtxCalc = pMtxCalc; }
J3DTransformInfo& getTransformInfo() { return mTransformInfo; }
void setTransformInfo(const J3DTransformInfo& i_info) { mTransformInfo = i_info; }
Vec* getMax() { return &mMax; }
Vec* getMin() { return &mMin; }
void setCallBack(J3DJointCallBack callback) { mCallBack = callback; }
J3DJointCallBack getCallBack() { return mCallBack; }
void setMtxCalc(J3DMtxCalc* i_mtxCalc) { mMtxCalc = i_mtxCalc; }
J3DMtxCalc* getMtxCalc() { return mMtxCalc; }
J3DMtxCalc* getCurrentMtxCalc() { return mCurrentMtxCalc; };
J3DJoint* getChild() { return mChild; }
u8 getMtxType() const { return (mKind & 0xf0) >> 4; }
void setMtxType(u8 type) { mKind = (mKind & ~0xf0) | (type << 4); }
f32 getRadius() const { return mBoundingSphereRadius; }
static J3DMtxCalc* mCurrentMtxCalc;
u8 getKind() const { return mKind & 15; }
private:
friend struct J3DJointFactory;
friend class J3DJointTree;
/* 0x00 */ void* mCallBackUserData;
/* 0x04 */ J3DJointCallBack mCallBack;
/* 0x08 */ void* field_0x8;
/* 0x0C */ J3DJoint* mChild;
/* 0x10 */ J3DJoint* mYounger;
/* 0x14 */ u16 mJntNo;
/* 0x16 */ u8 mKind;
/* 0x17 */ u8 mScaleCompensate;
/* 0x18 */ J3DTransformInfo mTransformInfo;
/* 0x38 */ f32 mBoundingSphereRadius;
/* 0x3C */ Vec mMin;
/* 0x48 */ Vec mMax;
/* 0x54 */ J3DMtxCalc* mMtxCalc;
/* 0x58 */ J3DMaterial* mMesh;
}; // Size: 0x5C
/**
* @ingroup jsystem-j3d
*
*/
class J3DMtxCalcNoAnmBase : public J3DMtxCalc {
public:
virtual ~J3DMtxCalcNoAnmBase() {}
};
/**
* @ingroup jsystem-j3d
*
*/
template <class A, class B>
class J3DMtxCalcNoAnm : public J3DMtxCalcNoAnmBase {
public:
J3DMtxCalcNoAnm() {}
virtual ~J3DMtxCalcNoAnm() {}
virtual void init(const Vec& param_0, const Mtx& param_1) { B::init(param_0, param_1); }
virtual void calc() {
J3DTransformInfo& transInfo = getJoint()->getTransformInfo();
A::calcTransform(transInfo);
}
};
struct J3DMtxCalcAnmBase: public J3DMtxCalc {
J3DMtxCalcAnmBase(J3DAnmTransform* pAnmTransform) { mAnmTransform = pAnmTransform; }
~J3DMtxCalcAnmBase() {}
J3DAnmTransform* getAnmTransform() { return mAnmTransform; }
void setAnmTransform(J3DAnmTransform* pAnmTransform) { mAnmTransform = pAnmTransform; }
J3DAnmTransform* mAnmTransform;
};
struct J3DMtxCalcAnimationAdaptorBase {
J3DMtxCalcAnimationAdaptorBase() {}
void change(J3DAnmTransform*) {}
};
template <typename A0>
struct J3DMtxCalcAnimationAdaptorDefault : public J3DMtxCalcAnimationAdaptorBase {
J3DMtxCalcAnimationAdaptorDefault(J3DAnmTransform* pAnmTransform) {}
void calc(J3DMtxCalcAnmBase* pMtxCalc) {
J3DTransformInfo transform;
J3DTransformInfo* transform_p;
if (pMtxCalc->getAnmTransform() != NULL) {
pMtxCalc->getAnmTransform()->getTransform(J3DMtxCalc::getJoint()->getJntNo(), &transform);
transform_p = &transform;
} else {
transform_p = &J3DMtxCalc::getJoint()->getTransformInfo();
}
A0::calcTransform(*transform_p);
}
};
template <typename A0, typename B0>
struct J3DMtxCalcAnimation : public J3DMtxCalcAnmBase {
J3DMtxCalcAnimation(J3DAnmTransform* pAnmTransform) : J3DMtxCalcAnmBase(pAnmTransform), field_0x8(pAnmTransform) {}
~J3DMtxCalcAnimation() {}
void setAnmTransform(J3DAnmTransform* pAnmTransform) {
mAnmTransform = pAnmTransform;
field_0x8.change(pAnmTransform);
}
void init(const Vec& param_0, const Mtx& param_1) { B0::init(param_0, param_1); }
void calc() { field_0x8.calc(this); }
A0 field_0x8;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcJ3DSysInitMaya {
static void init(const Vec&, const Mtx& param_1);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcJ3DSysInitBasic {
static void init(const Vec&, const Mtx& param_1);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcCalcTransformSoftimage {
static void calcTransform(J3DTransformInfo const&);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcCalcTransformMaya {
static void calcTransform(J3DTransformInfo const&);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcCalcTransformBasic {
static void calcTransform(J3DTransformInfo const&);
};
inline s32 checkScaleOne(const Vec& param_0) {
if (param_0.x == 1.0f && param_0.y == 1.0f && param_0.z == 1.0f) {
return true;
} else {
return false;
}
}
#endif /* J3DJOINT_H */
@@ -1,102 +0,0 @@
#ifndef J3DJOINTTREE_H
#define J3DJOINTTREE_H
#include "JSystem/J3DAssert.h"
#include "JSystem/J3DGraphBase/J3DTransform.h"
class J3DJoint;
class J3DMtxBuffer;
class J3DMtxCalc;
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DModelHierarchy {
/* 0x0 */ u16 mType;
/* 0x2 */ u16 mValue;
};
class J3DMaterialTable;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DDrawMtxData {
J3DDrawMtxData();
~J3DDrawMtxData();
/* 0x0 */ u16 mEntryNum;
/* 0x2 */ u16 mDrawFullWgtMtxNum;
/* 0x4 */ u8* mDrawMtxFlag;
/* 0x8 */ u16* mDrawMtxIndex;
}; // Size: 0xC
class J3DShapeTable;
/**
* @ingroup jsystem-j3d
*
*/
class J3DJointTree {
public:
J3DJointTree();
void makeHierarchy(J3DJoint*, J3DModelHierarchy const**, J3DMaterialTable*,
J3DShapeTable*);
void findImportantMtxIndex();
virtual void calc(J3DMtxBuffer*, Vec const&, f32 const (&)[3][4]);
virtual ~J3DJointTree() {}
const J3DModelHierarchy* getHierarchy() const { return mHierarchy; }
void setHierarchy(J3DModelHierarchy* hierarchy) { mHierarchy = hierarchy; }
void setBasicMtxCalc(J3DMtxCalc* calc) { mBasicMtxCalc = calc; }
u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; }
u16* getWEvlpMixIndex() const { return mWEvlpMixMtxIndex; }
u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; }
u16 * getWEvlpMixMtxIndex() const { return mWEvlpMixMtxIndex; }
f32 * getWEvlpMixWeight() const { return mWEvlpMixWeight; }
u16 * getWEvlpImportantMtxIndex() const { return mWEvlpImportantMtxIdx; }
u16 getDrawFullWgtMtxNum() const { return mDrawMtxData.mDrawFullWgtMtxNum; }
u16 getJointNum() const { return mJointNum; }
u16 getDrawMtxNum() const { return mDrawMtxData.mEntryNum; }
u8 getDrawMtxFlag(u16 idx) const { return mDrawMtxData.mDrawMtxFlag[idx]; }
u16 getDrawMtxIndex(u16 idx) const { return mDrawMtxData.mDrawMtxIndex[idx]; }
J3DDrawMtxData* getDrawMtxData() { return &mDrawMtxData; }
JUTNameTab* getJointName() const { return mJointName; }
J3DJoint* getRootNode() { return mRootNode; }
J3DJoint* getJointNodePointer(u16 idx) const {
J3D_ASSERT_RANGE(139, idx < mJointNum);
return mJointNodePointer[idx];
}
J3DMtxCalc* getBasicMtxCalc() { return mBasicMtxCalc; }
Mtx& getInvJointMtx(int idx) { return mInvJointMtx[idx]; }
u32 getModelDataType() const { return mModelDataType; }
void setModelDataType(u32 type) { mModelDataType = type; }
bool checkFlag(u32 flag) const { return mFlags & flag ? true : false; }
void setFlag(u32 flag) { mFlags = flag; }
private:
friend class J3DModelLoader;
/* 0x04 */ J3DModelHierarchy* mHierarchy;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u32 mModelDataType;
/* 0x10 */ J3DJoint* mRootNode;
/* 0x14 */ J3DMtxCalc* mBasicMtxCalc;
/* 0x18 */ J3DJoint** mJointNodePointer;
/* 0x1C */ u16 mJointNum;
/* 0x1E */ u16 mWEvlpMtxNum;
/* 0x20 */ u8* mWEvlpMixMtxNum;
/* 0x24 */ u16* mWEvlpMixMtxIndex;
/* 0x28 */ f32* mWEvlpMixWeight;
/* 0x2C */ Mtx* mInvJointMtx;
/* 0x30 */ u16* mWEvlpImportantMtxIdx;
/* 0x34 */ J3DDrawMtxData mDrawMtxData;
/* 0x40 */ u32 field_0x40;
/* 0x44 */ JUTNameTab* mJointName;
}; // Size: 0x48
#endif /* J3DJOINTTREE_H */
@@ -1,217 +0,0 @@
#ifndef J3DMATERIALANM_H
#define J3DMATERIALANM_H
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
/**
* @ingroup jsystem-j3d
*
*/
class J3DMatColorAnm {
public:
~J3DMatColorAnm() {}
J3DMatColorAnm() : field_0x0(0), mAnmFlag(1), mAnmColor(NULL) {}
J3DMatColorAnm(u16 param_1, J3DAnmColor* pAnmColor) {
field_0x0 = param_1;
mAnmFlag = 1;
mAnmColor = pAnmColor;
J3D_ASSERT_NULLPTR(56, pAnmColor != NULL);
}
void operator=(J3DMatColorAnm const& other) {
mAnmColor = other.mAnmColor;
field_0x0 = other.field_0x0;
mAnmFlag = other.mAnmFlag;
}
void setAnmFlag(bool flag) { mAnmFlag = flag; }
bool getAnmFlag() const { return mAnmFlag; }
void calc(GXColor* pColor) const {
J3D_ASSERT_NULLPTR(507, pColor != NULL);
mAnmColor->getColor(field_0x0, pColor);
}
private:
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 mAnmFlag;
/* 0x4 */ J3DAnmColor* mAnmColor;
}; // Size: 0x8
/**
* @ingroup jsystem-j3d
*
*/
class J3DTexMtxAnm {
public:
~J3DTexMtxAnm() {}
J3DTexMtxAnm() : field_0x0(0), mAnmFlag(1), mAnmTransform(NULL) {}
J3DTexMtxAnm(u16 param_1, J3DAnmTextureSRTKey* pSRTKey) {
field_0x0 = param_1;
mAnmFlag = 1;
mAnmTransform = pSRTKey;
J3D_ASSERT_NULLPTR(134, pSRTKey != NULL);
}
void operator=(J3DTexMtxAnm const& other) {
mAnmTransform = other.mAnmTransform;
field_0x0 = other.field_0x0;
mAnmFlag = other.mAnmFlag;
}
void setAnmFlag(bool flag) { mAnmFlag = flag; }
void calc(J3DTextureSRTInfo* pSRTInfo) const {
J3D_ASSERT_NULLPTR(519, pSRTInfo != NULL);
mAnmTransform->getTransform(field_0x0, pSRTInfo);
}
bool getAnmFlag() const { return mAnmFlag; }
private:
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 mAnmFlag;
/* 0x4 */ J3DAnmTextureSRTKey* mAnmTransform;
}; // Size: 0x8
/**
* @ingroup jsystem-j3d
*
*/
class J3DTexNoAnm {
public:
~J3DTexNoAnm() {}
J3DTexNoAnm() : field_0x4(0), mAnmFlag(1), mAnmTexPattern(NULL) {}
J3DTexNoAnm(u16 param_1, J3DAnmTexPattern* pAnmTexPattern) {
field_0x4 = param_1;
mAnmFlag = 1;
mAnmTexPattern = pAnmTexPattern;
J3D_ASSERT_NULLPTR(214, pAnmTexPattern != NULL);
}
virtual void calc(u16* param_0) const {
J3D_ASSERT_NULLPTR(532, param_0);
mAnmTexPattern->getTexNo(field_0x4, param_0);
}
void operator=(J3DTexNoAnm const& other) {
mAnmTexPattern = other.mAnmTexPattern;
field_0x4 = other.field_0x4;
mAnmFlag = other.mAnmFlag;
}
void setAnmFlag(bool flag) { mAnmFlag = flag; }
bool getAnmFlag() const { return mAnmFlag; }
J3DAnmTexPattern* getAnmTexPattern() { return mAnmTexPattern; }
private:
/* 0x4 */ u16 field_0x4;
/* 0x6 */ u16 mAnmFlag;
/* 0x8 */ J3DAnmTexPattern* mAnmTexPattern;
}; // Size: 0xC
/**
* @ingroup jsystem-j3d
*
*/
class J3DTevColorAnm {
public:
~J3DTevColorAnm() {}
J3DTevColorAnm() : field_0x0(0), mAnmFlag(1), mAnmTevReg(NULL) {}
J3DTevColorAnm(u16 param_1, J3DAnmTevRegKey* pTevRegKey) {
field_0x0 = param_1;
mAnmFlag = 1;
mAnmTevReg = pTevRegKey;
J3D_ASSERT_NULLPTR(293, pTevRegKey != NULL);
}
void operator=(J3DTevColorAnm const& other) {
mAnmTevReg = other.mAnmTevReg;
field_0x0 = other.field_0x0;
mAnmFlag = other.mAnmFlag;
}
void setAnmFlag(bool flag) { mAnmFlag = flag; }
bool getAnmFlag() const { return mAnmFlag; }
void calc(GXColorS10* pColor) const {
J3D_ASSERT_NULLPTR(545, pColor != NULL);
mAnmTevReg->getTevColorReg(field_0x0, pColor);
}
private:
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 mAnmFlag;
/* 0x4 */ J3DAnmTevRegKey* mAnmTevReg;
}; // Size: 0x8
/**
* @ingroup jsystem-j3d
*
*/
class J3DTevKColorAnm {
public:
~J3DTevKColorAnm() {}
J3DTevKColorAnm() : field_0x0(0), mAnmFlag(1), mAnmTevReg(NULL) {}
J3DTevKColorAnm(u16 param_1, J3DAnmTevRegKey* pTevRegKey) {
field_0x0 = param_1;
mAnmFlag = 1;
mAnmTevReg = pTevRegKey;
J3D_ASSERT_NULLPTR(371, pTevRegKey != NULL);
}
void operator=(J3DTevKColorAnm const& other) {
mAnmTevReg = other.mAnmTevReg;
field_0x0 = other.field_0x0;
mAnmFlag = other.mAnmFlag;
}
void setAnmFlag(bool flag) { mAnmFlag = flag; }
bool getAnmFlag() const { return mAnmFlag; }
void calc(GXColor* pColor) const {
J3D_ASSERT_NULLPTR(558, pColor != NULL);
mAnmTevReg->getTevKonstReg(field_0x0, pColor);
}
private:
/* 0x0 */ u16 field_0x0;
/* 0x2 */ u16 mAnmFlag;
/* 0x4 */ J3DAnmTevRegKey* mAnmTevReg;
}; // Size: 0x8
/**
* @ingroup jsystem-j3d
*
*/
class J3DMaterialAnm {
public:
J3DMaterialAnm() { initialize(); }
void initialize();
void setMatColorAnm(int, J3DMatColorAnm*);
void setTexMtxAnm(int, J3DTexMtxAnm*);
void setTexNoAnm(int, J3DTexNoAnm*);
void setTevColorAnm(int, J3DTevColorAnm*);
void setTevKColorAnm(int, J3DTevKColorAnm*);
virtual ~J3DMaterialAnm() {}
virtual void calc(J3DMaterial*) const;
const J3DTexMtxAnm& getTexMtxAnm(int i) const { return mTexMtxAnm[i]; }
private:
/* 0x04 */ J3DMatColorAnm mMatColorAnm[2];
/* 0x14 */ J3DTexMtxAnm mTexMtxAnm[8];
/* 0x54 */ J3DTexNoAnm mTexNoAnm[8];
/* 0xB4 */ J3DTevColorAnm mTevColorAnm[4];
/* 0xD4 */ J3DTevKColorAnm mTevKColorAnm[4];
}; // Size: 0xF4
#endif /* J3DMATERIALANM_H */
@@ -1,62 +0,0 @@
#ifndef J3DMATERIALATTACH_H
#define J3DMATERIALATTACH_H
#include "JSystem/J3DAssert.h"
class J3DMaterial;
class J3DTexture;
class J3DAnmColor;
class J3DAnmTexPattern;
class J3DAnmTextureSRTKey;
class J3DAnmTevRegKey;
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
class J3DMaterialTable {
public:
void clear();
J3DMaterialTable();
int removeMatColorAnimator(J3DAnmColor*);
int removeTexNoAnimator(J3DAnmTexPattern*);
int removeTexMtxAnimator(J3DAnmTextureSRTKey*);
int removeTevRegAnimator(J3DAnmTevRegKey*);
int createTexMtxForAnimator(J3DAnmTextureSRTKey*);
int entryMatColorAnimator(J3DAnmColor*);
int entryTexNoAnimator(J3DAnmTexPattern*);
int entryTexMtxAnimator(J3DAnmTextureSRTKey*);
int entryTevRegAnimator(J3DAnmTevRegKey*);
virtual ~J3DMaterialTable();
J3DMaterial* getMaterialNodePointer(u16 idx) const {
J3D_ASSERT_RANGE(92, idx < mMaterialNum);
return mMaterialNodePointer[idx];
}
J3DTexture* getTexture() const { return mTexture; }
JUTNameTab* getTextureName() const { return mTextureName; }
JUTNameTab* getMaterialName() const { return mMaterialName; }
u16 getMaterialNum() const { return mMaterialNum; }
bool isLocked() const { return field_0x1c == 1; }
private:
friend class J3DModelLoader;
friend class J3DModelLoader_v26;
friend class J3DModelLoader_v21;
/* 0x04 */ u16 mMaterialNum;
/* 0x06 */ u16 mUniqueMatNum;
/* 0x08 */ J3DMaterial** mMaterialNodePointer;
/* 0x0C */ JUTNameTab* mMaterialName;
/* 0x10 */ J3DMaterial* field_0x10;
/* 0x14 */ J3DTexture* mTexture;
/* 0x18 */ JUTNameTab* mTextureName;
/* 0x1C */ u16 field_0x1c;
}; // Size: 0x20
#endif /* J3DMATERIALATTACH_H */
-128
View File
@@ -1,128 +0,0 @@
#ifndef J3DMODEL_H
#define J3DMODEL_H
#include "JSystem/J3DGraphAnimator/J3DSkinDeform.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include <dolphin/types.h>
enum J3DMdlFlag {
J3DMdlFlag_None = 0x0,
/* 0x00001 */ J3DMdlFlag_Unk1 = 0x1,
/* 0x00002 */ J3DMdlFlag_UseDefaultJ3D = 0x2,
/* 0x00004 */ J3DMdlFlag_SkinPosCpu = 0x4,
/* 0x00008 */ J3DMdlFlag_SkinNrmCpu = 0x8,
/* 0x00010 */ J3DMdlFlag_EnableLOD = 0x10,
/* 0x20000 */ J3DMdlFlag_UseSharedDL = 0x20000,
/* 0x40000 */ J3DMdlFlag_UseSingleDL = 0x40000,
/* 0x80000 */ J3DMdlFlag_DifferedDLBuffer = 0x80000,
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DUnkCalc1 {
virtual void calc(J3DModel* model);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DUnkCalc2 {
virtual void unk();
virtual void calc(J3DModelData* mpModelData);
};
typedef void (*J3DCalcCallBack)(J3DModel*, u32 timing);
/**
* @ingroup jsystem-j3d
*
*/
class J3DModel {
public:
J3DModel() {
initialize();
}
J3DModel(J3DModelData* pModelData, u32 mdlFlags, u32 mtxBufferFlag) {
initialize();
entryModelData(pModelData, mdlFlags, mtxBufferFlag);
}
void initialize();
s32 entryModelData(J3DModelData*, u32, u32);
s32 createShapePacket(J3DModelData*);
s32 createMatPacket(J3DModelData*, u32);
s32 newDifferedDisplayList(u32);
void lock();
void unlock();
void diff();
s32 setDeformData(J3DDeformData*, u32);
s32 setSkinDeform(J3DSkinDeform*, u32);
void calcAnmMtx();
void calcWeightEnvelopeMtx();
void calcNrmMtx();
void calcBumpMtx();
void calcBBoardMtx();
void prepareShapePackets();
void ptrToIndex();
void makeDL();
virtual void update();
virtual void entry();
virtual void calc();
virtual void calcMaterial();
virtual void calcDiffTexMtx();
virtual void viewCalc();
virtual ~J3DModel() {}
J3DModelData* getModelData() { return mModelData; }
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
bool isCpuSkinningOn() const { return (mFlags & J3DMdlFlag_SkinPosCpu) && (mFlags & J3DMdlFlag_SkinNrmCpu); }
Mtx& getBaseTRMtx() { return mBaseTransformMtx; }
void setBaseTRMtx(Mtx m) { MTXCopy(m, mBaseTransformMtx); }
u32 getMtxCalcMode() { return mFlags & (J3DMdlFlag_Unk1 | J3DMdlFlag_UseDefaultJ3D); }
J3DVertexBuffer* getVertexBuffer() { return (J3DVertexBuffer*)&mVertexBuffer; }
J3DMatPacket* getMatPacket(u16 idx) const { return &mMatPacket[idx]; }
J3DShapePacket* getShapePacket(u16 idx) const { return &mShapePacket[idx]; }
J3DMtxBuffer* getMtxBuffer() { return mMtxBuffer; }
void setScaleFlag(int idx, u8 flag) { mMtxBuffer->setScaleFlag(idx, flag); }
Mtx33* getBumpMtxPtr(int idx) { return mMtxBuffer->getBumpMtxPtr(idx); }
Mtx33* getNrmMtxPtr() { return mMtxBuffer->getNrmMtxPtr(); }
Mtx* getDrawMtxPtr() { return mMtxBuffer->getDrawMtxPtr(); }
void setBaseScale(const Vec& scale) { mBaseScale = scale; }
void setUserArea(uintptr_t area) { mUserArea = area; }
uintptr_t getUserArea() const { return mUserArea; }
Vec* getBaseScale() { return &mBaseScale; }
void setAnmMtx(int jointNo, Mtx m) { mMtxBuffer->setAnmMtx(jointNo, m); }
MtxP getAnmMtx(int jointNo) { return mMtxBuffer->getAnmMtx(jointNo); }
MtxP getWeightAnmMtx(int i) { return mMtxBuffer->getWeightAnmMtx(i); }
J3DSkinDeform* getSkinDeform() { return mSkinDeform; }
/* 0x04 */ J3DModelData* mModelData;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u32 mDiffFlag;
/* 0x10 */ J3DCalcCallBack mCalcCallBack;
/* 0x14 */ uintptr_t mUserArea;
/* 0x18 */ Vec mBaseScale;
/* 0x24 */ Mtx mBaseTransformMtx;
/* 0x54 */ Mtx mInternalView;
/* 0x84 */ J3DMtxBuffer* mMtxBuffer;
/* 0x88 */ J3DVertexBuffer mVertexBuffer;
/* 0xC0 */ J3DMatPacket* mMatPacket;
/* 0xC4 */ J3DShapePacket* mShapePacket;
/* 0xC8 */ J3DDeformData* mDeformData;
/* 0xCC */ J3DSkinDeform* mSkinDeform;
/* 0xD0 */ J3DVtxColorCalc* mVtxColorCalc;
/* 0xD4 */ J3DUnkCalc1* mUnkCalc1;
/* 0xD8 */ J3DUnkCalc2* mUnkCalc2;
};
#endif /* J3DMODEL_H */
@@ -1,119 +0,0 @@
#ifndef J3DMODELDATA_H
#define J3DMODELDATA_H
#include "JSystem/J3DGraphAnimator/J3DJointTree.h"
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
#include "JSystem/J3DGraphBase/J3DVertex.h"
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelData {
public:
void clear();
J3DModelData();
s32 newSharedDisplayList(u32);
void indexToPtr();
void makeSharedDL();
void simpleCalcMaterial(u16, Mtx);
void syncJ3DSysPointers() const;
void syncJ3DSysFlags() const;
virtual ~J3DModelData() {}
void simpleCalcMaterial(Mtx mtx) { simpleCalcMaterial(0, mtx); }
J3DMaterialTable& getMaterialTable() { return mMaterialTable; }
JUTNameTab* getMaterialName() const { return mMaterialTable.getMaterialName(); }
J3DVertexData& getVertexData() { return mVertexData; }
u16 getShapeNum() const { return mShapeTable.getShapeNum(); }
u16 getMaterialNum() const { return mMaterialTable.getMaterialNum(); }
u16 getJointNum() const { return mJointTree.getJointNum(); }
u16 getDrawMtxNum() const { return mJointTree.getDrawMtxNum(); }
J3DMaterial* getMaterialNodePointer(u16 idx) const {
return mMaterialTable.getMaterialNodePointer(idx);
}
u32 getVtxNum() const { return mVertexData.getVtxNum(); }
u32 getNrmNum() const { return mVertexData.getNrmNum(); }
u8 getDrawMtxFlag(u16 idx) const { return mJointTree.getDrawMtxFlag(idx); }
u16 getDrawMtxIndex(u16 idx) const { return mJointTree.getDrawMtxIndex(idx); }
J3DDrawMtxData* getDrawMtxData() { return mJointTree.getDrawMtxData(); }
J3DShapeTable* getShapeTable() { return &mShapeTable; }
J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); }
J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
J3DJointTree& getJointTree() { return mJointTree; }
const J3DModelHierarchy* getHierarchy() const { return mJointTree.getHierarchy(); }
void setHierarchy(J3DModelHierarchy* hierarchy) { mJointTree.setHierarchy(hierarchy); }
void setBasicMtxCalc(J3DMtxCalc* calc) { mJointTree.setBasicMtxCalc(calc); }
JUTNameTab* getJointName() const { return mJointTree.getJointName(); }
Mtx& getInvJointMtx(int idx) { return mJointTree.getInvJointMtx(idx); }
J3DTexture* getTexture() const { return mMaterialTable.getTexture(); }
JUTNameTab* getTextureName() const { return mMaterialTable.getTextureName(); }
u16 getWEvlpMtxNum() const { return mJointTree.getWEvlpMtxNum(); }
u16* getWEvlpMixMtxIndex() const { return mJointTree.getWEvlpMixMtxIndex(); }
f32* getWEvlpMixWeight() const { return mJointTree.getWEvlpMixWeight(); }
u8 getWEvlpMixMtxNum(u16 idx) const { return mJointTree.getWEvlpMixMtxNum(idx); }
u16* getWEvlpImportantMtxIndex() const { return mJointTree.getWEvlpImportantMtxIndex(); }
u32 getModelDataType() const { return mJointTree.getModelDataType(); }
void setModelDataType(u32 type) { mJointTree.setModelDataType(type); }
void* getVtxPosArray() const { return mVertexData.getVtxPosArray(); }
void* getVtxNrmArray() const { return mVertexData.getVtxNrmArray(); }
GXColor* getVtxColorArray(u8 idx) const { return mVertexData.getVtxColorArray(idx); }
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
u32 getFlag() const { return mFlags; }
void const* getRawData() const { return mpRawData; }
bool checkBumpFlag() const { return mbHasBumpArray == 1; }
void setBumpFlag(u32 flag) { mbHasBumpArray = flag; }
bool checkBBoardFlag() const { return mbHasBillboard == 1; }
bool isLocked() { return mMaterialTable.isLocked(); }
void entryTexMtxAnimator(J3DAnmTextureSRTKey* anm) { mMaterialTable.entryTexMtxAnimator(anm); }
int entryTevRegAnimator(J3DAnmTevRegKey* anm) { return mMaterialTable.entryTevRegAnimator(anm); }
void entryTexNoAnimator(J3DAnmTexPattern* anm) { mMaterialTable.entryTexNoAnimator(anm); }
int removeTexNoAnimator(J3DAnmTexPattern* anm) {
return mMaterialTable.removeTexNoAnimator(anm);
}
int removeTexMtxAnimator(J3DAnmTextureSRTKey* anm) {
return mMaterialTable.removeTexMtxAnimator(anm);
}
int removeTevRegAnimator(J3DAnmTevRegKey* anm) {
return mMaterialTable.removeTevRegAnimator(anm);
}
int removeMatColorAnimator(J3DAnmColor* anm) {
return mMaterialTable.removeMatColorAnimator(anm);
}
void syncJ3DSys() const {
syncJ3DSysFlags();
syncJ3DSysPointers();
}
void makeHierarchy(J3DJoint* joint, J3DModelHierarchy const** hierarchy) {
mJointTree.makeHierarchy(joint, hierarchy, &mMaterialTable, &mShapeTable);
mShapeTable.initShapeNodes(getDrawMtxData(), &getVertexData());
}
void show() {
mShapeTable.show();
}
void hide() {
mShapeTable.hide();
}
const void* getBinary() {
return mpRawData;
}
private:
friend class J3DModelLoader;
/* 0x04 */ void const* mpRawData;
/* 0x08 */ u32 mFlags;
/* 0x0C */ u16 mbHasBumpArray;
/* 0x0E */ u16 mbHasBillboard;
/* 0x10 */ J3DJointTree mJointTree;
/* 0x58 */ J3DMaterialTable mMaterialTable;
/* 0x78 */ J3DShapeTable mShapeTable;
/* 0x88 */ J3DVertexData mVertexData;
}; // Size: 0xE4
#endif /* J3DMODELDATA_H */
@@ -1,89 +0,0 @@
#ifndef J3DMTXBUFFER_H
#define J3DMTXBUFFER_H
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
#include "JSystem/J3DGraphBase/J3DEnum.h"
class J3DModelData;
/**
* @ingroup jsystem-j3d
*
*/
class J3DMtxBuffer {
public:
J3DMtxBuffer() { initialize(); }
void initialize();
s32 create(J3DModelData*, u32);
J3DError createAnmMtx(J3DModelData*);
s32 createWeightEnvelopeMtx(J3DModelData*);
s32 setNoUseDrawMtx();
s32 createDoubleDrawMtx(J3DModelData*, u32);
s32 createBumpMtxArray(J3DModelData*, u32);
void calcWeightEnvelopeMtx();
void calcDrawMtx(u32, Vec const&, f32 const (&)[3][4]);
void calcNrmMtx();
void calcBBoardMtx();
MtxP getAnmMtx(int idx) { return mpAnmMtx[idx]; }
void setAnmMtx(int i, Mtx m) { MTXCopy(m, (MtxP)mpAnmMtx[i]); }
MtxP getWeightAnmMtx(int idx) { return mpWeightEvlpMtx[idx]; }
MtxP getUserAnmMtx(int idx) { return mpUserAnmMtx[idx]; }
void setScaleFlag(int idx, u8 flag) { mpScaleFlagArr[idx] = flag; }
u32* getCurrentViewNoPtr() { return &mCurrentViewNo; }
u8* getScaleFlagArray() const { return mpScaleFlagArr; }
u8 getScaleFlag(int idx) const { return mpScaleFlagArr[idx]; }
u8 getEnvScaleFlag(int idx) const { return mpEvlpScaleFlagArr[idx]; }
Mtx** getDrawMtxPtrPtr() { return mpDrawMtxArr[1]; }
Mtx* getDrawMtxPtr() { return mpDrawMtxArr[1][mCurrentViewNo]; }
Mtx* getDrawMtx(int idx) { return &mpDrawMtxArr[1][mCurrentViewNo][idx]; }
Mtx33** getNrmMtxPtrPtr() { return mpNrmMtxArr[1]; }
Mtx33* getNrmMtxPtr() { return mpNrmMtxArr[1][mCurrentViewNo]; }
Mtx33* getNrmMtx(int idx) { return &mpNrmMtxArr[1][mCurrentViewNo][idx]; }
Mtx33*** getBumpMtxPtrPtr() const { return mpBumpMtxArr[1]; }
Mtx33* getBumpMtxPtr(int idx) { return mpBumpMtxArr[1][idx][mCurrentViewNo]; }
J3DJointTree* getJointTree() const { return mJointTree; }
void setNrmMtx(int idx, Mtx mtx) {
J3DPSMtx33CopyFrom34(mtx, mpNrmMtxArr[1][mCurrentViewNo][idx]);
}
void swapDrawMtx() {
Mtx* tmp = mpDrawMtxArr[0][mCurrentViewNo];
mpDrawMtxArr[0][mCurrentViewNo] = mpDrawMtxArr[1][mCurrentViewNo];
mpDrawMtxArr[1][mCurrentViewNo] = tmp;
}
void swapNrmMtx() {
Mtx33* tmp = mpNrmMtxArr[0][mCurrentViewNo];
mpNrmMtxArr[0][mCurrentViewNo] = mpNrmMtxArr[1][mCurrentViewNo];
mpNrmMtxArr[1][mCurrentViewNo] = tmp;
}
static Mtx sNoUseDrawMtx;
static Mtx33 sNoUseNrmMtx;
static Mtx* sNoUseDrawMtxPtr;
static Mtx33* sNoUseNrmMtxPtr;
/* 0x00 */ J3DJointTree* mJointTree;
/* 0x04 */ u8* mpScaleFlagArr;
/* 0x08 */ u8* mpEvlpScaleFlagArr;
/* 0x0C */ Mtx* mpAnmMtx;
/* 0x10 */ Mtx* mpWeightEvlpMtx;
/* 0x14 */ Mtx** mpDrawMtxArr[2];
/* 0x1C */ Mtx33** mpNrmMtxArr[2];
/* 0x24 */ Mtx33*** mpBumpMtxArr[2];
/* 0x2C */ u32 mMtxNum;
/* 0x30 */ u32 mCurrentViewNo;
/* 0x34 */ Mtx* mpUserAnmMtx;
public:
virtual ~J3DMtxBuffer() {}
};
void J3DCalcViewBaseMtx(f32 (*param_0)[4], Vec const& param_1, f32 const (&param_2)[3][4],
f32 (*param_3)[4]);
#endif /* J3DMTXBUFFER_H */
@@ -1,44 +0,0 @@
#ifndef J3DSHAPETABLE_H
#define J3DSHAPETABLE_H
#include "JSystem/JUtility/JUTAssert.h"
class J3DVertexData;
struct J3DDrawMtxData;
class J3DShape;
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeTable {
public:
J3DShapeTable() {
mShapeNum = 0;
mShapeNodePointer = NULL;
mShapeName = NULL;
}
void hide();
void show();
void initShapeNodes(J3DDrawMtxData*, J3DVertexData*);
void sortVcdVatCmd();
virtual ~J3DShapeTable() {}
u16 getShapeNum() const { return mShapeNum; }
J3DShape* getShapeNodePointer(u16 idx) const {
J3D_ASSERT_RANGE(85, idx < mShapeNum);
return mShapeNodePointer[idx];
}
private:
friend class J3DModelLoader;
/* 0x4 */ u16 mShapeNum;
/* 0x8 */ J3DShape** mShapeNodePointer;
/* 0xC */ JUTNameTab* mShapeName;
}; // Size: 0x10
#endif /* J3DSHAPETABLE_H */
@@ -1,116 +0,0 @@
#ifndef J3DSKINDEFORM_H
#define J3DSKINDEFORM_H
#include "JSystem/J3DGraphAnimator/J3DCluster.h"
#include "JSystem/J3DGraphAnimator/J3DMtxBuffer.h"
#include <dolphin/types.h>
class J3DModel;
class J3DAnmCluster;
class J3DClusterVertex;
class JUTNameTab;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DSkinNList {
J3DSkinNList();
void calcSkin_VtxPosF32(f32 (*)[4], void*, void*);
void calcSkin_VtxNrmF32(f32 (*)[4], void*, void*);
/* 0x00 */ u16* field_0x0;
/* 0x04 */ u16* field_0x4;
/* 0x08 */ f32* field_0x8;
/* 0x0C */ f32* field_0xc;
/* 0x10 */ u16 field_0x10;
/* 0x12 */ u16 field_0x12;
}; // Size: 0x14
/**
* @ingroup jsystem-j3d
*
*/
class J3DSkinDeform {
public:
J3DSkinDeform();
void initSkinInfo(J3DModelData*);
int initMtxIndexArray(J3DModelData*);
void changeFastSkinDL(J3DModelData*);
void calcNrmMtx(J3DMtxBuffer*);
void transformVtxPosNrm(J3DModelData*);
void calcAnmInvJointMtx(J3DMtxBuffer*);
void deformFastVtxPos_F32(J3DVertexBuffer*, J3DMtxBuffer*) const;
void deformFastVtxNrm_F32(J3DVertexBuffer*, J3DMtxBuffer*) const;
void deformVtxPos_F32(J3DVertexBuffer*, J3DMtxBuffer*) const;
void deformVtxPos_S16(J3DVertexBuffer*, J3DMtxBuffer*) const;
void deformVtxNrm_F32(J3DVertexBuffer*) const;
void deformVtxNrm_S16(J3DVertexBuffer*) const;
void deform(J3DModel*);
void setNrmMtx(int i, MtxP mtx) {
J3DPSMtx33CopyFrom34(mtx, (Mtx3P)mNrmMtx[i]);
}
Mtx3P getNrmMtx(int i) { return mNrmMtx[i]; }
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) { return mFlags & flag ? true : false; }
virtual void deform(J3DVertexBuffer*, J3DMtxBuffer*);
virtual ~J3DSkinDeform();
static u16* sWorkArea_WEvlpMixMtx[1024];
static f32* sWorkArea_WEvlpMixWeight[1024];
static u16 sWorkArea_MtxReg[1024];
private:
/* 0x04 */ u16* mPosData;
/* 0x08 */ u16* mNrmData;
/* 0x0C */ Mtx* mPosMtx;
/* 0x10 */ Mtx33* mNrmMtx;
/* 0x14 */ u32 mFlags;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1C */ int field_0x1c;
/* 0x20 */ int field_0x20;
/* 0x24 */ J3DSkinNList* mSkinNList;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DDeformer {
public:
J3DDeformer(J3DDeformData*);
void deform(J3DVertexBuffer*, u16, f32*);
void deform(J3DVertexBuffer*, u16);
void deform_VtxPosF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*);
void deform_VtxNrmF32(J3DVertexBuffer*, J3DCluster*, J3DClusterKey*, f32*);
void normalizeWeight(int, f32*);
void offFlag(u32 i_flag) { mFlags &= ~i_flag; }
bool checkFlag(u32 i_flag) { return mFlags & i_flag ? true : false; }
void setAnmCluster(J3DAnmCluster* anm) { mAnmCluster = anm; }
void normalize(f32* i_vec) { VECNormalize((Vec*)i_vec, (Vec*)i_vec); }
/* 0x00 */ J3DDeformData* mDeformData;
/* 0x04 */ J3DAnmCluster* mAnmCluster;
/* 0x08 */ f32* field_0x8;
/* 0x0C */ f32* field_0xc;
/* 0x10 */ u32 mFlags;
}; // Size: 0x14
inline void J3DFillZero32B(__REGISTER void* param_0, __REGISTER u32 param_1) {
#ifdef __MWERKS__
asm {
srwi param_1, param_1, 5
mtctr param_1
lbl_8032D948:
dcbz 0, param_0
addi param_0, param_0, 0x20
bdnz lbl_8032D948
}
#endif
}
#endif /* J3DSKINDEFORM_H */
@@ -1,105 +0,0 @@
#ifndef J3DDRAWBUFFER_H
#define J3DDRAWBUFFER_H
#include "JSystem/J3DGraphBase/J3DSys.h"
// matches debug
inline f32 J3DCalcZValue(__REGISTER MtxP m, __REGISTER Vec v) {
#ifdef __MWERKS__
__REGISTER f32 temp_f4;
__REGISTER f32 out;
__REGISTER f32 temp_f0;
__REGISTER f32 temp_f2;
__REGISTER f32 temp_f1 = 1.0f;
// clang-format off
asm {
psq_l temp_f0, 0(v), 0, 0 /* qr0 */
lfs temp_f2, 8(v)
psq_l temp_f4, 32(m), 0, 0 /* qr0 */
psq_l out, 40(m), 0, 0 /* qr0 */
ps_merge00 temp_f2, temp_f2, temp_f1
ps_mul temp_f4, temp_f0, temp_f4
ps_madd out, temp_f2, out, temp_f4
ps_sum0 out, out, out, out
}
// clang-format on
return out;
#endif
}
class J3DDrawBuffer;
class J3DPacket;
class J3DDrawPacket;
class J3DMatPacket;
class J3DShapePacket;
enum J3DDrawBufDrawMode {
J3DDrawBufDrawMode_Head,
J3DDrawBufDrawMode_Tail,
J3DDrawBufDrawMode_MAX,
};
enum J3DDrawBufSortMode {
J3DDrawBufSortMode_Mat,
J3DDrawBufSortMode_MatAnm,
J3DDrawBufSortMode_Z,
J3DDrawBufSortMode_Model,
J3DDrawBufSortMode_Invalid,
J3DDrawBufSortMode_Non,
J3DDrawBufSortMode_MAX,
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DDrawBuffer {
public:
typedef int (J3DDrawBuffer::*sortFunc)(J3DMatPacket*);
typedef void (J3DDrawBuffer::*drawFunc)() const;
J3DDrawBuffer() { initialize(); }
~J3DDrawBuffer();
void initialize();
int allocBuffer(u32);
void frameInit();
int entryMatSort(J3DMatPacket*);
int entryMatAnmSort(J3DMatPacket*);
int entryZSort(J3DMatPacket*);
int entryModelSort(J3DMatPacket*);
int entryInvalidSort(J3DMatPacket*);
int entryNonSort(J3DMatPacket*);
int entryImm(J3DPacket* pPacket, u16 index);
void draw() const;
void drawHead() const;
void drawTail() const;
u32 getEntryTableSize() { return mEntryTableSize; }
int getSortMode() { return mSortMode; }
inline void calcZRatio();
void setNonSort() { mSortMode = J3DDrawBufSortMode_Non; }
void setZSort() { mSortMode = J3DDrawBufSortMode_Z; }
void setZMtx(MtxP mtx) { mpZMtx = mtx; }
public:
/* 0x00 */ J3DPacket** mpBuffer;
/* 0x04 */ u32 mEntryTableSize;
/* 0x08 */ u32 mDrawMode;
/* 0x0C */ u32 mSortMode;
/* 0x10 */ f32 mZNear;
/* 0x14 */ f32 mZFar;
/* 0x18 */ f32 mZRatio;
/* 0x1C */ MtxP mpZMtx;
/* 0x20 */ J3DPacket* mpCallBackPacket;
static sortFunc sortFuncTable[6];
static drawFunc drawFuncTable[2];
static int entryNum;
};
#endif /* J3DDRAWBUFFER_H */
-9
View File
@@ -1,9 +0,0 @@
#ifndef J3DENUM_H
#define J3DENUM_H
enum J3DError {
kJ3DError_Success = 0,
kJ3DError_Alloc = 4,
};
#endif /* J3DENUM_H */
-67
View File
@@ -1,67 +0,0 @@
#ifndef J3DFIFO_H
#define J3DFIFO_H
#include <dolphin/gx.h>
#include <dolphin/gd.h>
inline void J3DFifoLoadBPCmd(u32 regval) {
GXCmd1u8(GX_LOAD_BP_REG);
GXCmd1u32(regval);
}
inline void J3DFifoWriteXFCmdHdr(u16 addr, u8 len) {
GXCmd1u8(GX_LOAD_XF_REG);
GXCmd1u16(len - 1);
GXCmd1u16(addr);
}
inline void J3DFifoLoadIndx(u8 cmd, u16 indx, u16 addr) {
GXWGFifo.u8 = cmd;
GXWGFifo.u16 = indx;
GXWGFifo.u16 = addr;
}
inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
GXWGFifo.u8 = GX_LOAD_CP_REG;
GXWGFifo.u8 = cmd;
GXWGFifo.u32 = param;
}
inline void J3DFifoLoadCPCmd(u8 reg, u32 value) {
GXCmd1u8(GX_LOAD_CP_REG);
GXCmd1u8(reg);
GXCmd1u32(value);
}
inline void J3DFifoWriteXFCmd(u16 cmd, u16 len) {
GXWGFifo.u8 = GX_LOAD_XF_REG;
GXWGFifo.u16 = (len - 1);
GXWGFifo.u16 = cmd;
}
inline void J3DFifoLoadXFCmdHdr(u16 addr, u8 len) {
GXCmd1u8(GX_LOAD_XF_REG);
GXCmd1u16(len - 1);
GXCmd1u16(addr);
}
inline void J3DFifoLoadPosMtxIndx(u16 index, u32 addr) {
GXCmd1u8(GX_LOAD_INDX_A);
GXCmd1u16(index);
GXCmd1u16(((sizeof(Vec) - 1) << 12) | (u16)(addr * 4));
}
inline void J3DFifoLoadNrmMtxIndx3x3(u16 index, u32 addr) {
GXCmd1u8(GX_LOAD_INDX_B);
GXCmd1u16(index);
GXCmd1u16(((9 - 1) << 12) | (u16)((addr * 3) + 0x400));
}
void J3DFifoLoadPosMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxImm3x3(f32 (*)[3], u32);
void J3DFifoLoadNrmMtxToTexMtx(f32 (*)[4], u32);
void J3DFifoLoadNrmMtxToTexMtx3x3(f32 (*)[3], u32);
void J3DFifoLoadTexCached(GXTexMapID, u32, GXTexCacheSize, u32, GXTexCacheSize);
#endif /* J3DFIFO_H */
-149
View File
@@ -1,149 +0,0 @@
#ifndef J3DGD_H
#define J3DGD_H
#include <dolphin/gx.h>
#include <dolphin/gd.h>
inline void J3DGDWrite_u8(u8 data) {
__GDWrite(data);
}
inline void J3DGDWrite_u16(u16 data) {
__GDWrite((u8)((data >> 8)));
__GDWrite((u8)((data >> 0) & 0xFF));
}
inline void J3DGDWrite_u32(u32 data) {
__GDWrite((u8)((data >> 24) & 0xFF));
__GDWrite((u8)((data >> 16) & 0xFF));
__GDWrite((u8)((data >> 8) & 0xFF));
__GDWrite((u8)((data >> 0) & 0xFF));
}
inline void J3DGDWrite_f32(f32 data) {
union {
f32 f;
u32 u;
} fid;
fid.f = data;
J3DGDWrite_u32(fid.u);
}
inline void J3DGDWriteBPCmd(u32 regval) {
J3DGDWrite_u8(GX_LOAD_BP_REG);
J3DGDWrite_u32(regval);
}
inline void J3DGDWriteXFCmd(u16 addr, u32 val) {
J3DGDWrite_u8(GX_LOAD_XF_REG);
J3DGDWrite_u16(0);
J3DGDWrite_u16(addr);
J3DGDWrite_u32(val);
}
inline void J3DGDWriteXFCmdHdr(u16 addr, u8 len) {
J3DGDWrite_u8(GX_LOAD_XF_REG);
J3DGDWrite_u16(len - 1);
J3DGDWrite_u16(addr);
}
inline void J3DGXCmd1f32ptr(f32* data) {
GXCmd1u32(*(u32*)data);
}
inline void J3DGXCmd1f32(f32 data) {
union {
f32 f;
u32 u;
} fid;
fid.f = data;
GXCmd1u32(fid.u);
}
inline void J3DGDWriteCPCmd(u8 reg, u32 value) {
J3DGDWrite_u8(8);
J3DGDWrite_u8(reg);
J3DGDWrite_u32(value);
}
void J3DGDSetGenMode(u8 texGenNum, u8 colorChanNum, u8 tevStageNum, u8 IndTexStageNum,
GXCullMode cullMode);
void J3DGDSetGenMode_3Param(u8 texGenNum, u8 tevStageNum, u8 indTexStageNum);
void J3DGDSetLightAttn(GXLightID, f32, f32, f32, f32, f32, f32);
void J3DGDSetLightColor(GXLightID, GXColor);
void J3DGDSetLightPos(GXLightID, f32, f32, f32);
void J3DGDSetLightDir(GXLightID, f32, f32, f32);
void J3DGDSetVtxAttrFmtv(GXVtxFmt, GXVtxAttrFmtList const*, bool);
void J3DGDSetTexCoordGen(GXTexGenType, GXTexGenSrc);
void J3DGDSetTexCoordScale2(GXTexCoordID, u16, u8, u8, u16, u8, u8);
void J3DGDSetTexLookupMode(GXTexMapID, GXTexWrapMode, GXTexWrapMode, GXTexFilter, GXTexFilter, f32,
f32, f32, u8, u8, GXAnisotropy);
void J3DGDSetTexImgAttr(GXTexMapID, u16, u16, GXTexFmt);
void J3DGDSetTexImgPtr(GXTexMapID, void*);
void J3DGDSetTexImgPtrRaw(GXTexMapID, u32);
void J3DGDSetTexTlut(GXTexMapID, u32, _GXTlutFmt);
void J3DGDLoadTlut(void*, u32, _GXTlutSize);
void J3DGDSetIndTexMtx(GXIndTexMtxID, f32 (*)[3], s8);
void J3DGDSetIndTexCoordScale(GXIndTexStageID, GXIndTexScale, GXIndTexScale, GXIndTexScale,
GXIndTexScale);
void J3DGDSetIndTexOrder(u32, GXTexCoordID, GXTexMapID, GXTexCoordID, GXTexMapID, GXTexCoordID,
GXTexMapID, GXTexCoordID, GXTexMapID);
void J3DGDSetTevOrder(GXTevStageID, GXTexCoordID, GXTexMapID, GXChannelID, GXTexCoordID, GXTexMapID,
GXChannelID);
void J3DGDSetTevKColor(GXTevKColorID, GXColor);
void J3DGDSetTevColorS10(GXTevRegID, GXColorS10);
void J3DGDSetFog(GXFogType, f32, f32, f32, f32, GXColor);
void J3DGDSetFogRangeAdj(u8, u16, _GXFogAdjTable*);
inline void J3DGDSetNumChans(u8 numChans) {
J3DGDWriteXFCmd(0x1009, numChans);
}
inline void J3DGDSetNumTexGens(u8 numTexGens) {
J3DGDWriteXFCmd(0x103f, numTexGens);
}
inline void J3DGDSetTevKonstantSel_SwapModeTable(GXTevStageID stage, GXTevKColorSel colorSel1, GXTevKAlphaSel alphaSel1, GXTevKColorSel colorSel2, GXTevKAlphaSel alphaSel2, GXTevColorChan chan1, GXTevColorChan chan2) {
J3DGDWriteBPCmd((stage / 2 + 0xf6) << 24 | (chan1 | chan2 << 2 | colorSel1 << 4 | alphaSel1 << 9 | colorSel2 << 14 | alphaSel2 << 19) & 0x00FFFFFF);
}
inline void J3DGDSetAlphaCompare(GXCompare cmp0, u8 ref0, GXAlphaOp op, GXCompare cmp1, u8 ref1) {
J3DGDWriteBPCmd(ref0 | ref1 << 8 | cmp0 << 16 | cmp1 << 19 | op << 22 | 0xF3 << 24);
}
inline void J3DGDSetBlendMode(GXBlendMode mode, GXBlendFactor srcFactor, GXBlendFactor dstFactor, GXLogicOp logicOp) {
J3DGDWriteBPCmd(0xFE00FFE3);
J3DGDWriteBPCmd(
(mode == GX_BM_BLEND || mode == GX_BM_SUBTRACT) << 0 |
(mode == GX_BM_LOGIC) << 1 |
dstFactor << 5 |
srcFactor << 8 |
(mode == GX_BM_SUBTRACT) << 11 |
logicOp << 12 |
0x41 << 24);
}
inline void J3DGDSetBlendMode(GXBlendMode mode, GXBlendFactor srcFactor, GXBlendFactor dstFactor, GXLogicOp logicOp, u8 ditherEnable) {
J3DGDWriteBPCmd(0xFE00FFE7);
J3DGDWriteBPCmd(
u32(mode == GX_BM_BLEND || mode == GX_BM_SUBTRACT) << 0 |
(mode == GX_BM_LOGIC) << 1 |
ditherEnable << 2 |
dstFactor << 5 |
srcFactor << 8 |
(mode == GX_BM_SUBTRACT) << 11 |
logicOp << 12 |
0x41 << 24);
}
inline void J3DGDSetZMode(u8 compareEnable, GXCompare func, u8 writeEnable) {
J3DGDWriteBPCmd(compareEnable | func << 1 | writeEnable << 4 | 0x40 << 24);
}
inline void J3DGDSetZCompLoc(u32 compLocEnable) {
J3DGDWriteBPCmd(0xFE000040);
J3DGDWriteBPCmd(compLocEnable << 6 | 0x43 << 24);
}
#endif /* J3DGD_H */
File diff suppressed because it is too large Load Diff
-163
View File
@@ -1,163 +0,0 @@
#ifndef J3DMATERIAL_H
#define J3DMATERIAL_H
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DShape.h"
#include <stdint.h>
class J3DJoint;
class J3DMaterialAnm;
/**
* @ingroup jsystem-j3d
*
*/
class J3DMaterial {
public:
static J3DColorBlock* createColorBlock(u32);
static J3DTexGenBlock* createTexGenBlock(u32);
static J3DTevBlock* createTevBlock(int);
static J3DIndBlock* createIndBlock(int);
static J3DPEBlock* createPEBlock(u32, u32);
static u32 calcSizeColorBlock(u32);
static u32 calcSizeTexGenBlock(u32);
static u32 calcSizeTevBlock(int);
static u32 calcSizeIndBlock(int);
static u32 calcSizePEBlock(u32, u32);
void initialize();
u32 countDLSize();
void makeDisplayList_private(J3DDisplayListObj*);
void setCurrentMtx();
void calcCurrentMtx();
void copy(J3DMaterial*);
s32 newSharedDisplayList(u32);
s32 newSingleSharedDisplayList(u32);
virtual void calc(f32 const (*)[4]);
virtual void calcDiffTexMtx(f32 const (*)[4]);
virtual void makeDisplayList();
virtual void makeSharedDisplayList();
virtual void load();
virtual void loadSharedDL();
virtual void patch();
virtual void diff(u32);
virtual void reset();
virtual void change();
J3DMaterial() { initialize(); }
~J3DMaterial() {}
J3DMaterial* getNext() { return mNext; }
J3DShape* getShape() { return mShape; }
J3DTevBlock* getTevBlock() { return mTevBlock; }
J3DColorBlock* getColorBlock() { return mColorBlock; }
J3DTexGenBlock* getTexGenBlock() { return mTexGenBlock; }
J3DDisplayListObj* getSharedDisplayListObj() { return mSharedDLObj; }
J3DIndBlock* getIndBlock() { return mIndBlock; }
J3DJoint* getJoint() { return mJoint; }
J3DMaterialAnm* getMaterialAnm() {
return (uintptr_t)mMaterialAnm < 0xC0000000 ? mMaterialAnm : NULL;
}
u32 getMaterialMode() { return mMaterialMode; }
J3DNBTScale* getNBTScale() { return mTexGenBlock->getNBTScale(); }
u16 getTexNo(u32 idx) { return mTevBlock->getTexNo(idx); }
J3DGXColor* getTevKColor(u32 param_0) { return mTevBlock->getTevKColor(param_0); }
J3DGXColorS10* getTevColor(u32 param_0) { return mTevBlock->getTevColor(param_0); }
J3DFog* getFog() { return mPEBlock->getFog(); }
J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); }
u16 getIndex() { return mIndex; }
BOOL isDrawModeOpaTexEdge() { return (mMaterialMode & 3) ? 1 : 0; }
J3DPEBlock* getPEBlock() { return mPEBlock; }
void onInvalid() { mInvalid = 1; }
u32 getInvalid() { return mInvalid; }
u32 getTexGenNum() const { return mTexGenBlock->getTexGenNum(); }
u8 getTevStageNum() const { return mTevBlock->getTevStageNum(); }
J3DTexCoord* getTexCoord(u32 idx) { return mTexGenBlock->getTexCoord(idx); }
J3DZMode* getZMode() { return mPEBlock->getZMode(); }
J3DBlend* getBlend() { return mPEBlock->getBlend(); }
J3DColorChan* getColorChan(u32 idx) { return mColorBlock->getColorChan(idx); }
J3DGXColor* getMatColor(u32 i) { return mColorBlock->getMatColor(i); }
void setTevColor(u32 i, const J3DGXColorS10* i_color) { mTevBlock->setTevColor(i, i_color); }
void setTevKColor(u32 i, const J3DGXColor* i_color) { mTevBlock->setTevKColor(i, i_color); }
void setAmbColor(u32 i, const J3DGXColor* i_color) { mColorBlock->setAmbColor(i, i_color); }
void setLight(u32 i, J3DLightObj* i_lightobj) { mColorBlock->setLight(i, i_lightobj); }
void setMaterialAnm(J3DMaterialAnm* i_anm) { mMaterialAnm = i_anm; }
void setCullMode(u8 i_mode) { mColorBlock->setCullMode(i_mode); }
void setTexMtx(u32 idx, J3DTexMtx* mtx) { mTexGenBlock->setTexMtx(idx, mtx); }
void setZCompLoc(u8 i_comploc) { mPEBlock->setZCompLoc(i_comploc); }
void setMaterialMode(u32 i_mode) { mMaterialMode = i_mode; }
void addShape(J3DShape* pShape) {
J3D_ASSERT_NULLPTR(618, pShape != NULL);
mShape = pShape;
}
void setNext(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(623, pMaterial != NULL);
mNext = pMaterial;
}
void setJoint(J3DJoint* pJoint) {
J3D_ASSERT_NULLPTR(628, pJoint != NULL);
mJoint = pJoint;
}
public:
/* 0x04 */ J3DMaterial* mNext;
/* 0x08 */ J3DShape* mShape;
/* 0x0C */ J3DJoint* mJoint;
/* 0x10 */ u32 mMaterialMode;
/* 0x14 */ u16 mIndex;
/* 0x18 */ u32 mInvalid;
/* 0x1C */ u32 field_0x1c;
/* 0x20 */ u32 mDiffFlag;
/* 0x24 */ J3DColorBlock* mColorBlock;
/* 0x28 */ J3DTexGenBlock* mTexGenBlock;
/* 0x2C */ J3DTevBlock* mTevBlock;
/* 0x30 */ J3DIndBlock* mIndBlock;
/* 0x34 */ J3DPEBlock* mPEBlock;
/* 0x38 */ J3DMaterial* mpOrigMaterial;
/* 0x3C */ J3DMaterialAnm* mMaterialAnm;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ J3DDisplayListObj* mSharedDLObj;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DPatchedMaterial : public J3DMaterial {
public:
J3DPatchedMaterial() { initialize(); }
void initialize();
virtual void makeDisplayList();
virtual void makeSharedDisplayList();
virtual void load();
virtual void loadSharedDL();
virtual void reset();
virtual void change();
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DLockedMaterial : public J3DMaterial {
public:
J3DLockedMaterial() { initialize(); }
void initialize();
virtual void calc(f32 const (*)[4]);
virtual void makeDisplayList();
virtual void makeSharedDisplayList();
virtual void load();
virtual void loadSharedDL();
virtual void patch();
virtual void diff(u32);
virtual void reset();
virtual void change();
};
#endif /* J3DMATERIAL_H */
-330
View File
@@ -1,330 +0,0 @@
#ifndef J3DPACKET_H
#define J3DPACKET_H
#include "JSystem/J3DAssert.h"
#include "JSystem/J3DGraphBase/J3DSys.h"
#include "JSystem/J3DGraphBase/J3DEnum.h"
#include <dolphin/gd/GDBase.h>
#include <dolphin/mtx.h>
#include <stdint.h>
class J3DMatPacket;
class J3DDrawBuffer;
class J3DMaterial;
class J3DMaterialAnm;
class J3DModel;
class J3DMtxBuffer;
class J3DShape;
class J3DTexMtx;
class J3DTexMtxObj;
class J3DTexture;
enum J3DDiffFlag {
J3DDiffFlag_MatColor = 0x1,
J3DDiffFlag_ColorChan = 0x2,
J3DDiffFlag_AmbColor = 0x4,
J3DDiffFlag_TexGen = 0x1000,
J3DDiffFlag_TevReg = 0x1000000,
J3DDiffFlag_KonstColor = 0x2000000, // is this right?
J3DDiffFlag_TexCoordScale = 0x4000000,
J3DDiffFlag_TevStageIndirect = 0x8000000,
J3DDiffFlag_Fog = 0x10000000,
J3DDiffFlag_Blend = 0x20000000,
J3DDiffFlag_Unk40000000 = 0x40000000,
J3DDiffFlag_Changed = 0x80000000,
};
#define J3D_DIFF_LIGHTOBJNUM(n) ((n & 0xF) << 4)
#define J3D_DIFF_TEXGENNUM(n) ((n & 0xF) << 8)
#define J3D_DIFF_TEXNONUM(n) ((n & 0xF) << 16)
#define J3D_DIFF_TEVSTAGENUM(n) ((n & 0xF) << 20)
#define J3D_DIFF_FLAG(MatColor, ColorChan, AmbColor, LightNum, TexGenNum, TexGen, TexCoordNum, TevStageNum, TevReg, KColor, TexCoordScale, TevStageInd, Fog, Blend) \
( \
(MatColor << 0) | \
(ColorChan << 1) | \
(AmbColor << 2) | \
((LightNum & 0xF) << 4) | \
((TexGenNum & 0xF) << 8) | \
(TexGen << 12) | \
((TexCoordNum & 0xF) << 16) | \
((TevStageNum & 0xF) << 20) | \
(TevReg << 24) | \
(KColor << 25) | \
(TexCoordScale << 26) | \
(TevStageInd << 27) | \
(Fog << 28) | \
(Blend << 29) \
)
inline u32 getDiffFlag_LightObjNum(u32 diffFlags) {
return (diffFlags & 0xf0) >> 4;
}
inline u32 getDiffFlag_TexGenNum(u32 diffFlags) {
return (diffFlags & 0xf00) >> 8;
}
inline int calcDifferedBufferSize_TexMtxSize(u32 param_1) {
return param_1 * 0x35;
}
inline int calcDifferedBufferSize_TexGenSize(u32 param_1) {
return param_1 * 0x3d + 10;
}
inline u32 getDiffFlag_TexNoNum(u32 diffFlags) {
return (diffFlags & 0xf0000) >> 0x10;
}
inline int calcDifferedBufferSize_TexNoSize(u32 param_1) {
return param_1 * 0x37;
}
inline u32 calcDifferedBufferSize_TexNoAndTexCoordScaleSize(u32 param_1) {
u32 res = param_1 * 0x37;
res += ((param_1 + 1) >> 1) * 0x37;
return res;
}
inline u32 getDiffFlag_TevStageNum(u32 diffFlags) {
return (diffFlags & 0xf00000) >> 0x14;
}
inline int calcDifferedBufferSize_TevStageSize(u32 param_1) {
return param_1 * 10;
}
inline int calcDifferedBufferSize_TevStageDirectSize(u32 param_1) {
return param_1 * 5;
}
/**
* @ingroup jsystem-j3d
*
*/
class J3DDisplayListObj {
public:
J3DDisplayListObj() {
mpDisplayList[0] = NULL;
mpDisplayList[1] = NULL;
mSize = 0;
mMaxSize = 0;
}
J3DError newDisplayList(u32);
J3DError newSingleDisplayList(u32);
int single_To_Double();
void setSingleDisplayList(void*, u32);
void swapBuffer();
void callDL() const;
void beginDL();
u32 endDL();
void beginPatch();
u32 endPatch();
u8* getDisplayList(int idx) { return (u8*)mpDisplayList[idx]; }
u32 getDisplayListSize() { return mSize; }
static GDLObj sGDLObj;
static s32 sInterruptFlag;
/* 0x0 */ void* mpDisplayList[2];
/* 0x8 */ u32 mSize;
/* 0xC */ u32 mMaxSize;
}; // Size: 0x10
/**
* @ingroup jsystem-j3d
*
*/
class J3DTexMtxObj {
public:
Mtx& getMtx(u16 idx) {
J3D_ASSERT_RANGE(275, idx < mTexMtxNum);
return mpTexMtx[idx];
}
void setMtx(u16 idx, const Mtx mtx) {
J3D_ASSERT_RANGE(288, idx < mTexMtxNum);
MTXCopy(mtx, mpTexMtx[idx]);
}
Mtx44& getEffectMtx(u16 idx) {
J3D_ASSERT_RANGE(293, idx < mTexMtxNum);
return mpEffectMtx[idx];
}
u16 getNumTexMtx() const { return mTexMtxNum; }
/* 0x00 */ Mtx* mpTexMtx;
/* 0x04 */ Mtx44* mpEffectMtx;
/* 0x08 */ u16 mTexMtxNum;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DPacket {
public:
J3DPacket() {
mpNextPacket = NULL;
mpFirstChild = NULL;
mpUserArea = NULL;
}
void addChildPacket(J3DPacket*);
J3DPacket* getNextPacket() const { return mpNextPacket; }
void setNextPacket(J3DPacket* i_packet) { mpNextPacket = i_packet; }
void drawClear() {
mpNextPacket = NULL;
mpFirstChild = NULL;
}
void* getUserArea() const { return mpUserArea; }
void setUserArea(uintptr_t area) { mpUserArea = (void*)area; }
virtual int entry(J3DDrawBuffer*);
virtual void draw();
virtual ~J3DPacket() {}
public:
/* 0x04 */ J3DPacket* mpNextPacket;
/* 0x08 */ J3DPacket* mpFirstChild;
/* 0x0C */ void* mpUserArea;
}; // Size: 0x10
/**
* @ingroup jsystem-j3d
*
*/
class J3DDrawPacket : public J3DPacket {
public:
J3DDrawPacket();
~J3DDrawPacket();
J3DError newDisplayList(u32);
J3DError newSingleDisplayList(u32);
virtual void draw();
J3DDisplayListObj* getDisplayListObj() { return mpDisplayListObj; }
void setDisplayListObj(J3DDisplayListObj* pObj) { mpDisplayListObj = pObj; }
void beginPatch() { mpDisplayListObj->beginPatch(); }
void endPatch() { mpDisplayListObj->endPatch(); }
void callDL() const { mpDisplayListObj->callDL(); }
void beginDL() { mpDisplayListObj->beginDL(); }
void endDL() { mpDisplayListObj->endDL(); }
void* getDisplayList(int i) { return mpDisplayListObj->mpDisplayList[i]; }
u32 getDisplayListSize() const { return mpDisplayListObj->mSize; }
enum {
LOCKED = 0x01,
};
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
void lock() { onFlag(LOCKED); }
void unlock() { offFlag(LOCKED); }
J3DTexMtxObj* getTexMtxObj() { return mpTexMtxObj; }
bool isLocked() const { return checkFlag(1); }
public:
/* 0x10 */ u32 mFlags;
/* 0x14 */ char unk_0x14[0x20 - 0x14];
/* 0x20 */ J3DDisplayListObj* mpDisplayListObj;
/* 0x24 */ J3DTexMtxObj* mpTexMtxObj;
}; // Size: 0x28
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapePacket : public J3DDrawPacket {
public:
J3DShapePacket();
u32 calcDifferedBufferSize(u32);
int newDifferedDisplayList(u32);
void prepareDraw() const;
void drawFast();
virtual ~J3DShapePacket();
virtual void draw();
void setShape(J3DShape* pShape) {
J3D_ASSERT_NULLPTR(523, pShape != NULL);
mpShape = pShape;
}
void setModel(J3DModel* pModel) {
J3D_ASSERT_NULLPTR(533, pModel != NULL);
mpModel = pModel;
}
void setMtxBuffer(J3DMtxBuffer* pMtxBuffer) { mpMtxBuffer = pMtxBuffer; }
void setBaseMtxPtr(Mtx* pMtx) { mpBaseMtxPtr = pMtx; }
J3DShape* getShape() const { return mpShape; }
J3DModel* getModel() const { return mpModel; }
Mtx* getBaseMtxPtr() const { return mpBaseMtxPtr; }
public:
/* 0x28 */ J3DShape* mpShape;
/* 0x2C */ J3DMtxBuffer* mpMtxBuffer;
/* 0x30 */ Mtx* mpBaseMtxPtr;
/* 0x34 */ u32 mDiffFlag;
/* 0x38 */ J3DModel* mpModel;
}; // Size: 0x3C
/**
* @ingroup jsystem-j3d
*
*/
class J3DMatPacket : public J3DDrawPacket {
public:
J3DMatPacket();
void addShapePacket(J3DShapePacket*);
void beginDiff();
void endDiff();
bool isSame(J3DMatPacket*) const;
J3DMaterial* getMaterial() const { return mpMaterial; }
J3DShapePacket* getShapePacket() const { return mpShapePacket; }
void setShapePacket(J3DShapePacket* packet) { mpShapePacket = packet; }
void setMaterial(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(646, pMaterial != NULL);
mpMaterial = pMaterial;
}
void setTexture(J3DTexture* pTexture) {
J3D_ASSERT_NULLPTR(651, pTexture != NULL);
mpTexture = pTexture;
}
void setInitShapePacket(J3DShapePacket* packet) { mpInitShapePacket = packet; }
void setMaterialID(u32 id) { mDiffFlag = id; }
void setMaterialAnmID(J3DMaterialAnm* materialAnm) { mpMaterialAnm = materialAnm; }
BOOL isChanged() { return mDiffFlag & J3DDiffFlag_Changed; }
bool isEnabled_Diff() { return mpInitShapePacket->getDisplayListObj() != NULL; }
virtual ~J3DMatPacket();
virtual int entry(J3DDrawBuffer*);
virtual void draw();
public:
/* 0x28 */ J3DShapePacket* mpInitShapePacket;
/* 0x2C */ J3DShapePacket* mpShapePacket;
/* 0x30 */ J3DMaterial* mpMaterial;
/* 0x34 */ u32 mDiffFlag;
/* 0x38 */ J3DTexture* mpTexture;
/* 0x3C */ J3DMaterialAnm* mpMaterialAnm;
}; // Size: 0x40
#endif /* J3DPACKET_H */
-230
View File
@@ -1,230 +0,0 @@
#ifndef J3DSHAPE_H
#define J3DSHAPE_H
#include "JSystem/J3DGraphBase/J3DShapeDraw.h"
#include "JSystem/J3DAssert.h"
#include "JSystem/J3DGraphBase/J3DFifo.h"
#include <dolphin/mtx.h>
class J3DShapeMtx;
/**
* @ingroup jsystem-j3d
*
*/
class J3DCurrentMtxInfo {
public:
u32 mMtxIdxRegA;
u32 mMtxIdxRegB;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DCurrentMtx : public J3DCurrentMtxInfo {
public:
J3DCurrentMtx() {
mMtxIdxRegA = 0x3cf3cf00;
mMtxIdxRegB = 0x00f3cf3c;
}
J3DCurrentMtx& operator=(J3DCurrentMtxInfo const& info) {
mMtxIdxRegA = info.mMtxIdxRegA;
mMtxIdxRegB = info.mMtxIdxRegB;
return *this;
}
u32 getMtxIdxRegA() const { return mMtxIdxRegA; }
u32 getMtxIdxRegB() const { return mMtxIdxRegB; }
void load() const {
J3DFifoLoadCPCmd(CP_REG_MTXIDXA_ID, mMtxIdxRegA);
J3DFifoLoadCPCmd(CP_REG_MTXIDXB_ID, mMtxIdxRegB);
J3DFifoLoadXFCmdHdr(GX_XF_REG_MATRIXINDEX0, 2);
GXCmd1u32(mMtxIdxRegA);
GXCmd1u32(mMtxIdxRegB);
}
void setCurrentTexMtx(u8 param_1, u8 param_2, u8 param_3, u8 param_4,
u8 param_5, u8 param_6, u8 param_7, u8 param_8) {
mMtxIdxRegA = (param_1 << 6) | (param_2 << 0xc) | (param_3 << 0x12) | (param_4 << 0x18);
mMtxIdxRegB = (param_5) | param_6 << 6 | param_7 << 0xc | param_8 << 0x12;
}
};
typedef void (J3DShapeMtx::*J3DShapeMtx_LoadFunc)(int, u16) const;
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtx {
public:
J3DShapeMtx(u16 useMtxIndex)
: mUseMtxIndex(useMtxIndex)
{}
void loadMtxIndx_PNGP(int, u16) const;
void loadMtxIndx_PCPU(int, u16) const;
void loadMtxIndx_NCPU(int, u16) const;
void loadMtxIndx_PNCPU(int, u16) const;
virtual ~J3DShapeMtx() {}
virtual u32 getType() const { return 'SMTX'; }
virtual u16 getUseMtxNum() const { return 1; }
virtual u16 getUseMtxIndex(u16) const { return mUseMtxIndex; }
virtual void load() const;
virtual void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
static J3DShapeMtx_LoadFunc sMtxLoadPipeline[4];
static u16 sMtxLoadCache[10];
static u32 sCurrentPipeline;
static u8* sCurrentScaleFlag;
static bool sNBTFlag;
static bool sLODFlag;
static u32 sTexMtxLoadType;
static void setCurrentPipeline(u32 pipeline) {
J3D_ASSERT_RANGE(91, pipeline < 4);
sCurrentPipeline = pipeline;
}
static void setLODFlag(bool flag) { sLODFlag = flag; }
static u32 getLODFlag() { return sLODFlag; }
static void resetMtxLoadCache();
protected:
/* 0x04 */ u16 mUseMtxIndex;
};
class J3DMaterial;
class J3DVertexData;
struct J3DDrawMtxData;
enum J3DShpFlag {
J3DShpFlag_Visible = 0x0001,
J3DShpFlag_SkinPosCpu = 0x0004,
J3DShpFlag_SkinNrmCpu = 0x0008,
J3DShpFlag_Hidden = 0x0010,
J3DShpFlag_EnableLod = 0x0100,
J3DShpFlag_NoMtx = 0x0200,
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShape {
public:
J3DShape() {
initialize();
}
static const int kVcdVatDLSize = 0xC0;
void initialize();
void addTexMtxIndexInDL(_GXAttr, u32);
void addTexMtxIndexInVcd(_GXAttr);
void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
u16 countBumpMtxNum() const;
void loadVtxArray() const;
bool isSameVcdVatCmd(J3DShape*);
void makeVtxArrayCmd();
void makeVcdVatCmd();
void loadPreDrawSetting() const;
void setArrayAndBindPipeline() const;
virtual void draw() const;
virtual void drawFast() const;
virtual void simpleDraw() const;
virtual void simpleDrawCache() const;
void loadCurrentMtx() const;
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) const { return (mFlags & flag) ? true : false; }
void setMaterial(J3DMaterial* pMaterial) {
J3D_ASSERT_NULLPTR(509, pMaterial != NULL);
mMaterial = pMaterial;
}
void setDrawMtxDataPointer(J3DDrawMtxData* pMtxData) {
J3D_ASSERT_NULLPTR(554, pMtxData != NULL);
mDrawMtxData = pMtxData;
}
void setVertexDataPointer(J3DVertexData* pVtxData) {
J3D_ASSERT_NULLPTR(657, pVtxData != NULL);
mVertexData = pVtxData;
}
void* getVcdVatCmd() { return mVcdVatCmd; }
void setVcdVatCmd(void* pVatCmd) { mVcdVatCmd = (u8*)pVatCmd; }
void show() { offFlag(J3DShpFlag_Visible); }
void hide() { onFlag(J3DShpFlag_Visible); }
void setCurrentViewNoPtr(u32* pViewNoPtr) {
J3D_ASSERT_NULLPTR(584, pViewNoPtr != NULL);
mCurrentViewNo = pViewNoPtr;
}
void setCurrentMtx(J3DCurrentMtx& mtx) { mCurrentMtx = mtx; }
void setScaleFlagArray(u8* pScaleFlagArray) {
J3D_ASSERT_NULLPTR(595, pScaleFlagArray != NULL);
mScaleFlagArray = pScaleFlagArray;
}
void setDrawMtx(Mtx** pDrawMtx) { mDrawMtx = pDrawMtx; }
void setNrmMtx(Mtx33** pNrmMtx) { mNrmMtx = pNrmMtx; }
void setTexMtxLoadType(u32 type) { mFlags = type | (mFlags & ~0xF000); }
bool getNBTFlag() const { return mHasNBT; }
u32 getBumpMtxOffset() const { return mBumpMtxOffset; }
void setBumpMtxOffset(u32 offset) { mBumpMtxOffset = offset; }
GXVtxDescList* getVtxDesc() { return mVtxDesc; }
J3DMaterial* getMaterial() const { return mMaterial; }
u16 getIndex() const { return mIndex; }
u32 getTexMtxLoadType() const { return mFlags & 0xF000; }
u16 getMtxGroupNum() const { return mMtxGroupNum; }
J3DShapeDraw* getShapeDraw(u16 idx) { return mShapeDraw[idx]; }
J3DShapeMtx* getShapeMtx(u16 idx) { return mShapeMtx[idx]; }
Vec* getMin() { return &mMin; }
Vec* getMax() { return &mMax; }
static void resetVcdVatCache() { sOldVcdVatCmd = NULL; }
static void* sOldVcdVatCmd;
static bool sEnvelopeFlag;
private:
friend struct J3DShapeFactory;
friend class J3DJointTree;
/* 0x04 */ J3DMaterial* mMaterial;
/* 0x08 */ u16 mIndex;
/* 0x0A */ u16 mMtxGroupNum;
/* 0x0C */ u32 mFlags;
/* 0x10 */ f32 mRadius;
/* 0x14 */ Vec mMin;
/* 0x20 */ Vec mMax;
/* 0x2C */ u8* mVcdVatCmd;
/* 0x30 */ GXVtxDescList* mVtxDesc;
/* 0x34 */ bool mHasNBT;
/* 0x38 */ J3DShapeMtx** mShapeMtx;
/* 0x3C */ J3DShapeDraw** mShapeDraw;
/* 0x40 */ J3DCurrentMtx mCurrentMtx;
/* 0x48 */ bool mHasPNMTXIdx;
/* 0x4C */ J3DVertexData* mVertexData;
/* 0x50 */ J3DDrawMtxData* mDrawMtxData;
/* 0x54 */ u8* mScaleFlagArray;
/* 0x58 */ Mtx** mDrawMtx;
/* 0x5C */ Mtx33** mNrmMtx;
/* 0x60 */ u32* mCurrentViewNo;
/* 0x64 */ u32 mBumpMtxOffset;
};
#endif /* J3DSHAPE_H */
@@ -1,28 +0,0 @@
#ifndef J3DSHAPEDRAW_H
#define J3DSHAPEDRAW_H
#include <dolphin/types.h>
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeDraw {
public:
u32 countVertex(u32);
void addTexMtxIndexInDL(u32, u32, u32);
J3DShapeDraw(u8 const*, u32);
void draw() const;
virtual ~J3DShapeDraw();
u8* getDisplayList() const { return (u8*)mDisplayList; }
u32 getDisplayListSize() const { return mDisplayListSize; }
void setDisplayListSize(u32 size) { mDisplayListSize = size; }
private:
/* 0x04 */ u32 mDisplayListSize;
/* 0x08 */ void* mDisplayList;
};
#endif /* J3DSHAPEDRAW_H */
-137
View File
@@ -1,137 +0,0 @@
#ifndef J3DSHAPEMTX_H
#define J3DSHAPEMTX_H
#include "JSystem/J3DGraphBase/J3DShape.h"
#include "JSystem/J3DAssert.h"
#include <dolphin/mtx.h>
class J3DTexMtx;
class J3DTexGenBlock;
/**
* @ingroup jsystem-j3d
*
*/
class J3DDifferedTexMtx {
public:
static void loadExecute(f32 const (*)[4]);
static inline void load(const Mtx m) {
if (sTexGenBlock != NULL)
loadExecute(m);
}
static J3DTexGenBlock* sTexGenBlock;
static J3DTexMtxObj* sTexMtxObj;
};
class J3DShapeMtxConcatView;
typedef void (J3DShapeMtxConcatView::*J3DShapeMtxConcatView_LoadFunc)(int, u16) const;
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtxMulti : public J3DShapeMtx {
public:
J3DShapeMtxMulti(u16 useMtxIndex, u16 useMtxNum, u16* useMtxIndexTable)
: J3DShapeMtx(useMtxIndex)
, mUseMtxNum(useMtxNum)
, mUseMtxIndexTable(useMtxIndexTable)
{}
virtual ~J3DShapeMtxMulti() {}
virtual u32 getType() const { return 'SMML'; }
virtual u16 getUseMtxNum() const { return mUseMtxNum; }
virtual u16 getUseMtxIndex(u16 no) const { return mUseMtxIndexTable[no]; }
virtual void load() const;
virtual void calcNBTScale(Vec const&, f32 (*)[3][3], f32 (*)[3][3]);
private:
/* 0x8 */ u16 mUseMtxNum;
/* 0xC */ u16* mUseMtxIndexTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtxConcatView : public J3DShapeMtx {
public:
J3DShapeMtxConcatView(u16 useMtxIndex)
: J3DShapeMtx(useMtxIndex)
{}
virtual ~J3DShapeMtxConcatView() {}
virtual u32 getType() const { return 'SMCV'; }
virtual void load() const;
virtual void loadNrmMtx(int, u16) const {}
virtual void loadNrmMtx(int, u16, f32 (*)[4]) const;
void loadMtxConcatView_PNGP(int, u16) const;
void loadMtxConcatView_PCPU(int, u16) const;
void loadMtxConcatView_NCPU(int, u16) const;
void loadMtxConcatView_PNCPU(int, u16) const;
void loadMtxConcatView_PNGP_LOD(int, u16) const;
static J3DShapeMtxConcatView_LoadFunc sMtxLoadPipeline[4];
static J3DShapeMtxConcatView_LoadFunc sMtxLoadLODPipeline[4];
static MtxP sMtxPtrTbl[2];
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtxMultiConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxMultiConcatView(u16 useMtxIndex, u16 useMtxNum, u16* useMtxIndexTable)
: J3DShapeMtxConcatView(useMtxIndex)
, mUseMtxNum(useMtxNum)
, mUseMtxIndexTable(useMtxIndexTable)
{}
virtual ~J3DShapeMtxMultiConcatView() {}
virtual u32 getType() const { return 'SMMC'; }
virtual u16 getUseMtxNum() const { return mUseMtxNum; }
virtual u16 getUseMtxIndex(u16 no) const { return mUseMtxIndexTable[no]; }
virtual void load() const;
virtual void loadNrmMtx(int, u16) const {}
virtual void loadNrmMtx(int, u16, f32 (*)[4]) const;
private:
/* 0x8 */ u16 mUseMtxNum;
/* 0xC */ u16* mUseMtxIndexTable;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtxBBoardConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxBBoardConcatView(u16 useMtxIndex)
: J3DShapeMtxConcatView(useMtxIndex)
{}
virtual ~J3DShapeMtxBBoardConcatView() {}
virtual u32 getType() const { return 'SMBB'; }
virtual void load() const;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DShapeMtxYBBoardConcatView : public J3DShapeMtxConcatView {
public:
J3DShapeMtxYBBoardConcatView(u16 useMtxIndex)
: J3DShapeMtxConcatView(useMtxIndex)
{}
virtual ~J3DShapeMtxYBBoardConcatView() {}
virtual u32 getType() const { return 'SMYB'; }
virtual void load() const;
};
#endif /* J3DSHAPEMTX_H */
-324
View File
@@ -1,324 +0,0 @@
#ifndef J3DSTRUCT_H
#define J3DSTRUCT_H
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
#include <dolphin/mtx.h>
#include "global.h"
/**
* @ingroup jsystem-j3d
*
*/
struct J3DLightInfo {
bool operator==(J3DLightInfo& other) const;
J3DLightInfo& operator=(J3DLightInfo const&);
/* 0x00 */ Vec mLightPosition;
/* 0x0C */ Vec mLightDirection;
/* 0x18 */ GXColor mColor;
/* 0x1C */ Vec mCosAtten;
/* 0x28 */ Vec mDistAtten;
}; // Size = 0x34
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTextureSRTInfo {
/* 0x00 */ f32 mScaleX;
/* 0x04 */ f32 mScaleY;
/* 0x08 */ s16 mRotation;
/* 0x0C */ f32 mTranslationX;
/* 0x10 */ f32 mTranslationY;
bool operator==(J3DTextureSRTInfo&) const;
inline void operator=(J3DTextureSRTInfo const& other) {
#ifdef __MWERKS__
__REGISTER const f32* src = &other.mScaleX;
__REGISTER f32* dst = &mScaleX;
__REGISTER f32 xy;
asm {
psq_l xy, 0(src), 0, 0
psq_st xy, 0(dst), 0, 0
};
// Unclear why there's a 4 byte copy here.
*(u32*)&mRotation = *(u32*)&other.mRotation;
src = &other.mTranslationX;
dst = &mTranslationX;
asm {
psq_l xy, 0(src), 0, 0
psq_st xy, 0(dst), 0, 0
};
#endif
}
}; // Size: 0x14
enum J3DTexMtxMode {
J3DTexMtxMode_None,
J3DTexMtxMode_EnvmapBasic,
J3DTexMtxMode_ProjmapBasic,
J3DTexMtxMode_ViewProjmapBasic,
J3DTexMtxMode_Unknown4,
J3DTexMtxMode_Unknown5,
J3DTexMtxMode_EnvmapOld,
J3DTexMtxMode_Envmap,
J3DTexMtxMode_Projmap,
J3DTexMtxMode_ViewProjmap,
J3DTexMtxMode_EnvmapOldEffectMtx,
J3DTexMtxMode_EnvmapEffectMtx,
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTexMtxInfo {
bool operator==(J3DTexMtxInfo& other) const;
J3DTexMtxInfo& operator=(J3DTexMtxInfo const&);
void setEffectMtx(Mtx);
/* 0x00 */ u8 mProjection;
/* 0x01 */ u8 mInfo;
/* 0x02 */ u8 field_0x2;
/* 0x03 */ u8 field_0x3;
/* 0x04 */ Vec mCenter;
/* 0x10 */ J3DTextureSRTInfo mSRT;
/* 0x24 */ Mtx44 mEffectMtx;
}; // Size: 0x64
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTexMtxInfo {
J3DIndTexMtxInfo& operator=(J3DIndTexMtxInfo const&);
/* 0x00 */ Mtx23 field_0x0;
/* 0x18 */ s8 field_0x18;
}; // Size: 0x1C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DFogInfo {
bool operator==(J3DFogInfo&) const;
J3DFogInfo& operator=(const J3DFogInfo&);
/* 0x00 */ u8 mType;
/* 0x01 */ u8 mAdjEnable;
/* 0x02 */ u16 mCenter;
/* 0x04 */ f32 mStartZ;
/* 0x08 */ f32 mEndZ;
/* 0x0C */ f32 mNearZ;
/* 0x10 */ f32 mFarZ;
/* 0x14 */ GXColor mColor;
/* 0x18 */ GXFogAdjTable mFogAdjTable;
}; // Size: 0x2C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DNBTScaleInfo {
bool operator==(const J3DNBTScaleInfo& other) const;
J3DNBTScaleInfo& operator=(const J3DNBTScaleInfo&);
/* 0x0 */ u8 mbHasScale;
/* 0x4 */ Vec mScale;
}; // Size: 0x10
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTexOrderInfo {
/* 0x0 */ u8 mCoord;
/* 0x1 */ u8 mMap;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
void operator=(J3DIndTexOrderInfo const& other) {
__memcpy(this, &other, sizeof(J3DIndTexOrderInfo));
}
}; // Size: 0x04
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevSwapModeInfo {
/* 0x0 */ u8 mRasSel;
/* 0x1 */ u8 mTexSel;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevSwapModeTableInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevStageInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 mTevColorOp;
/* 0x2 */ u8 mTevColorAB;
/* 0x3 */ u8 mTevColorCD;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 mTevAlphaOp;
/* 0x6 */ u8 mTevAlphaAB;
/* 0x7 */ u8 mTevSwapModeInfo;
/* 0x8 */ u8 field_0x8;
/* 0x8 */ u8 field_0x9;
/* 0x8 */ u8 field_0xa;
/* 0x8 */ u8 field_0xb;
/* 0x8 */ u8 field_0xc;
/* 0x8 */ u8 field_0xd;
/* 0x8 */ u8 field_0xe;
/* 0x8 */ u8 field_0xf;
/* 0x8 */ u8 field_0x10;
/* 0x8 */ u8 field_0x11;
/* 0x8 */ u8 field_0x12;
/* 0x8 */ u8 field_0x13;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTevStageInfo {
/* 0x0 */ u8 mIndStage;
/* 0x1 */ u8 mIndFormat;
/* 0x2 */ u8 mBiasSel;
/* 0x3 */ u8 mMtxSel;
/* 0x4 */ u8 mWrapS;
/* 0x5 */ u8 mWrapT;
/* 0x6 */ u8 mPrev;
/* 0x7 */ u8 mLod;
/* 0x8 */ u8 mAlphaSel;
/* 0x9 */ u8 pad[3];
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTexCoordInfo {
/* 0x0 */ u8 mTexGenType;
/* 0x1 */ u8 mTexGenSrc;
/* 0x2 */ u8 mTexGenMtx;
/* 0x3 */ u8 pad;
J3DTexCoordInfo& operator=(const J3DTexCoordInfo& other) {
__memcpy(this, &other, sizeof(J3DTexCoordInfo));
return *this;
}
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTexCoordScaleInfo {
/* 0x0 */ u8 mScaleS;
/* 0x1 */ u8 mScaleT;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 field_0x3;
J3DIndTexCoordScaleInfo& operator=(const J3DIndTexCoordScaleInfo& other) {
__memcpy(this, &other, sizeof(J3DIndTexCoordScaleInfo));
return *this;
}
}; // Size: 0x4
/**
* @ingroup jsystem-j3d
*
*/
struct J3DBlendInfo {
void operator=(J3DBlendInfo const& other) {
__memcpy(this, &other, sizeof(J3DBlendInfo));
}
/* 0x0 */ u8 mType;
/* 0x1 */ u8 mSrcFactor;
/* 0x2 */ u8 mDstFactor;
/* 0x3 */ u8 mOp;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevOrderInfo {
void operator=(const J3DTevOrderInfo& other) {
*(u32*) this = *(u32*)&other;
}
/* 0x0 */ u8 mTexCoord;
/* 0x1 */ u8 mTexMap;
/* 0x2 */ u8 mColorChan;
/* 0x3 */ u8 field_0x3; // Maybe padding
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DColorChanInfo {
/* 0x0 */ u8 mEnable;
/* 0x1 */ u8 mMatSrc;
/* 0x2 */ u8 mLightMask;
/* 0x3 */ u8 mDiffuseFn;
/* 0x4 */ u8 mAttnFn;
/* 0x5 */ u8 mAmbSrc;
/* 0x6 */ u8 pad[2];
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DZModeInfo {
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 field_0x1;
/* 0x2 */ u8 field_0x2;
/* 0x3 */ u8 pad;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAlphaCompInfo {
/* 0x0 */ u8 mComp0;
/* 0x1 */ u8 mRef0;
/* 0x2 */ u8 mOp;
/* 0x3 */ u8 mComp1;
/* 0x4 */ u8 mRef1;
/* 0x5 */ u8 field_0x5;
/* 0x6 */ u8 field_0x6;
/* 0x7 */ u8 field_0x7;
J3DAlphaCompInfo& operator=(const J3DAlphaCompInfo& other) {
mComp0 = other.mComp0;
mRef0 = other.mRef0;
mOp = other.mOp;
mComp1 = other.mComp1;
mRef1 = other.mRef1;
return *this;
}
};
#endif /* J3DSTRUCT_H */
-183
View File
@@ -1,183 +0,0 @@
#ifndef J3DSYS_H
#define J3DSYS_H
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
#include "JSystem/J3DAssert.h"
enum J3DSysDrawBuf {
/* 0x0 */ J3DSysDrawBuf_Opa,
/* 0x1 */ J3DSysDrawBuf_Xlu,
/* 0x2 */ J3DSysDrawBuf_MAX
};
class J3DMtxCalc;
class J3DModel;
class J3DMatPacket;
class J3DShapePacket;
class J3DShape;
class J3DDrawBuffer;
class J3DTexture;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTexCoordScaleInfo {
/* 0x0 */ u16 field_0x00;
/* 0x2 */ u16 field_0x02;
/* 0x4 */ u16 field_0x04;
/* 0x6 */ u16 field_0x06;
};
enum J3DSysFlag {
J3DSysFlag_SkinPosCpu = 0x00000004,
J3DSysFlag_SkinNrmCpu = 0x00000008,
J3DSysFlag_PostTexMtx = 0x40000000,
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DSys {
/* 0x000 */ Mtx mViewMtx;
/* 0x030 */ J3DMtxCalc* mCurrentMtxCalc;
/* 0x034 */ u32 mFlags;
/* 0x038 */ J3DModel* mModel;
/* 0x03C */ J3DMatPacket* mMatPacket;
/* 0x040 */ J3DShapePacket* mShapePacket;
/* 0x044 */ J3DShape* mShape;
/* 0x048 */ J3DDrawBuffer* mDrawBuffer[J3DSysDrawBuf_MAX];
/* 0x050 */ u32 mDrawMode;
/* 0x054 */ u32 mMaterialMode;
/* 0x058 */ J3DTexture* mTexture;
/* 0x05C */ u8 unk_0x5c[0x60 - 0x5C];
/* 0x060 */ u32 mTexCacheRegionNum;
/* 0x064 */ GXTexRegion mTexCacheRegion[8];
/* 0x0E4 */ u8 unk_0xe4[0x104 - 0xE4];
/* 0x104 */ Mtx* mModelDrawMtx;
/* 0x108 */ Mtx33* mModelNrmMtx;
/* 0x10C */ void* mVtxPos;
/* 0x110 */ void* mVtxNrm;
/* 0x114 */ GXColor* mVtxCol;
/* 0x118 */ Vec* mNBTScale;
J3DSys();
void loadPosMtxIndx(int, u16) const;
void loadNrmMtxIndx(int, u16) const;
void setTexCacheRegion(GXTexCacheSize);
void drawInit();
void reinitGX();
void reinitGenMode();
void reinitLighting();
void reinitTransform();
void reinitTexture();
void reinitTevStages();
void reinitIndStages();
void reinitPixelProc();
enum J3DSysDrawMode {
J3DSysDrawMode_OpaTexEdge = 3,
J3DSysDrawMode_Xlu
};
MtxP getViewMtx() { return mViewMtx; }
void setDrawModeOpaTexEdge() { mDrawMode = J3DSysDrawMode_OpaTexEdge; }
void setDrawModeXlu() { mDrawMode = J3DSysDrawMode_Xlu; }
void setDrawBuffer(J3DDrawBuffer* buffer, int type) {
J3D_ASSERT_RANGE(114, type >= 0 && type < J3DSysDrawBuf_MAX);
J3D_ASSERT_NULLPTR(115, buffer);
mDrawBuffer[type] = buffer;
}
J3DDrawBuffer* getDrawBuffer(int type) {
J3D_ASSERT_RANGE(121, type >= 0 && type < J3DSysDrawBuf_MAX);
return mDrawBuffer[type];
}
void setMatPacket(J3DMatPacket* pPacket) {
J3D_ASSERT_NULLPTR(162, pPacket != NULL);
mMatPacket = pPacket;
}
void setShapePacket(J3DShapePacket* pPacket) {
J3D_ASSERT_NULLPTR(172, pPacket != NULL);
mShapePacket = pPacket;
}
void setModel(J3DModel* pModel) {
J3D_ASSERT_NULLPTR(200, pModel != NULL);
mModel = pModel;
}
J3DMatPacket* getMatPacket() { return mMatPacket; }
void setMaterialMode(u32 mode) { mMaterialMode = mode; }
void setCurrentMtxCalc(J3DMtxCalc * pCalc) {
J3D_ASSERT_NULLPTR(210, pCalc != NULL);
mCurrentMtxCalc = pCalc;
}
J3DMtxCalc * getCurrentMtxCalc() const { return mCurrentMtxCalc; }
void setTexture(J3DTexture* pTex) {
JUT_ASSERT_MSG(220, pTex != NULL, "Error : null pointer.");
mTexture = pTex;
}
J3DTexture* getTexture() { return mTexture; }
void setNBTScale(Vec* scale) { mNBTScale = scale; }
Vec* getNBTScale() { return mNBTScale; }
void onFlag(u32 flag) { mFlags |= flag; }
void offFlag(u32 flag) { mFlags &= ~flag; }
bool checkFlag(u32 flag) { return mFlags & flag ? true : false; }
void setModelDrawMtx(Mtx* pMtxArr) {
J3D_ASSERT_NULLPTR(230, pMtxArr);
mModelDrawMtx = pMtxArr;
GXSetArray(GX_POS_MTX_ARRAY, mModelDrawMtx, sizeof(*mModelDrawMtx));
}
void setModelNrmMtx(Mtx33* pMtxArr) {
J3D_ASSERT_NULLPTR(241, pMtxArr);
mModelNrmMtx = pMtxArr;
GXSetArray(GX_NRM_MTX_ARRAY, mModelNrmMtx, sizeof(*mModelNrmMtx));
}
void* getVtxPos() { return mVtxPos; }
void setVtxPos(void* pVtxPos) {
J3D_ASSERT_NULLPTR(252, pVtxPos != NULL);
mVtxPos = pVtxPos;
}
void* getVtxNrm() { return mVtxNrm; }
void setVtxNrm(void* pVtxNrm) { mVtxNrm = pVtxNrm; }
void* getVtxCol() { return mVtxCol; }
void setVtxCol(GXColor* pVtxCol) { mVtxCol = pVtxCol; }
Mtx& getModelDrawMtx(u16 no) { return mModelDrawMtx[no]; }
J3DShapePacket* getShapePacket() { return mShapePacket; }
void setViewMtx(const Mtx m) { MTXCopy(m, mViewMtx); }
J3DModel* getModel() { return mModel; }
static Mtx mCurrentMtx;
static Vec mCurrentS;
static Vec mParentS;
static J3DTexCoordScaleInfo sTexCoordScaleTable[8];
};
extern u32 j3dDefaultViewNo;
extern J3DSys j3dSys;
#endif /* J3DSYS_H */
-310
View File
@@ -1,310 +0,0 @@
#ifndef J3DTEVS_H
#define J3DTEVS_H
#include <dolphin/types.h>
#include <dolphin/gx.h>
#include "JSystem/J3DGraphBase/J3DGD.h"
#include "JSystem/J3DGraphBase/J3DStruct.h"
extern u8 j3dTevSwapTableTable[1024];
extern const J3DLightInfo j3dDefaultLightInfo;
extern const J3DTexCoordInfo j3dDefaultTexCoordInfo[8];
extern const J3DTexMtxInfo j3dDefaultTexMtxInfo;
extern const J3DIndTexMtxInfo j3dDefaultIndTexMtxInfo;
extern const J3DTevStageInfo j3dDefaultTevStageInfo;
extern const J3DIndTevStageInfo j3dDefaultIndTevStageInfo;
extern const J3DFogInfo j3dDefaultFogInfo;
extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo;
extern const GXColor j3dDefaultColInfo;
extern const GXColor j3dDefaultAmbInfo;
extern const u8 j3dDefaultColorChanNum;
extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull;
extern const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull;
extern const GXColorS10 j3dDefaultTevColor;
extern const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo;
extern const GXColor j3dDefaultTevKColor;
extern const J3DTevSwapModeInfo j3dDefaultTevSwapMode;
extern const J3DTevSwapModeTableInfo j3dDefaultTevSwapModeTable;
extern const J3DBlendInfo j3dDefaultBlendInfo;
extern const J3DColorChanInfo j3dDefaultColorChanInfo;
extern const u8 j3dDefaultTevSwapTableID;
extern const u16 j3dDefaultAlphaCmpID;
extern const u16 j3dDefaultZModeID;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevStage {
J3DTevStage() {
setTevStageInfo(j3dDefaultTevStageInfo);
setTevSwapModeInfo(j3dDefaultTevSwapMode);
}
void setTevColorOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5) {
mTevColorOp = mTevColorOp & ~(0x01 << 2) | param_1 << 2;
if (param_1 <= 1) {
mTevColorOp = mTevColorOp & ~(0x03 << 4) | param_3 << 4;
mTevColorOp = mTevColorOp & ~0x03 | param_2;
} else {
mTevColorOp = mTevColorOp & ~(0x03 << 4) | (param_1 >> 1 & 3) << 4;
mTevColorOp = mTevColorOp & ~0x03 | 3;
}
mTevColorOp = mTevColorOp & ~(0x01 << 3) | param_4 << 3;
mTevColorOp = mTevColorOp & ~(0x03 << 6) | param_5 << 6;
}
void setTevColorAB(u8 a, u8 b) { mTevColorAB = a << 4 | b; }
void setTevColorCD(u8 c, u8 d) { mTevColorCD = c << 4 | d; }
void setAlphaA(u8 a) { mTevAlphaAB = mTevAlphaAB & ~(0x07 << 5) | a << 5; }
void setAlphaB(u8 b) { mTevAlphaAB = mTevAlphaAB & ~(0x07 << 2) | b << 2; }
void setAlphaC(u8 c) {
mTevAlphaAB = mTevAlphaAB & ~0x03 | c >> 1;
mTevSwapModeInfo = mTevSwapModeInfo & ~(0x01 << 7) | c << 7;
}
void setAlphaD(u8 d) { mTevSwapModeInfo = mTevSwapModeInfo & ~(0x07 << 4) | d << 4; }
void setAlphaABCD(u8 a, u8 b, u8 c, u8 d) {
setAlphaA(a);
setAlphaB(b);
setAlphaC(c);
setAlphaD(d);
}
void setTevAlphaOp(u8 param_1, u8 param_2, u8 param_3, u8 param_4, u8 param_5) {
mTevAlphaOp = mTevAlphaOp & ~(0x01 << 2) | param_1 << 2;
if (param_1 <= 1) {
mTevAlphaOp = mTevAlphaOp & ~0x03 | param_2;
mTevAlphaOp = mTevAlphaOp & ~(0x03 << 4) | param_3 << 4;
} else {
mTevAlphaOp = mTevAlphaOp & ~(0x03 << 4) | (param_1 >> 1 & 3) << 4;
mTevAlphaOp = mTevAlphaOp & ~0x03 | 3;
}
mTevAlphaOp = mTevAlphaOp & ~(0x01 << 3) | param_4 << 3;
mTevAlphaOp = mTevAlphaOp & ~(0x03 << 6) | param_5 << 6;
}
void setTevStageInfo(const J3DTevStageInfo& info) {
setTevColorOp(info.mTevAlphaOp, info.mTevAlphaAB, info.mTevSwapModeInfo, info.field_0x8, info.field_0x9);
setTevColorAB(info.mTevColorOp, info.mTevColorAB);
setTevColorCD(info.mTevColorCD, info.field_0x4);
setAlphaABCD(info.field_0xa, info.field_0xb, info.field_0xc, info.field_0xd);
setTevAlphaOp(info.field_0xe, info.field_0xf, info.field_0x10, info.field_0x11, info.field_0x12);
}
J3DTevStage(J3DTevStageInfo const& param_0) {
setTevStageInfo(param_0);
setTevSwapModeInfo(j3dDefaultTevSwapMode);
}
void setTevSwapModeInfo(J3DTevSwapModeInfo const& param_0) {
setTexSel(param_0.mTexSel);
setRasSel(param_0.mRasSel);
}
void setStageNo(u32 param_0) {
field_0x0 = 0xC0 + param_0 * 2;
field_0x4 = 0xC1 + param_0 * 2;
}
void setRasSel(u8 ras_sel) { mTevSwapModeInfo = (mTevSwapModeInfo & ~3) | ras_sel; }
void setTexSel(u8 tex_sel) { mTevSwapModeInfo = (mTevSwapModeInfo & ~0xc) | (tex_sel << 2); }
void load(u32 param_1) const {
J3DGDWriteBPCmd(*(u32*)&field_0x0);
J3DGDWriteBPCmd(*(u32*)&field_0x4);
}
J3DTevStage& operator=(const J3DTevStage& other) {
mTevColorOp = other.mTevColorOp;
mTevColorAB = other.mTevColorAB;
mTevColorCD = other.mTevColorCD;
mTevAlphaOp = other.mTevAlphaOp;
mTevAlphaAB = other.mTevAlphaAB;
mTevSwapModeInfo = other.mTevSwapModeInfo;
return *this;
}
J3DTevStage& operator=(J3DTevStage& other) {
mTevColorOp = other.mTevColorOp;
mTevColorAB = other.mTevColorAB;
mTevColorCD = other.mTevColorCD;
mTevAlphaOp = other.mTevAlphaOp;
mTevAlphaAB = other.mTevAlphaAB;
mTevSwapModeInfo = other.mTevSwapModeInfo;
return *this;
}
/* 0x0 */ u8 field_0x0;
/* 0x1 */ u8 mTevColorOp;
/* 0x2 */ u8 mTevColorAB;
/* 0x3 */ u8 mTevColorCD;
/* 0x4 */ u8 field_0x4;
/* 0x5 */ u8 mTevAlphaOp;
/* 0x6 */ u8 mTevAlphaAB;
/* 0x7 */ u8 mTevSwapModeInfo;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndTevStage {
J3DIndTevStage() : mInfo(0) { setIndTevStageInfo(j3dDefaultIndTevStageInfo); }
J3DIndTevStage(J3DIndTevStageInfo const& info) : mInfo(0) { setIndTevStageInfo(info); }
void setIndTevStageInfo(J3DIndTevStageInfo const& info) {
setIndStage(info.mIndStage);
setIndFormat(info.mIndFormat);
setBiasSel(info.mBiasSel);
setMtxSel(info.mMtxSel);
setWrapS(info.mWrapS);
setWrapT(info.mWrapT);
setPrev(info.mPrev);
setLod(info.mLod);
setAlphaSel(info.mAlphaSel);
}
void setIndStage(u8 indStage) { mInfo = (mInfo & ~3) | indStage; }
void setIndFormat(u8 indFormat) { mInfo = (mInfo & ~0xc) | (indFormat << 2); }
void setBiasSel(u8 biasSel) { mInfo = (mInfo & ~0x70) | (biasSel << 4); }
void setMtxSel(u8 mtxSel) { mInfo = (mInfo & ~0x1e00) | (mtxSel << 9); }
void setWrapS(u8 wrapS) { mInfo = (mInfo & ~0xe000) | (wrapS << 13); }
void setWrapT(u8 wrapT) { mInfo = (mInfo & ~0x70000) | (wrapT << 16); }
void setPrev(u8 prev) { mInfo = (mInfo & ~0x100000) | (prev << 20); }
void setLod(u8 lod) { mInfo = (mInfo & ~0x80000) | (lod << 19); }
void setAlphaSel(u8 alphaSel) { mInfo = (mInfo & ~0x180) | (alphaSel << 7); }
void load(u32 param_1) const {
J3DGDWriteBPCmd(mInfo | (param_1 + 0x10) * 0x1000000);
}
J3DIndTevStage& operator=(const J3DIndTevStage& other) {
mInfo = other.mInfo;
return *this;
}
J3DIndTevStage& operator=(J3DIndTevStage& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x0 */ u32 mInfo;
};
extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevOrder : public J3DTevOrderInfo {
J3DTevOrder() {
J3DTevOrderInfo::operator=(j3dDefaultTevOrderInfoNull);
}
J3DTevOrder(const J3DTevOrderInfo& info) {
J3DTevOrderInfo::operator=(info);
}
J3DTevOrderInfo& getTevOrderInfo() { return *this; }
u8 getTexMap() const { return mTexMap; }
};
extern u8 j3dTevSwapTableTable[1024];
extern u8 const j3dDefaultTevSwapTableID;
inline u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
return 0x40 * (u8)param_0 + 0x10 * (u8)param_1 + 4 * (u8)param_2 + param_3;
}
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTevSwapModeTable {
J3DTevSwapModeTable() { mIdx = j3dDefaultTevSwapTableID; }
J3DTevSwapModeTable(J3DTevSwapModeTableInfo const& info) {
mIdx = calcTevSwapTableID(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
}
J3DTevSwapModeTable& operator=(const J3DTevSwapModeTable& rhs) {
mIdx = rhs.mIdx;
return *this;
}
J3DTevSwapModeTable& operator=(J3DTevSwapModeTable& other) {
mIdx = other.mIdx;
return *this;
}
u8 getR() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 0); }
u8 getG() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 1); }
u8 getB() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 2); }
u8 getA() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 3); }
/* 0x0 */ u8 mIdx;
}; // Size: 0x1
/**
* @ingroup jsystem-j3d
*
*/
class J3DLightObj {
public:
J3DLightObj() { mInfo = j3dDefaultLightInfo; }
void load(u32) const;
J3DLightInfo* getLightInfo() { return &mInfo; }
J3DLightObj& operator=(J3DLightObj const& other) {
mInfo = other.mInfo;
return *this;
}
/* 0x00 */ J3DLightInfo mInfo;
/* 0x34 */ GXLightObj mLightObj;
}; // Size = 0x74
extern const J3DNBTScaleInfo j3dDefaultNBTScaleInfo;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DNBTScale : public J3DNBTScaleInfo {
J3DNBTScale() {
mbHasScale = j3dDefaultNBTScaleInfo.mbHasScale;
mScale.x = j3dDefaultNBTScaleInfo.mScale.x;
mScale.y = j3dDefaultNBTScaleInfo.mScale.y;
mScale.z = j3dDefaultNBTScaleInfo.mScale.z;
}
J3DNBTScale(J3DNBTScaleInfo const& info) {
mbHasScale = info.mbHasScale;
mScale.x = info.mScale.x;
mScale.y = info.mScale.y;
mScale.z = info.mScale.z;
}
Vec* getScale() { return &mScale; }
};
extern const GXColor j3dDefaultColInfo;
extern const GXColor j3dDefaultAmbInfo;
extern const GXColorS10 j3dDefaultTevColor;
extern const GXColor j3dDefaultTevKColor;
extern u8 j3dAlphaCmpTable[768];
extern const u8 j3dDefaultNumChans;
struct J3DNBTScale;
struct J3DTexCoord;
void loadNBTScale(J3DNBTScale& param_0);
void loadTexCoordGens(u32 param_0, J3DTexCoord* param_1);
void loadTexNo(u32 param_0, u16 const& param_1);
void patchTexNo_PtrToIdx(u32 texID, u16 const& idx);
bool isTexNoReg(void* param_0);
u16 getTexNoReg(void* param_0);
void makeTexCoordTable();
void makeAlphaCmpTable();
void makeZModeTable();
void makeTevSwapTable();
#endif /* J3DTEVS_H */
-119
View File
@@ -1,119 +0,0 @@
#ifndef J3DTEXTURE_H
#define J3DTEXTURE_H
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/J3DAssert.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "global.h"
#include <stdint.h>
/**
* @ingroup jsystem-j3d
*
*/
class J3DTexture {
private:
/* 0x0 */ u16 mNum;
/* 0x2 */ u16 unk_0x2;
/* 0x4 */ ResTIMG* mpRes;
public:
J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {
J3D_ASSERT_NULLPTR(52, res != NULL || num == 0);
}
void loadGX(u16, GXTexMapID) const;
void entryNum(u16);
void addResTIMG(u16, ResTIMG const*);
virtual ~J3DTexture() {}
u16 getNum() const { return mNum; }
ResTIMG* getResTIMG(u16 index) const {
J3D_ASSERT_RANGE(72, index < mNum);
return &mpRes[index];
}
void setResTIMG(u16 index, const ResTIMG& timg) {
J3D_ASSERT_RANGE(81, index < mNum);
mpRes[index] = timg;
mpRes[index].imageOffset = ((mpRes[index].imageOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
mpRes[index].paletteOffset = ((mpRes[index].paletteOffset + (uintptr_t)&timg - (uintptr_t)(mpRes + index)));
}
};
extern J3DTexMtxInfo const j3dDefaultTexMtxInfo;
/**
* @ingroup jsystem-j3d
*
*/
class J3DTexMtx {
public:
J3DTexMtx() {
mTexMtxInfo = j3dDefaultTexMtxInfo;
}
J3DTexMtx(const J3DTexMtxInfo& info) {
mTexMtxInfo = info;
}
void load(u32) const;
void calc(const Mtx);
void calcTexMtx(const Mtx);
void calcPostTexMtx(const Mtx);
void loadTexMtx(u32) const;
void loadPostTexMtx(u32) const;
J3DTexMtxInfo& getTexMtxInfo() { return mTexMtxInfo; }
Mtx& getMtx() { return mMtx; }
void setEffectMtx(Mtx effectMtx) { mTexMtxInfo.setEffectMtx(effectMtx); }
private:
/* 0x00 */ J3DTexMtxInfo mTexMtxInfo;
/* 0x64 */ Mtx mMtx;
}; // Size: 0x94
extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8];
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTexCoord : public J3DTexCoordInfo {
J3DTexCoord() {
J3DTexCoordInfo::operator=(j3dDefaultTexCoordInfo[0]);
mTexMtxReg = mTexGenMtx;
}
J3DTexCoord(const J3DTexCoordInfo& info) {
J3DTexCoordInfo::operator=(info);
mTexMtxReg = mTexGenMtx;
}
void setTexCoordInfo(const J3DTexCoordInfo& info) {
J3DTexCoordInfo::operator=(info);
}
u8 getTexGenType() const { return mTexGenType; }
u8 getTexGenSrc() const { return mTexGenSrc; }
u8 getTexGenMtx() const { return mTexGenMtx; }
u32 getTexMtxReg() const { return mTexMtxReg & 0xff; }
void setTexGenMtx(u8 param_1) { mTexGenMtx = param_1; }
void setTexMtxReg(u16 reg) { mTexMtxReg = reg; }
J3DTexCoord& operator=(const J3DTexCoord& other) {
#if DEBUG
J3DTexCoordInfo::operator=(other);
#else
// Fakematch: Instruction order is wrong with __memcpy or J3DTexCoordInfo::operator=
*(u32*)this = *(u32*)&other;
#endif
return *this;
}
void resetTexMtxReg() {
mTexMtxReg = mTexGenMtx;
}
/* 0x4 */ u16 mTexMtxReg;
}; // Size: 0x6
#endif /* J3DTEXTURE_H */
-231
View File
@@ -1,231 +0,0 @@
#ifndef J3DTRANSFORM_H
#define J3DTRANSFORM_H
#include <dolphin/mtx.h>
struct J3DTextureSRTInfo;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTransformInfo {
/* 0x00 */ Vec mScale;
/* 0x0C */ S16Vec mRotation;
/* 0x14 */ Vec mTranslate;
/* inline J3DTransformInfo& operator=(const J3DTransformInfo& b) {
mScale = b.mScale;
mRotation = b.mRotation;
mTranslate = b.mTranslate;
return *this;
} */
#ifdef __MWERKS__
inline J3DTransformInfo& operator=(const __REGISTER J3DTransformInfo& b) {
__REGISTER const J3DTransformInfo& var_r31 = b;
__REGISTER J3DTransformInfo& var_r30 = *this;
__REGISTER f32 var_f31;
asm {
psq_l var_f31, J3DTransformInfo.mScale(var_r31), 0, 0
psq_st var_f31, J3DTransformInfo.mScale(var_r30), 0, 0
}
mScale.z = b.mScale.z;
*(u32*)&mRotation = *(u32*)&b.mRotation;
mRotation.z = b.mRotation.z;
asm {
psq_l var_f31, J3DTransformInfo.mTranslate(var_r31), 0, 0
psq_st var_f31, J3DTransformInfo.mTranslate(var_r30), 0, 0
}
mTranslate.z = b.mTranslate.z;
return *this;
}
#endif
}; // Size: 0x20
extern J3DTransformInfo const j3dDefaultTransformInfo;
extern Vec const j3dDefaultScale;
extern Mtx const j3dDefaultMtx;
extern f32 const PSMulUnit01[];
void J3DGQRSetup7(u32 param_0, u32 param_1, u32 param_2, u32 param_3);
void J3DCalcBBoardMtx(f32 (*)[4]);
void J3DCalcYBBoardMtx(f32 (*)[4]);
void J3DPSCalcInverseTranspose(f32 (*param_0)[4], f32 (*param_1)[3]);
void J3DGetTranslateRotateMtx(const J3DTransformInfo&, Mtx);
void J3DGetTranslateRotateMtx(s16, s16, s16, f32, f32, f32, Mtx);
void J3DGetTextureMtx(const J3DTextureSRTInfo&, const Vec&, f32 (*)[4]);
void J3DGetTextureMtxOld(const J3DTextureSRTInfo&, const Vec&, f32 (*)[4]);
void J3DGetTextureMtxMaya(const J3DTextureSRTInfo&, f32 (*)[4]);
void J3DGetTextureMtxMayaOld(const J3DTextureSRTInfo& param_0, f32 (*)[4]);
void J3DScaleNrmMtx(f32 (*)[4], const Vec&);
void J3DScaleNrmMtx33(f32 (*)[3], const Vec&);
void J3DMtxProjConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4]);
void J3DPSMtxArrayConcat(f32 (*)[4], f32 (*)[4], f32 (*)[4], u32);
inline void J3DPSMtx33Copy(__REGISTER Mtx3P src, __REGISTER Mtx3P dst) {
#ifdef __MWERKS__
__REGISTER f32 fr4;
__REGISTER f32 fr3;
__REGISTER f32 fr2;
__REGISTER f32 fr1;
__REGISTER f32 fr0;
asm {
psq_l fr4, 0(src), 0, 0
psq_l fr3, 8(src), 0, 0
psq_l fr2, 0x10(src), 0, 0
psq_l fr1, 0x18(src), 0, 0
lfs fr0, 0x20(src)
psq_st fr4, 0(dst), 0, 0
psq_st fr3, 8(dst), 0, 0
psq_st fr2, 0x10(dst), 0, 0
psq_st fr1, 0x18(dst), 0, 0
stfs fr0, 0x20(dst)
}
#endif
}
inline void J3DPSMtx33CopyFrom34(__REGISTER MtxP src, __REGISTER Mtx3P dst) {
#ifdef __MWERKS__
__REGISTER f32 x_y1;
__REGISTER f32 z1;
__REGISTER f32 x_y2;
__REGISTER f32 z2;
__REGISTER f32 x_y3;
__REGISTER f32 z3;
asm {
psq_l x_y1, 0(src), 0, 0
lfs z1, 8(src)
psq_l x_y2, 16(src), 0, 0
lfs z2, 0x18(src)
psq_l x_y3, 32(src), 0, 0
lfs z3, 0x28(src)
psq_st x_y1, 0(dst), 0, 0
stfs z1, 8(dst)
psq_st x_y2, 12(dst), 0, 0
stfs z2, 0x14(dst)
psq_st x_y3, 24(dst), 0, 0
stfs z3, 0x20(dst)
}
#endif
}
inline void J3DPSMulMtxVec(__REGISTER MtxP mtx, __REGISTER Vec* vec, __REGISTER Vec* dst) {
#ifdef __MWERKS__
asm {
psq_l f0, 0(vec), 0, 0
psq_l f2, 0(mtx), 0, 0
psq_l f1, 8(vec), 1, 0
ps_mul f4, f2, f0
psq_l f3, 8(mtx), 0, 0
ps_madd f5, f3, f1, f4
psq_l f8, 16(mtx), 0, 0
ps_sum0 f6, f5, f6, f5
psq_l f9, 24(mtx), 0, 0
ps_mul f10, f8, f0
psq_st f6, 0(dst), 1, 0
ps_madd f11, f9, f1, f10
psq_l f2, 32(mtx), 0, 0
ps_sum0 f12, f11, f12, f11
psq_l f3, 40(mtx), 0, 0
ps_mul f4, f2, f0
psq_st f12, 4(dst), 1, 0
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_st f6, 8(dst), 1, 0
}
#endif
}
inline void J3DPSMulMtxVec(__REGISTER MtxP mtx, __REGISTER S16Vec* vec, __REGISTER S16Vec* dst) {
#ifdef __MWERKS__
asm {
psq_l f0, 0(vec), 0, 7
psq_l f2, 0(mtx), 0, 0
psq_l f1, 4(vec), 1, 7
ps_mul f4, f2, f0
psq_l f3, 8(mtx), 0, 0
ps_madd f5, f3, f1, f4
psq_l f8, 16(mtx), 0, 0
ps_sum0 f6, f5, f6, f5
psq_l f9, 24(mtx), 0, 0
ps_mul f10, f8, f0
psq_st f6, 0(dst), 1, 7
ps_madd f11, f9, f1, f10
psq_l f2, 32(mtx), 0, 0
ps_sum0 f12, f11, f12, f11
psq_l f3, 40(mtx), 0, 0
ps_mul f4, f2, f0
psq_st f12, 2(dst), 1, 7
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_st f6, 4(dst), 1, 7
}
#endif
}
inline void J3DPSMulMtxVec(__REGISTER Mtx3P mtx, __REGISTER Vec* vec, __REGISTER Vec* dst) {
#ifdef __MWERKS__
asm {
lis r6, PSMulUnit01@ha
psq_l f0, 0(vec), 0, 0
addi r6, r6, PSMulUnit01@l
psq_l f2, 0(mtx), 0, 0
psq_l f13, 0(r6), 0, 0
psq_l f1, 8(vec), 1, 0
ps_add f1, f13, f1
psq_l f3, 8(mtx), 1, 0
ps_mul f4, f2, f0
psq_l f8, 12(mtx), 0, 0
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_l f9, 20(mtx), 1, 0
ps_mul f10, f8, f0
psq_st f6, 0(dst), 1, 0
ps_madd f11, f9, f1, f10
psq_l f2, 24(mtx), 0, 0
ps_sum0 f12, f11, f12, f11
psq_l f3, 32(mtx), 1, 0
ps_mul f4, f2, f0
psq_st f12, 4(dst), 1, 0
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_st f6, 8(dst), 1, 0
}
#endif
}
inline void J3DPSMulMtxVec(__REGISTER Mtx3P mtx, __REGISTER S16Vec* vec, __REGISTER S16Vec* dst) {
#ifdef __MWERKS__
asm {
lis r6, PSMulUnit01@ha
psq_l f0, 0(vec), 0, 7
addi r6, r6, PSMulUnit01@l
psq_l f2, 0(mtx), 0, 0
psq_l f13, 0(r6), 0, 0
psq_l f1, 4(vec), 1, 7
ps_add f1, f13, f1
psq_l f3, 8(mtx), 1, 0
ps_mul f4, f2, f0
psq_l f8, 12(mtx), 0, 0
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_l f9, 20(mtx), 1, 0
ps_mul f10, f8, f0
psq_st f6, 0(dst), 1, 7
ps_madd f11, f9, f1, f10
psq_l f2, 24(mtx), 0, 0
ps_sum0 f12, f11, f12, f11
psq_l f3, 32(mtx), 1, 0
ps_mul f4, f2, f0
psq_st f12, 2(dst), 1, 7
ps_madd f5, f3, f1, f4
ps_sum0 f6, f5, f6, f5
psq_st f6, 4(dst), 1, 7
}
#endif
}
#endif /* J3DTRANSFORM_H */
-165
View File
@@ -1,165 +0,0 @@
#ifndef J3DVERTEX_H
#define J3DVERTEX_H
#include <dolphin/gx.h>
#include <dolphin/mtx.h>
typedef struct _GXColor GXColor;
class J3DModel;
class J3DAnmVtxColor;
class J3DVertexBuffer;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DVtxColorCalc {
void calc(J3DModel*);
virtual void calc(J3DVertexBuffer*);
virtual ~J3DVtxColorCalc() {}
bool checkFlag(u32 flag) { return mFlags & flag ? true : false; }
/* 0x4 */ u32 mFlags;
/* 0x8 */ J3DAnmVtxColor* mpVtxColor;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DVertexData {
public:
J3DVertexData();
~J3DVertexData() {}
void* getVtxPosArray() const { return mVtxPosArray; }
void* getVtxNrmArray() const { return mVtxNrmArray; }
GXColor* getVtxColorArray(u8 idx) const { return mVtxColorArray[idx]; }
void* getVtxTexCoordArray(u8 idx) const { return mVtxTexCoordArray[idx]; }
void* getVtxNBTArray() const { return mVtxNBTArray; }
u32 getNrmNum() const { return mNrmNum; }
u32 getVtxNum() const { return mVtxNum; }
u32 getColNum() const { return mColNum; }
GXVtxAttrFmtList* getVtxAttrFmtList() const { return mVtxAttrFmtList; }
u8 getVtxPosFrac() const { return mVtxPosFrac; }
u8 getVtxNrmFrac() const { return mVtxNrmFrac; }
int getVtxPosType() const { return mVtxPosType; }
int getVtxNrmType() const { return mVtxNrmType; }
void setVtxPosFrac(u8 frac) { mVtxPosFrac = frac; }
void setVtxPosType(GXCompType type) { mVtxPosType = type; }
void setVtxNrmFrac(u8 frac) { mVtxNrmFrac = frac; }
void setVtxNrmType(GXCompType type) { mVtxNrmType = type; }
private:
friend class J3DModelLoader;
/* 0x00 */ u32 mVtxNum;
/* 0x04 */ u32 mNrmNum;
/* 0x08 */ u32 mColNum;
/* 0x0C */ u32 mTexCoordNum;
/* 0x10 */ u32 mPacketNum;
/* 0x14 */ GXVtxAttrFmtList* mVtxAttrFmtList;
/* 0x18 */ void* mVtxPosArray;
/* 0x1C */ void* mVtxNrmArray;
/* 0x20 */ void* mVtxNBTArray;
/* 0x24 */ GXColor* mVtxColorArray[2];
/* 0x2C */ void* mVtxTexCoordArray[8];
/* 0x4C */ u8 mVtxPosFrac;
/* 0x50 */ GXCompType mVtxPosType;
/* 0x54 */ u8 mVtxNrmFrac;
/* 0x58 */ GXCompType mVtxNrmType;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DVertexBuffer {
public:
J3DVertexBuffer() { init(); }
void setVertexData(J3DVertexData*);
void init();
~J3DVertexBuffer();
void setArray() const;
s32 copyLocalVtxPosArray(u32);
s32 copyLocalVtxNrmArray(u32);
s32 copyLocalVtxArray(u32);
s32 allocTransformedVtxPosArray();
s32 allocTransformedVtxNrmArray();
void setCurrentVtxPos(void* pVtxPos) { mCurrentVtxPos = pVtxPos; }
void* getCurrentVtxPos() { return mCurrentVtxPos; }
void setCurrentVtxNrm(void* pVtxNrm) { mCurrentVtxNrm = pVtxNrm; }
void* getCurrentVtxNrm() { return mCurrentVtxNrm; }
void setCurrentVtxCol(GXColor* pVtxCol) { mCurrentVtxCol = pVtxCol; }
void frameInit() {
setCurrentVtxPos(mVtxPosArray[0]);
setCurrentVtxNrm(mVtxNrmArray[0]);
setCurrentVtxCol(mVtxColArray[0]);
}
void* getTransformedVtxPos(int idx) { return mTransformedVtxPosArray[idx]; }
void* getTransformedVtxNrm(int idx) { return mTransformedVtxNrmArray[idx]; }
J3DVertexData* getVertexData() const { return mVtxData; }
void swapTransformedVtxPos() {
void* tmp = mTransformedVtxPosArray[0];
mTransformedVtxPosArray[0] = mTransformedVtxPosArray[1];
mTransformedVtxPosArray[1] = tmp;
}
void swapTransformedVtxNrm() {
void* tmp = mTransformedVtxNrmArray[0];
mTransformedVtxNrmArray[0] = mTransformedVtxNrmArray[1];
mTransformedVtxNrmArray[1] = tmp;
}
void swapVtxPosArrayPointer() {
void* temp = mVtxPosArray[0];
mVtxPosArray[0] = mVtxPosArray[1];
mVtxPosArray[1] = temp;
}
void swapVtxNrmArrayPointer() {
void* temp = mVtxNrmArray[0];
mVtxNrmArray[0] = mVtxNrmArray[1];
mVtxNrmArray[1] = temp;
}
void swapVtxColArrayPointer() {
GXColor* temp = mVtxColArray[0];
mVtxColArray[0] = mVtxColArray[1];
mVtxColArray[1] = temp;
}
void* getVtxPosArrayPointer(int index) {
return mVtxPosArray[index];
}
void* getVtxNrmArrayPointer(int index) {
return mVtxNrmArray[index];
}
GXColor* getVtxColArrayPointer(int index) {
return mVtxColArray[index];
}
private:
/* 0x00 */ J3DVertexData* mVtxData;
/* 0x04 */ void* mVtxPosArray[2];
/* 0x0C */ void* mVtxNrmArray[2];
/* 0x14 */ GXColor* mVtxColArray[2];
/* 0x1C */ void* mTransformedVtxPosArray[2];
/* 0x24 */ void* mTransformedVtxNrmArray[2];
/* 0x2C */ void* mCurrentVtxPos;
/* 0x30 */ void* mCurrentVtxNrm;
/* 0x34 */ GXColor* mCurrentVtxCol;
}; // Size: 0x38
#endif /* J3DVERTEX_H */
@@ -1,100 +0,0 @@
#ifndef J3DANMLOADER_H
#define J3DANMLOADER_H
class J3DAnmClusterFull;
struct J3DAnmClusterFullData;
class J3DAnmClusterKey;
struct J3DAnmClusterKeyData;
class J3DAnmColorFull;
struct J3DAnmColorFullData;
class J3DAnmColorKey;
struct J3DAnmColorKeyData;
class J3DAnmTevRegKey;
struct J3DAnmTevRegKeyData;
class J3DAnmTexPattern;
struct J3DAnmTexPatternFullData;
class J3DAnmTextureSRTKey;
struct J3DAnmTextureSRTKeyData;
class J3DAnmTransformFull;
struct J3DAnmTransformFullData;
class J3DAnmTransformKey;
struct J3DAnmTransformKeyData;
class J3DAnmVisibilityFull;
struct J3DAnmVisibilityFullData;
class J3DAnmVtxColorFull;
struct J3DAnmVtxColorFullData;
class J3DAnmVtxColorKey;
struct J3DAnmVtxColorKeyData;
enum J3DAnmLoaderDataBaseFlag {
J3DLOADER_UNK_FLAG0,
J3DLOADER_UNK_FLAG1,
};
class J3DAnmBase;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DAnmLoaderDataBase {
static J3DAnmBase* load(void const*, J3DAnmLoaderDataBaseFlag);
static void setResource(J3DAnmBase*, void const*);
static J3DAnmBase* load(void const* param_0) { return load(param_0, J3DLOADER_UNK_FLAG0); }
};
class J3DAnmLoader {
public:
virtual J3DAnmBase* load(const void*) = 0;
virtual void setResource(J3DAnmBase*, const void*) = 0;
virtual ~J3DAnmLoader() {}
};
class J3DAnmFullLoader_v15 : public J3DAnmLoader {
public:
J3DAnmFullLoader_v15();
void readAnmTransform(J3DAnmTransformFullData const*);
void setAnmTransform(J3DAnmTransformFull*, J3DAnmTransformFullData const*);
void readAnmColor(J3DAnmColorFullData const*);
void setAnmColor(J3DAnmColorFull*, J3DAnmColorFullData const*);
void readAnmTexPattern(J3DAnmTexPatternFullData const*);
void setAnmTexPattern(J3DAnmTexPattern*, J3DAnmTexPatternFullData const*);
void readAnmVisibility(J3DAnmVisibilityFullData const*);
void setAnmVisibility(J3DAnmVisibilityFull*, J3DAnmVisibilityFullData const*);
void readAnmCluster(J3DAnmClusterFullData const*);
void setAnmCluster(J3DAnmClusterFull*, J3DAnmClusterFullData const*);
void readAnmVtxColor(J3DAnmVtxColorFullData const*);
void setAnmVtxColor(J3DAnmVtxColorFull*, J3DAnmVtxColorFullData const*);
virtual J3DAnmBase* load(void const*);
virtual void setResource(J3DAnmBase*, void const*);
virtual ~J3DAnmFullLoader_v15();
/* 0x4 */ J3DAnmBase* mAnm;
};
class J3DAnmKeyLoader_v15 : public J3DAnmLoader {
public:
J3DAnmKeyLoader_v15();
void readAnmTransform(J3DAnmTransformKeyData const*);
void setAnmTransform(J3DAnmTransformKey*, J3DAnmTransformKeyData const*);
void readAnmTextureSRT(J3DAnmTextureSRTKeyData const*);
void setAnmTextureSRT(J3DAnmTextureSRTKey*, J3DAnmTextureSRTKeyData const*);
void readAnmColor(J3DAnmColorKeyData const*);
void setAnmColor(J3DAnmColorKey*, J3DAnmColorKeyData const*);
void readAnmCluster(J3DAnmClusterKeyData const*);
void setAnmCluster(J3DAnmClusterKey*, J3DAnmClusterKeyData const*);
void readAnmTevReg(J3DAnmTevRegKeyData const*);
void setAnmTevReg(J3DAnmTevRegKey*, J3DAnmTevRegKeyData const*);
void readAnmVtxColor(J3DAnmVtxColorKeyData const*);
void setAnmVtxColor(J3DAnmVtxColorKey*, J3DAnmVtxColorKeyData const*);
virtual J3DAnmBase* load(void const*);
virtual void setResource(J3DAnmBase*, void const*);
virtual ~J3DAnmKeyLoader_v15();
/* 0x4 */ J3DAnmBase* mAnm;
};
#endif /* J3DANMLOADER_H */
@@ -1,61 +0,0 @@
#ifndef J3DCLUSTERLOADER_H
#define J3DCLUSTERLOADER_H
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
/**
* @ingroup jsystem-j3d
*
*/
struct J3DClusterLoaderDataBase {
static void* load(void const*);
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DClusterBlock : public JUTDataBlockHeader {
public:
/* 0x08 */ u16 mClusterNum;
/* 0x0A */ u16 mClusterKeyNum;
/* 0x0C */ u16 mClusterVertexNum;
/* 0x0E */ u16 mVtxPosNum;
/* 0x10 */ u16 mVtxNrmNum;
/* 0x14 */ void* mClusterPointer;
/* 0x18 */ void* mClusterKeyPointer;
/* 0x1C */ void* mClusterVertex;
/* 0x20 */ void* mVtxPos;
/* 0x24 */ void* mVtxNrm;
/* 0x28 */ void* mClusterName;
/* 0x2C */ void* mClusterKeyName;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DClusterLoader {
public:
virtual void* load(const void*) = 0;
virtual ~J3DClusterLoader() {}
};
class J3DDeformData;
/**
* @ingroup jsystem-j3d
*
*/
class J3DClusterLoader_v15 : public J3DClusterLoader {
public:
J3DClusterLoader_v15();
void readCluster(J3DClusterBlock const*);
virtual void* load(void const*);
virtual ~J3DClusterLoader_v15();
/* 0x04 */ J3DDeformData* mpDeformData;
};
#endif /* J3DCLUSTERLOADER_H */
@@ -1,43 +0,0 @@
#ifndef J3DJOINTFACTORY_H
#define J3DJOINTFACTORY_H
#include "JSystem/J3DGraphBase/J3DTransform.h"
class J3DJoint;
struct J3DJointBlock;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DJointInitData {
/* 0x00 */ u16 mKind;
/* 0x02 */ bool mScaleCompensate;
/* 0x04 */ J3DTransformInfo mTransformInfo;
/* 0x24 */ f32 mRadius;
/* 0x28 */ Vec mMin;
/* 0x2C */ Vec mMax;
}; // Size: 0x30
/**
* @ingroup jsystem-j3d
*
*/
struct J3DJointFactory {
J3DJointFactory(J3DJointBlock const&);
J3DJoint* create(int);
J3DJointInitData* mJointInitData;
u16* mIndexTable;
u8 getKind(int no) const { return mJointInitData[mIndexTable[no]].mKind; }
u8 getScaleCompensate(int no) const { return mJointInitData[mIndexTable[no]].mScaleCompensate; }
const J3DTransformInfo& getTransformInfo(int no) const {
return mJointInitData[mIndexTable[no]].mTransformInfo;
}
f32 getRadius(int no) const { return mJointInitData[mIndexTable[no]].mRadius; }
Vec& getMin(int no) const { return mJointInitData[mIndexTable[no]].mMin; }
Vec& getMax(int no) const { return mJointInitData[mIndexTable[no]].mMax; }
};
#endif /* J3DJOINTFACTORY_H */
@@ -1,182 +0,0 @@
#ifndef J3DMATERIALFACTORY_H
#define J3DMATERIALFACTORY_H
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include <dolphin/gx.h>
class J3DMaterial;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMaterialInitData {
/* 0x000 */ u8 mMaterialMode;
/* 0x001 */ u8 mCullModeIdx;
/* 0x002 */ u8 mColorChanNumIdx;
/* 0x003 */ u8 mTexGenNumIdx;
/* 0x004 */ u8 mTevStageNumIdx;
/* 0x005 */ u8 mZCompLocIdx;
/* 0x006 */ u8 mZModeIdx;
/* 0x007 */ u8 mDitherIdx;
/* 0x008 */ u16 mMatColorIdx[2];
/* 0x00C */ u16 mColorChanIdx[4];
/* 0x014 */ u16 mAmbColorIdx[2];
/* 0x018 */ u8 field_0x018[0x10];
/* 0x028 */ u16 mTexCoordIdx[8];
/* 0x038 */ u8 field_0x038[0x10];
/* 0x048 */ u16 mTexMtxIdx[8];
/* 0x058 */ u8 field_0x058[0x2c];
/* 0x084 */ u16 mTexNoIdx[8];
/* 0x094 */ u16 mTevKColorIdx[4];
/* 0x09C */ u8 mTevKColorSel[0x10];
/* 0x0AC */ u8 mTevKAlphaSel[0x10];
/* 0x0BC */ u16 mTevOrderIdx[0x10];
/* 0x0DC */ u16 mTevColorIdx[4];
/* 0x0E4 */ u16 mTevStageIdx[0x10];
/* 0x104 */ u16 mTevSwapModeIdx[0x10];
/* 0x124 */ u16 mTevSwapModeTableIdx[4];
/* 0x12C */ u8 field_0x12c[0x18];
/* 0x144 */ u16 mFogIdx;
/* 0x146 */ u16 mAlphaCompIdx;
/* 0x148 */ u16 mBlendIdx;
/* 0x14A */ u16 mNBTScaleIdx;
}; // size 0x14C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DIndInitData {
/* 0x000 */ bool mEnabled;
/* 0x001 */ u8 mIndTexStageNum;
/* 0x002 */ u8 field_0x002[2];
/* 0x004 */ J3DIndTexOrderInfo mIndTexOrderInfo[3];
/* 0x010 */ u8 field_0x010[4];
/* 0x014 */ J3DIndTexMtxInfo mIndTexMtxInfo[3];
/* 0x068 */ J3DIndTexCoordScaleInfo mIndTexCoordScaleInfo[3];
/* 0x074 */ u8 field_0x074[4];
/* 0x078 */ J3DIndTevStageInfo mIndTevStageInfo[0x10];
}; // size 0x138
/**
* @ingroup jsystem-j3d
*
*/
struct J3DPatchingInfo {
/* 0x0 */ u16 mMatColorOffset;
/* 0x2 */ u16 mColorChanOffset;
/* 0x4 */ u16 mTexMtxOffset;
/* 0x6 */ u16 mTexNoOffset;
/* 0x8 */ u16 mTevRegOffset;
/* 0xA */ u16 mFogOffset;
/* 0xC */ u8 field_0xc[4];
}; // size 0x10
/**
* @ingroup jsystem-j3d
*
*/
struct J3DDisplayListInit {
/* 0x0 */ u32 mOffset;
/* 0x4 */ u32 field_0x4;
}; // size 8
struct J3DTexCoord2Info;
class J3DCurrentMtxInfo;
/**
* @ingroup jsystem-j3d
*
*/
class J3DMaterialFactory {
public:
enum MaterialType {
MATERIAL_TYPE_NORMAL = 0,
MATERIAL_TYPE_LOCKED = 1,
MATERIAL_TYPE_PATCHED = 2,
};
J3DMaterialFactory(J3DMaterialDLBlock const&);
J3DMaterialFactory(J3DMaterialBlock const&);
u16 countUniqueMaterials();
u32 countTexGens(int) const;
u32 countStages(int) const;
J3DMaterial* create(J3DMaterial*, MaterialType, int, u32) const;
J3DMaterial* createNormalMaterial(J3DMaterial*, int, u32) const;
J3DMaterial* createPatchedMaterial(J3DMaterial*, int, u32) const;
void modifyPatchedCurrentMtx(J3DMaterial*, int) const;
J3DMaterial* createLockedMaterial(J3DMaterial*, int, u32) const;
u32 calcSize(J3DMaterial*, MaterialType, int, u32) const;
u32 calcSizeNormalMaterial(J3DMaterial*, int, u32) const;
u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
J3DGXColor newMatColor(int, int) const;
const u8 newColorChanNum(int) const;
J3DColorChan newColorChan(int, int) const;
J3DGXColor newAmbColor(int, int) const;
u32 newTexGenNum(int) const;
J3DTexCoord newTexCoord(int, int) const;
J3DTexMtx* newTexMtx(int, int) const;
u8 newCullMode(int) const;
u16 newTexNo(int, int) const;
J3DTevOrder newTevOrder(int, int) const;
J3DGXColorS10 newTevColor(int, int) const;
J3DGXColor newTevKColor(int, int) const;
const u8 newTevStageNum(int) const;
J3DTevStage newTevStage(int, int) const;
J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
u8 newIndTexStageNum(int) const;
J3DIndTexOrder newIndTexOrder(int, int) const;
J3DIndTexMtx newIndTexMtx(int, int) const;
J3DIndTevStage newIndTevStage(int, int) const;
J3DIndTexCoordScale newIndTexCoordScale(int, int) const;
J3DFog newFog(int) const;
J3DAlphaComp newAlphaComp(int) const;
J3DBlend newBlend(int) const;
J3DZMode newZMode(int) const;
const u8 newZCompLoc(int) const;
const u8 newDither(int) const;
J3DNBTScale newNBTScale(int) const;
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; }
/* 0x00 */ u16 mMaterialNum;
/* 0x04 */ J3DMaterialInitData* mpMaterialInitData;
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ J3DIndInitData* mpIndInitData;
/* 0x10 */ GXColor* mpMatColor;
/* 0x14 */ u8* mpColorChanNum;
/* 0x18 */ J3DColorChanInfo* mpColorChanInfo;
/* 0x1C */ GXColor* mpAmbColor;
/* 0x20 */ J3DLightInfo* mpLightInfo;
/* 0x24 */ u8* mpTexGenNum;
/* 0x28 */ J3DTexCoordInfo* mpTexCoordInfo;
/* 0x2C */ J3DTexCoord2Info* mpTexCoord2Info;
/* 0x30 */ J3DTexMtxInfo* mpTexMtxInfo;
/* 0x34 */ J3DTexMtxInfo* field_0x34;
/* 0x38 */ u16* mpTexNo;
/* 0x3C */ GXCullMode* mpCullMode;
/* 0x40 */ J3DTevOrderInfo* mpTevOrderInfo;
/* 0x44 */ GXColorS10* mpTevColor;
/* 0x48 */ GXColor* mpTevKColor;
/* 0x4C */ u8* mpTevStageNum;
/* 0x50 */ J3DTevStageInfo* mpTevStageInfo;
/* 0x54 */ J3DTevSwapModeInfo* mpTevSwapModeInfo;
/* 0x58 */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo;
/* 0x5C */ J3DFogInfo* mpFogInfo;
/* 0x60 */ J3DAlphaCompInfo* mpAlphaCompInfo;
/* 0x64 */ J3DBlendInfo* mpBlendInfo;
/* 0x68 */ J3DZModeInfo* mpZModeInfo;
/* 0x6C */ u8* mpZCompLoc;
/* 0x70 */ u8* mpDither;
/* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo;
/* 0x78 */ J3DDisplayListInit* mpDisplayListInit;
/* 0x7C */ J3DPatchingInfo* mpPatchingInfo;
/* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo;
/* 0x84 */ u8* mpMaterialMode;
};
#endif /* J3DMATERIALFACTORY_H */
@@ -1,115 +0,0 @@
#ifndef J3DMATERIALFACTORY_V21_H
#define J3DMATERIALFACTORY_V21_H
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include <dolphin/gx.h>
class J3DMaterial;
struct J3DTexCoord2Info;
class J3DCurrentMtxInfo;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMaterialInitData_v21 {
/* 0x000 */ u8 mMaterialMode;
/* 0x001 */ u8 mCullModeIdx;
/* 0x002 */ u8 mColorChanNumIdx;
/* 0x003 */ u8 mTexGenNumIdx;
/* 0x004 */ u8 mTevStageNumIdx;
/* 0x005 */ u8 mZCompLocIdx;
/* 0x006 */ u8 mZModeIdx;
/* 0x007 */ u8 mDitherIdx;
/* 0x008 */ u16 mMatColorIdx[2];
/* 0x00C */ u16 mColorChanIdx[4];
/* 0x014 */ u16 mTexCoordIdx[8];
/* 0x024 */ u8 field_0x038[0x10];
/* 0x034 */ u16 mTexMtxIdx[8];
/* 0x044 */ u8 field_0x058[0x2c];
/* 0x070 */ u16 mTexNoIdx[8];
/* 0x080 */ u16 mTevKColorIdx[4];
/* 0x088 */ u8 mTevKColorSel[0x10];
/* 0x098 */ u8 mTevKAlphaSel[0x10];
/* 0x0A8 */ u16 mTevOrderIdx[0x10];
/* 0x0C8 */ u16 mTevColorIdx[4];
/* 0x0D0 */ u16 mTevStageIdx[0x10];
/* 0x0F0 */ u16 mTevSwapModeIdx[0x10];
/* 0x110 */ u16 mTevSwapModeTableIdx[4];
/* 0x118 */ u8 field_0x12c[0x18];
/* 0x130 */ u16 mFogIdx;
/* 0x132 */ u16 mAlphaCompIdx;
/* 0x134 */ u16 mBlendIdx;
/* 0x136 */ u16 mNBTScaleIdx;
}; // size 0x138
/**
* @ingroup jsystem-j3d
*
*/
class J3DMaterialFactory_v21 {
public:
J3DMaterialFactory_v21(J3DMaterialBlock_v21 const&);
u16 countUniqueMaterials();
u32 countTexGens(int) const;
u32 countStages(int) const;
J3DMaterial* create(J3DMaterial*, int, u32) const;
J3DGXColor newMatColor(int, int) const;
const u8 newColorChanNum(int) const;
J3DColorChan newColorChan(int, int) const;
u32 newTexGenNum(int) const;
J3DTexCoord newTexCoord(int, int) const;
J3DTexMtx* newTexMtx(int, int) const;
u8 newCullMode(int) const;
u16 newTexNo(int, int) const;
J3DTevOrder newTevOrder(int, int) const;
J3DGXColorS10 newTevColor(int, int) const;
J3DGXColor newTevKColor(int, int) const;
const u8 newTevStageNum(int) const;
J3DTevStage newTevStage(int, int) const;
J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
J3DFog newFog(int) const;
J3DAlphaComp newAlphaComp(int) const;
J3DBlend newBlend(int) const;
const J3DZMode newZMode(int) const;
const u8 newZCompLoc(int) const;
const u8 newDither(int) const;
J3DNBTScale newNBTScale(int) const;
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; }
/* 0x00 */ u16 mMaterialNum;
/* 0x04 */ J3DMaterialInitData_v21* mpMaterialInitData;
/* 0x08 */ u16* mpMaterialID;
/* 0x0C */ GXColor* mpMatColor;
/* 0x10 */ u8* mpColorChanNum;
/* 0x14 */ J3DColorChanInfo* mpColorChanInfo;
/* 0x18 */ u8* mpTexGenNum;
/* 0x1C */ J3DTexCoordInfo* mpTexCoordInfo;
/* 0x20 */ J3DTexCoord2Info* mpTexCoord2Info;
/* 0x24 */ J3DTexMtxInfo* mpTexMtxInfo;
/* 0x28 */ J3DTexMtxInfo* field_0x28;
/* 0x2C */ u16* mpTexNo;
/* 0x30 */ GXCullMode* mpCullMode;
/* 0x34 */ J3DTevOrderInfo* mpTevOrderInfo;
/* 0x38 */ GXColorS10* mpTevColor;
/* 0x3C */ GXColor* mpTevKColor;
/* 0x40 */ u8* mpTevStageNum;
/* 0x44 */ J3DTevStageInfo* mpTevStageInfo;
/* 0x48 */ J3DTevSwapModeInfo* mpTevSwapModeInfo;
/* 0x4C */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo;
/* 0x50 */ J3DFogInfo* mpFogInfo;
/* 0x54 */ J3DAlphaCompInfo* mpAlphaCompInfo;
/* 0x58 */ J3DBlendInfo* mpBlendInfo;
/* 0x5C */ J3DZModeInfo* mpZModeInfo;
/* 0x60 */ u8* mpZCompLoc;
/* 0x64 */ u8* mpDither;
/* 0x68 */ J3DNBTScaleInfo* mpNBTScaleInfo;
/* 0x6C */ u16 field_0x6c;
/* 0x6E */ u8 field_0x6e;
/* 0x6F */ u8 field_0x6f;
};
#endif /* J3DMATERIALFACTORY_V21_H */
@@ -1,351 +0,0 @@
#ifndef J3DMODELLOADER_H
#define J3DMODELLOADER_H
#include "JSystem/J3DGraphBase/J3DSys.h"
#include <dolphin/mtx.h>
class J3DModelData;
class J3DMaterialTable;
struct J3DModelHierarchy;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DModelBlock {
/* 0x00 */ u32 mBlockType;
/* 0x04 */ u32 mBlockSize;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DModelFileData {
/* 0x00 */ u32 mMagic1;
/* 0x04 */ u32 mMagic2;
/* 0x08 */ u8 field_0x08[4];
/* 0x0C */ u32 mBlockNum;
/* 0x10 */ u8 field_0x10[0x1C - 0x10];
/* 0x1C */ int field_0x1c;
/* 0x20 */ J3DModelBlock mBlocks[1];
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DModelInfoBlock : public J3DModelBlock {
/* 0x08 */ u16 mFlags;
/* 0x0C */ u32 mPacketNum;
/* 0x10 */ u32 mVtxNum;
/* 0x14 */ void* mpHierarchy;
}; // size 0x18
/**
* @ingroup jsystem-j3d
*
*/
struct J3DVertexBlock : public J3DModelBlock {
/* 0x08 */ void* mpVtxAttrFmtList;
/* 0x0C */ void* mpVtxPosArray;
/* 0x10 */ void* mpVtxNrmArray;
/* 0x14 */ void* mpVtxNBTArray;
/* 0x18 */ void* mpVtxColorArray[2];
/* 0x20 */ void* mpVtxTexCoordArray[8];
}; // size 0x40
/**
* @ingroup jsystem-j3d
*
*/
struct J3DEnvelopeBlock : public J3DModelBlock {
/* 0x08 */ u16 mWEvlpMtxNum;
/* 0x0C */ void* mpWEvlpMixMtxNum;
/* 0x10 */ void* mpWEvlpMixIndex;
/* 0x14 */ void* mpWEvlpMixWeight;
/* 0x18 */ void* mpInvJointMtx;
}; // size 0x1C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DDrawBlock : public J3DModelBlock {
/* 0x08 */ u16 mMtxNum;
/* 0x0C */ void* mpDrawMtxFlag;
/* 0x10 */ void* mpDrawMtxIndex;
}; // size 0x14
/**
* @ingroup jsystem-j3d
*
*/
struct J3DJointBlock : public J3DModelBlock {
/* 0x08 */ u16 mJointNum;
/* 0x0C */ void* mpJointInitData;
/* 0x10 */ void* mpIndexTable;
/* 0x14 */ void* mpNameTable;
}; // size 0x18
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMaterialBlock : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* mpMaterialInitData;
/* 0x10 */ void* mpMaterialID;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpIndInitData;
/* 0x1C */ void* mpCullMode;
/* 0x20 */ void* mpMatColor;
/* 0x24 */ void* mpColorChanNum;
/* 0x28 */ void* mpColorChanInfo;
/* 0x2C */ void* mpAmbColor;
/* 0x30 */ void* mpLightInfo;
/* 0x34 */ void* mpTexGenNum;
/* 0x38 */ void* mpTexCoordInfo;
/* 0x3C */ void* mpTexCoord2Info;
/* 0x40 */ void* mpTexMtxInfo;
/* 0x44 */ void* field_0x44;
/* 0x48 */ void* mpTexNo;
/* 0x4C */ void* mpTevOrderInfo;
/* 0x50 */ void* mpTevColor;
/* 0x54 */ void* mpTevKColor;
/* 0x58 */ void* mpTevStageNum;
/* 0x5C */ void* mpTevStageInfo;
/* 0x60 */ void* mpTevSwapModeInfo;
/* 0x64 */ void* mpTevSwapModeTableInfo;
/* 0x68 */ void* mpFogInfo;
/* 0x6C */ void* mpAlphaCompInfo;
/* 0x70 */ void* mpBlendInfo;
/* 0x74 */ void* mpZModeInfo;
/* 0x78 */ void* mpZCompLoc;
/* 0x7C */ void* mpDither;
/* 0x80 */ void* mpNBTScaleInfo;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMaterialBlock_v21 : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* mpMaterialInitData;
/* 0x10 */ void* mpMaterialID;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpCullMode;
/* 0x1C */ void* mpMatColor;
/* 0x20 */ void* mpColorChanNum;
/* 0x24 */ void* mpColorChanInfo;
/* 0x28 */ void* mpTexGenNum;
/* 0x2C */ void* mpTexCoordInfo;
/* 0x30 */ void* mpTexCoord2Info;
/* 0x34 */ void* mpTexMtxInfo;
/* 0x38 */ void* field_0x38;
/* 0x3C */ void* mpTexNo;
/* 0x40 */ void* mpTevOrderInfo;
/* 0x44 */ void* mpTevColor;
/* 0x48 */ void* mpTevKColor;
/* 0x4C */ void* mpTevStageNum;
/* 0x50 */ void* mpTevStageInfo;
/* 0x54 */ void* mpTevSwapModeInfo;
/* 0x58 */ void* mpTevSwapModeTableInfo;
/* 0x5C */ void* mpFogInfo;
/* 0x60 */ void* mpAlphaCompInfo;
/* 0x64 */ void* mpBlendInfo;
/* 0x68 */ void* mpZModeInfo;
/* 0x6C */ void* mpZCompLoc;
/* 0x70 */ void* mpDither;
/* 0x74 */ void* mpNBTScaleInfo;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMaterialDLBlock : public J3DModelBlock {
/* 0x08 */ u16 mMaterialNum;
/* 0x0C */ void* mpDisplayListInit;
/* 0x10 */ void* mpPatchingInfo;
/* 0x14 */ void* mpCurrentMtxInfo;
/* 0x18 */ void* mpMaterialMode;
/* 0x1C */ void* field_0x1c;
/* 0x20 */ void* mpNameTable;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DShapeBlock : public J3DModelBlock {
/* 0x08 */ u16 mShapeNum;
/* 0x0C */ void* mpShapeInitData;
/* 0x10 */ void* mpIndexTable;
/* 0x14 */ void* mpNameTable;
/* 0x18 */ void* mpVtxDescList;
/* 0x1C */ void* mpMtxTable;
/* 0x20 */ void* mpDisplayListData;
/* 0x24 */ void* mpMtxInitData;
/* 0x28 */ void* mpDrawInitData;
}; // size 0x2C
/**
* @ingroup jsystem-j3d
*
*/
struct J3DTextureBlock : public J3DModelBlock {
/* 0x08 */ u16 mTextureNum;
/* 0x0C */ void* mpTextureRes;
/* 0x10 */ void* mpNameTable;
};
enum J3DModelLoaderFlagTypes {
J3DMLF_None = 0x00000000,
J3DMLF_MtxSoftImageCalc = 0x00000001,
J3DMLF_MtxMayaCalc = 0x00000002,
J3DMLF_MtxBasicCalc = 0x00000004,
J3DMLF_04 = 0x00000008,
J3DMLF_MtxTypeMask = J3DMLF_MtxSoftImageCalc | J3DMLF_MtxMayaCalc | J3DMLF_MtxBasicCalc |
J3DMLF_04, // 0 - 2 (0 = Basic, 1 = SoftImage, 2 = Maya)
J3DMLF_UseImmediateMtx = 0x00000010,
J3DMLF_UsePostTexMtx = 0x00000020,
J3DMLF_07 = 0x00000040,
J3DMLF_08 = 0x00000080,
J3DMLF_NoMatrixTransform = 0x00000100,
J3DMLF_10 = 0x00000200,
J3DMLF_11 = 0x00000400,
J3DMLF_12 = 0x00000800,
J3DMLF_13 = 0x00001000,
J3DMLF_DoBdlMaterialCalc = 0x00002000,
J3DMLF_15 = 0x00004000,
J3DMLF_16 = 0x00008000,
J3DMLF_TevNumShift = 0x00010000,
J3DMLF_18 = 0x00020000,
J3DMLF_UseSingleSharedDL = 0x00040000,
J3DMLF_20 = 0x00080000,
J3DMLF_21 = 0x00100000,
J3DMLF_UseUniqueMaterials = 0x00200000,
J3DMLF_23 = 0x00400000,
J3DMLF_24 = 0x00800000,
J3DMLF_Material_UseIndirect = 0x01000000,
J3DMLF_26 = 0x02000000,
J3DMLF_27 = 0x04000000,
J3DMLF_Material_TexGen_Block4 = 0x08000000,
J3DMLF_Material_PE_Full = 0x10000000,
J3DMLF_Material_PE_FogOff = 0x20000000,
J3DMLF_Material_Color_LightOn = 0x40000000,
J3DMLF_Material_Color_AmbientOn = 0x80000000
};
static inline u32 getMdlDataFlag_TevStageNum(u32 flags) { return (flags & 0x001f0000) >> 0x10; }
static inline u32 getMdlDataFlag_TexGenFlag(u32 flags) { return flags & 0x0c000000; }
static inline u32 getMdlDataFlag_ColorFlag(u32 flags) { return flags & 0xc0000000; }
static inline u32 getMdlDataFlag_PEFlag(u32 flags) { return flags & 0x30000000; }
static inline u32 getMdlDataFlag_MtxLoadType(u32 flags) { return flags & 0x10; }
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelLoader {
public:
J3DModelLoader();
void readInformation(J3DModelInfoBlock const*, u32);
void readVertex(J3DVertexBlock const*);
void readEnvelop(J3DEnvelopeBlock const*);
void readDraw(J3DDrawBlock const*);
void readJoint(J3DJointBlock const*);
void readShape(J3DShapeBlock const*, u32);
void readTexture(J3DTextureBlock const*);
void readTextureTable(J3DTextureBlock const*);
void readPatchedMaterial(J3DMaterialBlock const*, u32);
void readMaterialDL(J3DMaterialDLBlock const*, u32);
void modifyMaterial(u32);
u32 calcSizeInformation(J3DModelInfoBlock const*, u32);
u32 calcSizeJoint(J3DJointBlock const*);
u32 calcSizeEnvelope(J3DEnvelopeBlock const*);
u32 calcSizeDraw(J3DDrawBlock const*);
u32 calcSizeShape(J3DShapeBlock const*, u32);
u32 calcSizeTexture(J3DTextureBlock const*);
u32 calcSizeTextureTable(J3DTextureBlock const*);
u32 calcSizePatchedMaterial(J3DMaterialBlock const*, u32);
u32 calcSizeMaterialDL(J3DMaterialDLBlock const*, u32);
virtual J3DModelData* load(void const*, u32);
virtual J3DMaterialTable* loadMaterialTable(void const*);
virtual J3DModelData* loadBinaryDisplayList(void const*, u32);
virtual u32 calcLoadSize(void const*, u32);
virtual u32 calcLoadMaterialTableSize(void const*);
virtual u32 calcLoadBinaryDisplayListSize(void const*, u32);
virtual u16 countMaterialNum(void const*);
virtual void setupBBoardInfo();
virtual ~J3DModelLoader() {}
virtual void readMaterial(J3DMaterialBlock const*, u32) {}
virtual void readMaterial_v21(J3DMaterialBlock_v21 const*, u32) {}
virtual void readMaterialTable(J3DMaterialBlock const*, u32) {}
virtual void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32) {}
virtual u32 calcSizeMaterial(J3DMaterialBlock const*, u32) { return false; }
virtual u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32) { return false; }
/* 0x04 */ J3DModelData* mpModelData;
/* 0x08 */ J3DMaterialTable* mpMaterialTable;
/* 0x0C */ J3DShapeBlock const* mpShapeBlock;
/* 0x10 */ J3DMaterialBlock const* mpMaterialBlock;
/* 0x14 */ J3DModelHierarchy* mpModelHierarchy;
/* 0x18 */ u8 field_0x18;
/* 0x19 */ u8 field_0x19;
/* 0x1A */ u16 mEnvelopeSize;
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelLoader_v26 : public J3DModelLoader {
public:
~J3DModelLoader_v26() {}
void readMaterial(J3DMaterialBlock const*, u32);
void readMaterialTable(J3DMaterialBlock const*, u32);
u32 calcSizeMaterial(J3DMaterialBlock const*, u32);
u32 calcSizeMaterialTable(J3DMaterialBlock const*, u32);
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelLoader_v21 : public J3DModelLoader {
public:
~J3DModelLoader_v21() {}
void readMaterial_v21(J3DMaterialBlock_v21 const*, u32);
void readMaterialTable_v21(J3DMaterialBlock_v21 const*, u32);
};
/**
* @ingroup jsystem-j3d
*
*/
class J3DModelLoaderDataBase {
public:
static J3DModelData* load(void const* i_data, u32 i_flags);
static J3DModelData* loadBinaryDisplayList(const void* i_data, u32 flags);
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DMtxCalcJ3DSysInitSoftimage {
static void init(const Vec& param_0, const Mtx& param_1) {
J3DSys::mCurrentS = param_0;
MTXCopy(param_1, J3DSys::mCurrentMtx);
}
};
#endif /* J3DMODELLOADER_H */
@@ -1,6 +0,0 @@
#ifndef J3DMODELLOADERCALCSIZE_H
#define J3DMODELLOADERCALCSIZE_H
#include <dolphin/types.h>
#endif /* J3DMODELLOADERCALCSIZE_H */
@@ -1,14 +0,0 @@
#ifndef J3DMODELSAVER_H
#define J3DMODELSAVER_H
#include "JSystem/J3DGraphAnimator/J3DModel.h"
enum J3DBinaryDisplayListSaverFlag {
J3DBinaryDisplayListSaverFlag_UNK_1 = 1,
};
namespace J3DModelSaverDataBase {
void* saveBinaryDisplayList(const J3DModel*, J3DBinaryDisplayListSaverFlag, u32);
};
#endif
@@ -1,77 +0,0 @@
#ifndef J3DSHAPEFACTORY_H
#define J3DSHAPEFACTORY_H
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
#include <dolphin/gx.h>
class J3DShape;
class J3DShapeMtx;
class J3DShapeDraw;
struct ResNTAB;
/**
* @ingroup jsystem-j3d
*
*/
struct J3DShapeInitData {
/* 0x00 */ u8 mShapeMtxType;
/* 0x02 */ u16 mMtxGroupNum;
/* 0x04 */ u16 mVtxDescListIndex;
/* 0x06 */ u16 mMtxInitDataIndex;
/* 0x08 */ u16 mDrawInitDataIndex;
/* 0x0C */ f32 mRadius;
/* 0x10 */ Vec mMin;
/* 0x1C */ Vec mMax;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DShapeMtxInitData {
/* 0x00 */ u16 mUseMtxIndex;
/* 0x02 */ u16 mUseMtxCount;
/* 0x04 */ u32 mFirstUseMtxIndex;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DShapeDrawInitData {
/* 0x00 */ u32 mDisplayListSize;
/* 0x04 */ u32 mDisplayListIndex;
};
/**
* @ingroup jsystem-j3d
*
*/
struct J3DShapeFactory {
J3DShapeFactory(J3DShapeBlock const&);
J3DShape* create(int, u32, GXVtxDescList*);
J3DShapeMtx* newShapeMtx(u32, int, int) const;
J3DShapeDraw* newShapeDraw(int, int) const;
void allocVcdVatCmdBuffer(u32);
s32 calcSize(int, u32);
s32 calcSizeVcdVatCmdBuffer(u32);
s32 calcSizeShapeMtx(u32, int, int) const;
/* 0x00 */ J3DShapeInitData* mShapeInitData;
/* 0x04 */ u16* mIndexTable;
/* 0x08 */ GXVtxDescList* mVtxDescList;
/* 0x0C */ u16* mMtxTable;
/* 0x10 */ u8* mDisplayListData;
/* 0x14 */ J3DShapeMtxInitData* mMtxInitData;
/* 0x18 */ J3DShapeDrawInitData* mDrawInitData;
/* 0x1C */ u8* mVcdVatCmdBuffer;
u16 getMtxGroupNum(int no) const { return mShapeInitData[mIndexTable[no]].mMtxGroupNum; }
GXVtxDescList* getVtxDescList(int no) const { return (GXVtxDescList*)((u8*)mVtxDescList + mShapeInitData[mIndexTable[no]].mVtxDescListIndex); }
f32 getRadius(int no) const { return mShapeInitData[mIndexTable[no]].mRadius; }
Vec& getMin(int no) const { return mShapeInitData[mIndexTable[no]].mMin; }
Vec& getMax(int no) const { return mShapeInitData[mIndexTable[no]].mMax; }
};
#endif /* J3DSHAPEFACTORY_H */
-38
View File
@@ -1,38 +0,0 @@
#ifndef J3DUCLIPPER_H
#define J3DUCLIPPER_H
#include <dolphin/mtx.h>
/**
* @ingroup jsystem-j3d
*
*/
class J3DUClipper {
public:
J3DUClipper() { init(); }
virtual ~J3DUClipper() {}
void init();
void calcViewFrustum();
int clip(f32 const (*)[4], Vec, f32) const;
int clip(f32 const (*)[4], Vec*, Vec*) const;
void setFovy(f32 fovy) { mFovY = fovy; }
void setAspect(f32 aspect) { mAspect = aspect; }
void setNear(f32 near) { mNear = near; }
void setFar(f32 far) { mFar = far; }
f32 getFar() { return mFar; }
private:
/* 0x04 */ Vec _04;
/* 0x10 */ Vec _10;
/* 0x1C */ Vec _1C;
/* 0x28 */ Vec _28;
/* 0x34 */ u8 _34[0x4C - 0x34];
/* 0x4C */ f32 mFovY;
/* 0x50 */ f32 mAspect;
/* 0x54 */ f32 mNear;
/* 0x58 */ f32 mFar;
};
#endif /* J3DUCLIPPER_H */
-14
View File
@@ -1,14 +0,0 @@
#ifndef J3DUD_H
#define J3DUD_H
#include <dolphin/types.h>
namespace J3DUD {
inline f32 JMAAbs(f32 x) {
#ifdef __MWERKS__
return __fabsf(x);
#endif
}
}
#endif /* J3DUD_H */
-5
View File
@@ -1,5 +0,0 @@
#ifndef J3DUDL_H
#define J3DUDL_H
#endif /* J3DUDL_H */
-6
View File
@@ -1,6 +0,0 @@
#ifndef J3DUFUR_H
#define J3DUFUR_H
// NONMATCHING
#endif /* J3DUFUR_H */
-6
View File
@@ -1,6 +0,0 @@
#ifndef J3DUMOTION_H
#define J3DUMOTION_H
// NONMATCHING
#endif /* J3DUMOTION_H */
-6
View File
@@ -1,6 +0,0 @@
#ifndef J3DUSHADOW_H
#define J3DUSHADOW_H
// NONMATCHING
#endif /* J3DUSHADOW_H */
@@ -1,11 +0,0 @@
#ifndef JAHSOUNDPLAYERNODE_H
#define JAHSOUNDPLAYERNODE_H
#include "JSystem/JAHostIO/JAHFrameNode.h"
class JAHSoundPlayerNode : public JAHFrameNode {
public:
JAHSoundPlayerNode();
};
#endif /* JAHSOUNDPLAYERNODE_H */
-29
View File
@@ -1,29 +0,0 @@
#ifndef JAHFRAMENODE_H
#define JAHFRAMENODE_H
#include <dolphin/types.h>
#include "JSystem/JAHostIO/JAHioNode.h"
class JAHVirtualNode;
class JAHFrameNode : public JAHioNode {
public:
JAHFrameNode(const char*);
/* vt[07] */ virtual ~JAHFrameNode();
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
/* vt[05] */ virtual void genMessage(JORMContext*);
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
/* vt[0C] */ virtual s32 getNodeType();
/* vt[11] */ virtual void onCurrentNodeFrame();
/* vt[12] */ virtual void onFrame();
void framework();
void currentFramework();
JSULink<JAHFrameNode>* getFrameNodeLink() { return &mFrameNodeLink; }
/* 0x44 */ JSUTree<JAHVirtualNode> mTree;
/* 0x60 */ JSULink<JAHFrameNode> mFrameNodeLink;
};
#endif /* JAHFRAMENODE_H */
-29
View File
@@ -1,29 +0,0 @@
#ifndef JAHPUBDEFINE_H
#define JAHPUBDEFINE_H
#include "JSystem/JUtility/JUTAssert.h"
template<class T>
class JAHSingletonBase {
public:
JAHSingletonBase() { sInstance = (T*)this; }
virtual ~JAHSingletonBase() { sInstance = NULL; }
static T* newInstance() {
JUT_ASSERT(82, sInstance==NULL);
if (!sInstance) {
sInstance = new T();
}
JUT_ASSERT(85, sInstance!=NULL);
return sInstance;
}
static T* getIns() {
JUT_ASSERT(110, sInstance);
return sInstance;
}
static T* sInstance;
};
#endif /* JAHPUBDEFINE_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef JAHUTABLEDIT_H
#define JAHUTABLEDIT_H
#include "JSystem/JAHostIO/JAHVirtualNode.h"
class JAHUSeBox : public JAHVirtualNode {
public:
JAHUSeBox();
};
#endif /* JAHUTABLEDIT_H */
-23
View File
@@ -1,23 +0,0 @@
#ifndef JAHVIRTUALNODE_H
#define JAHVIRTUALNODE_H
#include "JSystem/JAHostIO/JAHioNode.h"
#include "JSystem/JSupport/JSUList.h"
class JAHControl;
class JAHVirtualNode {
public:
JAHVirtualNode();
virtual void updateNode();
virtual void message(JAHControl&);
virtual void onFrame();
virtual void onCurrentNodeFrame();
virtual void propertyEvent(JAH_P_Event, u32);
virtual void nodeEvent(JAH_N_Event);
/* 0x04 */ JSUTree<JAHVirtualNode> mTree;
/* 0x20 */ char mName[32];
};
#endif /* JAHVIRTUALNODE_H */
-52
View File
@@ -1,52 +0,0 @@
#ifndef JAHIOMESSAGE_H
#define JAHIOMESSAGE_H
#include <dolphin/types.h>
class JAHioNode;
class JORMContext;
class JAHControl {
public:
JAHControl(JORMContext*, JAHioNode*);
void returnY(u16);
void indent(s8);
void makeComment(const char*, u32, u8, u32);
static u16 getLineHeight() { return smLineHeight; }
static u16 getContWidth() { return smContWidth; }
static u16 getIntervalX() { return smIntX; }
static u16 getNameWidth() { return smNameWidth; }
static u16 smButtonWidth[];
static u16 smCommentWidth[];
static u16 smComboWidth[];
static u16 smYTop;
static u16 smXLeft;
static u16 smIndentSize;
static u16 smLineHeight;
static u16 smContWidth;
static u16 smIntX;
static u16 smIntY;
static u16 smNameWidth;
u16 getX() { return mX; }
u16 getY() { return mY; }
JORMContext* getContext() { return mContext; }
void tabX(u16 param_1) {
mX += param_1 + smIntX;
}
void returnYDirectSize(u16 param_1) {
mY += param_1;
mX = smXLeft + field_0x4 * smIndentSize;
}
/* 0x00 */ u16 mX;
/* 0x02 */ u16 mY;
/* 0x04 */ u16 field_0x4;
/* 0x08 */ JORMContext* mContext;
/* 0x0C */ JAHioNode* mNode;
};
#endif /* JAHIOMESSAGE_H */
-28
View File
@@ -1,28 +0,0 @@
#ifndef JAHIOMGR_H
#define JAHIOMGR_H
#include "JSystem/JAHostIO/JAHPubDefine.h"
#include "JSystem/JSupport/JSUList.h"
class JAHFrameNode;
class JAHioNode;
class JORReflexible;
class JAHioMgr : public JAHSingletonBase<JAHioMgr> {
public:
JAHioMgr();
void init_OnGame();
bool isGameMode();
void appendRootNode(JORReflexible*, JAHioNode*);
void appendFrameNode(JAHioNode*);
void removeFrameNode(JAHioNode*);
u32 framework();
u32 getNodeSysType() { return field_0x8; }
/* 0x04 */ s32 field_0x4;
/* 0x08 */ u32 field_0x8;
JSUList<JAHFrameNode> field_0xc;
};
#endif /* JAHIOMGR_H */
-55
View File
@@ -1,55 +0,0 @@
#ifndef JAHIONODE_H
#define JAHIONODE_H
#include "JSystem/JHostIO/JORReflexible.h"
#include "JSystem/JSupport/JSUList.h"
enum JAH_N_Event {
JAH_N_EVENT0 = 0,
JAH_N_EVENT1 = 1,
JAH_N_EVENT2 = 2,
};
enum JAH_P_Event {
JAH_P_EVENT0 = 0,
JAH_P_EVENT1 = 1,
};
class JAHControl;
class JAHioNode : public JORReflexible {
public:
JAHioNode(const char*);
/* vt[07] */ virtual ~JAHioNode();
/* vt[02] */ virtual void listenPropertyEvent(const JORPropertyEvent*);
/* vt[05] */ virtual void genMessage(JORMContext*);
/* vt[06] */ virtual void listenNodeEvent(const JORNodeEvent*);
/* vt[08] */ virtual void message(JAHControl&) {}
/* vt[09] */ virtual void appendNode(JAHioNode*, const char*);
/* vt[0A] */ virtual void prependNode(JAHioNode*, const char*);
/* vt[0B] */ virtual void removeNode(JAHioNode*);
/* vt[0C] */ virtual s32 getNodeType() { return 0; }
/* vt[0D] */ virtual u32 getNodeKind() const;
/* vt[0E] */ virtual u32 getNodeIcon() const { return 0; }
/* vt[0F] */ virtual void propertyEvent(JAH_P_Event, u32) {}
/* vt[10] */ virtual void nodeEvent(JAH_N_Event) {}
void updateNode();
void setNodeName(const char*);
void generateRealChildren(JORMContext*);
void generateTempChildren(JORMContext*);
JAHioNode* getParent();
static JAHioNode* getCurrentNode() { return smCurrentNode; }
static JAHioNode* smCurrentNode;
JSUTree<JAHioNode>* getTree() { return &mTree; }
char* getNodeName() { return mName; }
void setLastChild(JAHioNode* node) { mLastChild = node; }
/* 0x04 */ JSUTree<JAHioNode> mTree;
/* 0x20 */ char mName[32];
/* 0x40 */ JAHioNode* mLastChild;
};
#endif /* JAHIONODE_H */
-10
View File
@@ -1,10 +0,0 @@
#ifndef JAHIOUTIL_H
#define JAHIOUTIL_H
namespace JAHioUtil {
char* getString(const char* msg, ...);
extern char mStringBuffer[];
}
#endif /* JAHIOUTIL_H */
@@ -1,49 +0,0 @@
#ifndef JAWEXTSYSTEM_H
#define JAWEXTSYSTEM_H
#include "JSystem/JAWExtSystem/JAWSystem.h"
#include "JSystem/JGadget/std-list.h"
class JAWWindow;
struct JUTGamePad;
namespace JAWExtSystem {
BOOL registWindow(u32, JAWWindow*, int, int);
BOOL destroyWindow(u32, JAWWindow*);
void nextPage();
void prevPage();
void nextWindow();
void prevWindow();
void draw();
void padProc(const JUTGamePad&);
class TSystemInterface : public JAWSystemInterface {
public:
TSystemInterface() {}
virtual BOOL registWindow(u32 param_1, JAWWindow* param_2, int param_3, int param_4) {
return JAWExtSystem::registWindow(param_1, param_2, param_3, param_4);
}
virtual BOOL destroyWindow(u32 param_1, JAWWindow* param_2) {
return JAWExtSystem::destroyWindow(param_1, param_2);
}
virtual void setForegroundWindow(JAWWindow*) {}
};
class TCurrentHeap {
public:
TCurrentHeap(const TSystemInterface& interface) {
heap = JKRGetCurrentHeap();
JKRSetCurrentHeap(interface.getCurrentHeap());
}
~TCurrentHeap() { JKRSetCurrentHeap(heap); }
/* 0x00 */ JKRHeap* heap;
};
extern JGadget::TList<JAWWindow*> sPage[128];
extern TSystemInterface sInterface;
extern s32 sCurrentPage;
extern u8 lbl_80748E44;
}
#endif /* JAWEXTSYSTEM_H */
@@ -1,43 +0,0 @@
#ifndef JAWGRAPHCONTEXT_H
#define JAWGRAPHCONTEXT_H
#include "JSystem/JUtility/TColor.h"
#include "JSystem/JGeometry.h"
class J2DPrint;
class JUTResFont;
class JAWGraphContext {
public:
JAWGraphContext();
~JAWGraphContext();
void reset();
void color(u8, u8, u8, u8);
void color(const JUtility::TColor&);
void locate(int, int);
void print(char const*, ...);
void print(int, int, const char*, ...);
void color(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
void fillBox(const JGeometry::TBox2<f32>&);
void drawFrame(const JGeometry::TBox2<f32>&);
void line(const JGeometry::TVec2<f32>&, const JGeometry::TVec2<f32>&);
void setGXforPrint();
void setGXforDraw();
/* 0x00 */ J2DPrint* field_0x0;
/* 0x04 */ JUtility::TColor field_0x4;
/* 0x08 */ JUtility::TColor field_0x8;
/* 0x0C */ JUtility::TColor field_0xc;
/* 0x10 */ JUtility::TColor field_0x10;
/* 0x14 */ u8 mParentAlpha;
/* 0x15 */ u8 field_0x15;
/* 0x16 */ u8 field_0x16;
/* 0x18 */ int field_0x18;
void setParentAlpha(u8 alpha) { mParentAlpha = alpha; }
static JUTResFont* sFont;
static bool lbl_8074CD30;
};
#endif /* JAWGRAPHCONTEXT_H */
-22
View File
@@ -1,22 +0,0 @@
#ifndef JAWSYSTEM_H
#define JAWSYSTEM_H
#include "JSystem/JKernel/JKRHeap.h"
class JAWWindow;
class JAWSystemInterface {
public:
JAWSystemInterface();
virtual BOOL registWindow(u32, JAWWindow*, int, int) = 0;
virtual BOOL destroyWindow(u32, JAWWindow*) = 0;
virtual void setForegroundWindow(JAWWindow*) = 0;
/* 0x04 */ JKRHeap* mHeap;
JKRHeap* getCurrentHeap() const;
static JAWSystemInterface* sInstance;
};
#endif /* JAWSYSTEM_H */
-114
View File
@@ -1,114 +0,0 @@
#ifndef JAWWINDOW_H
#define JAWWINDOW_H
#include "JSystem/JAWExtSystem/JAWGraphContext.h"
#include "JSystem/J2DGraph/J2DTextBox.h"
#include "JSystem/J2DGraph/J2DWindow.h"
#include "JSystem/JGeometry.h"
class JAWGraphContext;
struct JUTGamePad;
class JUTPoint {
public:
JUTPoint(int i_x, int i_y) {
x = i_x;
y = i_y;
}
/* 0x00*/ int x;
/* 0x04*/ int y;
};
class JAWWindow {
public:
class TWindowText : public J2DPane {
public:
TWindowText(JAWWindow*);
virtual ~TWindowText();
virtual void drawSelf(f32, f32);
virtual void drawSelf(f32, f32, Mtx*);
/* 0x0FC */ JAWGraphContext field_0xfc;
/* 0x118 */ JAWWindow* m_pParent;
/* 0x11C */ JUTPoint field_0x11c;
};
class TJ2DWindowDraw : public J2DWindow {
public:
TJ2DWindowDraw(u32 param_1, const JGeometry::TBox2<f32>& param_2, const char* param_3) : J2DWindow(param_1, param_2, param_3, TEXTUREBASE_0, NULL) {}
virtual ~TJ2DWindowDraw() {}
void drawPane(int x, int y, const J2DGrafContext* p_grafCtx) {
J2DPane::draw(x, y, p_grafCtx, true, true);
calcMtx();
}
};
JAWWindow(const char*, int, int);
virtual ~JAWWindow();
virtual void onDraw(JAWGraphContext*);
virtual BOOL onInit();
virtual void frameWork() {}
virtual void onPadProc(const JUTGamePad&) {}
virtual void onTrigA(const JUTGamePad&) {}
virtual void onTrigB(const JUTGamePad&) {}
virtual void onTrigX(const JUTGamePad&) {}
virtual void onTrigY(const JUTGamePad&) {}
virtual void onTrigMenu(const JUTGamePad&) {}
virtual void onTrigL(const JUTGamePad&) {}
virtual void onTrigZ(const JUTGamePad&) {}
virtual void onTrigUp(const JUTGamePad&) {}
virtual void onTrigDown(const JUTGamePad&) {}
virtual void onTrigLeft(const JUTGamePad&) {}
virtual void onTrigRight(const JUTGamePad&) {}
virtual void onReleaseA(const JUTGamePad&) {}
virtual void onReleaseB(const JUTGamePad&) {}
virtual void onReleaseX(const JUTGamePad&) {}
virtual void onReleaseY(const JUTGamePad&) {}
virtual void onReleaseMenu(const JUTGamePad&) {}
virtual void onReleaseL(const JUTGamePad&) {}
virtual void onReleaseZ(const JUTGamePad&) {}
virtual void onReleaseUp(const JUTGamePad&) {}
virtual void onReleaseDown(const JUTGamePad&) {}
virtual void onReleaseLeft(const JUTGamePad&) {}
virtual void onReleaseRight(const JUTGamePad&) {}
virtual void onKeyA(const JUTGamePad&) {}
virtual void onKeyB(const JUTGamePad&) {}
virtual void onKeyX(const JUTGamePad&) {}
virtual void onKeyY(const JUTGamePad&) {}
virtual void onKeyMenu(const JUTGamePad&) {}
virtual void onKeyL(const JUTGamePad&) {}
virtual void onKeyZ(const JUTGamePad&) {}
virtual void onKeyUp(const JUTGamePad&) {}
virtual void onKeyDown(const JUTGamePad&) {}
virtual void onKeyLeft(const JUTGamePad&) {}
virtual void onKeyRight(const JUTGamePad&) {}
BOOL initIf();
void setTitleColor(const JUtility::TColor&, const JUtility::TColor&);
void setWindowColor(const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&, const JUtility::TColor&);
void move(f32, f32);
void addPosition(f32, f32);
void addSize(f32, f32);
static JUtility::TColor convJudaColor(u16);
void padProc(const JUTGamePad&);
/* 0x004 */ Mtx mMatrix;
/* 0x034 */ u8 field_0x34[0x38 - 0x34];
/* 0x038 */ TJ2DWindowDraw field_0x38;
/* 0x180 */ J2DTextBox field_0x180;
/* 0x2B0 */ TWindowText field_0x2b0;
/* 0x3D8 */ JUtility::TColor field_0x3d8;
/* 0x3DC */ JUtility::TColor field_0x3dc;
/* 0x3E0 */ JUtility::TColor field_0x3e0;
/* 0x3E4 */ JUtility::TColor field_0x3e4;
/* 0x3E8 */ int field_0x3e8;
/* 0x3EC */ u8 field_0x3ec;
void setMatrix(Mtx mtx) { MTXCopy(mtx, mMatrix); }
void setAlpha(u8 alpha) { field_0x38.setAlpha(alpha); }
void draw(int x, int y, const J2DGrafContext* p_grafCtx) { field_0x38.drawPane(x, y, p_grafCtx); }
};
#endif /* JAWWINDOW_H */
@@ -1,10 +0,0 @@
#ifndef JAWWINDOW3D_H
#define JAWWINDOW3D_H
#include "JSystem/JGeometry.h"
namespace JAWWindow3D {
extern JGeometry::TVec2<f32> sPtOrigin;
}
#endif /* JAWWINDOW3D_H */
-20
View File
@@ -1,20 +0,0 @@
#ifndef JAWBANKVIEW_H
#define JAWBANKVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWBankView : public JAWWindow {
public:
JAWBankView();
/* 0x3F0 */ int field_0x3f0;
/* 0x3F4 */ int field_0x3f4;
/* 0x3F8 */ int field_0x3f8;
/* 0x3FC */ int field_0x3fc;
/* 0x400 */ u8 field_0x400;
/* 0x404 */ int field_0x404;
/* 0x408 */ f32 field_0x408;
/* 0x40C */ u8 field_0x40c[4];
};
#endif /* JAWBANKVIEW_H */
-14
View File
@@ -1,14 +0,0 @@
#ifndef JAWCHVIEW_H
#define JAWCHVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWChView : public JAWWindow {
public:
JAWChView();
/* 0x3F0 */ int field_0x3f0;
/* 0x3F4 */ u8 field_0x3f4[4];
};
#endif /* JAWCHVIEW_H */
@@ -1,11 +0,0 @@
#ifndef JAWENTRYSEVIEW_H
#define JAWENTRYSEVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWEntrySeViewBasic : public JAWWindow {
public:
JAWEntrySeViewBasic();
};
#endif /* JAWENTRYSEVIEW_H */
@@ -1,11 +0,0 @@
#ifndef JAWHIOBANKEDIT_H
#define JAWHIOBANKEDIT_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWHioBankEdit : public JAWWindow {
public:
JAWHioBankEdit();
};
#endif /* JAWHIOBANKEDIT_H */
@@ -1,55 +0,0 @@
#ifndef JAWHIORECEIVER_H
#define JAWHIORECEIVER_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
#include "JSystem/JHostIO/JHIComm.h"
#include "JSystem/JHostIO/JHICommonMem.h"
#include "JSystem/JAudio2/JAISound.h"
struct JAISeqData;
class JADHioReceiver : JHITag<JHICmnMem> {
public:
JADHioReceiver();
virtual ~JADHioReceiver();
virtual void receive(const char*, s32);
virtual u32 parse(u32,char*, u32) = 0;
};
class JAWHioReceiver : public JAWWindow {
public:
class TSeqList {
public:
class TSeqData {
public:
};
bool getSeqData(JAISoundID, JAISeqData*) const;
/* 0x00 */ JSUList<TSeqData> mList;
};
class THioReceiver : public JADHioReceiver {
public:
THioReceiver();
virtual ~THioReceiver();
virtual u32 parse(u32,char*, u32);
/* 0x0C */ int field_0xc;
/* 0x10 */ u8 field_0x10;
/* 0x14 */ TSeqList field_0x14;
/* 0x20 */ int field_0x20;
/* 0x24 */ int field_0x24;
/* 0x28 */ int field_0x28;
/* 0x2C */ int field_0x2c;
};
JAWHioReceiver();
const TSeqList* getSeqList() const { return &field_0x3f0.field_0x14; }
/* 0x3F0 */ THioReceiver field_0x3f0;
};
#endif /* JAWHIORECEIVER_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef JAWPLAYSEVIEW_H
#define JAWPLAYSEVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWPlaySeViewBasic : public JAWWindow {
public:
JAWPlaySeViewBasic();
};
#endif /* JAWPLAYSEVIEW_H */
@@ -1,11 +0,0 @@
#ifndef JAWPLAYERCHVIEW_H
#define JAWPLAYERCHVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWPlayerChView : public JAWWindow {
public:
JAWPlayerChView();
};
#endif /* JAWPLAYERCHVIEW_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef JAWREPORTVIEW_H
#define JAWREPORTVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWReportView : public JAWWindow {
public:
JAWReportView();
};
#endif /* JAWREPORTVIEW_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef JAWSYSMEMVIEW_H
#define JAWSYSMEMVIEW_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWSysMemView : public JAWWindow {
public:
JAWSysMemView();
};
#endif /* JAWSYSMEMVIEW_H */
-11
View File
@@ -1,11 +0,0 @@
#ifndef JAWVOLUME_H
#define JAWVOLUME_H
#include "JSystem/JAWExtSystem/JAWWindow.h"
class JAWVolume : public JAWWindow {
public:
JAWVolume(int, int);
};
#endif /* JAWVOLUME_H */
-24
View File
@@ -1,24 +0,0 @@
#ifndef JAIAUDIBLE_H
#define JAIAUDIBLE_H
#include "JSystem/JGeometry.h"
struct JASSoundParams;
/**
* @ingroup jsystem-jaudio
*
*/
class JAIAudible {
public:
virtual ~JAIAudible();
virtual JASSoundParams* getOuterParams(int) = 0;
virtual void calc() = 0;
JGeometry::TVec3<float>& getPos() { return mPos; }
void setPos(const JGeometry::TVec3<float>& other) { mPos.set(other); }
/* 0x04 */ JGeometry::TVec3<float> mPos;
};
#endif /* JAIAUDIBLE_H */
-24
View File
@@ -1,24 +0,0 @@
#ifndef JAIAUDIENCE_H
#define JAIAUDIENCE_H
#include "JSystem/JGeometry.h"
class JAIAudible;
class JAISoundID;
struct JASSoundParams;
/**
* @ingroup jsystem-jaudio
*
*/
struct JAIAudience {
virtual ~JAIAudience();
virtual JAIAudible* newAudible(JGeometry::TVec3<f32> const&, JAISoundID,
JGeometry::TVec3<f32> const*, u32) = 0;
virtual int getMaxChannels() = 0;
virtual void deleteAudible(JAIAudible*) = 0;
virtual u32 calcPriority(JAIAudible*) = 0;
virtual void mixChannelOut(JASSoundParams const&, JAIAudible*, int) = 0;
};
#endif /* JAIAUDIENCE_H */
-58
View File
@@ -1,58 +0,0 @@
#ifndef JAISE_H
#define JAISE_H
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JASTrack.h"
class JAISeMgr;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISe : public JSULink<JAISe>, public JAISound, public JASPoolAllocObject<JAISe> {
public:
class TInner {
public:
TInner() : mSeqData(NULL, 0) {}
/* 0x000 */ u32 mProperPriority;
/* 0x004 */ u32 mPriority;
/* 0x008 */ JASSoundParams mSoundParams;
/* 0x01c */ JASTrack track;
/* 0x264 */ JAISeqData mSeqData;
/* 0x26c */ u8 field_0x26c;
/* 0x270 */ JAISeMgr* seMgr;
/* 0x274 */ JAISoundStrategyMgr<JAISe>* mSoundStrategyMgr;
/* 0x278 */ JAISoundStrategyMgr__unknown<JAISe>* field_0x278;
/* 0x27c */ JAITempoMgr mTempoMgr;
};
virtual s32 getNumChild() const;
virtual JAISoundChild* getChild(int);
virtual void releaseChild(int);
virtual JASTrack* getTrack();
virtual JASTrack* getChildTrack(int);
virtual JAISe* asSe();
virtual JAITempoMgr* getTempoMgr();
virtual bool JAISound_tryDie_();
JAISe(JAISeMgr* seMgr, JAISoundStrategyMgr<JAISe>* soundStrategyMgr, u32 priority);
void mixOut_(const JASSoundParams& params);
void stopTrack_();
void startTrack_(const JASSoundParams& params);
void JAISeCategoryMgr_mixOut_(bool, const JASSoundParams& params, JAISoundActivity activity);
void JAISeCategoryMgr_calc_();
void JAISeMgr_startID_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience);
bool prepare_getSeqData_();
void prepare_();
const JAISeqData* getSeqData() const { return &inner_.mSeqData; }
u32 JAISeCategoryMgr_getProperPriority_() const { return inner_.mProperPriority; }
u32 JAISeCategoryMgr_getPriority_() const { return inner_.mPriority; }
bool isFarAway() const { return inner_.mPriority == -1; }
/* 0x0ac */ TInner inner_;
};
#endif /* JAISE_H */
-147
View File
@@ -1,147 +0,0 @@
#ifndef JAISEMGR_H
#define JAISEMGR_H
#include "JSystem/JAudio2/JAISe.h"
#include "global.h"
struct JAIAudience;
struct JASSoundParams;
/**
* @ingroup jsystem-jaudio
*
*/
struct JASNonCopyable {
JASNonCopyable() {}
~JASNonCopyable() {}
/* 0x0 */ void* field_0x0;
}; // Size: 0x4
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeCategoryArrangementItem {
u8 mMaxActiveSe;
u8 mMaxInactiveSe;
};
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeCategoryArrangement {
JAISeCategoryArrangementItem mItems[16];
};
class JAISeMgr;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISeCategoryMgr : public JAISeqDataUser, public JASNonCopyable {
public:
void JAISeMgr_calc_();
void JAISeMgr_freeDeadSe_();
bool JAISeMgr_acceptsNewSe_(u32 priority) const;
void sortByPriority_();
void stop(u32 fadeTime);
void stop();
void stopSoundID(JAISoundID id);
void pause(bool);
void JAISeMgr_mixOut_(const JAISoundParamsMove& params, JAISoundActivity activity);
JAISeCategoryMgr() {
mParams.init();
mMaxActiveSe = 0;
mMaxInactiveSe = 0;
field_0x0 = NULL;
}
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
JAISoundParamsMove* getParams() { return &mParams; }
int getMaxSe() const {
if (mMaxActiveSe == 0) {
return 0;
}
return mMaxActiveSe + mMaxInactiveSe;
}
int getMaxInactiveSe() const { return mMaxInactiveSe; }
int getMaxActiveSe() const { return mMaxActiveSe; }
void setMaxActiveSe(int num) { mMaxActiveSe = num; }
void setMaxInactiveSe(int num) { mMaxInactiveSe = num; }
const JSUList<JAISe>* getSeList() const { return &mSeList; }
int getNumSe() const { return mSeList.getNumLinks(); }
JAIAudience* getAudience() { return (JAIAudience*)field_0x0; }
void JAISeMgr_appendSe_(JAISe* se) { mSeList.append(se); }
/* 0x08 */ JAISoundParamsMove mParams;
/* 0x58 */ JSUList<JAISe> mSeList;
/* 0x64 */ int mMaxInactiveSe;
/* 0x68 */ int mMaxActiveSe;
}; // Size: 0x6C
/**
* @ingroup jsystem-jaudio
*
*/
class JAISeMgr : public JASGlobalInstance<JAISeMgr>,
public JAISeqDataUser {
public:
JAISeMgr(bool setInstance);
void setCategoryArrangement(const JAISeCategoryArrangement& arrangement);
void getCategoryArrangement(JAISeCategoryArrangement*);
void stop();
void stopSoundID(JAISoundID id);
void initParams();
void setAudience(JAIAudience* audience);
void setSeqDataMgr(JAISeqDataMgr* seqDataMgr);
void resetSeqDataMgr();
JAISe* newSe_(int category, u32 priority);
void calc();
void mixOut();
bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr);
int getNumActiveSe() const;
/* 0x004 */ JAISoundActivity mSoundActivity;
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
JAISeCategoryMgr* getCategory(int categoryIndex) {
JUT_ASSERT(222, categoryIndex >= 0);
JUT_ASSERT(223, categoryIndex < NUM_CATEGORIES);
return &mCategoryMgrs[categoryIndex];
}
JAIAudience* getAudience() { return mAudience; }
JAIAudience* getAudience(int index) {
if (index >= 0 && index < NUM_CATEGORIES) {
JAIAudience* rv = mCategoryMgrs[index].getAudience();
if (rv) return rv;
}
return mAudience;
}
JAISeqDataMgr* getSeqDataMgr() { return mSeqDataMgr; }
JAISoundParamsMove* getParams() { return &mParams; }
bool isActive() const { return getNumActiveSe() > 0; }
static const int NUM_CATEGORIES = 16;
private:
/* 0x008 */ JAIAudience* mAudience;
/* 0x00C */ JAISeqDataMgr* mSeqDataMgr;
/* 0x010 */ JAISoundStrategyMgr<JAISe>* mStrategyMgr;
/* 0x014 */ JAISeCategoryMgr mCategoryMgrs[NUM_CATEGORIES];
/* 0x6D4 */ JAISoundParamsMove mParams;
}; // Size: 0x724
#if VERSION != VERSION_SHIELD_DEBUG
STATIC_ASSERT(sizeof(JAISeMgr) == 0x724);
#endif
#endif /* JAISEMGR_H */
-62
View File
@@ -1,62 +0,0 @@
#ifndef JAISEQ_H
#define JAISEQ_H
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JASTrack.h"
#include "JSystem/JSupport/JSUList.h"
class JAISeqMgr;
struct JAISoundChild;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISeq : public JAISound, public JSULink<JAISeq>, public JASPoolAllocObject<JAISeq> {
public:
static const int NUM_CHILDREN = 32;
class TInner {
public:
TInner() : mSeqData(NULL, 0) {}
/* 0x000 */ JASTrack outputTrack;
/* 0x248 */ JAISoundChild* mSoundChild[NUM_CHILDREN];
/* 0x2C8 */ JAITempoMgr mTempoMgr;
/* 0x2D8 */ JASSoundParams mSoundParams;
/* 0x2EC */ JAISeqData mSeqData;
/* 0x2F4 */ s32 field_0x39c;
/* 0x2F8 */ JAISeqMgr* seqMgr;
/* 0x2FC */ JAISoundStrategyMgr<JAISeq>* strategyMgr;
};
virtual s32 getNumChild() const;
virtual JAISoundChild* getChild(int index);
virtual void releaseChild(int index);
virtual JAISeq* asSeq();
virtual JASTrack* getTrack();
virtual JASTrack* getChildTrack(int);
virtual JAITempoMgr* getTempoMgr();
virtual bool JAISound_tryDie_();
JAISeq(JAISeqMgr* seqMgr, JAISoundStrategyMgr<JAISeq>* soundStrategyMgr);
void JAISeqMgr_startID_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience,
int category, int);
void playSeqData_(const JASSoundParams& params, JAISoundActivity activity);
void reserveChildTracks_(int);
void releaseChildTracks_();
bool prepare_getSeqData_();
bool prepare_(const JASSoundParams& params, JAISoundActivity activity);
void JAISeqMgr_calc_();
void die_();
void mixOut_(const JASSoundParams& params, JAISoundActivity activity);
void JAISeqMgr_mixOut_(const JASSoundParams& params, JAISoundActivity activity);
const JAISeqData& getSeqData() const { return inner_.mSeqData; }
s32 getCategory() const { return inner_.field_0x39c; }
/* 0x0A8 */ TInner inner_;
/* 0x3A8 */ JAISoundStrategyMgr__unknown<JAISeq>* field_0x3a8;
};
#endif /* JAISEQ_H */
-67
View File
@@ -1,67 +0,0 @@
#ifndef JAISEQDATAMGR_H
#define JAISEQDATAMGR_H
#include "JSystem/JAudio2/JAISound.h"
#include <stdint.h>
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeqData {
JAISeqData(const void* param_0, u32 param_1) {
field_0x0 = (void*)param_0;
field_0x4 = param_1;
}
void set(const void* param_0, u32 param_1) {
field_0x0 = (void*)param_0;
field_0x4 = param_1;
}
/* 0x00 */ void* field_0x0;
/* 0x04 */ u32 field_0x4;
};
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeqDataRegion {
bool intersects(const JAISeqData& seqData) const {
if ((uintptr_t)addr + size < (uintptr_t)seqData.field_0x0) {
return false;
}
if ((uintptr_t)seqData.field_0x0 + seqData.field_0x4 < (uintptr_t)addr) {
return false;
}
return true;
}
/* 0x00 */ u8* addr;
/* 0x04 */ u32 size;
};
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeqDataUser {
virtual ~JAISeqDataUser();
virtual bool isUsingSeqData(JAISeqDataRegion const&) = 0;
virtual int releaseSeqData(JAISeqDataRegion const&) = 0;
};
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISeqDataMgr {
enum SeqDataReturnValue{ SeqDataReturnValue_0 = 0, SeqDataReturnValue_1 = 1, SeqDataReturnValue_2 = 2};
virtual ~JAISeqDataMgr();
virtual SeqDataReturnValue getSeqData(JAISoundID, JAISeqData*) = 0;
virtual int releaseSeqData() = 0;
virtual bool setSeqDataUser(JAISeqDataUser*) = 0;
};
#endif /* JAISEQDATAMGR_H */
-72
View File
@@ -1,72 +0,0 @@
#ifndef JAISEQMGR_H
#define JAISEQMGR_H
#include "JSystem/JAudio2/JAISeqDataMgr.h"
#include "JSystem/JAudio2/JASGadget.h"
#include "JSystem/JSupport/JSUList.h"
struct JAIAudience;
class JAISeq;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISeqMgr : public JASGlobalInstance<JAISeqMgr>, public JAISeqDataUser {
public:
enum ReleaseSeqResult {
RELEASE_SEQ_1 = 1,
RELEASE_SEQ_2 = 2,
};
JAISeqMgr(bool setInstance);
void freeDeadSeq_();
bool startSound(JAISoundID id, JAISoundHandle* handle, const JGeometry::TVec3<f32>* posPtr);
void calc();
void stop();
void stop(u32 fadeTime);
void stopSoundID(JAISoundID id);
void mixOut();
JAISeq* beginStartSeq_();
bool endStartSeq_(JAISeq* seq, JAISoundHandle* handle);
/* 0x04 */ JAISoundActivity mActivity;
virtual ~JAISeqMgr() {}
virtual bool isUsingSeqData(const JAISeqDataRegion& seqDataRegion);
virtual int releaseSeqData(const JAISeqDataRegion& seqDataRegion);
void setAudience(JAIAudience* audience) { mAudience = audience; }
JAIAudience* getAudience() { return mAudience; }
JAISeqDataMgr* getSeqDataMgr() { return seqDataMgr_; }
void setSeqDataMgr(JAISeqDataMgr* seqDataMgr) {
JUT_ASSERT(124, !isActive());
resetSeqDataMgr();
seqDataMgr_ = seqDataMgr;
seqDataMgr_->setSeqDataUser(this);
}
void resetSeqDataMgr() {
JUT_ASSERT(131, !isActive());
if (seqDataMgr_) {
seqDataMgr_->setSeqDataUser(NULL);
seqDataMgr_ = NULL;
}
}
JAISoundParamsMove* getParams() { return &mMove; }
bool isActive() const { return mSeqList.getNumLinks() != 0; }
int getNumActiveSeqs() const { return mSeqList.getNumLinks(); }
void pause(bool paused) { mActivity.field_0x0.flags.flag2 = paused; }
private:
/* 0x08 */ JAIAudience* mAudience;
/* 0x0C */ JAISeqDataMgr* seqDataMgr_;
/* 0x10 */ JAISoundStrategyMgr<JAISeq>* field_0x10;
/* 0x14 */ JAISoundParamsMove mMove;
/* 0x64 */ JSUList<JAISeq> mSeqList;
/* 0x70 */ int field_0x70;
}; // Size: 0x74
#endif /* JAISEQMGR_H */
-378
View File
@@ -1,378 +0,0 @@
#ifndef JAISOUND_H
#define JAISOUND_H
#include "JSystem/JAudio2/JAISoundParams.h"
#include "JSystem/JAudio2/JAIAudible.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "global.h"
#include <cstdint>
class JAISound;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandle {
public:
JAISoundHandle() {sound_ = NULL;};
~JAISoundHandle() { releaseSound(); }
bool isSoundAttached() const { return sound_ != NULL; }
JAISound* getSound() {
JUT_ASSERT(41, sound_ != NULL);
return sound_;
}
JAISound* operator->() const {
JUT_ASSERT(58, sound_ != NULL);
return sound_;
}
operator bool() const { return isSoundAttached(); }
void releaseSound();
JAISound* sound_;
};
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundID {
public:
operator u32() const { return id_.composite_; }
JAISoundID(u32 id) { id_.composite_ = id; };
JAISoundID(const JAISoundID& other) { id_.composite_ = other.id_.composite_; };
JAISoundID() {}
bool isAnonymous() const { return id_.composite_ == -1; }
void setAnonymous() { id_.composite_ = -1; }
union {
u32 composite_;
struct {
union {
u16 value;
struct {
u8 sectionID;
u8 groupID;
} parts;
} type;
u16 waveID;
} info;
} id_;
};
struct JASTrack;
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundStatus_ {
s32 lockWhenPrepared();
s32 unlockIfLocked();
void init() {
field_0x0.value = 0;
field_0x1.value = 0;
*((u16*)&state) = 0;
userdata_ = 0;
}
bool isAlive() const { return state.unk != 6; }
bool isDead() const { return state.unk == 6;}
bool isPlaying() const { return state.unk == 5; }
bool isPrepared() const { return state.unk >= 3; }
bool isMute() const { return field_0x0.flags.mute; }
bool isPaused() const { return field_0x0.flags.paused; }
void pauseWhenOut() {
field_0x1.flags.flag3 = 1;
}
/* 0x0 */ union {
u8 value;
struct {
u8 mute : 1;
u8 paused : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x0;
/* 0x1 */ union {
u8 value;
struct {
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x1;
/* 0x2 */ struct {
u8 unk;
struct {
u8 flag1 : 1;
u8 calcedOnce : 1;
u8 animationState : 2;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} state;
/* 0x4 */ uintptr_t userdata_;
}; // Size: 0x8
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundFader {
void forceIn() {
value_ = 1.0f;
mTransition.zero();
}
void forceOut() {
value_ = 0.0f;
mTransition.zero();
}
void fadeOut(u32 maxSteps) {
if (maxSteps != 0) {
mTransition.set(0.0f, value_, maxSteps);
} else {
forceOut();
}
}
void fadeIn(u32 maxSteps) {
if (maxSteps != 0) {
mTransition.set(1.0f, value_, maxSteps);
} else {
forceIn();
}
}
void fadeInFromOut(u32 maxSteps) {
value_ = 0.0f;
fadeIn(maxSteps);
}
bool isOut() const {
return (mTransition.remainingSteps_ == 0 && value_ < 0.01f);
}
void calc() { value_ = mTransition.apply(value_); }
f32 getIntensity() const { return value_; }
/* 0x00 */ f32 value_;
/* 0x04 */ JAISoundParamsTransition::TTransition mTransition;
}; // Size: 0x10
/**
* @ingroup jsystem-jaudio
*
*/
template <typename A0>
struct JAISoundStrategyMgr__unknown {
virtual void virtual2();
virtual void calc(A0*);
virtual void virtual4(A0*, const JASSoundParams&);
};
/**
* @ingroup jsystem-jaudio
*
*/
template <typename A0>
struct JAISoundStrategyMgr {
virtual void virtual2();
virtual JAISoundStrategyMgr__unknown<A0>* calc(JAISoundID);
virtual void virtual4(JAISoundStrategyMgr__unknown<A0>*);
};
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundActivity {
public:
void init() { field_0x0.value = 0; }
/* 0x0 */ union {
u8 value;
struct {
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x0;
};
/**
* @ingroup jsystem-jaudio
*
*/
class JAITempoMgr {
public:
/* 0x00 */ f32 tempo_;
/* 0x04 */ JAISoundParamsTransition::TTransition transition_;
JAITempoMgr() { init(); }
void init() { setTempo(1.0f); }
void setTempo(f32 tempo) {
tempo_ = tempo;
transition_.zero();
}
f32 getTempo() const { return tempo_; }
void calc() { tempo_ = transition_.apply(tempo_); }
};
class JAISoundHandle;
class JAIAudible;
struct JAIAudience;
class JAISe;
class JAISeq;
struct JAISoundChild;
class JAIStream;
class JAITempoMgr;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISound {
public:
void releaseHandle();
void attachHandle(JAISoundHandle* handle);
JAISound();
void start_JAISound_(JAISoundID id, const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience);
bool acceptsNewAudible() const;
void newAudible(const JGeometry::TVec3<f32>&, JGeometry::TVec3<f32> const*, u32,
JAIAudience*);
void stop();
void stop(u32 fadeTime);
void die_JAISound_();
void increasePrepareCount_JAISound_();
bool calc_JAISound_();
void initTrack_JAISound_(JASTrack* track);
virtual s32 getNumChild() const = 0;
virtual JAISoundChild* getChild(int) = 0;
virtual void releaseChild(int) = 0;
virtual JAISe* asSe();
virtual JAISeq* asSeq();
virtual JAIStream* asStream();
virtual JASTrack* getTrack() = 0;
virtual JASTrack* getChildTrack(int) = 0;
virtual JAITempoMgr* getTempoMgr() = 0;
virtual bool JAISound_tryDie_() = 0;
JAISoundID getID() const { return soundID_; }
u32 getAnimationState() const { return status_.state.flags.animationState; }
bool isAnimated() const { return getAnimationState() != 0; }
void setAnimationState(u32 state) {
status_.state.flags.animationState = state;
}
uintptr_t getUserData() const { return status_.userdata_; }
void setUserData(uintptr_t userData) { status_.userdata_ = userData; }
JAIAudible* getAudible() { return audible_; }
bool isHandleAttached() const { return handle_ != NULL; }
bool hasLifeTime() const { return status_.field_0x1.flags.flag2; }
void removeLifeTime_() {
status_.field_0x1.flags.flag1 = false;
status_.field_0x1.flags.flag2 = 0;
}
bool isPrepared() const { return status_.isPrepared(); }
void unlockIfLocked() { status_.unlockIfLocked(); }
void lockWhenPrepared() { status_.lockWhenPrepared(); }
void stop_JAISound_() {
status_.state.flags.flag5 = 0;
status_.state.flags.flag1 = 1;
}
bool isStopping() const {
return status_.state.flags.flag1 && (!status_.state.flags.flag5 || fader_.isOut());
}
void pause(bool param_0) {
status_.field_0x0.flags.paused = param_0;
}
void updateLifeTime(u32 lifeTime) {
if (lifeTime > lifeTime_) {
lifeTime_ = lifeTime;
}
}
void setLifeTime(u32 lifeTime, bool param_1) {
JUT_ASSERT(333, status_.state.flags.calcedOnce == 0);
lifeTime_ = lifeTime;
setComesBack(param_1);
status_.field_0x1.flags.flag2 = 1;
}
void setComesBack(bool param_0) {
JUT_ASSERT(354, status_.state.flags.calcedOnce == 0);
status_.field_0x1.flags.flag1 = 1;
if (param_0) {
status_.pauseWhenOut();
}
}
bool setPos(const JGeometry::TVec3<f32>& pos) {
if (audible_ != NULL) {
audible_->setPos(pos);
}
return audible_ != NULL;
}
JAISoundFader* getFader() const { return (JAISoundFader*)&fader_; }
void fadeIn(u32 maxSteps) { fader_.fadeInFromOut(maxSteps); }
void fadeOut(u32 maxSteps) { fader_.fadeOut(maxSteps); }
JAISoundParamsProperty& getProperty() { return params_.property_; }
s32 getCount() const { return count_; }
JAISoundParamsMove& getAuxiliary() { return params_.move_; }
/* 0x04 */ JAISoundHandle* handle_;
/* 0x08 */ JAIAudible* audible_;
/* 0x0C */ JAIAudience* audience_;
/* 0x10 */ u32 lifeTime_;
/* 0x14 */ s32 prepareCount_;
/* 0x18 */ JAISoundID soundID_;
/* 0x1C */ JAISoundStatus_ status_;
/* 0x24 */ JAISoundFader fader_;
/* 0x34 */ u32 priority_;
/* 0x38 */ s32 count_;
/* 0x3C */ JAISoundParams params_;
}; // Size: 0x98
STATIC_ASSERT(sizeof(JAISound) == 0x98);
#endif /* JAISOUND_H */
-24
View File
@@ -1,24 +0,0 @@
#ifndef JAISOUNDCHILD_H
#define JAISOUNDCHILD_H
#include "JSystem/JAudio2/JAISoundParams.h"
#include "JSystem/JAudio2/JASHeapCtrl.h"
struct JASTrack;
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundChild : JASPoolAllocObject<JAISoundChild> {
void init();
void mixOut(JASTrack*);
void calc();
JAISoundChild() { init(); }
/* 0x00 */ JAISoundParamsMove mMove;
/* 0x50 */ JASSoundParams mParams;
}; // Size: 0x64
#endif /* JAISOUNDCHILD_H */
-31
View File
@@ -1,31 +0,0 @@
#ifndef JAISOUNDHANDLES_H
#define JAISOUNDHANDLES_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JUtility/JUTAssert.h"
class JAISound;
class JAISoundID;
/**
* @ingroup jsystem-jaudio
*
*/
class JAISoundHandles {
public:
JAISoundHandles(JAISoundHandle* handle, int handleNum) {
handle_ = handle;
numHandles_ = handleNum;
};
JAISoundHandle& operator[](int n) { return handle_[n]; }
JAISoundHandle* getHandleSoundID(JAISoundID id);
JAISoundHandle* getFreeHandle();
private:
JAISoundHandle* handle_;
int numHandles_;
};
#endif /* JAISOUNDHANDLES_H */
-22
View File
@@ -1,22 +0,0 @@
#ifndef JAISOUNDINFO_H
#define JAISOUNDINFO_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundInfo : public JASGlobalInstance<JAISoundInfo> {
JAISoundInfo(bool);
virtual int getSoundType(JAISoundID) const = 0;
virtual int getCategory(JAISoundID) const = 0;
virtual u32 getPriority(JAISoundID) const = 0;
virtual void getSeInfo(JAISoundID, JAISe*) const = 0;
virtual void getSeqInfo(JAISoundID, JAISeq*) const = 0;
virtual void getStreamInfo(JAISoundID, JAIStream*) const = 0;
virtual ~JAISoundInfo();
};
#endif /* JAISOUNDINFO_H */
-122
View File
@@ -1,122 +0,0 @@
#ifndef JAISOUNDPARAMS_H
#define JAISOUNDPARAMS_H
#include "JSystem/JAudio2/JASSoundParams.h"
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundParamsProperty {
void init() {
field_0x0 = 1.0f;
field_0x4 = 0.0f;
field_0x8 = 1.0f;
}
/* 0x00 */ f32 field_0x0;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
}; // Size: 0xC
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundParamsTransition {
struct TTransition {
void zero() {
step_ = 0.0f;
remainingSteps_ = 0;
targetValue_ = 0.0f;
}
void set(f32 newValue, f32 currentValue, u32 maxSteps) {
remainingSteps_ = maxSteps;
step_ = (newValue - currentValue) / remainingSteps_;
targetValue_ = newValue;
}
f32 apply(f32 value) {
if (remainingSteps_ > 1) {
remainingSteps_--;
value += step_;
} else {
if (remainingSteps_ == 1) {
remainingSteps_ = 0;
value = targetValue_;
}
}
return value;
}
/* 0x0 */ f32 step_;
/* 0x4 */ f32 targetValue_;
/* 0x8 */ u32 remainingSteps_;
}; // Size: 0xC
void init() {
volume_.zero();
pitch_.zero();
fxMix_.zero();
pan_.zero();
dolby_.zero();
}
void apply(JASSoundParams* params) {
params->mVolume = volume_.apply(params->mVolume);
params->mPitch = pitch_.apply(params->mPitch);
params->mFxMix = fxMix_.apply(params->mFxMix);
params->mDolby = dolby_.apply(params->mDolby);
params->mPan = pan_.apply(params->mPan);
}
/* 0x00 */ TTransition volume_;
/* 0x0C */ TTransition pitch_;
/* 0x18 */ TTransition fxMix_;
/* 0x24 */ TTransition pan_;
/* 0x30 */ TTransition dolby_;
}; // Size: 0x3C
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundParamsMove {
JAISoundParamsMove() : params_() {}
void init() {
params_.init();
transition_.init();
}
void calc() { transition_.apply(&params_); }
void moveVolume(f32 newValue, u32 maxSteps);
void movePitch(f32 newValue, u32 maxSteps);
void moveFxMix(f32 newValue, u32 maxSteps);
void movePan(f32 newValue, u32 maxSteps);
void moveDolby(f32 newValue, u32 maxSteps);
/* 0x00 */ JASSoundParams params_;
/* 0x14 */ JAISoundParamsTransition transition_;
}; // Size: 0x50
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundParams {
JAISoundParams() : move_() {}
void mixOutAll(const JASSoundParams& inParams, JASSoundParams* outParams, f32);
void init() {
move_.init();
property_.init();
}
/* 0x0 */ JAISoundParamsProperty property_;
/* 0xC */ JAISoundParamsMove move_;
}; // Size: 0x5C
#endif /* JAISOUNDPARAMS_H */
-19
View File
@@ -1,19 +0,0 @@
#ifndef JAISOUNDSTARTER_H
#define JAISOUNDSTARTER_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASGadget.h"
/**
* @ingroup jsystem-jaudio
*
*/
struct JAISoundStarter : public JASGlobalInstance<JAISoundStarter> {
JAISoundStarter(bool setInstance);
virtual ~JAISoundStarter();
virtual bool startSound(JAISoundID id, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr) = 0;
bool startLevelSound(JAISoundID id, JAISoundHandle* handlePtr, const JGeometry::TVec3<f32>* posPtr);
};
#endif /* JAISOUNDSTARTER_H */
-57
View File
@@ -1,57 +0,0 @@
#ifndef JAISTREAM_H
#define JAISTREAM_H
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASAramStream.h"
#include "JSystem/JSupport/JSUList.h"
class JAIStreamMgr;
/**
* @ingroup jsystem-jaudio
*
*/
class JAIStream : public JAISound, public JSULink<JAIStream>, public JASPoolAllocObject<JAIStream> {
public:
struct TInner {
JASAramStream aramStream_;
};
JAIStream(JAIStreamMgr* streamMgr, JAISoundStrategyMgr<JAIStream>* soundStrategyMgr);
void JAIStreamMgr_startID_(JAISoundID id, s32 streamFileEntry,
const JGeometry::TVec3<f32>* posPtr, JAIAudience* audience,
int category);
bool prepare_prepareStream_();
void prepare_();
void prepare_startStream_();
void JAIStreamMgr_mixOut_(const JASSoundParams& inParams, JAISoundActivity activity);
void die_JAIStream_();
bool JAISound_tryDie_();
void JAIStreamMgr_calc_();
s32 getNumChild() const;
JAISoundChild* getChild(int index);
void releaseChild(int index);
JASTrack* getTrack();
JASTrack* getChildTrack(int);
JAIStream* asStream();
JAITempoMgr* getTempoMgr();
void* JAIStreamMgr_getAramAddr_() const { return streamAramAddr_; }
static const int NUM_CHILDREN = 6;
/* 0x0A8 */ TInner inner_;
/* 0x290 */ int field_0x290;
/* 0x294 */ s32 field_0x294;
/* 0x298 */ int field_0x298;
/* 0x29C */ void* streamAramAddr_;
/* 0x2A0 */ JAISoundChild* children_[NUM_CHILDREN];
/* 0x2B8 */ JAIStreamMgr* streamMgr_;
/* 0x2BC */ JAISoundStrategyMgr__unknown<JAIStream>* field_0x2bc;
/* 0x2C0 */ JAISoundStrategyMgr<JAIStream>* field_0x2c0;
/* 0x2C4 */ bool field_0x2c4;
/* 0x2C5 */ u8 field_0x2c5;
/* 0x2C6 */ u8 field_0x2c6;
};
#endif /* JAISTREAM_H */

Some files were not shown because too many files have changed in this diff Show More