mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-09 12:37:18 -04:00
Merge branch 'main' of https://github.com/zeldaret/tp into compile
This commit is contained in:
@@ -27,9 +27,13 @@ enum J2DAnmKind {
|
||||
class J2DAnmBase {
|
||||
public:
|
||||
J2DAnmBase() {
|
||||
mFrame = 0;
|
||||
mFrame = 0.0f;
|
||||
mFrameMax = 0;
|
||||
}
|
||||
J2DAnmBase(s16 frameMax) {
|
||||
mFrame = 0.0f;
|
||||
mFrameMax = frameMax;
|
||||
}
|
||||
virtual ~J2DAnmBase() {}
|
||||
virtual void searchUpdateMaterialID(J2DScreen*) {}
|
||||
|
||||
@@ -54,10 +58,10 @@ class J2DAnmVtxColor : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmVtxColor() {
|
||||
mKind = KIND_VTX_COLOR;
|
||||
for (s32 i = 0; i < ARRAY_SIZEU(mAnmTableNum); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(mAnmTableNum); i++) {
|
||||
mAnmTableNum[i] = NULL;
|
||||
}
|
||||
for (s32 i = 0; i < ARRAY_SIZEU(mVtxColorIndexData); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(mVtxColorIndexData); i++) {
|
||||
mVtxColorIndexData[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +96,7 @@ struct J3DTextureSRTInfo;
|
||||
class J2DAnmVtxColorKey : public J2DAnmVtxColor {
|
||||
public:
|
||||
J2DAnmVtxColorKey() {
|
||||
for (s32 i = 0; i < ARRAY_SIZEU(mInfoTable); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(mInfoTable); i++) {
|
||||
mInfoTable[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +117,7 @@ public:
|
||||
class J2DAnmVtxColorFull : public J2DAnmVtxColor {
|
||||
public:
|
||||
J2DAnmVtxColorFull() {
|
||||
for (s32 i = 0; i < ARRAY_SIZEU(mInfoTable); i++) {
|
||||
for (int i = 0; i < ARRAY_SIZE(mInfoTable); i++) {
|
||||
mInfoTable[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -155,7 +159,7 @@ public:
|
||||
*/
|
||||
class J2DAnmTransform : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmTransform(f32* pScaleValues, s16* pRotationValues, f32* pTranslateValues) {
|
||||
J2DAnmTransform(s16 frameMax, f32* pScaleValues, s16* pRotationValues, f32* pTranslateValues) : J2DAnmBase(frameMax) {
|
||||
mScaleValues = pScaleValues;
|
||||
mRotationValues = pRotationValues;
|
||||
mTranslateValues = pTranslateValues;
|
||||
@@ -175,18 +179,18 @@ public:
|
||||
*/
|
||||
class J2DAnmTransformKey : public J2DAnmTransform {
|
||||
public:
|
||||
J2DAnmTransformKey() : J2DAnmTransform(NULL, NULL, NULL) {
|
||||
J2DAnmTransformKey() : J2DAnmTransform(0, NULL, NULL, NULL) {
|
||||
field_0x24 = 0;
|
||||
mInfoTable = NULL;
|
||||
}
|
||||
virtual ~J2DAnmTransformKey() {}
|
||||
virtual void getTransform(u16 p1, J3DTransformInfo* pInfo) const {
|
||||
this->calcTransform(getFrame(), p1, pInfo);
|
||||
this->calcTransform(mFrame, p1, pInfo);
|
||||
}
|
||||
virtual void calcTransform(f32, u16, J3DTransformInfo*) const;
|
||||
|
||||
/* 0x1C */ u8 field_0x1c[6];
|
||||
/* 0x22 */ s16 field_0x22;
|
||||
/* 0x22 */ u16 field_0x22;
|
||||
/* 0x24 */ u32 field_0x24;
|
||||
/* 0x28 */ J3DAnmTransformKeyTable* mInfoTable;
|
||||
};
|
||||
@@ -197,7 +201,7 @@ public:
|
||||
*/
|
||||
class J2DAnmTransformFull : public J2DAnmTransform {
|
||||
public:
|
||||
J2DAnmTransformFull() : J2DAnmTransform(NULL, NULL, NULL) { mTableInfo = NULL; }
|
||||
J2DAnmTransformFull() : J2DAnmTransform(0, NULL, NULL, NULL) { mTableInfo = NULL; }
|
||||
virtual ~J2DAnmTransformFull() {}
|
||||
virtual void getTransform(u16, J3DTransformInfo*) const;
|
||||
|
||||
@@ -214,21 +218,13 @@ class J2DAnmTextureSRTKey : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmTextureSRTKey() {
|
||||
field_0x10 = 0;
|
||||
field_0x1e = 0;
|
||||
field_0x1c = 0;
|
||||
field_0x1a = 0;
|
||||
mUpdateMaterialNum = 0;
|
||||
mUpdateMaterialNum = field_0x1a = field_0x1c = field_0x1e = 0;
|
||||
mInfoTable = NULL;
|
||||
mTranslationValues = NULL;
|
||||
mScaleValues = NULL;
|
||||
mScaleValues = mTranslationValues = NULL;
|
||||
mRotationValues = NULL;
|
||||
field_0x4c = 0;
|
||||
field_0x4a = 0;
|
||||
field_0x48 = 0;
|
||||
field_0x4e = 0;
|
||||
field_0x4e = field_0x48 = field_0x4a = field_0x4c = 0;
|
||||
field_0x5c = NULL;
|
||||
field_0x58 = NULL;
|
||||
field_0x50 = NULL;
|
||||
field_0x50 = field_0x58 = NULL;
|
||||
field_0x54 = NULL;
|
||||
field_0x7c = 0;
|
||||
mKind = KIND_TEXTURE_SRT;
|
||||
@@ -238,9 +234,15 @@ public:
|
||||
virtual ~J2DAnmTextureSRTKey() {}
|
||||
virtual void searchUpdateMaterialID(J2DScreen*);
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum / 3; }
|
||||
u16 getUpdateMaterialID(u16 i) const { return mUpdateMaterialID[i]; }
|
||||
u8 getUpdateTexMtxID(u16 i) const { return mUpdateTexMtxID[i]; }
|
||||
void getTransform(u16 param_1, J3DTextureSRTInfo* param_2) {
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -279,8 +281,13 @@ public:
|
||||
class J2DAnmTexPattern : public J2DAnmBase {
|
||||
public:
|
||||
struct J2DAnmTexPatternTIMGPointer {
|
||||
J2DAnmTexPatternTIMGPointer();
|
||||
~J2DAnmTexPatternTIMGPointer();
|
||||
J2DAnmTexPatternTIMGPointer() {
|
||||
mRes = NULL;
|
||||
mPalette = NULL;
|
||||
}
|
||||
~J2DAnmTexPatternTIMGPointer() {
|
||||
delete mPalette;
|
||||
}
|
||||
|
||||
/* 0x0 */ ResTIMG* mRes;
|
||||
/* 0x4 */ JUTPalette* mPalette;
|
||||
@@ -302,7 +309,10 @@ public:
|
||||
virtual ~J2DAnmTexPattern() { delete[] mTIMGPtrArray; }
|
||||
virtual void searchUpdateMaterialID(J2DScreen*);
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
|
||||
u16 getUpdateMaterialID(u16 i) const { return mUpdateMaterialID[i]; }
|
||||
u16 getUpdateMaterialID(u16 i) const {
|
||||
J3D_PANIC(619, i < mUpdateMaterialNum, "Error : range over.");
|
||||
return mUpdateMaterialID[i];
|
||||
}
|
||||
J3DAnmTexPatternFullTable* getAnmTable() const { return mAnmTable; }
|
||||
|
||||
/* 0x10 */ u16* mValues;
|
||||
@@ -321,39 +331,31 @@ public:
|
||||
class J2DAnmTevRegKey : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmTevRegKey() {
|
||||
mKRegUpdateMaterialNum = 0;
|
||||
mCRegUpdateMaterialNum = 0;
|
||||
field_0x1a = 0;
|
||||
field_0x18 = 0;
|
||||
field_0x16 = 0;
|
||||
field_0x14 = 0;
|
||||
field_0x22 = 0;
|
||||
field_0x20 = 0;
|
||||
field_0x1e = 0;
|
||||
field_0x1c = 0;
|
||||
mKRegUpdateMaterialID = NULL;
|
||||
mCRegUpdateMaterialID = NULL;
|
||||
mCAValues = NULL;
|
||||
mCBValues = NULL;
|
||||
mCGValues = NULL;
|
||||
mCRValues = NULL;
|
||||
mKAValues = NULL;
|
||||
mKBValues = NULL;
|
||||
mKGValues = NULL;
|
||||
mKRValues = NULL;
|
||||
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;
|
||||
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 { return mCRegUpdateMaterialID[i]; }
|
||||
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 { return mKRegUpdateMaterialID[i]; }
|
||||
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; }
|
||||
@@ -391,10 +393,7 @@ public:
|
||||
class J2DAnmColor : public J2DAnmBase {
|
||||
public:
|
||||
J2DAnmColor() {
|
||||
field_0x16 = 0;
|
||||
field_0x14 = 0;
|
||||
field_0x12 = 0;
|
||||
field_0x10 = 0;
|
||||
field_0x10 = field_0x12 = field_0x14 = field_0x16 = 0;
|
||||
mUpdateMaterialNum = 0;
|
||||
mUpdateMaterialID = NULL;
|
||||
mKind = KIND_COLOR;
|
||||
@@ -403,7 +402,10 @@ public:
|
||||
virtual void searchUpdateMaterialID(J2DScreen*);
|
||||
virtual void getColor(u16, _GXColor*) const {}
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
|
||||
u16 getUpdateMaterialID(u16 i) const { return mUpdateMaterialID[i]; }
|
||||
u16 getUpdateMaterialID(u16 i) const {
|
||||
J3D_PANIC(224, i < mUpdateMaterialNum, "Error : range over.");
|
||||
return mUpdateMaterialID[i];
|
||||
}
|
||||
|
||||
/* 0x10 */ u16 field_0x10;
|
||||
/* 0x12 */ u16 field_0x12;
|
||||
@@ -475,17 +477,12 @@ public:
|
||||
/* 0x40 */ J3DAnmColorFullTable* mInfoTable;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline f32 J2DHermiteInterpolation(f32, T*, T*, T*, T*, T*, T*);
|
||||
|
||||
template <>
|
||||
inline f32 J2DHermiteInterpolation<f32>(f32 f1, f32* f2, f32* f3, f32* f4, f32* f5, f32* f6,
|
||||
f32* f7) {
|
||||
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);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline f32 J2DHermiteInterpolation<s16>(__REGISTER f32 pp1, __REGISTER s16* pp2, __REGISTER s16* pp3,
|
||||
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__
|
||||
|
||||
@@ -49,6 +49,8 @@ public:
|
||||
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;
|
||||
|
||||
@@ -13,7 +13,7 @@ struct J2DResReference {
|
||||
/* 0x00 */ u16 mCount;
|
||||
/* 0x02 */ u16 mOffsets[1];
|
||||
|
||||
s8* getResReference(u16) const;
|
||||
char* getResReference(u16) const;
|
||||
char* getName(u16) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
virtual u32 getType() = 0;
|
||||
virtual u8 getMaxStage() = 0;
|
||||
virtual void setTexNo(u32, u16) {}
|
||||
virtual u32 getTexNo(u32) const { return 0xFFFF; }
|
||||
virtual u16 getTexNo(u32) const { return 0xFFFF; }
|
||||
virtual void setFontNo(u16) {}
|
||||
virtual u16 getFontNo() const { return 0xFFFF; }
|
||||
virtual void setTevOrder(u32, J2DTevOrder) {}
|
||||
@@ -127,46 +127,84 @@ public:
|
||||
virtual void loadTexture(_GXTexMapID, u32);
|
||||
virtual u32 getType() { return 'TVB1'; }
|
||||
virtual u8 getMaxStage() { return 1; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) { mTexNo[index] = texNo; }
|
||||
virtual u32 getTexNo(u32 index) const { return mTexNo[index]; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) {
|
||||
J3D_PANIC(241, index < 1, "Error : range over.");
|
||||
mTexNo[index] = texNo;
|
||||
}
|
||||
virtual u16 getTexNo(u32 index) const {
|
||||
J3D_PANIC(242, index < 1, "Error : range over.");
|
||||
return mTexNo[index];
|
||||
}
|
||||
virtual void setFontNo(u16 fontNo) { mFontNo = fontNo; }
|
||||
virtual u16 getFontNo() const { return mFontNo; }
|
||||
virtual void setTevOrder(u32 index, J2DTevOrder order) {
|
||||
J3D_PANIC(247, index < 1, "Error : range over.");
|
||||
mTevOrder[index] = order;
|
||||
}
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) { return &mTevOrder[index]; }
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) {
|
||||
J3D_PANIC(248, index < 1, "Error : range over.");
|
||||
return &mTevOrder[index];
|
||||
}
|
||||
virtual void setTevColor(u32 index, J2DGXColorS10 color) {
|
||||
J3D_PANIC(250, index < 4, "Error : range over.");
|
||||
mTevColor[index] = color;
|
||||
}
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) { return &mTevColor[index]; }
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) {
|
||||
J3D_PANIC(251, index < 4, "Error : range over.");
|
||||
return &mTevColor[index];
|
||||
}
|
||||
virtual void setTevKColor(u32 index, JUtility::TColor color) {
|
||||
J3D_PANIC(253, index < 4, "Error : range over.");
|
||||
mTevKColor[index] = color;
|
||||
}
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) { return &mTevKColor[index]; }
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) { mTevKColorSel[index] = sel; }
|
||||
virtual u8 getTevKColorSel(u32 index) { return mTevKColorSel[index]; }
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) { mTevKAlphaSel[index] = sel; }
|
||||
virtual u8 getTevKAlphaSel(u32 index) { return mTevKAlphaSel[index]; }
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) {
|
||||
J3D_PANIC(254, index < 4, "Error : range over.");
|
||||
return &mTevKColor[index];
|
||||
}
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(256, index < 1, "Error : range over.");
|
||||
mTevKColorSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKColorSel(u32 index) {
|
||||
J3D_PANIC(257, index < 1, "Error : range over.");
|
||||
return mTevKColorSel[index];
|
||||
}
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(259, index < 1, "Error : range over.");
|
||||
mTevKAlphaSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKAlphaSel(u32 index) {
|
||||
J3D_PANIC(260, index < 1, "Error : range over.");
|
||||
return mTevKAlphaSel[index];
|
||||
}
|
||||
virtual void setTevStageNum(u8 num) {}
|
||||
virtual u8 getTevStageNum() const { return 1; }
|
||||
virtual void setTevStage(u32 index, J2DTevStage stage) {
|
||||
J3D_PANIC(265, index < 1, "Error : range over.");
|
||||
mTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DTevStage* getTevStage(u32 index) { return &mTevStage[index]; }
|
||||
virtual J2DTevStage* getTevStage(u32 index) {
|
||||
J3D_PANIC(266, index < 1, "Error : range over.");
|
||||
return &mTevStage[index];
|
||||
}
|
||||
virtual void setTevSwapModeInfo(u32 index, J2DTevSwapModeInfo info) {
|
||||
J3D_PANIC(268, index < 1, "Error : range over.");
|
||||
mTevStage[index].setTevSwapModeInfo(info);
|
||||
}
|
||||
virtual void setTevSwapModeTable(u32 index, J2DTevSwapModeTable table) {
|
||||
J3D_PANIC(270, index < 4, "Error : range over.");
|
||||
mTevSwapModeTable[index] = table;
|
||||
}
|
||||
virtual J2DTevSwapModeTable* getTevSwapModeTable(u32 index) {
|
||||
J3D_PANIC(271, index < 4, "Error : range over.");
|
||||
return &mTevSwapModeTable[index];
|
||||
}
|
||||
virtual void setIndTevStage(u32 index, J2DIndTevStage stage) {
|
||||
J3D_PANIC(273, index < 1, "Error : range over.");
|
||||
mIndTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DIndTevStage* getIndTevStage(u32 index) {
|
||||
J3D_PANIC(274, index < 1, "Error : range over.");
|
||||
return &mIndTevStage[index];
|
||||
}
|
||||
virtual bool insertTexture(u32 index, ResTIMG const* p_timg) {
|
||||
@@ -182,14 +220,20 @@ public:
|
||||
virtual bool setPalette(u32, ResTLUT const*);
|
||||
virtual bool prepareTexture(u8);
|
||||
virtual JUTTexture* getTexture(u32 index) {
|
||||
return index >= 1 ? NULL : mTexture[index];
|
||||
if (index >= 1) {
|
||||
return NULL;
|
||||
}
|
||||
return mTexture[index];
|
||||
}
|
||||
virtual JUTPalette* getPalette(u32 index) {
|
||||
return index >= 1 ? NULL : mPalette[index];
|
||||
if (index >= 1) {
|
||||
return NULL;
|
||||
}
|
||||
return mPalette[index];
|
||||
}
|
||||
virtual JUTFont* getFont() { return mFont; }
|
||||
virtual void shiftDeleteFlag(u8, bool);
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag &= flag; }
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag = mUndeleteFlag & flag; }
|
||||
virtual void setFontUndeleteFlag() { mUndeleteFlag &= 0x7F; }
|
||||
virtual ~J2DTevBlock1();
|
||||
|
||||
@@ -223,46 +267,84 @@ public:
|
||||
virtual void loadTexture(_GXTexMapID, u32);
|
||||
virtual u32 getType() { return 'TVB2'; }
|
||||
virtual u8 getMaxStage() { return 2; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) { mTexNo[index] = texNo; }
|
||||
virtual u32 getTexNo(u32 index) const { return mTexNo[index]; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) {
|
||||
J3D_PANIC(351, index < 2, "Error : range over.");
|
||||
mTexNo[index] = texNo;
|
||||
}
|
||||
virtual u16 getTexNo(u32 index) const {
|
||||
J3D_PANIC(352, index < 2, "Error : range over.");
|
||||
return mTexNo[index];
|
||||
}
|
||||
virtual void setFontNo(u16 fontNo) { mFontNo = fontNo; }
|
||||
virtual u16 getFontNo() const { return mFontNo; }
|
||||
virtual void setTevOrder(u32 index, J2DTevOrder order) {
|
||||
J3D_PANIC(357, index < 2, "Error : range over.");
|
||||
mTevOrder[index] = order;
|
||||
}
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) { return &mTevOrder[index]; }
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) {
|
||||
J3D_PANIC(358, index < 2, "Error : range over.");
|
||||
return &mTevOrder[index];
|
||||
}
|
||||
virtual void setTevColor(u32 index, J2DGXColorS10 color) {
|
||||
J3D_PANIC(360, index < 4, "Error : range over.");
|
||||
mTevColor[index] = color;
|
||||
}
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) { return &mTevColor[index]; }
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) {
|
||||
J3D_PANIC(361, index < 4, "Error : range over.");
|
||||
return &mTevColor[index];
|
||||
}
|
||||
virtual void setTevKColor(u32 index, JUtility::TColor color) {
|
||||
J3D_PANIC(363, index < 4, "Error : range over.");
|
||||
mTevKColor[index] = color;
|
||||
}
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) { return &mTevKColor[index]; }
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) { mTevKColorSel[index] = sel; }
|
||||
virtual u8 getTevKColorSel(u32 index) { return mTevKColorSel[index]; }
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) { mTevKAlphaSel[index] = sel; }
|
||||
virtual u8 getTevKAlphaSel(u32 index) { return mTevKAlphaSel[index]; }
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) {
|
||||
J3D_PANIC(364, index < 4, "Error : range over.");
|
||||
return &mTevKColor[index];
|
||||
}
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(366, index < 2, "Error : range over.");
|
||||
mTevKColorSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKColorSel(u32 index) {
|
||||
J3D_PANIC(367, index < 2, "Error : range over.");
|
||||
return mTevKColorSel[index];
|
||||
}
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(369, index < 2, "Error : range over.");
|
||||
mTevKAlphaSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKAlphaSel(u32 index) {
|
||||
J3D_PANIC(370, index < 2, "Error : range over.");
|
||||
return mTevKAlphaSel[index];
|
||||
}
|
||||
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
|
||||
virtual u8 getTevStageNum() const { return mTevStageNum; }
|
||||
virtual void setTevStage(u32 index, J2DTevStage stage) {
|
||||
J3D_PANIC(375, index < 2, "Error : range over.");
|
||||
mTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DTevStage* getTevStage(u32 index) { return &mTevStage[index]; }
|
||||
virtual J2DTevStage* getTevStage(u32 index) {
|
||||
J3D_PANIC(376, index < 2, "Error : range over.");
|
||||
return &mTevStage[index];
|
||||
}
|
||||
virtual void setTevSwapModeInfo(u32 index, J2DTevSwapModeInfo info) {
|
||||
J3D_PANIC(378, index < 2, "Error : range over.");
|
||||
mTevStage[index].setTevSwapModeInfo(info);
|
||||
}
|
||||
virtual void setTevSwapModeTable(u32 index, J2DTevSwapModeTable table) {
|
||||
J3D_PANIC(380, index < 4, "Error : range over.");
|
||||
mTevSwapModeTable[index] = table;
|
||||
}
|
||||
virtual J2DTevSwapModeTable* getTevSwapModeTable(u32 index) {
|
||||
J3D_PANIC(381, index < 4, "Error : range over.");
|
||||
return &mTevSwapModeTable[index];
|
||||
}
|
||||
virtual void setIndTevStage(u32 index, J2DIndTevStage stage) {
|
||||
J3D_PANIC(383, index < 2, "Error : range over.");
|
||||
mIndTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DIndTevStage* getIndTevStage(u32 index) {
|
||||
J3D_PANIC(384, index < 2, "Error : range over.");
|
||||
return &mIndTevStage[index];
|
||||
}
|
||||
virtual bool insertTexture(u32 index, ResTIMG const* p_timg) {
|
||||
@@ -278,14 +360,20 @@ public:
|
||||
virtual bool setPalette(u32, ResTLUT const*);
|
||||
virtual bool prepareTexture(u8);
|
||||
virtual JUTTexture* getTexture(u32 index) {
|
||||
return index >= 2 ? NULL : mTexture[index];
|
||||
if (index >= 2) {
|
||||
return NULL;
|
||||
}
|
||||
return mTexture[index];
|
||||
}
|
||||
virtual JUTPalette* getPalette(u32 index) {
|
||||
return index >= 2 ? NULL : mPalette[index];
|
||||
if (index >= 2) {
|
||||
return NULL;
|
||||
}
|
||||
return mPalette[index];
|
||||
}
|
||||
virtual JUTFont* getFont() { return mFont; }
|
||||
virtual void shiftDeleteFlag(u8, bool);
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag &= flag; }
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag = mUndeleteFlag & flag; }
|
||||
virtual void setFontUndeleteFlag() { mUndeleteFlag &= 0x7F; }
|
||||
virtual ~J2DTevBlock2();
|
||||
|
||||
@@ -321,46 +409,84 @@ public:
|
||||
virtual void loadTexture(_GXTexMapID, u32);
|
||||
virtual u32 getType() { return 'TVB4'; }
|
||||
virtual u8 getMaxStage() { return 4; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) { mTexNo[index] = texNo; }
|
||||
virtual u32 getTexNo(u32 index) const { return mTexNo[index]; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) {
|
||||
J3D_PANIC(459, index < 4, "Error : range over.");
|
||||
mTexNo[index] = texNo;
|
||||
}
|
||||
virtual u16 getTexNo(u32 index) const {
|
||||
J3D_PANIC(460, index < 4, "Error : range over.");
|
||||
return mTexNo[index];
|
||||
}
|
||||
virtual void setFontNo(u16 fontNo) { mFontNo = fontNo; }
|
||||
virtual u16 getFontNo() const { return mFontNo; }
|
||||
virtual void setTevOrder(u32 index, J2DTevOrder order) {
|
||||
J3D_PANIC(465, index < 4, "Error : range over.");
|
||||
mTevOrder[index] = order;
|
||||
}
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) { return &mTevOrder[index]; }
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) {
|
||||
J3D_PANIC(466, index < 4, "Error : range over.");
|
||||
return &mTevOrder[index];
|
||||
}
|
||||
virtual void setTevColor(u32 index, J2DGXColorS10 color) {
|
||||
J3D_PANIC(468, index < 4, "Error : range over.");
|
||||
mTevColor[index] = color;
|
||||
}
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) { return &mTevColor[index]; }
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) {
|
||||
J3D_PANIC(469, index < 4, "Error : range over.");
|
||||
return &mTevColor[index];
|
||||
}
|
||||
virtual void setTevKColor(u32 index, JUtility::TColor color) {
|
||||
J3D_PANIC(471, index < 4, "Error : range over.");
|
||||
mTevKColor[index] = color;
|
||||
}
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) { return &mTevKColor[index]; }
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) { mTevKColorSel[index] = sel; }
|
||||
virtual u8 getTevKColorSel(u32 index) { return mTevKColorSel[index]; }
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) { mTevKAlphaSel[index] = sel; }
|
||||
virtual u8 getTevKAlphaSel(u32 index) { return mTevKAlphaSel[index]; }
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) {
|
||||
J3D_PANIC(472, index < 4, "Error : range over.");
|
||||
return &mTevKColor[index];
|
||||
}
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(474, index < 4, "Error : range over.");
|
||||
mTevKColorSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKColorSel(u32 index) {
|
||||
J3D_PANIC(475, index < 4, "Error : range over.");
|
||||
return mTevKColorSel[index];
|
||||
}
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(477, index < 4, "Error : range over.");
|
||||
mTevKAlphaSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKAlphaSel(u32 index) {
|
||||
J3D_PANIC(478, index < 4, "Error : range over.");
|
||||
return mTevKAlphaSel[index];
|
||||
}
|
||||
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
|
||||
virtual u8 getTevStageNum() const { return mTevStageNum; }
|
||||
virtual void setTevStage(u32 index, J2DTevStage stage) {
|
||||
J3D_PANIC(483, index < 4, "Error : range over.");
|
||||
mTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DTevStage* getTevStage(u32 index) { return &mTevStage[index]; }
|
||||
virtual J2DTevStage* getTevStage(u32 index) {
|
||||
J3D_PANIC(484, index < 4, "Error : range over.");
|
||||
return &mTevStage[index];
|
||||
}
|
||||
virtual void setTevSwapModeInfo(u32 index, J2DTevSwapModeInfo info) {
|
||||
J3D_PANIC(486, index < 4, "Error : range over.");
|
||||
mTevStage[index].setTevSwapModeInfo(info);
|
||||
}
|
||||
virtual void setTevSwapModeTable(u32 index, J2DTevSwapModeTable table) {
|
||||
J3D_PANIC(488, index < 4, "Error : range over.");
|
||||
mTevSwapModeTable[index] = table;
|
||||
}
|
||||
virtual J2DTevSwapModeTable* getTevSwapModeTable(u32 index) {
|
||||
J3D_PANIC(489, index < 4, "Error : range over.");
|
||||
return &mTevSwapModeTable[index];
|
||||
}
|
||||
virtual void setIndTevStage(u32 index, J2DIndTevStage stage) {
|
||||
J3D_PANIC(491, index < 4, "Error : range over.");
|
||||
mIndTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DIndTevStage* getIndTevStage(u32 index) {
|
||||
J3D_PANIC(492, index < 4, "Error : range over.");
|
||||
return &mIndTevStage[index];
|
||||
}
|
||||
virtual bool insertTexture(u32 index, ResTIMG const* p_timg) {
|
||||
@@ -376,14 +502,20 @@ public:
|
||||
virtual bool setPalette(u32, ResTLUT const*);
|
||||
virtual bool prepareTexture(u8);
|
||||
virtual JUTTexture* getTexture(u32 index) {
|
||||
return index >= 4 ? NULL : mTexture[index];
|
||||
if (index >= 4) {
|
||||
return NULL;
|
||||
}
|
||||
return mTexture[index];
|
||||
}
|
||||
virtual JUTPalette* getPalette(u32 index) {
|
||||
return index >= 4 ? NULL : mPalette[index];
|
||||
if (index >= 4) {
|
||||
return NULL;
|
||||
}
|
||||
return mPalette[index];
|
||||
}
|
||||
virtual JUTFont* getFont() { return mFont; }
|
||||
virtual void shiftDeleteFlag(u8, bool);
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag &= flag; }
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag = mUndeleteFlag & flag; }
|
||||
virtual void setFontUndeleteFlag() { mUndeleteFlag &= 0x7F; }
|
||||
virtual ~J2DTevBlock4();
|
||||
|
||||
@@ -419,46 +551,84 @@ public:
|
||||
virtual void loadTexture(_GXTexMapID, u32);
|
||||
virtual u32 getType() { return 'TVB8'; }
|
||||
virtual u8 getMaxStage() { return 8; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) { mTexNo[index] = texNo; }
|
||||
virtual u32 getTexNo(u32 index) const { return mTexNo[index]; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) {
|
||||
J3D_PANIC(570, index < 8, "Error : range over.");
|
||||
mTexNo[index] = texNo;
|
||||
}
|
||||
virtual u16 getTexNo(u32 index) const {
|
||||
J3D_PANIC(571, index < 8, "Error : range over.");
|
||||
return mTexNo[index];
|
||||
}
|
||||
virtual void setFontNo(u16 fontNo) { mFontNo = fontNo; }
|
||||
virtual u16 getFontNo() const { return mFontNo; }
|
||||
virtual void setTevOrder(u32 index, J2DTevOrder order) {
|
||||
J3D_PANIC(576, index < 8, "Error : range over.");
|
||||
mTevOrder[index] = order;
|
||||
}
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) { return &mTevOrder[index]; }
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) {
|
||||
J3D_PANIC(577, index < 8, "Error : range over.");
|
||||
return &mTevOrder[index];
|
||||
}
|
||||
virtual void setTevColor(u32 index, J2DGXColorS10 color) {
|
||||
J3D_PANIC(579, index < 4, "Error : range over.");
|
||||
mTevColor[index] = color;
|
||||
}
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) { return &mTevColor[index]; }
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) {
|
||||
J3D_PANIC(580, index < 4, "Error : range over.");
|
||||
return &mTevColor[index];
|
||||
}
|
||||
virtual void setTevKColor(u32 index, JUtility::TColor color) {
|
||||
J3D_PANIC(582, index < 4, "Error : range over.");
|
||||
mTevKColor[index] = color;
|
||||
}
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) { return &mTevKColor[index]; }
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) { mTevKColorSel[index] = sel; }
|
||||
virtual u8 getTevKColorSel(u32 index) { return mTevKColorSel[index]; }
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) { mTevKAlphaSel[index] = sel; }
|
||||
virtual u8 getTevKAlphaSel(u32 index) { return mTevKAlphaSel[index]; }
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) {
|
||||
J3D_PANIC(583, index < 4, "Error : range over.");
|
||||
return &mTevKColor[index];
|
||||
}
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(585, index < 8, "Error : range over.");
|
||||
mTevKColorSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKColorSel(u32 index) {
|
||||
J3D_PANIC(586, index < 8, "Error : range over.");
|
||||
return mTevKColorSel[index];
|
||||
}
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(588, index < 8, "Error : range over.");
|
||||
mTevKAlphaSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKAlphaSel(u32 index) {
|
||||
J3D_PANIC(589, index < 8, "Error : range over.");
|
||||
return mTevKAlphaSel[index];
|
||||
}
|
||||
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
|
||||
virtual u8 getTevStageNum() const { return mTevStageNum; }
|
||||
virtual void setTevStage(u32 index, J2DTevStage stage) {
|
||||
J3D_PANIC(594, index < 8, "Error : range over.");
|
||||
mTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DTevStage* getTevStage(u32 index) { return &mTevStage[index]; }
|
||||
virtual J2DTevStage* getTevStage(u32 index) {
|
||||
J3D_PANIC(595, index < 8, "Error : range over.");
|
||||
return &mTevStage[index];
|
||||
}
|
||||
virtual void setTevSwapModeInfo(u32 index, J2DTevSwapModeInfo info) {
|
||||
J3D_PANIC(597, index < 8, "Error : range over.");
|
||||
mTevStage[index].setTevSwapModeInfo(info);
|
||||
}
|
||||
virtual void setTevSwapModeTable(u32 index, J2DTevSwapModeTable table) {
|
||||
J3D_PANIC(599, index < 4, "Error : range over.");
|
||||
mTevSwapModeTable[index] = table;
|
||||
}
|
||||
virtual J2DTevSwapModeTable* getTevSwapModeTable(u32 index) {
|
||||
J3D_PANIC(600, index < 4, "Error : range over.");
|
||||
return &mTevSwapModeTable[index];
|
||||
}
|
||||
virtual void setIndTevStage(u32 index, J2DIndTevStage stage) {
|
||||
J3D_PANIC(602, index < 8, "Error : range over.");
|
||||
mIndTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DIndTevStage* getIndTevStage(u32 index) {
|
||||
J3D_PANIC(603, index < 8, "Error : range over.");
|
||||
return &mIndTevStage[index];
|
||||
}
|
||||
virtual bool insertTexture(u32 index, ResTIMG const* p_timg) {
|
||||
@@ -474,14 +644,20 @@ public:
|
||||
virtual bool setPalette(u32, ResTLUT const*);
|
||||
virtual bool prepareTexture(u8);
|
||||
virtual JUTTexture* getTexture(u32 index) {
|
||||
return index >= 8 ? NULL : mTexture[index];
|
||||
if (index >= 8) {
|
||||
return NULL;
|
||||
}
|
||||
return mTexture[index];
|
||||
}
|
||||
virtual JUTPalette* getPalette(u32 index) {
|
||||
return index >= 8 ? NULL : mPalette[index];
|
||||
if (index >= 8) {
|
||||
return NULL;
|
||||
}
|
||||
return mPalette[index];
|
||||
}
|
||||
virtual JUTFont* getFont() { return mFont; }
|
||||
virtual void shiftDeleteFlag(u8, bool);
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag &= flag; }
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag = mUndeleteFlag & flag; }
|
||||
virtual void setFontUndeleteFlag() { mFontUndeleteFlag = false; }
|
||||
virtual ~J2DTevBlock8();
|
||||
|
||||
@@ -518,46 +694,84 @@ public:
|
||||
virtual void loadTexture(_GXTexMapID, u32);
|
||||
virtual u32 getType() { return 'TV16'; }
|
||||
virtual u8 getMaxStage() { return 16; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) { mTexNo[index] = texNo; }
|
||||
virtual u32 getTexNo(u32 index) const { return mTexNo[index]; }
|
||||
virtual void setTexNo(u32 index, u16 texNo) {
|
||||
J3D_PANIC(682, index < 8, "Error : range over.");
|
||||
mTexNo[index] = texNo;
|
||||
}
|
||||
virtual u16 getTexNo(u32 index) const {
|
||||
J3D_PANIC(683, index < 8, "Error : range over.");
|
||||
return mTexNo[index];
|
||||
}
|
||||
virtual void setFontNo(u16 fontNo) { mFontNo = fontNo; }
|
||||
virtual u16 getFontNo() const { return mFontNo; }
|
||||
virtual void setTevOrder(u32 index, J2DTevOrder order) {
|
||||
J3D_PANIC(688, index < 16, "Error : range over.");
|
||||
mTevOrder[index] = order;
|
||||
}
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) { return &mTevOrder[index]; }
|
||||
virtual J2DTevOrder* getTevOrder(u32 index) {
|
||||
J3D_PANIC(689, index < 16, "Error : range over.");
|
||||
return &mTevOrder[index];
|
||||
}
|
||||
virtual void setTevColor(u32 index, J2DGXColorS10 color) {
|
||||
J3D_PANIC(691, index < 4, "Error : range over.");
|
||||
mTevColor[index] = color;
|
||||
}
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) { return &mTevColor[index]; }
|
||||
virtual J2DGXColorS10* getTevColor(u32 index) {
|
||||
J3D_PANIC(692, index < 4, "Error : range over.");
|
||||
return &mTevColor[index];
|
||||
}
|
||||
virtual void setTevKColor(u32 index, JUtility::TColor color) {
|
||||
J3D_PANIC(694, index < 4, "Error : range over.");
|
||||
mTevKColor[index] = color;
|
||||
}
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) { return &mTevKColor[index]; }
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) { mTevKColorSel[index] = sel; }
|
||||
virtual u8 getTevKColorSel(u32 index) { return mTevKColorSel[index]; }
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) { mTevKAlphaSel[index] = sel; }
|
||||
virtual u8 getTevKAlphaSel(u32 index) { return mTevKAlphaSel[index]; }
|
||||
virtual JUtility::TColor* getTevKColor(u32 index) {
|
||||
J3D_PANIC(695, index < 4, "Error : range over.");
|
||||
return &mTevKColor[index];
|
||||
}
|
||||
virtual void setTevKColorSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(697, index < 16, "Error : range over.");
|
||||
mTevKColorSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKColorSel(u32 index) {
|
||||
J3D_PANIC(698, index < 16, "Error : range over.");
|
||||
return mTevKColorSel[index];
|
||||
}
|
||||
virtual void setTevKAlphaSel(u32 index, u8 sel) {
|
||||
J3D_PANIC(700, index < 16, "Error : range over.");
|
||||
mTevKAlphaSel[index] = sel;
|
||||
}
|
||||
virtual u8 getTevKAlphaSel(u32 index) {
|
||||
J3D_PANIC(701, index < 16, "Error : range over.");
|
||||
return mTevKAlphaSel[index];
|
||||
}
|
||||
virtual void setTevStageNum(u8 num) { mTevStageNum = num; }
|
||||
virtual u8 getTevStageNum() const { return mTevStageNum; }
|
||||
virtual void setTevStage(u32 index, J2DTevStage stage) {
|
||||
J3D_PANIC(706, index < 16, "Error : range over.");
|
||||
mTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DTevStage* getTevStage(u32 index) { return &mTevStage[index]; }
|
||||
virtual J2DTevStage* getTevStage(u32 index) {
|
||||
J3D_PANIC(707, index < 16, "Error : range over.");
|
||||
return &mTevStage[index];
|
||||
}
|
||||
virtual void setTevSwapModeInfo(u32 index, J2DTevSwapModeInfo info) {
|
||||
J3D_PANIC(709, index < 16, "Error : range over.");
|
||||
mTevStage[index].setTevSwapModeInfo(info);
|
||||
}
|
||||
virtual void setTevSwapModeTable(u32 index, J2DTevSwapModeTable table) {
|
||||
J3D_PANIC(711, index < 4, "Error : range over.");
|
||||
mTevSwapModeTable[index] = table;
|
||||
}
|
||||
virtual J2DTevSwapModeTable* getTevSwapModeTable(u32 index) {
|
||||
J3D_PANIC(712, index < 4, "Error : range over.");
|
||||
return &mTevSwapModeTable[index];
|
||||
}
|
||||
virtual void setIndTevStage(u32 index, J2DIndTevStage stage) {
|
||||
J3D_PANIC(714, index < 16, "Error : range over.");
|
||||
mIndTevStage[index] = stage;
|
||||
}
|
||||
virtual J2DIndTevStage* getIndTevStage(u32 index) {
|
||||
J3D_PANIC(715, index < 16, "Error : range over.");
|
||||
return &mIndTevStage[index];
|
||||
}
|
||||
virtual bool insertTexture(u32 index, ResTIMG const* p_timg) {
|
||||
@@ -573,14 +787,20 @@ public:
|
||||
virtual bool setPalette(u32, ResTLUT const*);
|
||||
virtual bool prepareTexture(u8);
|
||||
virtual JUTTexture* getTexture(u32 index) {
|
||||
return index >= 8 ? NULL : mTexture[index];
|
||||
if (index >= 8) {
|
||||
return NULL;
|
||||
}
|
||||
return mTexture[index];
|
||||
}
|
||||
virtual JUTPalette* getPalette(u32 index) {
|
||||
return index >= 8 ? NULL : mPalette[index];
|
||||
if (index >= 8) {
|
||||
return NULL;
|
||||
}
|
||||
return mPalette[index];
|
||||
}
|
||||
virtual JUTFont* getFont() { return mFont; }
|
||||
virtual void shiftDeleteFlag(u8, bool);
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag &= flag; }
|
||||
virtual void setUndeleteFlag(u8 flag) { mUndeleteFlag = mUndeleteFlag & flag; }
|
||||
virtual void setFontUndeleteFlag() { mFontUndeleteFlag = false; }
|
||||
virtual ~J2DTevBlock16();
|
||||
|
||||
@@ -619,8 +839,8 @@ struct J2DAlphaCompInfo {
|
||||
/* 0x7 */ u8 field_0x7;
|
||||
};
|
||||
|
||||
inline u16 J2DCalcAlphaCmp(s32 param_1, u32 param_2, u32 param_3) {
|
||||
return ((param_1) << 5) | ((param_2 & 0xff) << 3) | (param_3 & 0xff);
|
||||
inline u16 J2DCalcAlphaCmp(u8 param_1, u8 param_2, u8 param_3) {
|
||||
return (param_1 << 5) | (param_2 << 3) | param_3;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -643,11 +863,11 @@ struct J2DAlphaComp {
|
||||
mRef0 = other.mRef0;
|
||||
mRef1 = other.mRef1;
|
||||
}
|
||||
u8 getComp0() { return mAlphaCmp >> 5 & 7; }
|
||||
u8 getRef0() { return mRef0; }
|
||||
u8 getOp() { return mAlphaCmp >> 3 & 3; }
|
||||
u8 getComp1() { return mAlphaCmp & 7; }
|
||||
u8 getRef1() { return mRef1; }
|
||||
u8 getComp0() const { return mAlphaCmp >> 5 & 7; }
|
||||
u8 getRef0() const { return mRef0; }
|
||||
u8 getOp() const { return mAlphaCmp >> 3 & 3; }
|
||||
u8 getComp1() const { return mAlphaCmp & 7; }
|
||||
u8 getRef1() const { return mRef1; }
|
||||
|
||||
/* 0x0 */ u16 mAlphaCmp;
|
||||
/* 0x2 */ u8 mRef0;
|
||||
@@ -682,10 +902,10 @@ struct J2DBlend {
|
||||
J2DBlend() { mBlendInfo = j2dDefaultBlendInfo; }
|
||||
J2DBlend(const J2DBlendInfo& info) { mBlendInfo = info; }
|
||||
void setBlendInfo(const J2DBlendInfo& info) { mBlendInfo = info; }
|
||||
u8 getType() { return mBlendInfo.mType; }
|
||||
u8 getSrcFactor() { return mBlendInfo.mSrcFactor; }
|
||||
u8 getDstFactor() { return mBlendInfo.mDstFactor; }
|
||||
u8 getOp() { return mBlendInfo.mOp; }
|
||||
u8 getType() const { return mBlendInfo.mType; }
|
||||
u8 getSrcFactor() const { return mBlendInfo.mSrcFactor; }
|
||||
u8 getDstFactor() const { return mBlendInfo.mDstFactor; }
|
||||
u8 getOp() const { return mBlendInfo.mOp; }
|
||||
|
||||
/* 0x0 */ J2DBlendInfo mBlendInfo;
|
||||
};
|
||||
@@ -697,6 +917,7 @@ struct J2DBlend {
|
||||
class J2DPEBlock {
|
||||
public:
|
||||
J2DPEBlock() { initialize(); }
|
||||
~J2DPEBlock() {}
|
||||
|
||||
void initialize();
|
||||
void setGX();
|
||||
@@ -744,19 +965,27 @@ public:
|
||||
virtual void setIndTexStageNum(u8 num) { mIndTexStageNum = num; }
|
||||
virtual u8 getIndTexStageNum() const { return mIndTexStageNum; }
|
||||
virtual void setIndTexOrder(u32 index, J2DIndTexOrder order) {
|
||||
J3D_PANIC(856, index < 4, "Error : range over.");
|
||||
mIndTexOrder[index] = order;
|
||||
}
|
||||
virtual J2DIndTexOrder* getIndTexOrder(u32 index) {
|
||||
J3D_PANIC(857, index < 4, "Error : range over.");
|
||||
return &mIndTexOrder[index];
|
||||
}
|
||||
virtual void setIndTexMtx(u32 index, J2DIndTexMtx mtx) {
|
||||
J3D_PANIC(859, index < 3, "Error : range over.");
|
||||
mIndTexMtx[index] = mtx;
|
||||
}
|
||||
virtual J2DIndTexMtx* getIndTexMtx(u32 index) { return &mIndTexMtx[index]; }
|
||||
virtual J2DIndTexMtx* getIndTexMtx(u32 index) {
|
||||
J3D_PANIC(860, index < 3, "Error : range over.");
|
||||
return &mIndTexMtx[index];
|
||||
}
|
||||
virtual void setIndTexCoordScale(u32 index, J2DIndTexCoordScale scale) {
|
||||
J3D_PANIC(862, index < 4, "Error : range over.");
|
||||
mTexCoordScale[index] = scale;
|
||||
}
|
||||
virtual J2DIndTexCoordScale* getIndTexCoordScale(u32 index) {
|
||||
J3D_PANIC(863, index < 4, "Error : range over.");
|
||||
return &mTexCoordScale[index];
|
||||
}
|
||||
virtual ~J2DIndBlockFull() {}
|
||||
@@ -801,11 +1030,27 @@ public:
|
||||
|
||||
u32 getTexGenNum() const { return mTexGenNum; }
|
||||
void setTexGenNum(u32 num) { mTexGenNum = num; }
|
||||
void setTexCoord(u32 i, J2DTexCoord coord) { mTexGenCoord[i] = coord; }
|
||||
void setTexCoord(u32 i, const J2DTexCoord* coord) { mTexGenCoord[i] = *coord; }
|
||||
void setTexMtx(u32 i, J2DTexMtx* mtx) { mTexMtx[i] = mtx; }
|
||||
J2DTexMtx& getTexMtx(u32 i) { return *mTexMtx[i]; }
|
||||
J2DTexCoord& getTexCoord(u32 i) { return mTexGenCoord[i]; }
|
||||
void setTexCoord(u32 i, J2DTexCoord coord) {
|
||||
J3D_PANIC(101, i < 8, "Error : range over.");
|
||||
mTexGenCoord[i] = coord;
|
||||
}
|
||||
void setTexCoord(u32 i, const J2DTexCoord* coord) {
|
||||
J3D_PANIC(98, i < 8, "Error : range over.");
|
||||
J3D_PANIC(99, coord, "Error : null pointer.");
|
||||
mTexGenCoord[i] = *coord;
|
||||
}
|
||||
void setTexMtx(u32 i, J2DTexMtx* mtx) {
|
||||
J3D_PANIC(120, i < 8, "Error : range over.");
|
||||
mTexMtx[i] = mtx;
|
||||
}
|
||||
J2DTexMtx& getTexMtx(u32 i) {
|
||||
J3D_PANIC(108, i < 8, "Error : range over.");
|
||||
return *mTexMtx[i];
|
||||
}
|
||||
J2DTexCoord& getTexCoord(u32 i) {
|
||||
J3D_PANIC(102, i < 8, "Error : range over.");
|
||||
return mTexGenCoord[i];
|
||||
}
|
||||
|
||||
virtual ~J2DTexGenBlock();
|
||||
}; // Size: 0x48
|
||||
@@ -829,12 +1074,24 @@ public:
|
||||
|
||||
virtual ~J2DColorBlock() {}
|
||||
|
||||
JUtility::TColor* getMatColor(u32 i) { return &mMatColor[i]; }
|
||||
J2DColorChan* getColorChan(u32 i) { return &mColorChan[i]; }
|
||||
JUtility::TColor* getMatColor(u32 i) {
|
||||
J3D_PANIC(49, i < 2, "Error : range over.");
|
||||
return &mMatColor[i];
|
||||
}
|
||||
J2DColorChan* getColorChan(u32 i) {
|
||||
J3D_PANIC(55, i < 4, "Error : range over.");
|
||||
return &mColorChan[i];
|
||||
}
|
||||
void setCullMode(u8 mode) { mCullMode = mode; }
|
||||
void setColorChanNum(u8 num) { mColorChanNum = num; }
|
||||
void setMatColor(u32 i, JUtility::TColor color) { mMatColor[i] = color; }
|
||||
void setColorChan(u32 i, const J2DColorChan& color) { mColorChan[i] = color; }
|
||||
void setMatColor(u32 i, JUtility::TColor color) {
|
||||
J3D_PANIC(48, i < 2, "Error : range over.");
|
||||
mMatColor[i] = color;
|
||||
}
|
||||
void setColorChan(u32 i, const J2DColorChan& color) {
|
||||
J3D_PANIC(54, i < 4, "Error : range over.");
|
||||
mColorChan[i] = color;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* J2DMATBLOCK_H */
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
J2DBlend newBlend(int) const;
|
||||
u8 newDither(int) const;
|
||||
|
||||
u32 getMaterialMode(int idx) const {
|
||||
u8 getMaterialMode(int idx) const {
|
||||
return field_0x4[field_0x8[idx]].field_0x0;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ public:
|
||||
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) {
|
||||
JGeometry::TBox2<f32> ortho(x, y, x + width, y + height);
|
||||
setOrtho(ortho, far, near);
|
||||
|
||||
@@ -84,20 +84,33 @@ public:
|
||||
/* vt 0x10 */ virtual void move(f32 x, f32 y);
|
||||
/* vt 0x14 */ virtual void add(f32 x, f32 y);
|
||||
/* vt 0x18 */ virtual void resize(f32 x, f32 y);
|
||||
/* vt 0x1C */ virtual void setCullBack(bool cull);
|
||||
/* vt 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);
|
||||
/* 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 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) {
|
||||
@@ -107,7 +120,7 @@ public:
|
||||
/* 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 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) {}
|
||||
@@ -118,9 +131,13 @@ public:
|
||||
/* vt 0x78 */ virtual void setAnimation(J2DAnmVtxColor* anm) {}
|
||||
/* vt 0x7C */ virtual const J2DAnmTransform* animationTransform(const J2DAnmTransform* transform);
|
||||
/* vt 0x80 */ virtual void setVisibileAnimation(J2DAnmVisibilityFull* visibility);
|
||||
/* vt 0x84 */ virtual void setAnimationVF(J2DAnmVisibilityFull* visibility);
|
||||
/* vt 0x84 */ virtual void setAnimationVF(J2DAnmVisibilityFull* p_visibility) {
|
||||
setAnimation(p_visibility);
|
||||
}
|
||||
/* vt 0x88 */ virtual void setVtxColorAnimation(J2DAnmVtxColor* vtx_color);
|
||||
/* vt 0x8C */ virtual void setAnimationVC(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(); }
|
||||
@@ -174,6 +191,7 @@ public:
|
||||
void show() { mVisible = true; }
|
||||
void hide() { mVisible = false; }
|
||||
|
||||
bool isInfluencedAlpha() const { return mIsInfluencedAlpha; }
|
||||
bool isConnectParent() const { return mConnected; }
|
||||
|
||||
u64 getUserInfo() const { return mUserInfoTag; }
|
||||
|
||||
@@ -17,6 +17,7 @@ enum J2DMirror {
|
||||
};
|
||||
|
||||
enum J2DBinding {
|
||||
/* 0 */ J2DBind_None = 0,
|
||||
/* 1 */ J2DBind_Bottom = (1 << 0),
|
||||
/* 2 */ J2DBind_Top = (1 << 1),
|
||||
/* 4 */ J2DBind_Right = (1 << 2),
|
||||
@@ -189,6 +190,9 @@ public:
|
||||
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*);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define J2DPRINT_H
|
||||
|
||||
#include "JSystem/J2DGraph/J2DTextBox.h"
|
||||
#include <stdarg>
|
||||
#include <cstdarg>
|
||||
|
||||
class JUTFont;
|
||||
class J2DPrint;
|
||||
|
||||
@@ -103,6 +103,7 @@ public:
|
||||
mInfo = info;
|
||||
return *this;
|
||||
}
|
||||
void setIndTexOrderInfo(const J2DIndTexOrderInfo& info) { mInfo = info; }
|
||||
void load(u8);
|
||||
|
||||
private:
|
||||
@@ -147,6 +148,7 @@ public:
|
||||
mIndTexMtxInfo = info;
|
||||
return *this;
|
||||
}
|
||||
void setIndTexMtxInfo(const J2DIndTexMtxInfo& info) { mIndTexMtxInfo = info; }
|
||||
void load(u8);
|
||||
void load(u32);
|
||||
void calc();
|
||||
@@ -191,6 +193,7 @@ public:
|
||||
mInfo = info;
|
||||
return *this;
|
||||
}
|
||||
void setIndTexCoordScaleInfo(const J2DIndTexCoordScaleInfo& info) { mInfo = info; }
|
||||
void load(u8);
|
||||
|
||||
private:
|
||||
@@ -426,7 +429,7 @@ public:
|
||||
}
|
||||
|
||||
void setTexSel(u8 param_0) {
|
||||
field_0x7 = (field_0x7 & ~0x0c) | (param_0 * 4);
|
||||
field_0x7 = (field_0x7 & ~0x0c) | (param_0 << 2);
|
||||
}
|
||||
|
||||
void setRasSel(u8 param_0) {
|
||||
@@ -632,6 +635,10 @@ public:
|
||||
|
||||
u8 getMatSrc() const { return mColorChan & 1; }
|
||||
|
||||
void operator=(const J2DColorChan& other) {
|
||||
mColorChan = other.mColorChan;
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x0 */ u16 mColorChan;
|
||||
};
|
||||
|
||||
@@ -61,27 +61,38 @@ public:
|
||||
void setTevMode(JUTTexture*, JUtility::TColor, JUtility::TColor);
|
||||
|
||||
virtual ~J2DWindow();
|
||||
virtual u16 getTypeID() const;
|
||||
virtual void resize(f32, f32);
|
||||
virtual void drawSelf(f32, f32);
|
||||
virtual void drawSelf(f32, f32, Mtx*);
|
||||
virtual bool isUsed(ResTIMG const*);
|
||||
virtual bool isUsed(ResFONT const*);
|
||||
virtual void rewriteAlpha();
|
||||
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&);
|
||||
/* 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; }
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef J3DANIMATION_H
|
||||
#define J3DANIMATION_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DJoint.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTNameTab.h"
|
||||
@@ -637,37 +638,184 @@ public:
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j3d
|
||||
*
|
||||
*
|
||||
*/
|
||||
class J3DAnmTexPattern : public J3DAnmBase {
|
||||
class J3DAnmCluster : public J3DAnmBase {
|
||||
public:
|
||||
J3DAnmTexPattern();
|
||||
void getTexNo(u16, u16*) const;
|
||||
void searchUpdateMaterialID(J3DMaterialTable*);
|
||||
void searchUpdateMaterialID(J3DModelData*);
|
||||
J3DAnmCluster(s16 frameMax, f32* pWeight) : J3DAnmBase(frameMax) { mWeight = pWeight; }
|
||||
|
||||
virtual ~J3DAnmTexPattern() {}
|
||||
virtual s32 getKind() const { return 2; }
|
||||
virtual ~J3DAnmCluster() {}
|
||||
virtual s32 getKind() const { return 3; }
|
||||
virtual f32 getWeight(u16) const { return 1.0f; }
|
||||
|
||||
u16 getUpdateMaterialID(u16 idx) const {
|
||||
J3D_ASSERT_RANGE(2288, idx < mUpdateMaterialNum);
|
||||
return mUpdateMaterialID[idx];
|
||||
/* 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; }
|
||||
J3DAnmTexPatternFullTable* getAnmTable() { return mAnmTable; }
|
||||
u16 getUpdateMaterialID(u16 idx) const {
|
||||
J3D_ASSERT_RANGE(1578, idx < mUpdateMaterialNum);
|
||||
return mUpdateMaterialID[idx];
|
||||
}
|
||||
|
||||
/* 0x0C */ u16* mTextureIndex;
|
||||
/* 0x10 */ J3DAnmTexPatternFullTable* mAnmTable;
|
||||
/* 0x14 */ u16 field_0x14;
|
||||
/* 0x16 */ u16 mUpdateMaterialNum;
|
||||
/* 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:
|
||||
@@ -726,177 +874,41 @@ public:
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j3d
|
||||
*
|
||||
*
|
||||
*/
|
||||
class J3DAnmColor : public J3DAnmBase {
|
||||
class J3DAnmTexPattern : public J3DAnmBase {
|
||||
public:
|
||||
J3DAnmColor();
|
||||
J3DAnmTexPattern();
|
||||
void getTexNo(u16, u16*) const;
|
||||
void searchUpdateMaterialID(J3DMaterialTable*);
|
||||
void searchUpdateMaterialID(J3DModelData*);
|
||||
|
||||
virtual ~J3DAnmColor() {}
|
||||
virtual s32 getKind() const { return 1; }
|
||||
virtual void getColor(u16, GXColor*) const {}
|
||||
virtual ~J3DAnmTexPattern() {}
|
||||
virtual s32 getKind() const { return 2; }
|
||||
|
||||
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);
|
||||
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 field_0xc;
|
||||
/* 0x0E */ u16 field_0xe;
|
||||
/* 0x10 */ u16 field_0x10;
|
||||
/* 0x12 */ u16 field_0x12;
|
||||
/* 0x14 */ u16 mUpdateMaterialNum;
|
||||
/* 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 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 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 J3DAnmVtxColor : public J3DAnmBase {
|
||||
public:
|
||||
J3DAnmVtxColor();
|
||||
|
||||
virtual ~J3DAnmVtxColor() {}
|
||||
virtual s32 getKind() const { return 7; }
|
||||
virtual void getColor(u8, u16, GXColor*) const {}
|
||||
|
||||
/* 0x0C */ u16 mAnmTableNum[2];
|
||||
/* 0x10 */ J3DAnmVtxColorIndexData* mAnmVtxColorIndexData[2];
|
||||
}; // Size: 0x18
|
||||
|
||||
/**
|
||||
* @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 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 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 J3DAnmVisibilityFull : public J3DAnmBase {
|
||||
public:
|
||||
J3DAnmVisibilityFull() : J3DAnmBase(0) {
|
||||
J3DAnmVisibilityFull() : J3DAnmBase() {
|
||||
mUpdateMaterialNum = 0;
|
||||
field_0xe = 0;
|
||||
mAnmTable = NULL;
|
||||
|
||||
@@ -32,7 +32,10 @@ public:
|
||||
}
|
||||
|
||||
J3DDeformer* getDeformer() { return mDeformer; }
|
||||
void setDeformer(J3DDeformer* deformer) { mDeformer = deformer; }
|
||||
void setDeformer(J3DDeformer* deformer) {
|
||||
J3D_ASSERT_NULLPTR(111, deformer);
|
||||
mDeformer = deformer;
|
||||
}
|
||||
|
||||
/* 0x00 */ f32 mMaxAngle;
|
||||
/* 0x04 */ f32 mMinAngle;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define J3DJOINT_H
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
|
||||
class J3DAnmTransform;
|
||||
@@ -146,17 +145,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j3d
|
||||
*
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
#ifndef J3DJOINTTREE_H
|
||||
#define J3DJOINTTREE_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DJoint.h"
|
||||
#include "JSystem/J3DGraphBase/J3DTransform.h"
|
||||
|
||||
class J3DJoint;
|
||||
class J3DMtxBuffer;
|
||||
class J3DMtxCalc;
|
||||
class JUTNameTab;
|
||||
|
||||
/**
|
||||
@@ -46,7 +49,7 @@ public:
|
||||
virtual void calc(J3DMtxBuffer*, Vec const&, f32 const (&)[3][4]);
|
||||
virtual ~J3DJointTree() {}
|
||||
|
||||
J3DModelHierarchy const* getHierarchy() { return mHierarchy; }
|
||||
const J3DModelHierarchy* getHierarchy() const { return mHierarchy; }
|
||||
void setHierarchy(J3DModelHierarchy* hierarchy) { mHierarchy = hierarchy; }
|
||||
void setBasicMtxCalc(J3DMtxCalc* calc) { mBasicMtxCalc = calc; }
|
||||
u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; }
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
#define J3DMODELDATA_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DJointTree.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMaterial.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DShapeTable.h"
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "JSystem/J3DGraphBase/J3DVertex.h"
|
||||
|
||||
class JUTNameTab;
|
||||
@@ -47,7 +45,7 @@ public:
|
||||
J3DShape* getShapeNodePointer(u16 idx) const { return mShapeTable.getShapeNodePointer(idx); }
|
||||
J3DJoint* getJointNodePointer(u16 idx) const { return mJointTree.getJointNodePointer(idx); }
|
||||
J3DJointTree& getJointTree() { return mJointTree; }
|
||||
J3DModelHierarchy const* getHierarchy() { return mJointTree.getHierarchy(); }
|
||||
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(); }
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define J3DMTXBUFFER_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
|
||||
#include "JSystem/J3DGraphBase/J3DEnum.h"
|
||||
|
||||
class J3DModelData;
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef J3DSHAPETABLE_H
|
||||
#define J3DSHAPETABLE_H
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DShape.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
class J3DVertexData;
|
||||
struct J3DDrawMtxData;
|
||||
class J3DShape;
|
||||
class JUTNameTab;
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
#ifndef J3DENUM_H
|
||||
#define J3DENUM_H
|
||||
|
||||
enum J3DError {
|
||||
kJ3DError_Success = 0,
|
||||
kJ3DError_Alloc = 4,
|
||||
};
|
||||
|
||||
#endif /* J3DENUM_H */
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
|
||||
#include "JSystem/J3DGraphBase/J3DPacket.h"
|
||||
#include "JSystem/J3DGraphBase/J3DShape.h"
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
class J3DJoint;
|
||||
class J3DMaterialAnm;
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
J3DFog* getFog() { return mPEBlock->getFog(); }
|
||||
J3DTexMtx* getTexMtx(u32 idx) { return mTexGenBlock->getTexMtx(idx); }
|
||||
u16 getIndex() { return mIndex; }
|
||||
bool isDrawModeOpaTexEdge() { return (mMaterialMode & 3) == 0; }
|
||||
BOOL isDrawModeOpaTexEdge() { return (mMaterialMode & 3) ? 1 : 0; }
|
||||
J3DPEBlock* getPEBlock() { return mPEBlock; }
|
||||
void onInvalid() { mInvalid = 1; }
|
||||
u32 getTexGenNum() const { return mTexGenBlock->getTexGenNum(); }
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#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 <stdint>
|
||||
#include "dolphin/mtx.h"
|
||||
#include <stdint.h>
|
||||
|
||||
class J3DMatPacket;
|
||||
|
||||
@@ -132,6 +135,34 @@ public:
|
||||
/* 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
|
||||
*
|
||||
|
||||
@@ -8,34 +8,6 @@
|
||||
class J3DTexMtx;
|
||||
class J3DTexGenBlock;
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
@@ -58,7 +30,31 @@ typedef void (J3DShapeMtxConcatView::*J3DShapeMtxConcatView_LoadFunc)(int, u16)
|
||||
|
||||
/**
|
||||
* @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:
|
||||
@@ -83,60 +79,6 @@ public:
|
||||
static MtxP sMtxPtrTbl[2];
|
||||
};
|
||||
|
||||
/**
|
||||
* @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;
|
||||
};
|
||||
|
||||
/**
|
||||
* @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 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
|
||||
*
|
||||
@@ -162,4 +104,34 @@ private:
|
||||
/* 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 */
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*
|
||||
*/
|
||||
struct J3DLightInfo {
|
||||
bool operator==(J3DLightInfo& other) const;
|
||||
J3DLightInfo& operator=(J3DLightInfo const&);
|
||||
|
||||
/* 0x00 */ Vec mLightPosition;
|
||||
@@ -31,6 +32,7 @@ struct J3DTextureSRTInfo {
|
||||
/* 0x0C */ f32 mTranslationX;
|
||||
/* 0x10 */ f32 mTranslationY;
|
||||
|
||||
bool operator==(J3DTextureSRTInfo&) const;
|
||||
inline void operator=(J3DTextureSRTInfo const& other) {
|
||||
#ifdef __MWERKS__
|
||||
__REGISTER const f32* src = &other.mScaleX;
|
||||
@@ -74,6 +76,7 @@ enum J3DTexMtxMode {
|
||||
*
|
||||
*/
|
||||
struct J3DTexMtxInfo {
|
||||
bool operator==(J3DTexMtxInfo& other) const;
|
||||
J3DTexMtxInfo& operator=(J3DTexMtxInfo const&);
|
||||
void setEffectMtx(Mtx);
|
||||
|
||||
@@ -93,7 +96,7 @@ struct J3DTexMtxInfo {
|
||||
struct J3DIndTexMtxInfo {
|
||||
J3DIndTexMtxInfo& operator=(J3DIndTexMtxInfo const&);
|
||||
/* 0x00 */ Mtx23 field_0x0;
|
||||
/* 0x18 */ u8 field_0x18;
|
||||
/* 0x18 */ s8 field_0x18;
|
||||
}; // Size: 0x1C
|
||||
|
||||
/**
|
||||
@@ -101,7 +104,8 @@ struct J3DIndTexMtxInfo {
|
||||
*
|
||||
*/
|
||||
struct J3DFogInfo {
|
||||
J3DFogInfo& operator=(J3DFogInfo const&);
|
||||
bool operator==(J3DFogInfo&) const;
|
||||
J3DFogInfo& operator=(const J3DFogInfo&);
|
||||
|
||||
/* 0x00 */ u8 mType;
|
||||
/* 0x01 */ u8 mAdjEnable;
|
||||
@@ -119,7 +123,8 @@ struct J3DFogInfo {
|
||||
*
|
||||
*/
|
||||
struct J3DNBTScaleInfo {
|
||||
J3DNBTScaleInfo& operator=(J3DNBTScaleInfo const&);
|
||||
bool operator==(const J3DNBTScaleInfo& other) const;
|
||||
J3DNBTScaleInfo& operator=(const J3DNBTScaleInfo&);
|
||||
|
||||
/* 0x0 */ u8 mbHasScale;
|
||||
/* 0x4 */ Vec mScale;
|
||||
|
||||
@@ -5,12 +5,6 @@
|
||||
#include <dolphin/mtx.h>
|
||||
#include "JSystem/J3DAssert.h"
|
||||
|
||||
// Perhaps move to a new J3DEnum.h?
|
||||
enum J3DError {
|
||||
kJ3DError_Success = 0,
|
||||
kJ3DError_Alloc = 4,
|
||||
};
|
||||
|
||||
enum J3DSysDrawBuf {
|
||||
/* 0x0 */ J3DSysDrawBuf_Opa,
|
||||
/* 0x1 */ J3DSysDrawBuf_Xlu,
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "JSystem/J3DAssert.h"
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include "global.h"
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j3d
|
||||
@@ -18,7 +18,9 @@ private:
|
||||
/* 0x4 */ ResTIMG* mpRes;
|
||||
|
||||
public:
|
||||
J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {}
|
||||
J3DTexture(u16 num, ResTIMG* res) : mNum(num), unk_0x2(0), mpRes(res) {
|
||||
J3D_ASSERT_NULLPTR(52, res && num);
|
||||
}
|
||||
|
||||
void loadGX(u16, GXTexMapID) const;
|
||||
void entryNum(u16);
|
||||
@@ -29,11 +31,11 @@ public:
|
||||
|
||||
ResTIMG* getResTIMG(u16 index) const {
|
||||
J3D_ASSERT_RANGE(72, index < mNum);
|
||||
return &mpRes[index];
|
||||
return &mpRes[index];
|
||||
}
|
||||
|
||||
void setResTIMG(u16 index, const ResTIMG& timg) {
|
||||
JUT_ASSERT_MSG(81, (bool)(index < mNum), "Error : range over.");
|
||||
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)));
|
||||
|
||||
@@ -16,8 +16,10 @@ class J3DVertexBuffer;
|
||||
struct J3DVtxColorCalc {
|
||||
void calc(J3DModel*);
|
||||
virtual void calc(J3DVertexBuffer*);
|
||||
virtual ~J3DVtxColorCalc() {}
|
||||
|
||||
bool checkFlag(u32 flag) { return mFlags & flag ? true : false; }
|
||||
|
||||
/* 0x0 */ void* vtable; // inlined vtable?
|
||||
/* 0x4 */ u32 mFlags;
|
||||
/* 0x8 */ J3DAnmVtxColor* mpVtxColor;
|
||||
};
|
||||
@@ -38,6 +40,7 @@ public:
|
||||
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; }
|
||||
@@ -129,6 +132,12 @@ public:
|
||||
mVtxNrmArray[1] = temp;
|
||||
}
|
||||
|
||||
void swapVtxColArrayPointer() {
|
||||
GXColor* temp = mVtxColArray[0];
|
||||
mVtxColArray[0] = mVtxColArray[1];
|
||||
mVtxColArray[1] = temp;
|
||||
}
|
||||
|
||||
void* getVtxPosArrayPointer(int index) {
|
||||
return mVtxPosArray[index];
|
||||
}
|
||||
@@ -137,6 +146,10 @@ public:
|
||||
return mVtxNrmArray[index];
|
||||
}
|
||||
|
||||
GXColor* getVtxColArrayPointer(int index) {
|
||||
return mVtxColArray[index];
|
||||
}
|
||||
|
||||
private:
|
||||
/* 0x00 */ J3DVertexData* mVtxData;
|
||||
/* 0x04 */ void* mVtxPosArray[2];
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
#ifndef J3DANMLOADER_H
|
||||
#define J3DANMLOADER_H
|
||||
|
||||
#include "JSystem/J3DGraphAnimator/J3DAnimation.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,
|
||||
@@ -28,29 +51,6 @@ public:
|
||||
virtual ~J3DAnmLoader() {}
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
class J3DAnmFullLoader_v15 : public J3DAnmLoader {
|
||||
public:
|
||||
J3DAnmFullLoader_v15();
|
||||
@@ -74,4 +74,27 @@ public:
|
||||
/* 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 */
|
||||
|
||||
@@ -30,7 +30,7 @@ struct J3DJointFactory {
|
||||
J3DJointInitData* mJointInitData;
|
||||
u16* mIndexTable;
|
||||
|
||||
u16 getKind(int no) const { return mJointInitData[mIndexTable[no]].mKind; }
|
||||
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;
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
const u8 newDither(int) const;
|
||||
J3DNBTScale newNBTScale(int) const;
|
||||
|
||||
u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; }
|
||||
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
|
||||
u8 getMaterialMode(int idx) const { return mpMaterialInitData[mpMaterialID[idx]].mMaterialMode; }
|
||||
|
||||
/* 0x00 */ u16 mMaterialNum;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef J3DMODELLOADER_H
|
||||
#define J3DMODELLOADER_H
|
||||
|
||||
#include "JSystem/J3DGraphBase/J3DSys.h"
|
||||
#include "dolphin/mtx.h"
|
||||
|
||||
class J3DModelData;
|
||||
@@ -301,17 +302,6 @@ public:
|
||||
/* 0x1A */ u16 mEnvelopeSize;
|
||||
};
|
||||
|
||||
/**
|
||||
* @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
|
||||
*
|
||||
@@ -325,6 +315,17 @@ public:
|
||||
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
|
||||
*
|
||||
@@ -332,6 +333,18 @@ public:
|
||||
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 */
|
||||
|
||||
@@ -66,7 +66,7 @@ struct J3DShapeFactory {
|
||||
/* 0x18 */ J3DShapeDrawInitData* mDrawInitData;
|
||||
/* 0x1C */ u8* mVcdVatCmdBuffer;
|
||||
|
||||
u32 getMtxGroupNum(int no) const { return mShapeInitData[mIndexTable[no]].mMtxGroupNum; }
|
||||
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; }
|
||||
|
||||
@@ -22,19 +22,10 @@ public:
|
||||
|
||||
class JAWWindow {
|
||||
public:
|
||||
class TJ2DWindowDraw : public J2DWindow {
|
||||
public:
|
||||
TJ2DWindowDraw(u32, const JGeometry::TBox2<f32>&, const char*);
|
||||
|
||||
void drawPane(int x, int y, const J2DGrafContext* p_grafCtx) {
|
||||
J2DPane::draw(x, y, p_grafCtx, true, true);
|
||||
calcMtx();
|
||||
}
|
||||
};
|
||||
|
||||
class TWindowText : public J2DPane {
|
||||
public:
|
||||
TWindowText(JAWWindow*);
|
||||
virtual ~TWindowText();
|
||||
virtual void drawSelf(f32, f32);
|
||||
virtual void drawSelf(f32, f32, Mtx*);
|
||||
|
||||
@@ -43,6 +34,17 @@ public:
|
||||
/* 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*);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JAISEQDATAMGR_H
|
||||
|
||||
#include "JSystem/JAudio2/JAISound.h"
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
|
||||
@@ -29,6 +29,7 @@ struct JASDSPChannel {
|
||||
void drop();
|
||||
void setPriority(u8);
|
||||
void updateProc();
|
||||
u8 getStatus() const { return mStatus; }
|
||||
|
||||
static void initAll();
|
||||
static JASDSPChannel* alloc(u8, Callback, void*);
|
||||
|
||||
@@ -334,7 +334,7 @@ template <typename T> JASMemPool<T> JASPoolAllocObject<T>::memPool_;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
*
|
||||
*
|
||||
*/
|
||||
template <typename T>
|
||||
class JASMemPool_MultiThreaded : public JASGenericMemPool {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include <bitset>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jaudio
|
||||
|
||||
@@ -25,6 +25,7 @@ public:
|
||||
void cancelAlarm() { OSCancelAlarm(this); }
|
||||
void removeLink() { sList.remove(&mLink); }
|
||||
void appendLink() { sList.append(&mLink); }
|
||||
OSAlarm* getAlarm() const { return (OSAlarm*)this; }
|
||||
OSThread* getThread() const { return mThread; }
|
||||
void setThread(OSThread* thread) { mThread = thread; }
|
||||
|
||||
@@ -134,7 +135,7 @@ private:
|
||||
/* 0x4A */ u8 field_0x4a;
|
||||
};
|
||||
|
||||
inline void JUTChangeFrameBuffer(void* buffer, u16 height, u16 width) {
|
||||
inline void JUTChangeFrameBuffer(void* buffer, u16 width, u16 height) {
|
||||
JUTDirectPrint::getManager()->changeFrameBuffer(buffer, width, height);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,9 +55,9 @@ private:
|
||||
JGadget_outMessage out(JGadget_outMessage::warning, __FILE__, line); \
|
||||
out << msg << (arg1) << (arg2) << (arg3) << (arg4);
|
||||
|
||||
#define JGADGET_EXITWARN(cond) \
|
||||
if (!(cond)) { \
|
||||
false; \
|
||||
#define JGADGET_EXITWARN(line, COND) \
|
||||
if (!(COND)) { \
|
||||
JGadget_outMessage(JGadget_outMessage::warning, __FILE__, line) << #COND, false; \
|
||||
return false; \
|
||||
}
|
||||
#else
|
||||
@@ -65,6 +65,7 @@ private:
|
||||
#define JGADGET_WARNMSG(line, msg) (void)0
|
||||
#define JGADGET_WARNMSG1(line, msg, arg) (void)0
|
||||
#define JGADGET_WARNMSG4(line, msg, arg1, arg2, arg3, arg4) (void)0
|
||||
#define JGADGET_EXITWARN(line, COND) (void)0
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,88 +10,96 @@
|
||||
namespace JGadget {
|
||||
struct TLinkListNode {
|
||||
TLinkListNode() {
|
||||
mNext = NULL;
|
||||
mPrev = NULL;
|
||||
pNext_ = NULL;
|
||||
pPrev_ = NULL;
|
||||
}
|
||||
|
||||
~TLinkListNode() {}
|
||||
|
||||
TLinkListNode* getNext() const { return mNext; }
|
||||
TLinkListNode* getPrev() const { return mPrev; }
|
||||
TLinkListNode* getNext() const { return pNext_; }
|
||||
TLinkListNode* getPrev() const { return pPrev_; }
|
||||
void clear_() { pNext_ = NULL; pPrev_ = NULL; }
|
||||
|
||||
public:
|
||||
/* 0x0 */ TLinkListNode* mNext;
|
||||
/* 0x4 */ TLinkListNode* mPrev;
|
||||
/* 0x0 */ TLinkListNode* pNext_;
|
||||
/* 0x4 */ TLinkListNode* pPrev_;
|
||||
}; // Size: 0x8
|
||||
|
||||
struct TNodeLinkList {
|
||||
struct iterator {
|
||||
iterator() { node = NULL; }
|
||||
explicit iterator(TLinkListNode* pNode) { node = pNode; }
|
||||
iterator& operator=(const iterator& other) { node = other.node; return *this; }
|
||||
struct iterator : public std::iterator<std::bidirectional_iterator_tag, TLinkListNode, s32, TLinkListNode*, TLinkListNode&> {
|
||||
iterator() { p_ = NULL; }
|
||||
explicit iterator(TLinkListNode* pNode) { p_ = pNode; }
|
||||
iterator& operator=(const iterator& other) { p_ = other.p_; return *this; }
|
||||
|
||||
iterator& operator++() { node = node->getNext(); return *this; }
|
||||
iterator& operator--() { node = node->getPrev(); return *this; }
|
||||
iterator& operator++() { p_ = p_->getNext(); return *this; }
|
||||
iterator& operator--() { p_ = p_->getPrev(); return *this; }
|
||||
iterator operator++(int) { const iterator old(*this); (void)++*this; return old; }
|
||||
iterator operator--(int) { const iterator old(*this); (void)--*this; return old; }
|
||||
friend bool operator==(iterator a, iterator b) { return a.node == b.node; }
|
||||
friend bool operator==(iterator a, iterator b) { return a.p_ == b.p_; }
|
||||
friend bool operator!=(iterator a, iterator b) { return !(a == b); }
|
||||
|
||||
TLinkListNode* operator->() const { return node; }
|
||||
TLinkListNode& operator*() const { return *node; }
|
||||
TLinkListNode* operator->() const { return p_; }
|
||||
TLinkListNode& operator*() const {
|
||||
JUT_ASSERT(196, p_!=NULL);
|
||||
return *p_;
|
||||
}
|
||||
|
||||
public:
|
||||
/* 0x00 */ TLinkListNode* node;
|
||||
/* 0x00 */ TLinkListNode* p_;
|
||||
};
|
||||
|
||||
struct const_iterator {
|
||||
explicit const_iterator(TLinkListNode* pNode) { node = pNode; }
|
||||
explicit const_iterator(iterator it) { node = it.node; }
|
||||
explicit const_iterator(const TLinkListNode* pNode) { p_ = pNode; }
|
||||
explicit const_iterator(const iterator it) { p_ = it.p_; }
|
||||
|
||||
const_iterator& operator++() { node = node->getNext(); return *this; }
|
||||
const_iterator& operator--() { node = node->getPrev(); return *this; }
|
||||
const_iterator& operator++() { p_ = p_->getNext(); return *this; }
|
||||
const_iterator& operator--() { p_ = p_->getPrev(); return *this; }
|
||||
const_iterator operator++(int) { const const_iterator old(*this); (void)++*this; return old; }
|
||||
const_iterator operator--(int) { const const_iterator old(*this); (void)--*this; return old; }
|
||||
friend bool operator==(const_iterator a, const_iterator b) { return a.node == b.node; }
|
||||
friend bool operator==(const_iterator a, const_iterator b) { return a.p_ == b.p_; }
|
||||
friend bool operator!=(const_iterator a, const_iterator b) { return !(a == b); }
|
||||
|
||||
friend bool operator==(const_iterator a, iterator b) { return a.node == b.node; }
|
||||
friend bool operator==(const_iterator a, iterator b) { return a.p_ == b.p_; }
|
||||
friend bool operator!=(const_iterator a, iterator b) { return !(a == b); }
|
||||
|
||||
const TLinkListNode* operator->() const { return node; }
|
||||
const TLinkListNode& operator*() const { return *node; }
|
||||
const TLinkListNode* operator->() const { return p_; }
|
||||
const TLinkListNode& operator*() const { return *p_; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ TLinkListNode* node;
|
||||
/* 0x00 */ const TLinkListNode* p_;
|
||||
};
|
||||
|
||||
TNodeLinkList() : ocObject_() { Initialize_(); }
|
||||
TNodeLinkList() : oNode_() { Initialize_(); }
|
||||
~TNodeLinkList();
|
||||
|
||||
void Initialize_() {
|
||||
count = 0;
|
||||
ocObject_.mNext = &ocObject_;
|
||||
ocObject_.mPrev = &ocObject_;
|
||||
oNode_.pNext_ = &oNode_;
|
||||
oNode_.pPrev_ = &oNode_;
|
||||
}
|
||||
|
||||
iterator begin() { return iterator(ocObject_.getNext()); }
|
||||
const_iterator begin() const { return const_iterator(ocObject_.getNext()); }
|
||||
iterator end() { return iterator(&ocObject_); }
|
||||
const_iterator end() const { return const_iterator((TLinkListNode*)(&ocObject_)); }
|
||||
iterator begin() { return iterator(oNode_.getNext()); }
|
||||
const_iterator begin() const { return const_iterator(oNode_.getNext()); }
|
||||
iterator end() { return iterator(&oNode_); }
|
||||
const_iterator end() const { return const_iterator((TLinkListNode*)(&oNode_)); }
|
||||
u32 size() const { return count; }
|
||||
bool empty() const { return size() == 0; }
|
||||
iterator pop_front() { return erase(begin()); }
|
||||
void clear() { erase(begin(), end()); }
|
||||
|
||||
iterator erase(JGadget::TNodeLinkList::iterator, JGadget::TNodeLinkList::iterator);
|
||||
iterator erase(JGadget::TNodeLinkList::iterator);
|
||||
void splice(JGadget::TNodeLinkList::iterator, JGadget::TNodeLinkList&,
|
||||
JGadget::TNodeLinkList::iterator);
|
||||
iterator Find(const JGadget::TLinkListNode*);
|
||||
iterator Insert(JGadget::TNodeLinkList::iterator, JGadget::TLinkListNode*);
|
||||
iterator Erase(JGadget::TLinkListNode*);
|
||||
void Remove(JGadget::TLinkListNode*);
|
||||
iterator erase(iterator, iterator);
|
||||
iterator erase(iterator);
|
||||
void splice(iterator, TNodeLinkList&);
|
||||
void splice(iterator, TNodeLinkList&, iterator);
|
||||
void splice(iterator, TNodeLinkList&, iterator, iterator);
|
||||
iterator Find(const TLinkListNode*);
|
||||
iterator Insert(iterator, TLinkListNode*);
|
||||
iterator Erase(TLinkListNode*);
|
||||
void Remove(TLinkListNode*);
|
||||
bool Confirm() const;
|
||||
bool Confirm_iterator(const_iterator) const;
|
||||
|
||||
bool Iterator_isEnd_(const_iterator it) const { return it.node == &ocObject_; }
|
||||
bool Iterator_isEnd_(const_iterator it) const { return it.p_ == &oNode_; }
|
||||
template <typename Predicate>
|
||||
void Remove_if(Predicate predicate, TNodeLinkList& tList) {
|
||||
iterator it = begin();
|
||||
@@ -115,7 +123,7 @@ struct TNodeLinkList {
|
||||
|
||||
public:
|
||||
/* 0x00 */ u32 count;
|
||||
/* 0x04 */ TLinkListNode ocObject_;
|
||||
/* 0x04 */ TLinkListNode oNode_;
|
||||
}; // Size: 0xC
|
||||
|
||||
template <typename T, int I>
|
||||
@@ -130,7 +138,7 @@ struct TLinkList : TNodeLinkList {
|
||||
//TODO: Probably fakematch? Not sure what's going on here exactly
|
||||
(TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&>&)*this =
|
||||
(const TIterator<std::bidirectional_iterator_tag, T, s32, T*, T&>&)rhs;
|
||||
this->node = rhs.node;
|
||||
this->p_ = rhs.p_;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace JGadget {
|
||||
template <typename T>
|
||||
struct TAllocator {
|
||||
T* allocate(u32 count, void *param_2) {
|
||||
T* allocate(u32 count, const void *param_2) {
|
||||
return AllocateRaw(count * sizeof(T));
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ struct TAllocator {
|
||||
DeallocateRaw(mem);
|
||||
}
|
||||
|
||||
void DeallocateRaw(T* mem) {
|
||||
void DeallocateRaw(void* mem) {
|
||||
delete mem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
#ifndef STD_VECTOR_H
|
||||
#define STD_VECTOR_H
|
||||
|
||||
#include "JSystem/JGadget/define.h"
|
||||
#include "JSystem/JGadget/std-memory.h"
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
namespace JGadget {
|
||||
namespace vector {
|
||||
@@ -33,7 +34,9 @@ struct TVector {
|
||||
typedef const T* const_iterator;
|
||||
|
||||
TVector(Allocator const& allocator) {
|
||||
#if PLATFORM_GCN
|
||||
mAllocator = allocator;
|
||||
#endif
|
||||
pBegin_ = NULL;
|
||||
pEnd_ = pBegin_;
|
||||
mCapacity = 0;
|
||||
@@ -41,48 +44,52 @@ struct TVector {
|
||||
}
|
||||
|
||||
~TVector() {
|
||||
#if DEBUG
|
||||
Confirm();
|
||||
#endif
|
||||
clear();
|
||||
JGADGET_ASSERTWARN(250, size()==0);
|
||||
mAllocator.deallocate(pBegin_, 0);
|
||||
}
|
||||
|
||||
void insert(T* pos, u32 count, const T& val) {
|
||||
if (count != 0) {
|
||||
T* ptr = Insert_raw(pos, count);
|
||||
if (ptr == end()) {
|
||||
/* JGadget_outMessage sp120(JGadget_outMessage::warning, __FILE__, 0x141);
|
||||
sp120 << "can't allocate memory"; */
|
||||
} else {
|
||||
std::uninitialized_fill_n(ptr, count, val);
|
||||
}
|
||||
if (count == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
T* ptr = Insert_raw(pos, count);
|
||||
if (ptr == end()) {
|
||||
JGADGET_WARNMSG(321, "can't allocate memory");
|
||||
} else {
|
||||
std::uninitialized_fill_n(ptr, count, val);
|
||||
}
|
||||
}
|
||||
|
||||
T* Insert_raw(T* pIt, u32 pCount) {
|
||||
JUT_ASSERT(446, (pBegin_ <= pIt) && (pIt <= pEnd_));
|
||||
|
||||
T* const pFirst = pIt;
|
||||
T* Insert_raw(T* pFirst, u32 pCount) {
|
||||
T* const pIt = pFirst;
|
||||
JUT_ASSERT(446, (pBegin_<=pIt)&&(pIt<=pEnd_));
|
||||
|
||||
if (pCount == 0) {
|
||||
return pIt;
|
||||
return pFirst;
|
||||
}
|
||||
|
||||
if (pCount + size() <= mCapacity) {
|
||||
void** newEnd = pFirst + pCount;
|
||||
void** newEnd = pIt + pCount;
|
||||
|
||||
if (newEnd < pEnd_) {
|
||||
void** pOverwrittenValues = pEnd_ - pCount;
|
||||
std::uninitialized_copy(pOverwrittenValues, pEnd_, pEnd_);
|
||||
std::copy_backward(pFirst, pOverwrittenValues, pEnd_);
|
||||
DestroyElement_(pFirst, newEnd);
|
||||
std::copy_backward(pIt, pOverwrittenValues, pEnd_);
|
||||
DestroyElement_(pIt, newEnd);
|
||||
|
||||
pEnd_ += pCount;
|
||||
return pIt;
|
||||
return pFirst;
|
||||
} else {
|
||||
std::uninitialized_copy(pFirst, pEnd_, newEnd);
|
||||
DestroyElement_(pFirst, pEnd_);
|
||||
std::uninitialized_copy(pIt, pEnd_, newEnd);
|
||||
DestroyElement_(pIt, pEnd_);
|
||||
|
||||
pEnd_ += pCount;
|
||||
return pIt;
|
||||
return pFirst;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,8 +102,8 @@ struct TVector {
|
||||
|
||||
TDestructed_deallocate_ destructionDeallocator(mAllocator, newDataPointer);
|
||||
|
||||
void** const endOfCopy = std::uninitialized_copy(pBegin_, pFirst, newDataPointer);
|
||||
std::uninitialized_copy(pFirst, pEnd_, endOfCopy + pCount);
|
||||
void** const endOfCopy = std::uninitialized_copy(pBegin_, pIt, newDataPointer);
|
||||
std::uninitialized_copy(pIt, pEnd_, endOfCopy + pCount);
|
||||
|
||||
DestroyElement_all_();
|
||||
destructionDeallocator.set(pBegin_);
|
||||
@@ -126,10 +133,18 @@ struct TVector {
|
||||
return (int)((uintptr_t)pEnd_ - (uintptr_t)pBegin_) / 4;
|
||||
}
|
||||
|
||||
u32 capacity() { return mCapacity; }
|
||||
u32 capacity() const { return mCapacity; }
|
||||
|
||||
u32 GetSize_extend_(u32 count) {
|
||||
JUT_ASSERT(0x22B, pfnExtend_!=NULL);
|
||||
bool Confirm() const {
|
||||
if (size() > mCapacity) {
|
||||
JGADGET_WARNMSG(507, "illegal size");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
u32 GetSize_extend_(u32 count) const {
|
||||
JUT_ASSERT(555, pfnExtend_!=NULL);
|
||||
|
||||
u32 oldSize = size();
|
||||
u32 neededNewSpace = oldSize + count;
|
||||
@@ -138,20 +153,28 @@ struct TVector {
|
||||
return neededNewSpace > extendedSize ? neededNewSpace : extendedSize;
|
||||
}
|
||||
|
||||
void DestroyElement_(T* start, T* end) {
|
||||
for (; start != end; start++) {
|
||||
mAllocator.destroy(start);
|
||||
void DestroyElement_(T* pFirst, T* pLast) {
|
||||
JUT_ASSERT(536, (pBegin_<=pFirst)&&(pFirst<=pEnd_));
|
||||
JUT_ASSERT(537, (pBegin_<=pLast)&&(pLast<=pEnd_));
|
||||
T* it = pFirst;
|
||||
for (; it != pLast; it++) {
|
||||
mAllocator.destroy(it);
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyElement_all_() { DestroyElement_(pBegin_, pEnd_); }
|
||||
|
||||
T* erase(T* start, T* end) {
|
||||
T* vectorEnd = pEnd_;
|
||||
T* ppvVar3 = std::copy(end, vectorEnd, start);
|
||||
T* erase(T* pFirst, T* pLast) {
|
||||
iterator pItFirst = pFirst;
|
||||
iterator pItLast = pLast;
|
||||
JUT_ASSERT(347, (pBegin_<=pItFirst)&&(pItFirst<=pEnd_))
|
||||
JUT_ASSERT(348, (pBegin_<=pItLast)&&(pItLast<=pEnd_));
|
||||
JUT_ASSERT(349, pItFirst<=pItLast);
|
||||
T* vectorEnd = pEnd_; // DEBUG NONMATCHING
|
||||
T* ppvVar3 = std::copy(pItLast, vectorEnd, pItFirst);
|
||||
DestroyElement_(ppvVar3, pEnd_);
|
||||
pEnd_ = ppvVar3;
|
||||
return start;
|
||||
return pFirst;
|
||||
}
|
||||
|
||||
void clear() { erase(begin(), end()); }
|
||||
|
||||
+36
-19
@@ -130,19 +130,16 @@ struct TVec3<s16> {
|
||||
}
|
||||
};
|
||||
|
||||
inline void setTVec3f(const f32* vec_a, f32* vec_b) {
|
||||
inline void setTVec3f(const __REGISTER f32* vec_a, __REGISTER f32* vec_b) {
|
||||
#ifdef __MWERKS__
|
||||
const __REGISTER f32* v_a = vec_a;
|
||||
__REGISTER f32* v_b = vec_b;
|
||||
|
||||
__REGISTER f32 a_x;
|
||||
__REGISTER f32 b_x;
|
||||
|
||||
asm {
|
||||
psq_l a_x, 0(v_a), 0, 0
|
||||
lfs b_x, 8(v_a)
|
||||
psq_st a_x, 0(v_b), 0, 0
|
||||
stfs b_x, 8(v_b)
|
||||
psq_l a_x, 0(vec_a), 0, 0
|
||||
lfs b_x, 8(vec_a)
|
||||
psq_st a_x, 0(vec_b), 0, 0
|
||||
stfs b_x, 8(vec_b)
|
||||
};
|
||||
#endif
|
||||
}
|
||||
@@ -247,7 +244,7 @@ struct TVec3<f32> : public Vec {
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVec3<f32> operator+(const TVec3<f32>& b) {
|
||||
inline TVec3<f32> operator+(const TVec3<f32>& b) const {
|
||||
TVec3<f32> a = *this;
|
||||
a += b;
|
||||
return a;
|
||||
@@ -289,6 +286,11 @@ struct TVec3<f32> : public Vec {
|
||||
}
|
||||
|
||||
void scale(__REGISTER f32 sc) {
|
||||
#if DEBUG
|
||||
x *= sc;
|
||||
y *= sc;
|
||||
z *= sc;
|
||||
#else
|
||||
#ifdef __MWERKS__
|
||||
__REGISTER f32 z;
|
||||
__REGISTER f32 x_y;
|
||||
@@ -303,6 +305,7 @@ struct TVec3<f32> : public Vec {
|
||||
ps_muls0 zres, z, sc
|
||||
psq_st zres, 8(dst), 1, 0
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -447,6 +450,14 @@ struct TVec2 {
|
||||
y += other.y;
|
||||
}
|
||||
|
||||
bool equals(const TVec2<T>& other) const {
|
||||
bool result = false;
|
||||
if (this->x == other.x && this->y == other.y) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool isAbove(const TVec2<T>& other) const {
|
||||
return (x >= other.x) && (y >= other.y) ? true : false;
|
||||
}
|
||||
@@ -463,6 +474,10 @@ struct TVec2 {
|
||||
return TUtil<f32>::sqrt(squared());
|
||||
}
|
||||
|
||||
bool operator==(const TVec2<T>& other) const {
|
||||
return equals(other);
|
||||
}
|
||||
|
||||
T x;
|
||||
T y;
|
||||
};
|
||||
@@ -497,6 +512,18 @@ template<> struct TBox<TVec2<f32> > {
|
||||
return isValid();
|
||||
}
|
||||
|
||||
void absolute() {
|
||||
if (this->isValid()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TBox<TVec2<f32> > box(*this);
|
||||
this->i.setMin(box.i);
|
||||
this->i.setMin(box.f);
|
||||
this->f.setMax(box.i);
|
||||
this->f.setMax(box.f);
|
||||
}
|
||||
|
||||
TVec2<f32> i, f;
|
||||
};
|
||||
|
||||
@@ -509,16 +536,6 @@ struct TBox2 : public TBox<TVec2<T> > {
|
||||
}
|
||||
TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); }
|
||||
|
||||
void absolute() {
|
||||
if (!this->isValid()) {
|
||||
TBox2<T> box(*this);
|
||||
this->i.setMin(box.i);
|
||||
this->i.setMin(box.f);
|
||||
this->f.setMax(box.i);
|
||||
this->f.setMax(box.f);
|
||||
}
|
||||
}
|
||||
|
||||
void set(const TBox<TVec2<T> >& other) { set(other.i, other.f); }
|
||||
void set(const TVec2<f32>& i, const TVec2<f32>& f) { this->i.set(i), this->f.set(f); }
|
||||
void set(f32 x0, f32 y0, f32 x1, f32 y1) { this->i.set(x0, y0); this->f.set(x1, y1); }
|
||||
|
||||
@@ -66,9 +66,13 @@ public:
|
||||
void setNExtensionName(u16 length) { mNExtensionName = length; }
|
||||
void setStatus(s32 status) { mStatus = status; }
|
||||
|
||||
virtual ~JORFile() {}
|
||||
virtual int open(const char* path, u32 flags, const char* extMask, const char* defaultExt, const char*, const char* fileSuffix);
|
||||
virtual int open(u32 flags, const char* extMask, const char* defaultExt, const char*, const char* fileSuffix);
|
||||
virtual ~JORFile() {
|
||||
close();
|
||||
}
|
||||
virtual int open(const char* path, u32 flags, const char* extMask, const char* defaultExt, const char* param_4, const char* fileSuffix);
|
||||
virtual int open(u32 flags, const char* extMask, const char* defaultExt, const char* param_4, const char* fileSuffix) {
|
||||
return open(NULL, flags, extMask, defaultExt, param_4, fileSuffix);
|
||||
}
|
||||
virtual void close();
|
||||
virtual s32 readData(void* buffer, s32 length);
|
||||
virtual s32 writeData(const void* buffer, s32 length);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JORMCONTEXT_H
|
||||
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
#include "JSystem/JHostIO/JORReflexible.h"
|
||||
#include "JSystem/JSupport/JSUMemoryStream.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JKREXPHEAP_H
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jkernel
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
#include <new>
|
||||
|
||||
class JKRHeap;
|
||||
typedef void (*JKRErrorHandler)(void*, u32, int);
|
||||
@@ -204,16 +205,6 @@ void* operator new[](size_t size, JKRHeap* heap, int alignment);
|
||||
void operator delete(void* ptr);
|
||||
void operator delete[](void* ptr);
|
||||
|
||||
#ifdef __MWERKS__
|
||||
inline void* operator new(size_t size, void* ptr) {
|
||||
return ptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline void* operator new[](size_t size, void* ptr) {
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void JKRDefaultMemoryErrorRoutine(void* heap, u32 size, int alignment);
|
||||
|
||||
inline void* JKRAllocFromHeap(JKRHeap* heap, u32 size, int alignment) {
|
||||
|
||||
@@ -2,8 +2,18 @@
|
||||
#define JMATRIGONOMETRIC_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include <cmath>
|
||||
#include <utility>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern double asin(double);
|
||||
extern double atan(double);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace JMath {
|
||||
template<typename T>
|
||||
struct TAngleConstant_;
|
||||
@@ -28,6 +38,16 @@ template<int N, typename T>
|
||||
struct TSinCosTable {
|
||||
std::pair<T, T> table[1 << N];
|
||||
|
||||
TSinCosTable() {
|
||||
init();
|
||||
}
|
||||
void init() {
|
||||
for (int i = 0; i < 1 << N; i++) {
|
||||
table[i].first = sin((i * f64(TAngleConstant_<f32>::RADIAN_DEG360())) / (1 << N));
|
||||
table[i].second = cos((i * f64(TAngleConstant_<f32>::RADIAN_DEG360())) / (1 << N));
|
||||
}
|
||||
}
|
||||
|
||||
T sinShort(s16 v) const { return table[(u16)v >> (16U - N)].first; }
|
||||
T cosShort(s16 v) const { return table[(u16)v >> (16U - N)].second; }
|
||||
|
||||
@@ -64,9 +84,23 @@ struct TSinCosTable {
|
||||
* @ingroup jsystem-jmath
|
||||
*
|
||||
*/
|
||||
template<int N, typename T>
|
||||
struct TAtanTable {
|
||||
f32 table[1025];
|
||||
T table[N + 1];
|
||||
u8 pad[0x1C];
|
||||
|
||||
TAtanTable() {
|
||||
init();
|
||||
}
|
||||
|
||||
void init() {
|
||||
// u32 cast needed for cmplwi instead of cmpwi
|
||||
for (int i = 0; i < (u32)N; i++) {
|
||||
table[i] = atan(i / (f64)N);
|
||||
}
|
||||
table[0] = 0.0f;
|
||||
table[N] = TAngleConstant_<T>::RADIAN_DEG180() / 4.0f;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -75,9 +109,21 @@ struct TAtanTable {
|
||||
*/
|
||||
template<int N, typename T>
|
||||
struct TAsinAcosTable {
|
||||
T table[1025];
|
||||
T table[N + 1];
|
||||
u8 pad[0x1C];
|
||||
|
||||
TAsinAcosTable() {
|
||||
init();
|
||||
}
|
||||
|
||||
void init() {
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
table[i] = asin(i / (f64)N);
|
||||
}
|
||||
table[0] = 0.0f;
|
||||
table[N] = TAngleConstant_<T>::RADIAN_DEG180() / 4.0f;
|
||||
}
|
||||
|
||||
T acos_(T x) const {
|
||||
if (x >= 1.0f) {
|
||||
return 0.0f;
|
||||
@@ -96,7 +142,7 @@ struct TAsinAcosTable {
|
||||
};
|
||||
|
||||
extern TSinCosTable<13, f32> sincosTable_;
|
||||
extern TAtanTable atanTable_;
|
||||
extern TAtanTable<1024, f32> atanTable_;
|
||||
extern TAsinAcosTable<1024, f32> asinAcosTable_;
|
||||
|
||||
inline f32 acosDegree(f32 x) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JMATH_H
|
||||
|
||||
#include "dolphin/mtx.h"
|
||||
#include <math>
|
||||
#include <cmath>
|
||||
|
||||
void JMAMTXApplyScale(const Mtx, Mtx, f32, f32, f32);
|
||||
void JMAEulerToQuat(s16 param_0, s16 param_1, s16 param_2, Quaternion* param_3);
|
||||
@@ -197,14 +197,15 @@ namespace JMathInlineVEC {
|
||||
#ifdef __MWERKS__
|
||||
__REGISTER f32 axy;
|
||||
__REGISTER f32 bxy;
|
||||
__REGISTER f32 sumab;
|
||||
__REGISTER f32 az;
|
||||
__REGISTER f32 sumz;
|
||||
__REGISTER f32 bz;
|
||||
__REGISTER f32 sumz;
|
||||
asm {
|
||||
psq_l axy, 0(a), 0, 0
|
||||
psq_l bxy, 0(b), 0, 0
|
||||
ps_add bxy, axy, bxy
|
||||
psq_st bxy, 0(ab), 0, 0
|
||||
ps_add sumab, axy, bxy
|
||||
psq_st sumab, 0(ab), 0, 0
|
||||
psq_l az, 8(a), 1, 0
|
||||
psq_l bz, 8(b), 1, 0
|
||||
ps_add sumz, az, bz
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JPAEMITTER_H
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
#include "JSystem/JParticle/JPAResource.h"
|
||||
#include "JSystem/JParticle/JPAList.h"
|
||||
#include "JSystem/JParticle/JPARandom.h"
|
||||
@@ -151,7 +151,10 @@ public:
|
||||
void setAwayFromAxisSpeed(f32 i_speed) { mAwayFromAxisSpeed = i_speed; }
|
||||
void setSpread(f32 i_spread) { mSpread = i_spread; }
|
||||
void setLocalTranslation(const JGeometry::TVec3<f32>& i_trans) { mLocalTrs.set(i_trans); }
|
||||
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); }
|
||||
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) {
|
||||
mLocalRot.set(i_rot.x * (360.0f / 0xffff), i_rot.y * (360.0f / 0xffff),
|
||||
i_rot.z * (360.0f / 0xffff));
|
||||
}
|
||||
void setRateStep(u8 i_step) { mRateStep = i_step; }
|
||||
|
||||
void setGlobalParticleHeightScale(f32 height) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef FUNCTIONVALUE_H
|
||||
#define FUNCTIONVALUE_H
|
||||
|
||||
#include <math>
|
||||
#include <cmath>
|
||||
#include "JSystem/JGadget/std-vector.h"
|
||||
#include "JSystem/JGadget/define.h"
|
||||
#include "JSystem/JGadget/search.h"
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
#define JSTUDIO_MATH_H
|
||||
|
||||
#include "dolphin/mtx.h"
|
||||
#include <math>
|
||||
#include <cmath>
|
||||
|
||||
#define m_PI_D 3.141592653589793
|
||||
|
||||
namespace JStudio {
|
||||
namespace math {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "JSystem/JStudio/JStudio/jstudio-control.h"
|
||||
#include "global.h"
|
||||
#include <limits>
|
||||
#include <math>
|
||||
#include <cmath>
|
||||
|
||||
typedef struct _GXColor GXColor;
|
||||
|
||||
|
||||
@@ -89,6 +89,10 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
s32 read(bool& val) {
|
||||
return read(&val, sizeof(bool));
|
||||
}
|
||||
|
||||
s32 read(u8& val) {
|
||||
return read(&val, sizeof(u8));
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JSUPPORT_H
|
||||
|
||||
#include <dolphin/dolphin.h>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jsupport
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifndef JSYSTEM_PCH
|
||||
#define JSYSTEM_PCH
|
||||
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DMaterialAttach.h"
|
||||
#include "JSystem/J3DGraphBase/J3DPacket.h"
|
||||
#include "JSystem/J3DGraphBase/J3DShape.h"
|
||||
#include "JSystem/JAudio2/JASDSPChannel.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
#endif // JSYSTEM_PCH
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#define JUT_PANIC_F(LINE, MSG, ...) \
|
||||
JUTAssertion::showAssert_f(JUTAssertion::getSDevice(), __FILE__, LINE, MSG, __VA_ARGS__); \
|
||||
OSPanic(__FILE__, LINE, MSG, __VA_ARGS__);
|
||||
OSPanic(__FILE__, LINE, "Halt");
|
||||
|
||||
#define JUT_WARN_DEVICE(LINE, DEVICE, ...) \
|
||||
JUTAssertion::setWarningMessage_f(DEVICE, __FILE__, LINE, __VA_ARGS__); \
|
||||
@@ -63,7 +63,7 @@ namespace JUTAssertion {
|
||||
|
||||
u32 getSDevice();
|
||||
void showAssert_f(u32 device, const char* file, int line, const char* msg, ...);
|
||||
void showAssert_f_va(u32 device, const char* file, int line, const char* msg, __va_list args);
|
||||
void showAssert_f_va(u32 device, const char* file, int line, const char* msg, va_list args);
|
||||
void setWarningMessage_f(u32 device, char * file, int line, const char * fmt, ...);
|
||||
void setWarningMessage_f_va(u32 device, const char* file, int line, const char* msg, va_list args);
|
||||
void setLogMessage_f(u32 device, char* file, int line, const char* fmt, ...);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "JSystem/JUtility/JUTFont.h"
|
||||
#include <stdarg>
|
||||
#include <cstdarg>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JUTDIRECTPRINT_H
|
||||
|
||||
#include "JSystem/JUtility/TColor.h"
|
||||
#include <stdarg>
|
||||
#include <cstdarg>
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jutility
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
#include "JSystem/JUtility/JUTGamePad.h"
|
||||
#include <stdarg>
|
||||
#include <cstdarg>
|
||||
#include <dolphin/gx.h>
|
||||
#include <dolphin/os.h>
|
||||
#include "global.h"
|
||||
|
||||
@@ -30,7 +30,8 @@ public:
|
||||
}
|
||||
|
||||
void end() {
|
||||
mCost = ((OSGetTick() - mTick) * 8) / ((*(u32*)0x800000F8 / 4) / 125000);
|
||||
OSTick diff = OSGetTick() - mTick;
|
||||
mCost = OSTicksToMicroseconds(diff);
|
||||
if (mCost == 0) {
|
||||
mCost = 1;
|
||||
}
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
void wholeLoopEnd() { mWholeLoop.end(); }
|
||||
void idleStart() { mIdle.start(255, 129, 30); }
|
||||
void idleEnd() { mIdle.end(); }
|
||||
void setCostFrame(int frame) { mCostFrame = frame; }
|
||||
void setCostFrame(int frame) { sManager->mCostFrame = frame; }
|
||||
void setVisible(bool visible) { mVisible = visible; }
|
||||
void setVisibleHeapBar(bool visible) { mHeapBarVisible = visible; }
|
||||
void setWatchHeap(JKRHeap* pHeap) { mWatchHeap = pHeap; }
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define JUTTEXTURE_H
|
||||
|
||||
#include <dolphin/gx.h>
|
||||
#include <stdint>
|
||||
#include <stdint.h>
|
||||
|
||||
class JUTPalette;
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ public:
|
||||
width = (u16)getFbWidth();
|
||||
height = (u16)getEfbHeight();
|
||||
}
|
||||
u16 getXfbHeight() const { return mRenderObj->xfbHeight; }
|
||||
u32 isAntiAliasing() const { return mRenderObj->aa; }
|
||||
u16 getXfbHeight() const { return u16(mRenderObj->xfbHeight); }
|
||||
u8 isAntiAliasing() const { return u8(mRenderObj->aa); }
|
||||
Pattern getSamplePattern() const { return mRenderObj->sample_pattern; }
|
||||
u8* getVFilter() const { return mRenderObj->vfilter; }
|
||||
OSMessageQueue* getMessageQueue() { return &mMessageQueue; }
|
||||
|
||||
@@ -45,15 +45,23 @@ public:
|
||||
}
|
||||
|
||||
void* getDrawingXfb() const {
|
||||
if (mDrawingXfbIndex >= 0)
|
||||
return mBuffer[mDrawingXfbIndex];
|
||||
return NULL;
|
||||
void* result;
|
||||
if (mDrawingXfbIndex >= 0) {
|
||||
result = mBuffer[mDrawingXfbIndex];
|
||||
} else {
|
||||
result = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void* getDisplayingXfb() const {
|
||||
if (mDisplayingXfbIndex >= 0)
|
||||
return mBuffer[mDisplayingXfbIndex];
|
||||
return NULL;
|
||||
void* xfb;
|
||||
if (mDisplayingXfbIndex >= 0) {
|
||||
xfb = mBuffer[mDisplayingXfbIndex];
|
||||
} else {
|
||||
xfb = NULL;
|
||||
}
|
||||
return xfb;
|
||||
}
|
||||
|
||||
void setDisplayingXfbIndex(s16 index) { mDisplayingXfbIndex = index; }
|
||||
|
||||
Reference in New Issue
Block a user