mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-09 14:05:28 -04:00
Merge branch 'main' of https://github.com/Crain-32/tww
This commit is contained in:
+2
-2
@@ -891,8 +891,8 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DClusterLoader.cpp"),
|
||||
Object(Matching, "JSystem/J3DGraphLoader/J3DModelLoader.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DModelLoaderCalcSize.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DJointFactory.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DShapeFactory.cpp"),
|
||||
Object(Matching, "JSystem/J3DGraphLoader/J3DJointFactory.cpp"),
|
||||
Object(Matching, "JSystem/J3DGraphLoader/J3DShapeFactory.cpp"),
|
||||
Object(NonMatching, "JSystem/J3DGraphLoader/J3DAnmLoader.cpp"),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -84,7 +84,9 @@ struct J3DAnmClusterFullTable {
|
||||
u16 mOffset;
|
||||
};
|
||||
|
||||
struct J3DAnmClusterKeyTable;
|
||||
struct J3DAnmClusterKeyTable {
|
||||
/* 0x00 */ J3DAnmKeyTableBase mWeightTable;
|
||||
};
|
||||
|
||||
// same as J3DModelBlock?
|
||||
struct J3DAnmDataBlockHeader { // actual name unknown
|
||||
@@ -112,7 +114,8 @@ struct J3DAnmVtxColorFullData {
|
||||
/* 0x09 */ u8 field_0x9; // padding?
|
||||
/* 0x0A */ s16 mFrameMax;
|
||||
/* 0x0C */ u16 mAnmTableNum[2];
|
||||
/* 0x10 */ u8 field_0x10[0x18 - 0x10];
|
||||
/* 0x10 */ u16 mIndexNum[2];
|
||||
/* 0x14 */ u32 field_0x14;
|
||||
/* 0x18 */ s32 mTableOffsets[2];
|
||||
/* 0x20 */ s32 mVtxColorIndexDataOffsets[2];
|
||||
/* 0x28 */ s32 mVtxColorIndexPointerOffsets[2];
|
||||
@@ -213,14 +216,14 @@ struct J3DAnmVtxColorKeyData {
|
||||
/* 0x09 */ u8 field_0x9;
|
||||
/* 0x0A */ s16 mFrameMax;
|
||||
/* 0x0C */ u16 mAnmTableNum[2];
|
||||
/* 0x10 */ u8 field_0x10[0x18 - 0x10];
|
||||
/* 0x10 */ u32 mIndexNum[2];
|
||||
/* 0x18 */ s32 mTableOffsets[2];
|
||||
/* 0x20 */ s32 mVtxColoIndexDataOffset[2];
|
||||
/* 0x28 */ s32 mVtxColoIndexPointerOffset[2];
|
||||
/* 0x30 */ s32 mRValOffset;
|
||||
/* 0x34 */ s32 mGValOffset;
|
||||
/* 0x38 */ s32 mBValOffset;
|
||||
/* 0x3C */ s32 mAValOffset;
|
||||
/* 0x20 */ s32 mVtxColorIndexDataOffsets[2];
|
||||
/* 0x28 */ s32 mVtxColorIndexPointerOffsets[2];
|
||||
/* 0x30 */ s32 mRValuesOffset;
|
||||
/* 0x34 */ s32 mGValuesOffset;
|
||||
/* 0x38 */ s32 mBValuesOffset;
|
||||
/* 0x3C */ s32 mAValuesOffset;
|
||||
}; // Size = 0x40
|
||||
|
||||
STATIC_ASSERT(sizeof(J3DAnmVtxColorKeyData) == 0x40);
|
||||
@@ -547,24 +550,24 @@ public:
|
||||
J3DAnmTevRegKey() : J3DAnmBase(0) {
|
||||
mKRegUpdateMaterialNum = 0;
|
||||
mCRegUpdateMaterialNum = 0;
|
||||
mCRegDataCount[3] = 0;
|
||||
mCRegDataCount[2] = 0;
|
||||
mCRegDataCount[1] = 0;
|
||||
mCRegDataCount[0] = 0;
|
||||
mKRegDataCount[3] = 0;
|
||||
mKRegDataCount[2] = 0;
|
||||
mKRegDataCount[1] = 0;
|
||||
mKRegDataCount[0] = 0;
|
||||
mCRegDataCountA = 0;
|
||||
mCRegDataCountB = 0;
|
||||
mCRegDataCountG = 0;
|
||||
mCRegDataCountR = 0;
|
||||
mKRegDataCountA = 0;
|
||||
mKRegDataCountB = 0;
|
||||
mKRegDataCountG = 0;
|
||||
mKRegDataCountR = 0;
|
||||
mKRegUpdateMaterialID = NULL;
|
||||
mCRegUpdateMaterialID = NULL;
|
||||
mAnmCRegData[3] = NULL;
|
||||
mAnmCRegData[2] = NULL;
|
||||
mAnmCRegData[1] = NULL;
|
||||
mAnmCRegData[0] = NULL;
|
||||
mAnmKRegData[3] = NULL;
|
||||
mAnmKRegData[2] = NULL;
|
||||
mAnmKRegData[1] = NULL;
|
||||
mAnmKRegData[0] = NULL;
|
||||
mAnmCRegDataA = NULL;
|
||||
mAnmCRegDataB = NULL;
|
||||
mAnmCRegDataG = NULL;
|
||||
mAnmCRegDataR = NULL;
|
||||
mAnmKRegDataA = NULL;
|
||||
mAnmKRegDataB = NULL;
|
||||
mAnmKRegDataG = NULL;
|
||||
mAnmKRegDataR = NULL;
|
||||
mKind = 5;
|
||||
}
|
||||
void getTevColorReg(u16, GXColorS10*) const;
|
||||
@@ -589,16 +592,28 @@ public:
|
||||
private:
|
||||
/* 0x10 */ u16 mCRegUpdateMaterialNum;
|
||||
/* 0x12 */ u16 mKRegUpdateMaterialNum;
|
||||
/* 0x14 */ u16 mCRegDataCount[4];
|
||||
/* 0x1C */ u16 mKRegDataCount[4];
|
||||
/* 0x14 */ u16 mCRegDataCountR;
|
||||
/* 0x16 */ u16 mCRegDataCountG;
|
||||
/* 0x18 */ u16 mCRegDataCountB;
|
||||
/* 0x1A */ u16 mCRegDataCountA;
|
||||
/* 0x1C */ u16 mKRegDataCountR;
|
||||
/* 0x1E */ u16 mKRegDataCountG;
|
||||
/* 0x20 */ u16 mKRegDataCountB;
|
||||
/* 0x22 */ u16 mKRegDataCountA;
|
||||
/* 0x24 */ u16* mCRegUpdateMaterialID;
|
||||
/* 0x28 */ JUTNameTab mCRegUpdateMaterialName;
|
||||
/* 0x38 */ u16* mKRegUpdateMaterialID;
|
||||
/* 0x3C */ JUTNameTab mKRegUpdateMaterialName;
|
||||
/* 0x4C */ J3DAnmCRegKeyTable* mAnmCRegKeyTable;
|
||||
/* 0x50 */ J3DAnmKRegKeyTable* mAnmKRegKeyTable;
|
||||
/* 0x54 */ s16 * mAnmCRegData[4];
|
||||
/* 0x64 */ s16 * mAnmKRegData[4];
|
||||
/* 0x54 */ s16 * mAnmCRegDataR;
|
||||
/* 0x58 */ s16 * mAnmCRegDataG;
|
||||
/* 0x5C */ s16 * mAnmCRegDataB;
|
||||
/* 0x60 */ s16 * mAnmCRegDataA;
|
||||
/* 0x64 */ s16 * mAnmKRegDataR;
|
||||
/* 0x68 */ s16 * mAnmKRegDataG;
|
||||
/* 0x6C */ s16 * mAnmKRegDataB;
|
||||
/* 0x70 */ s16 * mAnmKRegDataA;
|
||||
}; // Size: 0x74
|
||||
|
||||
class J3DAnmColor : public J3DAnmBase {
|
||||
@@ -689,48 +704,62 @@ public:
|
||||
mAnmTableNum[i] = 0;
|
||||
}
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mAnmVtxColorIndexData[i] = 0;
|
||||
mAnmVtxColorIndexData[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~J3DAnmVtxColor();
|
||||
virtual void getColor(u8, u16, GXColor*) const {}
|
||||
|
||||
private:
|
||||
protected:
|
||||
/* 0x10 */ s16 mAnmTableNum[2];
|
||||
/* 0x14 */ int mAnmVtxColorIndexData[2];
|
||||
/* 0x14 */ void* mAnmVtxColorIndexData[2];
|
||||
}; // Size: 0x1C
|
||||
|
||||
class J3DAnmVtxColorKey : public J3DAnmVtxColor {
|
||||
public:
|
||||
friend class J3DAnmKeyLoader_v15;
|
||||
|
||||
J3DAnmVtxColorKey() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
field_0x1c[i] = 0;
|
||||
mpTable[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~J3DAnmVtxColorKey();
|
||||
virtual void getColor(u8, u16, GXColor*) const;
|
||||
|
||||
private:
|
||||
/* 0x1C */ int field_0x1c[2];
|
||||
/* 0x24 */ u8 field_0x24[0x34 - 0x24];
|
||||
J3DAnmColorKeyTable * getAnmTable(u8 idx) const { return mpTable[idx]; }
|
||||
|
||||
protected:
|
||||
/* 0x1C */ J3DAnmColorKeyTable* mpTable[2];
|
||||
/* 0x24 */ s16* mColorR;
|
||||
/* 0x28 */ s16* mColorG;
|
||||
/* 0x2C */ s16* mColorB;
|
||||
/* 0x30 */ s16* mColorA;
|
||||
};
|
||||
|
||||
class J3DAnmVtxColorFull : public J3DAnmVtxColor {
|
||||
public:
|
||||
friend class J3DAnmFullLoader_v15;
|
||||
|
||||
J3DAnmVtxColorFull() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
field_0x1c[i] = 0;
|
||||
mpTable[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~J3DAnmVtxColorFull();
|
||||
virtual void getColor(u8, u16, GXColor*) const;
|
||||
|
||||
private:
|
||||
/* 0x1C */ int field_0x1c[2];
|
||||
/* 0x24 */ u8 field_0x24[0x34 - 0x24];
|
||||
J3DAnmColorFullTable * getAnmTable(u8 idx) const { return mpTable[idx]; }
|
||||
|
||||
protected:
|
||||
/* 0x1C */ J3DAnmColorFullTable* mpTable[2];
|
||||
/* 0x24 */ u8* mColorR;
|
||||
/* 0x28 */ u8* mColorG;
|
||||
/* 0x2C */ u8* mColorB;
|
||||
/* 0x30 */ u8* mColorA;
|
||||
};
|
||||
|
||||
class J3DAnmCluster : public J3DAnmBase {
|
||||
@@ -767,13 +796,13 @@ public:
|
||||
friend class J3DAnmKeyLoader_v15;
|
||||
|
||||
J3DAnmClusterKey() : J3DAnmCluster(3, NULL) {
|
||||
field_0x14 = 0;
|
||||
mAnmTable = NULL;
|
||||
}
|
||||
virtual ~J3DAnmClusterKey() {}
|
||||
virtual f32 getWeight(u16) const;
|
||||
|
||||
private:
|
||||
/* 0x14 */ J3DAnmClusterKeyTable* field_0x14;
|
||||
/* 0x14 */ J3DAnmClusterKeyTable* mAnmTable;
|
||||
};
|
||||
|
||||
class J3DFrameCtrl {
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
J3DDrawMtxData * getDrawMtxData() { return &mDrawMtxData; }
|
||||
u16 getWEvlpMtxNum() const { return mWEvlpMtxNum; }
|
||||
u8 getWEvlpMixMtxNum(u16 idx) const { return mWEvlpMixMtxNum[idx]; }
|
||||
u16 * getWEvlpMixMtxIndex() const { return mWEvlpMixMtxIndex; }
|
||||
u16 * getWEvlpMixMtxIndex() { return mWEvlpMixMtxIndex; }
|
||||
f32 * getWEvlpMixWeight() { return mWEvlpMixWeight; }
|
||||
u16 getDrawFullWgtMtxNum() const { return mDrawMtxData.mDrawFullWgtMtxNum; }
|
||||
u16 getJointNum() const { return mJointNum; }
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
struct J3DGXColorS10 {
|
||||
J3DGXColorS10() {}
|
||||
J3DGXColorS10(J3DGXColorS10& other) { mColor = other.mColor; }
|
||||
J3DGXColorS10(const GXColorS10& other) { mColor = other; }
|
||||
J3DGXColorS10(const J3DGXColorS10& other) { mColor = other.mColor; }
|
||||
J3DGXColorS10& operator=(const J3DGXColorS10& other) {
|
||||
mColor = other.mColor;
|
||||
return *this;
|
||||
@@ -24,7 +25,8 @@ struct J3DGXColorS10 {
|
||||
|
||||
struct J3DGXColor {
|
||||
J3DGXColor() {}
|
||||
J3DGXColor(J3DGXColor& other) { mColor = other.mColor; }
|
||||
J3DGXColor(const GXColor& other) { mColor = other; }
|
||||
J3DGXColor(const J3DGXColor& other) { mColor = other.mColor; }
|
||||
J3DGXColor& operator=(const J3DGXColor& other) {
|
||||
mColor = other.mColor;
|
||||
return *this;
|
||||
@@ -271,6 +273,7 @@ private:
|
||||
|
||||
class J3DTevBlockNull : public J3DTevBlock {
|
||||
public:
|
||||
J3DTevBlockNull() { initialize(); }
|
||||
virtual void reset(J3DTevBlock*) {}
|
||||
virtual void ptrToIndex() {}
|
||||
virtual void indexToPtr() {}
|
||||
@@ -561,6 +564,7 @@ extern J3DZModeInfo j3dZModeTable[0x20];
|
||||
|
||||
struct J3DZMode {
|
||||
J3DZMode() { mZModeID = j3dDefaultZModeID; }
|
||||
explicit J3DZMode(const J3DZModeInfo& info) { setZModeInfo(info); }
|
||||
|
||||
u8 getCompareEnaable() const { return j3dZModeTable[mZModeID].mCompareEnable; }
|
||||
u8 getFunc() const { return j3dZModeTable[mZModeID].mFunc; }
|
||||
@@ -588,6 +592,7 @@ struct J3DZMode {
|
||||
|
||||
struct J3DBlend : public J3DBlendInfo {
|
||||
J3DBlend() { *(J3DBlendInfo*)this = j3dDefaultBlendInfo; }
|
||||
explicit J3DBlend(const J3DBlendInfo& info) { *(J3DBlendInfo*)this = info; }
|
||||
|
||||
GXBlendMode getBlendMode() const { return (GXBlendMode)mBlendMode; }
|
||||
GXBlendFactor getSrcFactor() const { return (GXBlendFactor)mSrcFactor; }
|
||||
@@ -616,6 +621,7 @@ extern const J3DFogInfo j3dDefaultFogInfo;
|
||||
struct J3DFog : public J3DFogInfo {
|
||||
// J3DFog() { *getFogInfo() = j3dDefaultFogInfo; } // Produces the wrong codegen for mDoExt_backupMatBlock_c's constructor
|
||||
J3DFog() { J3DFogInfo::operator=(j3dDefaultFogInfo); }
|
||||
explicit J3DFog(const J3DFogInfo& info) { J3DFogInfo::operator=(info); }
|
||||
J3DFogInfo* getFogInfo() { return (J3DFogInfo*)this; }
|
||||
|
||||
void load() {
|
||||
@@ -625,18 +631,18 @@ struct J3DFog : public J3DFogInfo {
|
||||
};
|
||||
|
||||
struct J3DAlphaCompInfo {
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
/* 0x1 */ u8 field_0x1;
|
||||
/* 0x2 */ u8 mRef0;
|
||||
/* 0x3 */ u8 mRef1;
|
||||
/* 0x4 */ u8 field_0x4;
|
||||
/* 0x0 */ u8 mComp0;
|
||||
/* 0x1 */ u8 mRef0;
|
||||
/* 0x2 */ u8 mOp;
|
||||
/* 0x3 */ u8 mComp1;
|
||||
/* 0x4 */ u8 mRef1;
|
||||
/* 0x5 */ u8 field_0x5;
|
||||
/* 0x6 */ u8 field_0x6;
|
||||
/* 0x7 */ u8 field_0x7;
|
||||
};
|
||||
|
||||
inline u32 calcAlphaCmpID(u32 param_1, u32 param_2, u32 param_3) {
|
||||
return ((param_1 & 0xff) << 5) + ((param_2 & 0xff) << 3) + (param_3 & 0xff);
|
||||
inline u16 calcAlphaCmpID(u32 comp0, u32 op, u32 comp1) {
|
||||
return (comp0 << 5) + ((op & 0xff) << 3) + (comp1 & 0xff);
|
||||
}
|
||||
|
||||
extern u8 j3dAlphaCmpTable[768];
|
||||
@@ -648,6 +654,8 @@ struct J3DAlphaComp {
|
||||
mRef1 = 0;
|
||||
}
|
||||
|
||||
explicit J3DAlphaComp(const J3DAlphaCompInfo& info) { setAlphaCompInfo(info); }
|
||||
|
||||
GXCompare getComp0() const { return GXCompare(j3dAlphaCmpTable[mAlphaCmpID * 3]); }
|
||||
GXAlphaOp getOp() const { return GXAlphaOp(j3dAlphaCmpTable[mAlphaCmpID * 3 + 1]); }
|
||||
GXCompare getComp1() const { return GXCompare(j3dAlphaCmpTable[mAlphaCmpID * 3 + 2]); }
|
||||
@@ -655,7 +663,9 @@ struct J3DAlphaComp {
|
||||
u8 getRef1() const { return mRef1; }
|
||||
|
||||
void setAlphaCompInfo(const J3DAlphaCompInfo& info) {
|
||||
// mAlphaCmpID = calcAlphaCmpID(param_1, param_1.mRef0, param_1.mRef1);
|
||||
mAlphaCmpID = calcAlphaCmpID(info.mComp0, info.mOp, info.mComp1);
|
||||
mRef0 = info.mRef0;
|
||||
mRef1 = info.mRef1;
|
||||
}
|
||||
|
||||
void load() {
|
||||
@@ -815,6 +825,7 @@ public:
|
||||
|
||||
struct J3DIndTexCoordScale : public J3DIndTexCoordScaleInfo {
|
||||
J3DIndTexCoordScale() { *(J3DIndTexCoordScaleInfo*)this = j3dDefaultIndTexCoordScaleInfo; }
|
||||
explicit J3DIndTexCoordScale(const J3DIndTexCoordScaleInfo& info) {*(J3DIndTexCoordScaleInfo*)this = info; }
|
||||
~J3DIndTexCoordScale() {}
|
||||
|
||||
u8 getScaleS() { return mScaleS; }
|
||||
@@ -823,6 +834,7 @@ struct J3DIndTexCoordScale : public J3DIndTexCoordScaleInfo {
|
||||
|
||||
struct J3DIndTexMtx : public J3DIndTexMtxInfo {
|
||||
J3DIndTexMtx() {*(J3DIndTexMtxInfo*)this = j3dDefaultIndTexMtxInfo; }
|
||||
explicit J3DIndTexMtx(const J3DIndTexMtxInfo& info) {*(J3DIndTexMtxInfo*)this = info; }
|
||||
~J3DIndTexMtx() {}
|
||||
|
||||
void load(u32 param_1) {
|
||||
@@ -839,7 +851,8 @@ struct J3DIndTexMtx : public J3DIndTexMtxInfo {
|
||||
}; // Size: 0x1C
|
||||
|
||||
struct J3DIndTexOrder : public J3DIndTexOrderInfo {
|
||||
J3DIndTexOrder() { *(J3DIndTexOrderInfo*) this = j3dDefaultIndTexOrderNull; }
|
||||
J3DIndTexOrder() { *(J3DIndTexOrderInfo*)this = j3dDefaultIndTexOrderNull; }
|
||||
explicit J3DIndTexOrder(const J3DIndTexOrderInfo& info) { *(J3DIndTexOrderInfo*)this = info; }
|
||||
|
||||
u8 getCoord() const { return mCoord; }
|
||||
u8 getMap() const { return mMap; }
|
||||
@@ -938,6 +951,7 @@ inline u32 setChanCtrlMacro(u8 enable, GXColorSrc ambSrc, GXColorSrc matSrc, u32
|
||||
|
||||
struct J3DColorChan {
|
||||
J3DColorChan() { setColorChanInfo(j3dDefaultColorChanInfo); }
|
||||
J3DColorChan(const J3DColorChanInfo & info) { setColorChanInfo(info); }
|
||||
GXAttnFn getAttnFn();
|
||||
GXDiffuseFn getDiffuseFn() { return GXDiffuseFn(mChanCtrl >> 7 & 3); }
|
||||
u8 getLightMask() { return ((mChanCtrl >> 2 & 0x0f) | (mChanCtrl >> 11 & 0x0f) << 4); }
|
||||
|
||||
@@ -109,6 +109,7 @@ public:
|
||||
|
||||
class J3DPatchedMaterial : public J3DMaterial {
|
||||
public:
|
||||
J3DPatchedMaterial() { initialize(); }
|
||||
void initialize();
|
||||
|
||||
virtual void calc(const Mtx);
|
||||
@@ -122,6 +123,7 @@ public:
|
||||
|
||||
class J3DLockedMaterial : public J3DMaterial {
|
||||
public:
|
||||
J3DLockedMaterial() { initialize(); }
|
||||
void initialize();
|
||||
|
||||
virtual void calc(const Mtx);
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
class J3DCurrentMtxInfo {
|
||||
public:
|
||||
u32 mMtxIdxRegA;
|
||||
u32 mMtxIdxRegB;
|
||||
/* 0x00 */ u32 mMtxIdxRegA;
|
||||
/* 0x04 */ u32 mMtxIdxRegB;
|
||||
};
|
||||
|
||||
static inline void J3DFifoWriteCPCmd(u8 cmd, u32 param) {
|
||||
@@ -31,6 +31,11 @@ public:
|
||||
mMtxIdxRegB = 0x00f3cf3c;
|
||||
}
|
||||
|
||||
explicit J3DCurrentMtx(const J3DCurrentMtxInfo& info) {
|
||||
mMtxIdxRegA = info.mMtxIdxRegA;
|
||||
mMtxIdxRegB = info.mMtxIdxRegB;
|
||||
}
|
||||
|
||||
u32 getMtxIdxRegA() const { return mMtxIdxRegA; }
|
||||
u32 getMtxIdxRegB() const { return mMtxIdxRegB; }
|
||||
|
||||
|
||||
@@ -78,7 +78,8 @@ public:
|
||||
|
||||
class J3DShapeMtxMultiImm : public J3DShapeMtxImm {
|
||||
public:
|
||||
J3DShapeMtxMultiImm(u16 useMtxIndex) : J3DShapeMtxImm(useMtxIndex) {}
|
||||
J3DShapeMtxMultiImm(u16 useMtxIndex, u16 useMtxNum, u16* useMtxIndexTable)
|
||||
: J3DShapeMtxImm(useMtxIndex), mUseMtxNum(useMtxNum), mUseMtxIndexTable(useMtxIndexTable) {}
|
||||
|
||||
virtual ~J3DShapeMtxMultiImm() {}
|
||||
virtual u32 getType() const { return 'SMMI'; }
|
||||
|
||||
@@ -145,8 +145,8 @@ struct J3DIndTexOrderInfo {
|
||||
};
|
||||
|
||||
struct J3DTevSwapModeInfo {
|
||||
/* 0x0 */ u8 field_0x0 ALIGN_DECL(4);
|
||||
/* 0x1 */ u8 field_0x1;
|
||||
/* 0x0 */ u8 mRasSel ALIGN_DECL(4);
|
||||
/* 0x1 */ u8 mTexSel;
|
||||
};
|
||||
|
||||
struct J3DTevSwapModeTableInfo {
|
||||
|
||||
@@ -36,7 +36,7 @@ struct J3DTevStage {
|
||||
setTevStageInfo(j3dDefaultTevStageInfo);
|
||||
setTevSwapModeInfo(j3dDefaultTevSwapMode);
|
||||
}
|
||||
J3DTevStage(const J3DTevStageInfo& info) {
|
||||
explicit J3DTevStage(const J3DTevStageInfo& info) {
|
||||
setTevStageInfo(info);
|
||||
setTevSwapModeInfo(j3dDefaultTevSwapMode);
|
||||
}
|
||||
@@ -100,8 +100,8 @@ struct J3DTevStage {
|
||||
void setTexSel(u8 param_0) { mTevSwapModeInfo = mTevSwapModeInfo & ~0x0C | param_0 << 2; }
|
||||
void setRasSel(u8 param_0) { mTevSwapModeInfo = mTevSwapModeInfo & ~0x03 | param_0; }
|
||||
void setTevSwapModeInfo(const J3DTevSwapModeInfo& info) {
|
||||
setTexSel(info.field_0x1);
|
||||
setRasSel(info.field_0x0);
|
||||
setTexSel(info.mTexSel);
|
||||
setRasSel(info.mRasSel);
|
||||
}
|
||||
|
||||
void load(u32) const {
|
||||
@@ -125,6 +125,11 @@ struct J3DIndTevStage {
|
||||
setIndTevStageInfo(j3dDefaultIndTevStageInfo);
|
||||
}
|
||||
|
||||
explicit J3DIndTevStage(const J3DIndTevStageInfo& info) {
|
||||
mInfo = 0;
|
||||
setIndTevStageInfo(info);
|
||||
}
|
||||
|
||||
void setIndStage(u8 stage) { mInfo = mInfo & ~0x03 | stage; }
|
||||
void setIndFormat(u8 format) { mInfo = mInfo & ~0x0C | format << 2; }
|
||||
void setBiasSel(u8 sel) { mInfo = mInfo & ~0x70 | sel << 4; }
|
||||
@@ -156,20 +161,26 @@ struct J3DIndTevStage {
|
||||
|
||||
struct J3DTevOrder : public J3DTevOrderInfo {
|
||||
J3DTevOrder() { *(J3DTevOrderInfo*)this = j3dDefaultTevOrderInfoNull; }
|
||||
explicit J3DTevOrder(const J3DTevOrderInfo& info) { *(J3DTevOrderInfo*)this = info; }
|
||||
|
||||
J3DTevOrderInfo& getTevOrderInfo() { return *this; }
|
||||
u8 getTexMap() { return mTexMap; }
|
||||
};
|
||||
|
||||
static inline u8 calcTevSwapTableID(u8 r, u8 g, u8 b, u8 a) {
|
||||
return r * 64 + g * 16 + b * 4 + a;
|
||||
}
|
||||
|
||||
struct J3DTevSwapModeTable {
|
||||
J3DTevSwapModeTable() { field_0x0 = j3dDefaultTevSwapTableID; }
|
||||
J3DTevSwapModeTable() { mIdx = j3dDefaultTevSwapTableID; }
|
||||
explicit J3DTevSwapModeTable(const J3DTevSwapModeTableInfo& info) { mIdx = calcTevSwapTableID(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3); }
|
||||
|
||||
u8 getR() { return j3dTevSwapTableTable[field_0x0 * 4]; }
|
||||
u8 getG() { return j3dTevSwapTableTable[field_0x0 * 4 + 1]; }
|
||||
u8 getB() { return j3dTevSwapTableTable[field_0x0 * 4 + 2]; }
|
||||
u8 getA() { return j3dTevSwapTableTable[field_0x0 * 4 + 3]; }
|
||||
u8 getR() { return j3dTevSwapTableTable[mIdx * 4]; }
|
||||
u8 getG() { return j3dTevSwapTableTable[mIdx * 4 + 1]; }
|
||||
u8 getB() { return j3dTevSwapTableTable[mIdx * 4 + 2]; }
|
||||
u8 getA() { return j3dTevSwapTableTable[mIdx * 4 + 3]; }
|
||||
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
/* 0x0 */ u8 mIdx;
|
||||
}; // Size: 0x1
|
||||
|
||||
class J3DLightObj {
|
||||
@@ -188,11 +199,8 @@ public:
|
||||
}; // Size = 0x74
|
||||
|
||||
struct J3DNBTScale : public J3DNBTScaleInfo {
|
||||
J3DNBTScale() {}
|
||||
J3DNBTScale(J3DNBTScaleInfo const& info) {
|
||||
mbHasScale = info.mbHasScale;
|
||||
mScale = info.mScale;
|
||||
}
|
||||
J3DNBTScale() { *(J3DNBTScaleInfo*)this = j3dDefaultNBTScaleInfo; }
|
||||
explicit J3DNBTScale(const J3DNBTScaleInfo& info) { *(J3DNBTScaleInfo*)this = info; }
|
||||
Vec* getScale() { return &mScale; }
|
||||
};
|
||||
|
||||
|
||||
@@ -81,6 +81,7 @@ private:
|
||||
|
||||
struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
J3DTexCoord() { *(J3DTexCoordInfo*)this = j3dDefaultTexCoordInfo[0]; }
|
||||
J3DTexCoord(const J3DTexCoordInfo& info) { *(J3DTexCoordInfo*)this = info; }
|
||||
|
||||
u8 getTexGenType() { return mTexGenType; }
|
||||
u8 getTexGenSrc() { return mTexGenSrc; }
|
||||
|
||||
@@ -2,10 +2,108 @@
|
||||
#define J3DMATERIALFACTORY_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "JSystem/J3DGraphBase/J3DStruct.h"
|
||||
|
||||
class J3DMaterial;
|
||||
struct J3DMaterialBlock;
|
||||
struct J3DMaterialDLBlock;
|
||||
struct J3DMaterialInitData;
|
||||
struct J3DIndInitData;
|
||||
struct J3DColorChanInfo;
|
||||
struct J3DLightInfo;
|
||||
struct J3DTexCoordInfo;
|
||||
struct J3DTexCoord2Info;
|
||||
struct J3DTexMtxInfo;
|
||||
struct J3DTevOrderInfo;
|
||||
struct J3DTevStageInfo;
|
||||
struct J3DTevSwapModeInfo;
|
||||
struct J3DTevSwapModeTableInfo;
|
||||
struct J3DFogInfo;
|
||||
struct J3DAlphaCompInfo;
|
||||
struct J3DBlendInfo;
|
||||
struct J3DZModeInfo;
|
||||
struct J3DNBTScaleInfo;
|
||||
struct J3DCurrentMtxInfo;
|
||||
|
||||
struct J3DColorChan;
|
||||
struct J3DGXColor;
|
||||
struct J3DGXColorS10;
|
||||
struct J3DTexCoord;
|
||||
struct J3DTexMtx;
|
||||
struct J3DTevOrder;
|
||||
struct J3DTevStage;
|
||||
struct J3DTevSwapMode;
|
||||
struct J3DTevSwapModeTable;
|
||||
struct J3DIndTexOrder;
|
||||
struct J3DIndTexMtx;
|
||||
struct J3DIndTevStage;
|
||||
struct J3DIndTexCoordScale;
|
||||
struct J3DFog;
|
||||
struct J3DAlphaComp;
|
||||
struct J3DBlend;
|
||||
struct J3DZMode;
|
||||
struct J3DNBTScale;
|
||||
|
||||
struct J3DMaterialInitData {
|
||||
/* 0x000 */ u8 mMaterialMode;
|
||||
/* 0x001 */ u8 mCullModeIdx;
|
||||
/* 0x002 */ u8 mColorChanNumIdx;
|
||||
/* 0x003 */ u8 mTexGenNumIdx;
|
||||
/* 0x004 */ u8 mTevStageNumIdx;
|
||||
/* 0x005 */ u8 mZCompLocIdx;
|
||||
/* 0x006 */ u8 mZModeIdx;
|
||||
/* 0x007 */ u8 mDitherIdx;
|
||||
/* 0x008 */ u16 mMatColorIdx[2];
|
||||
/* 0x00C */ u16 mColorChanIdx[4];
|
||||
/* 0x014 */ u16 mAmbColorIdx[2];
|
||||
/* 0x018 */ u8 field_0x018[16];
|
||||
/* 0x028 */ u16 mTexCoordIdx[8];
|
||||
/* 0x038 */ u8 field_0x038[16];
|
||||
/* 0x048 */ u16 mTexMtxIdx[8];
|
||||
/* 0x058 */ u8 field_0x058[44];
|
||||
/* 0x084 */ u16 mTexNoIdx[8];
|
||||
/* 0x094 */ u16 mTevKColorIdx[4];
|
||||
/* 0x09C */ u8 mTevKColorSel[16];
|
||||
/* 0x0AC */ u8 mTevKAlphaSel[16];
|
||||
/* 0x0BC */ u16 mTevOrderIdx[16];
|
||||
/* 0x0DC */ u16 mTevColorIdx[4];
|
||||
/* 0x0E4 */ u16 mTevStageIdx[16];
|
||||
/* 0x104 */ u16 mTevSwapModeIdx[16];
|
||||
/* 0x124 */ u16 mTevSwapModeTableIdx[4];
|
||||
/* 0x12C */ u8 field_0x12c[24];
|
||||
/* 0x144 */ u16 mFogIdx;
|
||||
/* 0x146 */ u16 mAlphaCompIdx;
|
||||
/* 0x148 */ u16 mBlendIdx;
|
||||
/* 0x14A */ u16 mNBTScaleIdx;
|
||||
};
|
||||
|
||||
struct J3DIndInitData {
|
||||
/* 0x000 */ bool mEnabled;
|
||||
/* 0x001 */ u8 mIndTexStageNum;
|
||||
/* 0x002 */ u8 field_0x002[2];
|
||||
/* 0x004 */ J3DIndTexOrderInfo mIndTexOrderInfo[3];
|
||||
/* 0x010 */ u8 field_0x010[4];
|
||||
/* 0x014 */ J3DIndTexMtxInfo mIndTexMtxInfo[3];
|
||||
/* 0x068 */ J3DIndTexCoordScaleInfo mIndTexCoordScaleInfo[3];
|
||||
/* 0x074 */ u8 field_0x074[4];
|
||||
/* 0x078 */ J3DIndTevStageInfo mIndTevStageInfo[16];
|
||||
};
|
||||
|
||||
struct J3DPatchingInfo {
|
||||
/* 0x0 */ u16 mMatColorOffset;
|
||||
/* 0x2 */ u16 mColorChanOffset;
|
||||
/* 0x4 */ u16 mTexMtxOffset;
|
||||
/* 0x6 */ u16 mTexNoOffset;
|
||||
/* 0x8 */ u16 mTevRegOffset;
|
||||
/* 0xA */ u16 mFogOffset;
|
||||
/* 0xC */ u8 field_0xc[4];
|
||||
};
|
||||
|
||||
struct J3DDisplayListInit {
|
||||
/* 0x0 */ u32 mOffset;
|
||||
/* 0x4 */ u32 mSize;
|
||||
};
|
||||
|
||||
class J3DMaterialFactory {
|
||||
public:
|
||||
@@ -18,52 +116,84 @@ public:
|
||||
J3DMaterialFactory(const J3DMaterialBlock&);
|
||||
J3DMaterialFactory(const J3DMaterialDLBlock&);
|
||||
u16 countUniqueMaterials();
|
||||
void countTexGens(int) const;
|
||||
void countStages(int) const;
|
||||
J3DMaterial* create(J3DMaterial*, MaterialType, int, unsigned long) const;
|
||||
void createNormalMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
void createPatchedMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
u32 countTexGens(int) const;
|
||||
u32 countStages(int) const;
|
||||
J3DMaterial* create(J3DMaterial*, MaterialType, int, u32) const;
|
||||
J3DMaterial* createNormalMaterial(J3DMaterial*, int, u32) const;
|
||||
J3DMaterial* createPatchedMaterial(J3DMaterial*, int, u32) const;
|
||||
void modifyPatchedCurrentMtx(J3DMaterial*, int) const;
|
||||
void createLockedMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
u32 calcSize(J3DMaterial*, MaterialType, int, unsigned long) const;
|
||||
u32 calcSizeNormalMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
u32 calcSizePatchedMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
u32 calcSizeLockedMaterial(J3DMaterial*, int, unsigned long) const;
|
||||
void newMatColor(int, int) const;
|
||||
void newColorChanNum(int) const;
|
||||
void newColorChan(int, int) const;
|
||||
void newAmbColor(int, int) const;
|
||||
void newTexGenNum(int) const;
|
||||
void newTexCoord(int, int) const;
|
||||
void newTexMtx(int, int) const;
|
||||
void newCullMode(int) const;
|
||||
void newTexNo(int, int) const;
|
||||
void newTevOrder(int, int) const;
|
||||
void newTevColor(int, int) const;
|
||||
void newTevKColor(int, int) const;
|
||||
void newTevStageNum(int) const;
|
||||
void newTevStage(int, int) const;
|
||||
void newTevSwapModeTable(int, int) const;
|
||||
void newIndTexStageNum(int) const;
|
||||
void newIndTexOrder(int, int) const;
|
||||
void newIndTexMtx(int, int) const;
|
||||
void newIndTevStage(int, int) const;
|
||||
void newIndTexCoordScale(int, int) const;
|
||||
void newFog(int) const;
|
||||
void newAlphaComp(int) const;
|
||||
void newBlend(int) const;
|
||||
void newZMode(int) const;
|
||||
void newZCompLoc(int) const;
|
||||
void newDither(int) const;
|
||||
void newNBTScale(int) const;
|
||||
J3DMaterial* createLockedMaterial(J3DMaterial*, int, u32) const;
|
||||
u32 calcSize(J3DMaterial*, MaterialType, int, u32) const;
|
||||
u32 calcSizeNormalMaterial(J3DMaterial*, int, u32) const;
|
||||
u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
|
||||
u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
|
||||
J3DGXColor newMatColor(int, int) const;
|
||||
u8 newColorChanNum(int) const;
|
||||
J3DColorChan newColorChan(int, int) const;
|
||||
J3DGXColor newAmbColor(int, int) const;
|
||||
u32 newTexGenNum(int) const;
|
||||
J3DTexCoord newTexCoord(int, int) const;
|
||||
J3DTexMtx* newTexMtx(int, int) const;
|
||||
u8 newCullMode(int) const;
|
||||
u16 newTexNo(int, int) const;
|
||||
J3DTevOrder newTevOrder(int, int) const;
|
||||
J3DGXColorS10 newTevColor(int, int) const;
|
||||
J3DGXColor newTevKColor(int, int) const;
|
||||
u8 newTevStageNum(int) const;
|
||||
J3DTevStage newTevStage(int, int) const;
|
||||
J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
|
||||
u8 newIndTexStageNum(int) const;
|
||||
J3DIndTexOrder newIndTexOrder(int, int) const;
|
||||
J3DIndTexMtx newIndTexMtx(int, int) const;
|
||||
J3DIndTevStage newIndTevStage(int, int) const;
|
||||
J3DIndTexCoordScale newIndTexCoordScale(int, int) const;
|
||||
J3DFog* newFog(int) const;
|
||||
J3DAlphaComp newAlphaComp(int) const;
|
||||
J3DBlend newBlend(int) const;
|
||||
J3DZMode newZMode(int) const;
|
||||
u8 newZCompLoc(int) const;
|
||||
u8 newDither(int) const;
|
||||
J3DNBTScale newNBTScale(int) const;
|
||||
|
||||
u16 getMaterialID(int i_idx) const { return mpMaterialID[i_idx]; }
|
||||
void getMaterialMode(int) const {}
|
||||
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
|
||||
u8 getMaterialMode(int idx) const { return mpMaterialInitData[getMaterialID(idx)].mMaterialMode; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ u8 field_0x00[8];
|
||||
/* 0x00 */ u16 mMaterialNum;
|
||||
/* 0x02 */
|
||||
/* 0x04 */ J3DMaterialInitData* mpMaterialInitData;
|
||||
/* 0x08 */ u16* mpMaterialID;
|
||||
/* 0x0C */ u8 field_0x0c[0x7C];
|
||||
/* 0x0C */ J3DIndInitData* mpIndInitData;
|
||||
/* 0x10 */ GXColor* mpMatColor;
|
||||
/* 0x14 */ u8* mpColorChanNum;
|
||||
/* 0x18 */ J3DColorChanInfo* mpColorChanInfo;
|
||||
/* 0x1C */ GXColor* mpAmbColor;
|
||||
/* 0x20 */ J3DLightInfo* mpLightInfo;
|
||||
/* 0x24 */ u8* mpTexGenNum;
|
||||
/* 0x28 */ J3DTexCoordInfo* mpTexCoordInfo;
|
||||
/* 0x2C */ J3DTexCoord2Info* mpTexCoord2Info;
|
||||
/* 0x30 */ J3DTexMtxInfo* mpTexMtxInfo;
|
||||
/* 0x34 */ J3DTexMtxInfo* field_0x44;
|
||||
/* 0x38 */ u16* mpTexNo;
|
||||
/* 0x3C */ GXCullMode* mpCullMode;
|
||||
/* 0x40 */ J3DTevOrderInfo* mpTevOrderInfo;
|
||||
/* 0x44 */ GXColorS10* mpTevColor;
|
||||
/* 0x48 */ GXColor* mpTevKColor;
|
||||
/* 0x4C */ u8* mpTevStageNum;
|
||||
/* 0x50 */ J3DTevStageInfo* mpTevStageInfo;
|
||||
/* 0x54 */ J3DTevSwapModeInfo* mpTevSwapModeInfo;
|
||||
/* 0x58 */ J3DTevSwapModeTableInfo* mpTevSwapModeTableInfo;
|
||||
/* 0x5C */ J3DFogInfo* mpFogInfo;
|
||||
/* 0x60 */ J3DAlphaCompInfo* mpAlphaCompInfo;
|
||||
/* 0x64 */ J3DBlendInfo* mpBlendInfo;
|
||||
/* 0x68 */ J3DZModeInfo* mpZModeInfo;
|
||||
/* 0x6C */ u8* mpZCompLoc;
|
||||
/* 0x70 */ u8* mpDither;
|
||||
/* 0x74 */ J3DNBTScaleInfo* mpNBTScaleInfo;
|
||||
/* 0x78 */ J3DDisplayListInit* mpDisplayListInit;
|
||||
/* 0x7C */ J3DPatchingInfo* mpPatchingInfo;
|
||||
/* 0x80 */ J3DCurrentMtxInfo* mpCurrentMtxInfo;
|
||||
/* 0x84 */ u8* field_0x84;
|
||||
};
|
||||
|
||||
#endif /* J3DMATERIALFACTORY_H */
|
||||
|
||||
@@ -30,8 +30,8 @@ class J3DMaterialFactory_v21 {
|
||||
public:
|
||||
J3DMaterialFactory_v21(const J3DMaterialBlock_v21&);
|
||||
u16 countUniqueMaterials();
|
||||
void countTexGens(int) const;
|
||||
void countStages(int) const;
|
||||
u32 countTexGens(int) const;
|
||||
u32 countStages(int) const;
|
||||
J3DMaterial* create(J3DMaterial*, int, unsigned long) const;
|
||||
void newMatColor(int, int) const;
|
||||
void newColorChanNum(int) const;
|
||||
|
||||
@@ -8,10 +8,12 @@ inline u32 getBdlFlag_MaterialType(u32 i_flags) {
|
||||
return i_flags & 0x3000;
|
||||
}
|
||||
|
||||
// Actual struct name unknown
|
||||
struct J3DModelBlock {
|
||||
/* 0x00 */ u32 mBlockType;
|
||||
/* 0x04 */ u32 mBlockSize;
|
||||
|
||||
// Fake inline
|
||||
const J3DModelBlock* getNext() const {
|
||||
return reinterpret_cast<const J3DModelBlock*>(reinterpret_cast<const u8*>(this) + mBlockSize);
|
||||
}
|
||||
@@ -102,9 +104,9 @@ struct J3DMaterialBlock_v21 : public J3DModelBlock {
|
||||
|
||||
struct J3DMaterialDLBlock : public J3DModelBlock {
|
||||
/* 0x08 */ u16 mMaterialNum;
|
||||
/* 0x0C */ void* field_0x0c;
|
||||
/* 0x10 */ void* field_0x10;
|
||||
/* 0x14 */ void* field_0x14;
|
||||
/* 0x0C */ void* mpDisplayListInit;
|
||||
/* 0x10 */ void* mpPatchingInfo;
|
||||
/* 0x14 */ void* mpCurrentMtxInfo;
|
||||
/* 0x18 */ void* field_0x18;
|
||||
/* 0x1C */ void* field_0x1c;
|
||||
/* 0x20 */ void* mpNameTable;
|
||||
|
||||
@@ -84,10 +84,6 @@ struct TVec3<f32> {
|
||||
setTVec3f(&i_vec.x, &x);
|
||||
}
|
||||
|
||||
inline TVec3(const TVec3<f32>& i_vec) {
|
||||
setTVec3f(&i_vec.x, &x);
|
||||
}
|
||||
|
||||
TVec3() {}
|
||||
|
||||
TVec3(f32 x, f32 y, f32 z) { set(x, y, z); }
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
virtual GXColor getPrmColor(s16) = 0;
|
||||
virtual GXColor getEnvColor(s16) = 0;
|
||||
virtual u8 getColorRegAnmType() = 0;
|
||||
virtual s32 getColorRegAnmMaxFrm() = 0;
|
||||
virtual s16 getColorRegAnmMaxFrm() = 0;
|
||||
virtual u32 isEnableTexScrollAnm() = 0;
|
||||
virtual f32 getTilingX() = 0;
|
||||
virtual f32 getTilingY() = 0;
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
virtual GXColor getPrmColor(s16 idx) { return mpPrmColorArr[idx]; }
|
||||
virtual GXColor getEnvColor(s16 idx) { return mpEnvColorArr[idx]; }
|
||||
virtual u8 getColorRegAnmType() { return (pBsd->mColorFlags >> 4) & 0x07; }
|
||||
virtual s32 getColorRegAnmMaxFrm() { return pBsd->mColorRegAnmMaxFrm; }
|
||||
virtual s16 getColorRegAnmMaxFrm() { return pBsd->mColorRegAnmMaxFrm; }
|
||||
virtual u32 isEnableTexScrollAnm() { return pBsd->mFlags & 0x1000000; }
|
||||
virtual f32 getTilingX() { return pBsd->mTilingX; }
|
||||
virtual f32 getTilingY() { return pBsd->mTilingY; }
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
/* 0xA0 */ DirTypeFunc mDirTypeFunc;
|
||||
/* 0xA4 */ RotTypeFunc mRotTypeFunc;
|
||||
/* 0xA8 */ BasePlaneTypeFunc mBasePlaneTypeFunc;
|
||||
/* 0xAC */ u32 field_0xa4;
|
||||
/* 0xAC */ f32 mScaleAnmTiming;
|
||||
/* 0xB0 */ s16 mColorAnmFrame;
|
||||
/* 0xB2 */ s16 field_0xb2;
|
||||
};
|
||||
|
||||
@@ -46,8 +46,8 @@ public:
|
||||
virtual f32 getScaleInValueY() = 0;
|
||||
virtual u8 getAnmTypeX() = 0;
|
||||
virtual u8 getAnmTypeY() = 0;
|
||||
virtual u32 getAnmCycleX() = 0;
|
||||
virtual u32 getAnmCycleY() = 0;
|
||||
virtual s16 getAnmCycleX() = 0;
|
||||
virtual s16 getAnmCycleY() = 0;
|
||||
virtual f32 getIncreaseRateX() = 0;
|
||||
virtual f32 getIncreaseRateY() = 0;
|
||||
virtual f32 getDecreaseRateX() = 0;
|
||||
@@ -92,8 +92,8 @@ public:
|
||||
virtual f32 getScaleInValueY() { return mpData->mScaleInValueY; }
|
||||
virtual u8 getAnmTypeX() { return (mpData->mFlag >> 18) & 0x01; }
|
||||
virtual u8 getAnmTypeY() { return (mpData->mFlag >> 19) & 0x01; }
|
||||
virtual u32 getAnmCycleX() { return mpData->mAnmCycleX; }
|
||||
virtual u32 getAnmCycleY() { return mpData->mAnmCycleY; }
|
||||
virtual s16 getAnmCycleX() { return mpData->mAnmCycleX; }
|
||||
virtual s16 getAnmCycleY() { return mpData->mAnmCycleY; }
|
||||
virtual f32 getIncreaseRateX() { return mIncreaseRateX; }
|
||||
virtual f32 getIncreaseRateY() { return mIncreaseRateY; }
|
||||
virtual f32 getDecreaseRateX() { return mDecreaseRateX; }
|
||||
|
||||
@@ -21,6 +21,10 @@ class JPACallBackBase;
|
||||
template<typename T, typename U>
|
||||
class JPACallBackBase2;
|
||||
|
||||
enum JPAParticleStatus {
|
||||
JPAPtclStts_Invisible = 0x08,
|
||||
};
|
||||
|
||||
class JPABaseParticle {
|
||||
public:
|
||||
void initParticle();
|
||||
@@ -36,8 +40,11 @@ public:
|
||||
void setOffsetPosition(f32 x, f32 y, f32 z) { mGlobalPosition.set(x, y, z); }
|
||||
void setOffsetPosition(const JGeometry::TVec3<f32>& pos) { mGlobalPosition.set(pos); }
|
||||
|
||||
bool checkStatus(u32 flag) { return mStatus & flag; }
|
||||
bool isInvisibleParticle() { return checkStatus(JPAPtclStts_Invisible); }
|
||||
void setInvisibleParticleFlag() { mStatus |= JPAPtclStts_Invisible; }
|
||||
|
||||
void calcCB(JPABaseEmitter*) {}
|
||||
void checkStatus(u32) {}
|
||||
void clearStatus(u32) {}
|
||||
void drawCB(JPABaseEmitter*) {}
|
||||
void getAge() const {}
|
||||
@@ -51,10 +58,8 @@ public:
|
||||
void getVelVec(JGeometry::TVec3<f32>&) const {}
|
||||
void getWidth() {}
|
||||
void initStatus(u32) {}
|
||||
void isInvisibleParticle() {}
|
||||
void setCallBackPtr(JPACallBackBase2<JPABaseEmitter*, JPABaseParticle*>*) {}
|
||||
void setDeleteParticleFlag() {}
|
||||
void setInvisibleParticleFlag() {}
|
||||
void setStatus(u32) {}
|
||||
|
||||
public:
|
||||
@@ -101,9 +106,4 @@ public:
|
||||
virtual void draw(JPABaseEmitter*, JPABaseParticle*);
|
||||
};
|
||||
|
||||
// not sure where this belongs
|
||||
static inline u32 COLOR_MULTI(u32 a, u32 b) {
|
||||
return ((a * (b + 1)) * 0x10000) >> 24;
|
||||
}
|
||||
|
||||
#endif /* JPAPARTICLE_H */
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
}
|
||||
void CalcPos(Vec*, f32) const { /* TODO */ }
|
||||
void CalcVec(Vec* pOut) const { VECSubtract(&this->mEnd, &this->mStart, pOut); }
|
||||
void SetEnd(const cXyz&) { /* TODO */ }
|
||||
void SetEnd(const cXyz& pos) { mEnd = pos; }
|
||||
const cXyz& GetStartP() const { return mStart; }
|
||||
cXyz& GetStartP() { return mStart; }
|
||||
const cXyz& GetStart() const { return mStart; }
|
||||
|
||||
+36
-13
@@ -4,29 +4,39 @@
|
||||
#include "f_op/f_op_actor.h"
|
||||
#include "c/c_damagereaction.h"
|
||||
#include "SSystem/SComponent/c_phase.h"
|
||||
#include "m_Do/m_Do_hostIO.h"
|
||||
|
||||
class dPath;
|
||||
|
||||
class bk_class : public fopEn_enemy_c {
|
||||
public:
|
||||
/* 0x02AC */ request_of_phase_process_class mPhsBk;
|
||||
/* 0x02B4 */ u8 mMode;
|
||||
/* 0x02AC */ request_of_phase_process_class mPhs;
|
||||
/* 0x02B4 */ u8 mType;
|
||||
/* 0x02B5 */ u8 m02B5;
|
||||
/* 0x02B6 */ u8 m02B6;
|
||||
/* 0x02B7 */ u8 m02B7;
|
||||
/* 0x02B8 */ u8 m02B8;
|
||||
/* 0x02B9 */ u8 m02B9;
|
||||
/* 0x02BA */ u8 m02BA[0x02BC - 0x02BA];
|
||||
/* 0x02BA */ u8 m02BA;
|
||||
/* 0x02BB */ u8 m02BB[0x02BC - 0x02BB];
|
||||
/* 0x02BC */ mDoExt_McaMorf* mpMorf;
|
||||
/* 0x02C0 */ u8 m02C0[0x02CC - 0x02C0];
|
||||
/* 0x02CC */ s16 m02CC;
|
||||
/* 0x02CE */ u8 m02CE[0x0302 - 0x02CE];
|
||||
/* 0x02CE */ u8 m02CE[0x02D4 - 0x02CE];
|
||||
/* 0x02D4 */ u8 m02D4;
|
||||
/* 0x02D5 */ u8 m02D5;
|
||||
/* 0x02D6 */ u8 m02D6[0x02DC - 0x02D6];
|
||||
/* 0x02DC */ u8 m02DC;
|
||||
/* 0x02DD */ u8 m02DD[0x0302 - 0x02DD];
|
||||
/* 0x0302 */ s16 m0302;
|
||||
/* 0x0304 */ u8 m0304[0x030C - 0x0304];
|
||||
/* 0x030C */ s16 m030C;
|
||||
/* 0x030E */ u8 m030E[0x0336 - 0x030E];
|
||||
/* 0x030E */ s16 m030E;
|
||||
/* 0x0310 */ u8 m0310[0x0336 - 0x0310];
|
||||
/* 0x0336 */ s16 m0336;
|
||||
/* 0x0338 */ u8 m0338[0x0344 - 0x0338];
|
||||
/* 0x0344 */ s16 m0344;
|
||||
/* 0x0346 */ u8 m0346[0x034C - 0x0346];
|
||||
/* 0x0338 */ cXyz m0338;
|
||||
/* 0x0344 */ csXyz m0344;
|
||||
/* 0x034A */ u8 m034A[0x034C - 0x034A];
|
||||
/* 0x034C */ s16 m034C;
|
||||
/* 0x034E */ u8 m034E;
|
||||
/* 0x034F */ u8 m034F;
|
||||
@@ -43,13 +53,26 @@ public:
|
||||
/* 0x0DE8 */ dCcD_Sph m0DE8;
|
||||
/* 0x0F14 */ dCcD_Sph m0F14;
|
||||
/* 0x1040 */ dCcD_Sph m1040;
|
||||
/* 0x116C */ u8 m116C[0x11F8 - 0x116C];
|
||||
/* 0x116C */ cXyz m116C;
|
||||
/* 0x1178 */ cXyz m1178;
|
||||
/* 0x1184 */ u8 m1184[0x11F0 - 0x1184];
|
||||
/* 0x11F0 */ u8 m11F0;
|
||||
/* 0x11F1 */ u8 m11F1;
|
||||
/* 0x11F2 */ u8 m11F2;
|
||||
/* 0x11F3 */ u8 m11F3;
|
||||
/* 0x11F4 */ s16 m11F4;
|
||||
/* 0x11F8 */ fopAc_ac_c* m11F8;
|
||||
/* 0x11FC */ u32 m11FC;
|
||||
/* 0x1200 */ u32 m1200;
|
||||
/* 0x1204 */ u8 m1204[0x121C - 0x1204];
|
||||
/* 0x1204 */ u8 m1204[0x1214 - 0x1204];
|
||||
/* 0x1214 */ u8 m1214;
|
||||
/* 0x1215 */ u8 m1215;
|
||||
/* 0x1216 */ u8 m1216;
|
||||
/* 0x1217 */ u8 m1217;
|
||||
/* 0x1218 */ dPath* m1218;
|
||||
/* 0x121C */ u8 m121C;
|
||||
/* 0x121D */ u8 m121D[0x121F - 0x121D];
|
||||
/* 0x121D */ u8 m121D;
|
||||
/* 0x121E */ u8 m121E[0x121F - 0x121E];
|
||||
/* 0x121F */ s8 m121F;
|
||||
/* 0x1220 */ u8 m1220[0x1264 - 0x1220];
|
||||
/* 0x1264 */ enemyice mEnemyIce;
|
||||
@@ -57,7 +80,7 @@ public:
|
||||
/* 0x1844 */ JntHit_c* mpJntHit;
|
||||
};
|
||||
|
||||
class bkHIO_c {
|
||||
class bkHIO_c : public JORReflexible {
|
||||
public:
|
||||
bkHIO_c() {
|
||||
/* Nonmatching */
|
||||
@@ -142,7 +165,7 @@ public:
|
||||
virtual ~bkHIO_c() {}
|
||||
|
||||
public:
|
||||
/* 0x004 */ u8 m004[0x005 - 0x004];
|
||||
/* 0x004 */ s8 mChildID;
|
||||
/* 0x005 */ u8 m005;
|
||||
/* 0x006 */ u8 m006;
|
||||
/* 0x007 */ u8 m007;
|
||||
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
/* 0xC */ f32 mRadius;
|
||||
|
||||
fopAc_cullSizeSphere() {}
|
||||
fopAc_cullSizeSphere(cXyz, float);
|
||||
fopAc_cullSizeSphere(cXyz, f32);
|
||||
~fopAc_cullSizeSphere() {}
|
||||
#endif
|
||||
};
|
||||
@@ -277,6 +277,28 @@ public:
|
||||
OPENING_GANONDORF_FINISHER_PARRY = 4,
|
||||
};
|
||||
|
||||
void initBt(f32 height, f32 radius) {
|
||||
setBtHeight(height);
|
||||
setBtBodyR(radius);
|
||||
}
|
||||
f32 getBtHeight() const { return m290; }
|
||||
void setBtHeight(f32 height) { m290 = height; }
|
||||
f32 getBtBodyR() const { return m294; }
|
||||
void setBtBodyR(f32 radius) { m294 = radius; }
|
||||
|
||||
// TODO
|
||||
void setBtAttackData(f32, f32, f32, u8) {}
|
||||
void getBtStartFrame() const {}
|
||||
void setBtStartFrame(f32) {}
|
||||
void getBtEndFrame() const {}
|
||||
void setBtEndFrame(f32) {}
|
||||
void getBtNowFrame() const {}
|
||||
void setBtNowFrame(f32) {}
|
||||
void getBtAttackType() const {}
|
||||
void setBtAttackType(u8) {}
|
||||
void getBtMaxDis() const {}
|
||||
void setBtMaxDis(f32) {}
|
||||
|
||||
/* 0x290 */ f32 m290;
|
||||
/* 0x294 */ f32 m294;
|
||||
/* 0x298 */ f32 m298;
|
||||
|
||||
@@ -242,18 +242,65 @@ f32 J3DAnmClusterFull::getWeight(u16 idx) const {
|
||||
return mWeight[maxFrame - 1 + getAnmTable()[idx].mOffset];
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
f32 J3DGetKeyFrameInterpolation(f32, J3DAnmKeyTableBase*, T*) {
|
||||
}
|
||||
|
||||
/* 802F1188-802F120C .text getWeight__16J3DAnmClusterKeyCFUs */
|
||||
f32 J3DAnmClusterKey::getWeight(u16) const {
|
||||
f32 J3DAnmClusterKey::getWeight(u16 idx) const {
|
||||
/* Nonmatching */
|
||||
J3DAnmKeyTableBase& table = mAnmTable[idx].mWeightTable;
|
||||
if (table.mMaxFrame != 0 && table.mMaxFrame != 1) {
|
||||
return J3DGetKeyFrameInterpolation<f32>(getFrame(), &table, &mWeight[table.mOffset]);
|
||||
} else if (table.mMaxFrame == 0) {
|
||||
return 1.0f;
|
||||
} else {
|
||||
return mWeight[table.mOffset];
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F120C-802F14B4 .text getColor__18J3DAnmVtxColorFullCFUcUsP8_GXColor */
|
||||
void J3DAnmVtxColorFull::getColor(u8, u16, GXColor* dst) const {
|
||||
/* Nonmatching */
|
||||
void J3DAnmVtxColorFull::getColor(u8 col, u16 idx, GXColor* dst) const {
|
||||
{
|
||||
u16 maxFrame = getAnmTable(col)[idx].mRMaxFrame;
|
||||
if (0.0f <= getFrame() && getFrame() < maxFrame)
|
||||
dst->r = mColorR[(s32)getFrame() + getAnmTable(col)[idx].mROffset];
|
||||
else if (getFrame() < 0.0f)
|
||||
dst->r = mColorR[getAnmTable(col)[idx].mROffset];
|
||||
else
|
||||
dst->r = mColorR[maxFrame - 1 + getAnmTable(col)[idx].mROffset];
|
||||
}
|
||||
{
|
||||
u16 maxFrame = getAnmTable(col)[idx].mGMaxFrame;
|
||||
if (0.0f <= getFrame() && getFrame() < maxFrame)
|
||||
dst->g = mColorG[(s32)getFrame() + getAnmTable(col)[idx].mGOffset];
|
||||
else if (getFrame() < 0.0f)
|
||||
dst->g = mColorG[getAnmTable(col)[idx].mGOffset];
|
||||
else
|
||||
dst->g = mColorG[maxFrame - 1 + getAnmTable(col)[idx].mGOffset];
|
||||
}
|
||||
{
|
||||
u16 maxFrame = getAnmTable(col)[idx].mBMaxFrame;
|
||||
if (0.0f <= getFrame() && getFrame() < maxFrame)
|
||||
dst->b = mColorB[(s32)getFrame() + getAnmTable(col)[idx].mBOffset];
|
||||
else if (getFrame() < 0.0f)
|
||||
dst->b = mColorB[getAnmTable(col)[idx].mBOffset];
|
||||
else
|
||||
dst->b = mColorB[maxFrame - 1 + getAnmTable(col)[idx].mBOffset];
|
||||
}
|
||||
{
|
||||
u16 maxFrame = getAnmTable(col)[idx].mAMaxFrame;
|
||||
if (0.0f <= getFrame() && getFrame() < maxFrame)
|
||||
dst->a = mColorA[(s32)getFrame() + getAnmTable(col)[idx].mAOffset];
|
||||
else if (getFrame() < 0.0f)
|
||||
dst->a = mColorA[getAnmTable(col)[idx].mAOffset];
|
||||
else
|
||||
dst->a = mColorA[maxFrame - 1 + getAnmTable(col)[idx].mAOffset];
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F14B4-802F17D0 .text getColor__17J3DAnmVtxColorKeyCFUcUsP8_GXColor */
|
||||
void J3DAnmVtxColorKey::getColor(u8, u16, GXColor* dst) const {
|
||||
void J3DAnmVtxColorKey::getColor(u8 col, u16 idx, GXColor* dst) const {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
@@ -382,11 +429,171 @@ void J3DAnmTextureSRTKey::searchUpdateMaterialID(J3DModelData* modelData) {
|
||||
/* 802F22E0-802F2624 .text getTevColorReg__15J3DAnmTevRegKeyCFUsP11_GXColorS10 */
|
||||
void J3DAnmTevRegKey::getTevColorReg(u16 idx, GXColorS10* dst) const {
|
||||
/* Nonmatching */
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmCRegKeyTable()[idx].mRTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->r = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->r = mAnmCRegDataR[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmCRegDataR[table.mOffset]);
|
||||
if (v < -1024.0f)
|
||||
dst->r = -1024;
|
||||
if (v > 1023.0f)
|
||||
dst->r = 1023;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmCRegKeyTable()[idx].mGTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->g = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->g = mAnmCRegDataG[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmCRegDataG[table.mOffset]);
|
||||
if (v < -1024.0f)
|
||||
dst->g = -1024;
|
||||
if (v > 1023.0f)
|
||||
dst->g = 1023;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->g = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmCRegKeyTable()[idx].mBTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->b = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->b = mAnmCRegDataB[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmCRegDataB[table.mOffset]);
|
||||
if (v < -1024.0f)
|
||||
dst->b = -1024;
|
||||
if (v > 1023.0f)
|
||||
dst->b = 1023;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->b = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmCRegKeyTable()[idx].mATable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->a = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->a = mAnmCRegDataA[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmCRegDataA[table.mOffset]);
|
||||
if (v < -1024.0f)
|
||||
dst->a = -1024;
|
||||
if (v > 1023.0f)
|
||||
dst->a = 1023;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->a = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F2624-802F2968 .text getTevKonstReg__15J3DAnmTevRegKeyCFUsP8_GXColor */
|
||||
void J3DAnmTevRegKey::getTevKonstReg(u16 idx, GXColor* dst) const {
|
||||
/* Nonmatching */
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmKRegKeyTable()[idx].mRTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->r = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->r = mAnmKRegDataR[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmKRegDataR[table.mOffset]);
|
||||
if (v < 0.0f)
|
||||
dst->r = 0;
|
||||
if (v > 255.0f)
|
||||
dst->r = 255;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmKRegKeyTable()[idx].mGTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->g = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->g = mAnmKRegDataG[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmKRegDataG[table.mOffset]);
|
||||
if (v < 0.0f)
|
||||
dst->g = 0;
|
||||
if (v > 255.0f)
|
||||
dst->g = 255;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->g = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmKRegKeyTable()[idx].mBTable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->b = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->b = mAnmKRegDataB[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmKRegDataB[table.mOffset]);
|
||||
if (v < 0.0f)
|
||||
dst->b = 0;
|
||||
if (v > 255.0f)
|
||||
dst->b = 255;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->b = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{
|
||||
J3DAnmKeyTableBase& table = getAnmKRegKeyTable()[idx].mATable;
|
||||
switch (table.mMaxFrame) {
|
||||
case 0:
|
||||
dst->a = 0;
|
||||
break;
|
||||
case 1:
|
||||
dst->a = mAnmKRegDataA[table.mOffset];
|
||||
break;
|
||||
default:
|
||||
f32 v = J3DGetKeyFrameInterpolation<s16>(getFrame(), &table, &mAnmKRegDataA[table.mOffset]);
|
||||
if (v < 0.0f)
|
||||
dst->a = 0;
|
||||
if (v > 255.0f)
|
||||
dst->a = 255;
|
||||
if (0.0f <= v && v <= 255.0f)
|
||||
dst->a = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F2968-802F2A64 .text searchUpdateMaterialID__15J3DAnmTevRegKeyFP16J3DMaterialTable */
|
||||
|
||||
@@ -343,8 +343,28 @@ void J3DAnmFullLoader_v15::readAnmVtxColor(const J3DAnmVtxColorFullData* param_1
|
||||
}
|
||||
|
||||
/* 803001B0-80300318 .text setAnmVtxColor__20J3DAnmFullLoader_v15FP18J3DAnmVtxColorFullPC22J3DAnmVtxColorFullData */
|
||||
void J3DAnmFullLoader_v15::setAnmVtxColor(J3DAnmVtxColorFull*, const J3DAnmVtxColorFullData*) {
|
||||
void J3DAnmFullLoader_v15::setAnmVtxColor(J3DAnmVtxColorFull* dst, const J3DAnmVtxColorFullData* data) {
|
||||
/* Nonmatching */
|
||||
dst->mFrameMax = data->mFrameMax;
|
||||
dst->mAttribute = data->field_0x8;
|
||||
dst->mFrame = 0.0f;
|
||||
dst->mAnmTableNum[0] = data->mAnmTableNum[0];
|
||||
dst->mAnmTableNum[1] = data->mAnmTableNum[1];
|
||||
dst->mpTable[0] = JSUConvertOffsetToPtr<J3DAnmColorFullTable>(data, (void*)data->mTableOffsets[0]);
|
||||
dst->mpTable[1] = JSUConvertOffsetToPtr<J3DAnmColorFullTable>(data, (void*)data->mTableOffsets[1]);
|
||||
dst->mAnmVtxColorIndexData[0] = JSUConvertOffsetToPtr<J3DAnmVtxColorIndexData>(data, (void*)data->mVtxColorIndexDataOffsets[0]);
|
||||
dst->mAnmVtxColorIndexData[1] = JSUConvertOffsetToPtr<J3DAnmVtxColorIndexData>(data, (void*)data->mVtxColorIndexDataOffsets[1]);
|
||||
void* indexPtr0 = JSUConvertOffsetToPtr<u16>(data, (void*)data->mVtxColorIndexPointerOffsets[0]);
|
||||
void* indexPtr1 = JSUConvertOffsetToPtr<u16>(data, (void*)data->mVtxColorIndexPointerOffsets[1]);
|
||||
|
||||
for (s32 i = 0; i < data->mIndexNum[0]; i++) {
|
||||
// dst->mpIndexPtr
|
||||
}
|
||||
|
||||
dst->mColorR = JSUConvertOffsetToPtr<u8>(data, (void*)data->mRValuesOffset);
|
||||
dst->mColorG = JSUConvertOffsetToPtr<u8>(data, (void*)data->mGValuesOffset);
|
||||
dst->mColorB = JSUConvertOffsetToPtr<u8>(data, (void*)data->mBValuesOffset);
|
||||
dst->mColorA = JSUConvertOffsetToPtr<u8>(data, (void*)data->mAValuesOffset);
|
||||
}
|
||||
|
||||
/* 80300318-80300464 .text load__19J3DAnmKeyLoader_v15FPCv */
|
||||
@@ -525,7 +545,7 @@ void J3DAnmKeyLoader_v15::setAnmCluster(J3DAnmClusterKey* param_1, const J3DAnmC
|
||||
param_1->mFrameMax = param_2->mFrameMax;
|
||||
param_1->mAttribute = param_2->field_0x8;
|
||||
param_1->mFrame = 0.0f;
|
||||
param_1->field_0x14 = JSUConvertOffsetToPtr<J3DAnmClusterKeyTable>(param_2, (void*)param_2->mTableOffset);
|
||||
param_1->mAnmTable = JSUConvertOffsetToPtr<J3DAnmClusterKeyTable>(param_2, (void*)param_2->mTableOffset);
|
||||
param_1->mWeight = JSUConvertOffsetToPtr<f32>(param_2, (void*)param_2->mWeightOffset);
|
||||
}
|
||||
|
||||
@@ -547,22 +567,22 @@ void J3DAnmKeyLoader_v15::setAnmTevReg(J3DAnmTevRegKey* param_1, const J3DAnmTev
|
||||
param_1->mAnmKRegKeyTable = JSUConvertOffsetToPtr<J3DAnmKRegKeyTable>(param_2, (void*)param_2->mKRegTableOffset);
|
||||
param_1->mKRegUpdateMaterialID = JSUConvertOffsetToPtr<u16>(param_2, (void*)param_2->mKRegUpdateMaterialIDOffset);
|
||||
param_1->mKRegUpdateMaterialName.setResource(JSUConvertOffsetToPtr<ResNTAB>(param_2, (void*)param_2->mKRegNameTabOffset));
|
||||
param_1->mCRegDataCount[0] = param_2->field_0x10;
|
||||
param_1->mCRegDataCount[1] = param_2->field_0x12;
|
||||
param_1->mCRegDataCount[2] = param_2->field_0x14;
|
||||
param_1->mCRegDataCount[3] = param_2->field_0x16;
|
||||
param_1->mAnmCRegData[0] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCRValuesOffset);
|
||||
param_1->mAnmCRegData[1] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCGValuesOffset);
|
||||
param_1->mAnmCRegData[2] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCBValuesOffset);
|
||||
param_1->mAnmCRegData[3] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCAValuesOffset);
|
||||
param_1->mKRegDataCount[0] = param_2->field_0x18;
|
||||
param_1->mKRegDataCount[1] = param_2->field_0x1a;
|
||||
param_1->mKRegDataCount[2] = param_2->field_0x1c;
|
||||
param_1->mKRegDataCount[3] = param_2->field_0x1e;
|
||||
param_1->mAnmKRegData[0] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKRValuesOffset);
|
||||
param_1->mAnmKRegData[1] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKGValuesOffset);
|
||||
param_1->mAnmKRegData[2] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKBValuesOffset);
|
||||
param_1->mAnmKRegData[3] = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKAValuesOffset);
|
||||
param_1->mCRegDataCountR = param_2->field_0x10;
|
||||
param_1->mCRegDataCountG = param_2->field_0x12;
|
||||
param_1->mCRegDataCountB = param_2->field_0x14;
|
||||
param_1->mCRegDataCountA = param_2->field_0x16;
|
||||
param_1->mAnmCRegDataR = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCRValuesOffset);
|
||||
param_1->mAnmCRegDataG = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCGValuesOffset);
|
||||
param_1->mAnmCRegDataB = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCBValuesOffset);
|
||||
param_1->mAnmCRegDataA = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mCAValuesOffset);
|
||||
param_1->mKRegDataCountR = param_2->field_0x18;
|
||||
param_1->mKRegDataCountG = param_2->field_0x1a;
|
||||
param_1->mKRegDataCountB = param_2->field_0x1c;
|
||||
param_1->mKRegDataCountA = param_2->field_0x1e;
|
||||
param_1->mAnmKRegDataR = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKRValuesOffset);
|
||||
param_1->mAnmKRegDataG = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKGValuesOffset);
|
||||
param_1->mAnmKRegDataB = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKBValuesOffset);
|
||||
param_1->mAnmKRegDataA = JSUConvertOffsetToPtr<s16>(param_2, (void*)param_2->mKAValuesOffset);
|
||||
}
|
||||
|
||||
/* 80300C34-80300C5C .text readAnmVtxColor__19J3DAnmKeyLoader_v15FPC21J3DAnmVtxColorKeyData */
|
||||
@@ -571,6 +591,27 @@ void J3DAnmKeyLoader_v15::readAnmVtxColor(const J3DAnmVtxColorKeyData* param_1)
|
||||
}
|
||||
|
||||
/* 80300C5C-80300DC4 .text setAnmVtxColor__19J3DAnmKeyLoader_v15FP17J3DAnmVtxColorKeyPC21J3DAnmVtxColorKeyData */
|
||||
void J3DAnmKeyLoader_v15::setAnmVtxColor(J3DAnmVtxColorKey*, const J3DAnmVtxColorKeyData*) {
|
||||
void J3DAnmKeyLoader_v15::setAnmVtxColor(J3DAnmVtxColorKey* dst, const J3DAnmVtxColorKeyData* data) {
|
||||
/* Nonmatching */
|
||||
|
||||
dst->mFrameMax = data->mFrameMax;
|
||||
dst->mAttribute = data->field_0x8;
|
||||
dst->mFrame = 0.0f;
|
||||
dst->mAnmTableNum[0] = data->mAnmTableNum[0];
|
||||
dst->mAnmTableNum[1] = data->mAnmTableNum[1];
|
||||
dst->mpTable[0] = JSUConvertOffsetToPtr<J3DAnmColorKeyTable>(data, (void*)data->mTableOffsets[0]);
|
||||
dst->mpTable[1] = JSUConvertOffsetToPtr<J3DAnmColorKeyTable>(data, (void*)data->mTableOffsets[1]);
|
||||
dst->mAnmVtxColorIndexData[0] = JSUConvertOffsetToPtr<J3DAnmVtxColorIndexData>(data, (void*)data->mVtxColorIndexDataOffsets[0]);
|
||||
dst->mAnmVtxColorIndexData[1] = JSUConvertOffsetToPtr<J3DAnmVtxColorIndexData>(data, (void*)data->mVtxColorIndexDataOffsets[1]);
|
||||
void* indexPtr0 = JSUConvertOffsetToPtr<u16>(data, (void*)data->mVtxColorIndexPointerOffsets[0]);
|
||||
void* indexPtr1 = JSUConvertOffsetToPtr<u16>(data, (void*)data->mVtxColorIndexPointerOffsets[1]);
|
||||
|
||||
for (s32 i = 0; i < data->mIndexNum[0]; i++) {
|
||||
// dst->mpIndexPtr
|
||||
}
|
||||
|
||||
dst->mColorR = JSUConvertOffsetToPtr<s16>(data, (void*)data->mRValuesOffset);
|
||||
dst->mColorG = JSUConvertOffsetToPtr<s16>(data, (void*)data->mGValuesOffset);
|
||||
dst->mColorB = JSUConvertOffsetToPtr<s16>(data, (void*)data->mBValuesOffset);
|
||||
dst->mColorA = JSUConvertOffsetToPtr<s16>(data, (void*)data->mAValuesOffset);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,8 @@
|
||||
|
||||
/* 802FE1A4-802FE1FC .text __ct__15J3DJointFactoryFRC13J3DJointBlock */
|
||||
J3DJointFactory::J3DJointFactory(const J3DJointBlock& jointBlock) {
|
||||
/* Nonmatching */
|
||||
mJointInitData = JSUConvertOffsetToPtr<J3DJointInitData>(&jointBlock, jointBlock.mpJointInitData);
|
||||
mIndexTable = JSUConvertOffsetToPtr<u16>(&jointBlock, jointBlock.mpIndexTable);
|
||||
mJointInitData = JSUConvertOffsetToPtr<J3DJointInitData>(&jointBlock, (u32)jointBlock.mpJointInitData);
|
||||
mIndexTable = JSUConvertOffsetToPtr<u16>(&jointBlock, (u32)jointBlock.mpIndexTable);
|
||||
}
|
||||
|
||||
/* 802FE1FC-802FE390 .text create__15J3DJointFactoryFi */
|
||||
|
||||
@@ -4,209 +4,637 @@
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphLoader/J3DMaterialFactory.h"
|
||||
#include "JSystem/J3DGraphLoader/J3DModelLoader.h"
|
||||
#include "JSystem/J3DGraphBase/J3DMatBlock.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
|
||||
/* 802F68F0-802F6B38 .text __ct__18J3DMaterialFactoryFRC16J3DMaterialBlock */
|
||||
J3DMaterialFactory::J3DMaterialFactory(const J3DMaterialBlock&) {
|
||||
/* Nonmatching */
|
||||
J3DMaterialFactory::J3DMaterialFactory(const J3DMaterialBlock& block) {
|
||||
mMaterialNum = block.mMaterialNum;
|
||||
mpMaterialInitData = JSUConvertOffsetToPtr<J3DMaterialInitData>(&block, block.mpMaterialInitData);
|
||||
mpMaterialID = JSUConvertOffsetToPtr<u16>(&block, block.mpMaterialID);
|
||||
|
||||
if (block.mpIndInitData != NULL && ((u32)block.mpIndInitData - (u32)block.mpNameTable) > 4)
|
||||
mpIndInitData = JSUConvertOffsetToPtr<J3DIndInitData>(&block, block.mpIndInitData);
|
||||
else
|
||||
mpIndInitData = NULL;
|
||||
|
||||
mpCullMode = JSUConvertOffsetToPtr<GXCullMode>(&block, block.mpCullMode);
|
||||
mpMatColor = JSUConvertOffsetToPtr<GXColor>(&block, block.mpMatColor);
|
||||
mpColorChanNum = JSUConvertOffsetToPtr<u8>(&block, block.mpColorChanNum);
|
||||
mpColorChanInfo = JSUConvertOffsetToPtr<J3DColorChanInfo>(&block, block.mpColorChanInfo);
|
||||
mpAmbColor = JSUConvertOffsetToPtr<GXColor>(&block, block.mpAmbColor);
|
||||
mpLightInfo = JSUConvertOffsetToPtr<J3DLightInfo>(&block, block.mpLightInfo);
|
||||
mpTexGenNum = JSUConvertOffsetToPtr<u8>(&block, block.mpTexGenNum);
|
||||
mpTexCoordInfo = JSUConvertOffsetToPtr<J3DTexCoordInfo>(&block, block.mpTexCoordInfo);
|
||||
mpTexCoord2Info = JSUConvertOffsetToPtr<J3DTexCoord2Info>(&block, block.mpTexCoord2Info);
|
||||
mpTexMtxInfo = JSUConvertOffsetToPtr<J3DTexMtxInfo>(&block, block.mpTexMtxInfo);
|
||||
field_0x44 = JSUConvertOffsetToPtr<J3DTexMtxInfo>(&block, block.field_0x44);
|
||||
mpTexNo = JSUConvertOffsetToPtr<u16>(&block, block.mpTexNo);
|
||||
mpTevOrderInfo = JSUConvertOffsetToPtr<J3DTevOrderInfo>(&block, block.mpTevOrderInfo);
|
||||
mpTevColor = JSUConvertOffsetToPtr<GXColorS10>(&block, block.mpTevColor);
|
||||
mpTevKColor = JSUConvertOffsetToPtr<GXColor>(&block, block.mpTevKColor);
|
||||
mpTevStageNum = JSUConvertOffsetToPtr<u8>(&block, block.mpTevStageNum);
|
||||
mpTevStageInfo = JSUConvertOffsetToPtr<J3DTevStageInfo>(&block, block.mpTevStageInfo);
|
||||
mpTevSwapModeInfo = JSUConvertOffsetToPtr<J3DTevSwapModeInfo>(&block, block.mpTevSwapModeInfo);
|
||||
mpTevSwapModeTableInfo = JSUConvertOffsetToPtr<J3DTevSwapModeTableInfo>(&block, block.mpTevSwapModeTableInfo);
|
||||
mpFogInfo = JSUConvertOffsetToPtr<J3DFogInfo>(&block, block.mpFogInfo);
|
||||
mpAlphaCompInfo = JSUConvertOffsetToPtr<J3DAlphaCompInfo>(&block, block.mpAlphaCompInfo);
|
||||
mpBlendInfo = JSUConvertOffsetToPtr<J3DBlendInfo>(&block, block.mpBlendInfo);
|
||||
mpZModeInfo = JSUConvertOffsetToPtr<J3DZModeInfo>(&block, block.mpZModeInfo);
|
||||
mpZCompLoc = JSUConvertOffsetToPtr<u8>(&block, block.mpZCompLoc);
|
||||
mpDither = JSUConvertOffsetToPtr<u8>(&block, block.mpDither);
|
||||
mpNBTScaleInfo = JSUConvertOffsetToPtr<J3DNBTScaleInfo>(&block, block.mpNBTScaleInfo);
|
||||
mpDisplayListInit = NULL;
|
||||
mpPatchingInfo = NULL;
|
||||
mpCurrentMtxInfo = NULL;
|
||||
field_0x84 = NULL;
|
||||
}
|
||||
|
||||
/* 802F6B38-802F6BC0 .text __ct__18J3DMaterialFactoryFRC18J3DMaterialDLBlock */
|
||||
J3DMaterialFactory::J3DMaterialFactory(const J3DMaterialDLBlock&) {
|
||||
J3DMaterialFactory::J3DMaterialFactory(const J3DMaterialDLBlock& block) {
|
||||
/* Nonmatching */
|
||||
mMaterialNum = block.mMaterialNum;
|
||||
mpMaterialInitData = NULL;
|
||||
mpDisplayListInit = JSUConvertOffsetToPtr<J3DDisplayListInit>(&block, block.mpDisplayListInit);
|
||||
mpPatchingInfo = JSUConvertOffsetToPtr<J3DPatchingInfo>(&block, block.mpPatchingInfo);
|
||||
mpCurrentMtxInfo = JSUConvertOffsetToPtr<J3DCurrentMtxInfo>(&block, block.mpCurrentMtxInfo);
|
||||
field_0x84 = JSUConvertOffsetToPtr<u8>(&block, block.field_0x18);
|
||||
}
|
||||
|
||||
/* 802F6BC0-802F6C08 .text countUniqueMaterials__18J3DMaterialFactoryFv */
|
||||
u16 J3DMaterialFactory::countUniqueMaterials() {
|
||||
/* Nonmatching */
|
||||
u16 num = 0;
|
||||
s32 maxID = -1;
|
||||
for (u16 i = 0; i < mMaterialNum; i++) {
|
||||
if (maxID < mpMaterialID[i]) {
|
||||
num++;
|
||||
maxID = mpMaterialID[i];
|
||||
}
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
/* 802F6C08-802F6C40 .text countTexGens__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::countTexGens(int) const {
|
||||
/* Nonmatching */
|
||||
u32 J3DMaterialFactory::countTexGens(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mTexGenNumIdx;
|
||||
if (no != 0xFF)
|
||||
return mpTexGenNum[no];
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802F6C40-802F6CC8 .text countStages__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::countStages(int) const {
|
||||
/* Nonmatching */
|
||||
u32 J3DMaterialFactory::countStages(int idx) const {
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
|
||||
u32 texGenNum = 0;
|
||||
u32 tevStageNum = 0;
|
||||
|
||||
u8 no = initData->mTevStageNumIdx;
|
||||
if (no != 0xFF)
|
||||
tevStageNum = mpTevStageNum[no];
|
||||
|
||||
for (s32 i = 0; i < 8; i++)
|
||||
if (initData->mTexNoIdx[i] != 0xFFFF)
|
||||
texGenNum++;
|
||||
|
||||
if (tevStageNum != texGenNum && texGenNum != 0) {
|
||||
return tevStageNum > texGenNum ? tevStageNum : texGenNum;
|
||||
} else {
|
||||
return tevStageNum;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802F6CC8-802F6D44 .text create__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */
|
||||
J3DMaterial* J3DMaterialFactory::create(J3DMaterial*, J3DMaterialFactory::MaterialType, int, unsigned long) const {
|
||||
J3DMaterial* J3DMaterialFactory::create(J3DMaterial* mat, J3DMaterialFactory::MaterialType type, int idx, u32 flag) const {
|
||||
/* Nonmatching */
|
||||
switch (type) {
|
||||
case MATERIAL_TYPE_NORMAL:
|
||||
return createNormalMaterial(mat, idx, flag);
|
||||
case MATERIAL_TYPE_LOCKED:
|
||||
return createLockedMaterial(mat, idx, flag);
|
||||
case MATERIAL_TYPE_PATCHED:
|
||||
return createPatchedMaterial(mat, idx, flag);
|
||||
}
|
||||
}
|
||||
|
||||
static inline u32 getMdlDataFlag_TevStageNum(u32 flag) { return (flag >> 16) & 0x1F; }
|
||||
static inline u32 getMdlDataFlag_TexGenFlag(u32 flag) { return flag & 0x0C000000; }
|
||||
static inline u32 getMdlDataFlag_PEFlag(u32 flag) { return flag & 0x30000000; }
|
||||
static inline u32 getMdlDataFlag_ColorFlag(u32 flag) { return flag & 0xC0000000; }
|
||||
|
||||
/* 802F6D44-802F768C .text createNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
void J3DMaterialFactory::createNormalMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
J3DMaterial* J3DMaterialFactory::createNormalMaterial(J3DMaterial* mat, int idx, u32 flag) const {
|
||||
/* Nonmatching */
|
||||
if (mpDisplayListInit != NULL)
|
||||
return createLockedMaterial(mat, idx, flag);
|
||||
|
||||
u32 stageNum = countStages(idx);
|
||||
u32 tevStageNum = getMdlDataFlag_TevStageNum(flag);
|
||||
|
||||
if (stageNum > tevStageNum)
|
||||
tevStageNum = stageNum;
|
||||
|
||||
u32 texGenNum = countTexGens(idx);
|
||||
u32 texGenFlag = texGenNum > 4 ? 0 : getMdlDataFlag_TexGenFlag(flag);
|
||||
u32 colorFlag = getMdlDataFlag_ColorFlag(flag);
|
||||
u32 peFlag = getMdlDataFlag_PEFlag(flag);
|
||||
u32 indFlag = !!(flag & 0x01000000);
|
||||
|
||||
if (mat == NULL)
|
||||
mat = new J3DMaterial();
|
||||
|
||||
mat->mColorBlock = J3DMaterial::createColorBlock(colorFlag);
|
||||
mat->mTexGenBlock = J3DMaterial::createTexGenBlock(texGenFlag);
|
||||
mat->mTevBlock = J3DMaterial::createTevBlock(tevStageNum);
|
||||
mat->mIndBlock = J3DMaterial::createIndBlock(indFlag);
|
||||
mat->mPEBlock = J3DMaterial::createPEBlock(peFlag, getMaterialMode(idx));
|
||||
mat->mIndex = idx;
|
||||
mat->mMaterialMode = getMaterialMode(idx);
|
||||
mat->mColorBlock->setColorChanNum(newColorChanNum(idx));
|
||||
mat->mColorBlock->setCullMode(newCullMode(idx));
|
||||
mat->mTexGenBlock->setTexGenNum(newTexGenNum(idx));
|
||||
mat->mTexGenBlock->setNBTScale(newNBTScale(idx));
|
||||
mat->mPEBlock->setFog(newFog(idx));
|
||||
mat->mPEBlock->setAlphaComp(newAlphaComp(idx));
|
||||
mat->mPEBlock->setBlend(newBlend(idx));
|
||||
mat->mPEBlock->setZMode(newZMode(idx));
|
||||
mat->mPEBlock->setZCompLoc(newZCompLoc(idx));
|
||||
mat->mPEBlock->setDither(newDither(idx));
|
||||
mat->mTevBlock->setTevStageNum(newTevStageNum(idx));
|
||||
|
||||
for (u8 i = 0; i < tevStageNum; i++)
|
||||
mat->mTevBlock->setTexNo(i, newTexNo(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++)
|
||||
mat->mTevBlock->setTevOrder(i, newTevOrder(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++) {
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
mat->mTevBlock->setTevStage(i, newTevStage(idx, i));
|
||||
if (initData->mTevSwapModeIdx[i] != 0xFFFF) {
|
||||
mat->mTevBlock->getTevStage(i)->setTexSel(mpTevSwapModeInfo[initData->mTevSwapModeIdx[i]].mTexSel);
|
||||
mat->mTevBlock->getTevStage(i)->setRasSel(mpTevSwapModeInfo[initData->mTevSwapModeIdx[i]].mRasSel);
|
||||
}
|
||||
}
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mTevBlock->setTevKColor(i, newTevKColor(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mTevBlock->setTevColor(i, newTevColor(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mTevBlock->setTevSwapModeTable(i, newTevSwapModeTable(idx, i));
|
||||
for (u8 i = 0; i < 2; i++)
|
||||
mat->mColorBlock->setAmbColor(i, newAmbColor(idx, i));
|
||||
for (u8 i = 0; i < 2; i++)
|
||||
mat->mColorBlock->setMatColor(i, newMatColor(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mColorBlock->setColorChan(i, newColorChan(idx, i));
|
||||
for (u8 i = 0; i < texGenNum; i++) {
|
||||
J3DTexCoord texCoord = newTexCoord(idx, i);
|
||||
mat->mTexGenBlock->setTexCoord(i, &texCoord);
|
||||
}
|
||||
for (u8 i = 0; i < 8; i++) {
|
||||
mat->mTexGenBlock->setTexMtx(i, newTexMtx(idx, i));
|
||||
}
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
for (u8 i = 0; i < tevStageNum; i++) {
|
||||
if (initData->mTevKColorSel[i] != 0xff) {
|
||||
mat->mTevBlock->setTevKColorSel(i, initData->mTevKColorSel[i]);
|
||||
} else {
|
||||
mat->mTevBlock->setTevKColorSel(i, 0xc);
|
||||
}
|
||||
}
|
||||
for (u8 i = 0; i < tevStageNum; i++) {
|
||||
if (initData->mTevKAlphaSel[i] != 0xff) {
|
||||
mat->mTevBlock->setTevKAlphaSel(i, initData->mTevKAlphaSel[i]);
|
||||
} else {
|
||||
mat->mTevBlock->setTevKAlphaSel(i, 0x1c);
|
||||
}
|
||||
}
|
||||
if (mpIndInitData != NULL) {
|
||||
u8 indTexStageNum = newIndTexStageNum(idx);
|
||||
mat->mIndBlock->setIndTexStageNum(newIndTexStageNum(idx));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexMtx(i, newIndTexMtx(idx, i));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexOrder(i, newIndTexOrder(idx, i));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexCoordScale(i, newIndTexCoordScale(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++)
|
||||
mat->mTevBlock->setIndTevStage(i, newIndTevStage(idx, i));
|
||||
}
|
||||
return mat;
|
||||
}
|
||||
|
||||
/* 802F768C-802F7F98 .text createPatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
void J3DMaterialFactory::createPatchedMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
J3DMaterial* J3DMaterialFactory::createPatchedMaterial(J3DMaterial* mat, int idx, u32 flag) const {
|
||||
/* Nonmatching */
|
||||
if (mat == NULL)
|
||||
mat = new J3DPatchedMaterial();
|
||||
|
||||
u32 indFlag = (flag & 0x03000000) ? 1 : 0;
|
||||
mat->mColorBlock = J3DMaterial::createColorBlock(0x40000000);
|
||||
|
||||
mat->mTexGenBlock = new J3DTexGenBlockPatched();
|
||||
mat->mTevBlock = new J3DTevBlockPatched();
|
||||
mat->mIndBlock = J3DMaterial::createIndBlock(indFlag);
|
||||
mat->mPEBlock = J3DMaterial::createPEBlock(0x10000000, getMaterialMode(idx));
|
||||
mat->mIndex = idx;
|
||||
mat->mMaterialMode = getMaterialMode(idx);
|
||||
mat->mTevBlock->setTevStageNum(newTevStageNum(idx));
|
||||
mat->mColorBlock->setColorChanNum(newColorChanNum(idx));
|
||||
mat->mColorBlock->setCullMode(newCullMode(idx));
|
||||
mat->mPEBlock->setFog(newFog(idx));
|
||||
mat->mPEBlock->setAlphaComp(newAlphaComp(idx));
|
||||
mat->mPEBlock->setBlend(newBlend(idx));
|
||||
mat->mPEBlock->setZMode(newZMode(idx));
|
||||
mat->mPEBlock->setZCompLoc(newZCompLoc(idx));
|
||||
mat->mPEBlock->setDither(newDither(idx));
|
||||
|
||||
u8 tevStageNum = mat->mTevBlock->getTevStageNum();
|
||||
for (u8 i = 0; i < 8; i++)
|
||||
mat->mTevBlock->setTexNo(i, newTexNo(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++)
|
||||
mat->mTevBlock->setTevOrder(i, newTevOrder(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mTevBlock->setTevKColor(i, newTevKColor(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mTevBlock->setTevColor(i, newTevColor(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++) {
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
mat->mTevBlock->setTevStage(i, newTevStage(idx, i));
|
||||
if (initData->mTevSwapModeIdx[i] != 0xFFFF) {
|
||||
mat->mTevBlock->getTevStage(i)->setTexSel(mpTevSwapModeInfo[initData->mTevSwapModeIdx[i]].mTexSel);
|
||||
mat->mTevBlock->getTevStage(i)->setRasSel(mpTevSwapModeInfo[initData->mTevSwapModeIdx[i]].mRasSel);
|
||||
}
|
||||
}
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
for (u8 i = 0; i < tevStageNum; i++) {
|
||||
if (initData->mTevKColorSel[i] != 0xff) {
|
||||
mat->mTevBlock->setTevKColorSel(i, initData->mTevKColorSel[i]);
|
||||
} else {
|
||||
mat->mTevBlock->setTevKColorSel(i, 0xc);
|
||||
}
|
||||
}
|
||||
for (u8 i = 0; i < 2; i++)
|
||||
mat->mColorBlock->setMatColor(i, newMatColor(idx, i));
|
||||
for (u8 i = 0; i < 4; i++)
|
||||
mat->mColorBlock->setColorChan(i, newColorChan(idx, i));
|
||||
|
||||
u32 texGenNum = countTexGens(idx);
|
||||
mat->mTexGenBlock->setTexGenNum(newTexGenNum(idx));
|
||||
for (u8 i = 0; i < 8; i++)
|
||||
mat->mTexGenBlock->setTexMtx(i, newTexMtx(idx, i));
|
||||
for (u8 i = 0; i < texGenNum; i++) {
|
||||
J3DTexCoord texCoord = newTexCoord(idx, i);
|
||||
mat->mTexGenBlock->setTexCoord(i, &texCoord);
|
||||
}
|
||||
if (mpIndInitData != NULL) {
|
||||
u8 indTexStageNum = newIndTexStageNum(idx);
|
||||
mat->mIndBlock->setIndTexStageNum(newIndTexStageNum(idx));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexMtx(i, newIndTexMtx(idx, i));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexOrder(i, newIndTexOrder(idx, i));
|
||||
for (u8 i = 0; i < indTexStageNum; i++)
|
||||
mat->mIndBlock->setIndTexCoordScale(i, newIndTexCoordScale(idx, i));
|
||||
for (u8 i = 0; i < tevStageNum; i++)
|
||||
mat->mTevBlock->setIndTevStage(i, newIndTevStage(idx, i));
|
||||
}
|
||||
return mat;
|
||||
}
|
||||
|
||||
/* 802F7F98-802F80F8 .text modifyPatchedCurrentMtx__18J3DMaterialFactoryCFP11J3DMateriali */
|
||||
void J3DMaterialFactory::modifyPatchedCurrentMtx(J3DMaterial*, int) const {
|
||||
void J3DMaterialFactory::modifyPatchedCurrentMtx(J3DMaterial* mat, int idx) const {
|
||||
/* Nonmatching */
|
||||
J3DTexCoord coord[8];
|
||||
u32 texGenNum = countTexGens(idx);
|
||||
for (u8 i = 0; i < texGenNum; i++)
|
||||
coord[i] = newTexCoord(idx, i);
|
||||
mat->mCurrentMtx.setCurrentTexMtx(
|
||||
coord[0].getTexGenMtx(),
|
||||
coord[1].getTexGenMtx(),
|
||||
coord[2].getTexGenMtx(),
|
||||
coord[3].getTexGenMtx(),
|
||||
coord[4].getTexGenMtx(),
|
||||
coord[5].getTexGenMtx(),
|
||||
coord[6].getTexGenMtx(),
|
||||
coord[7].getTexGenMtx()
|
||||
);
|
||||
}
|
||||
|
||||
/* 802F80F8-802F83A0 .text createLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
void J3DMaterialFactory::createLockedMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
/* Nonmatching */
|
||||
J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* mat, int idx, u32 flag) const {
|
||||
/* Nonmatching - J3DCurrentMtx constructor */
|
||||
if (mat == NULL) {
|
||||
mat = new J3DLockedMaterial();
|
||||
mat->mColorBlock = new J3DColorBlockNull();
|
||||
mat->mTexGenBlock = new J3DTexGenBlockNull();
|
||||
mat->mTevBlock = new J3DTevBlockNull();
|
||||
mat->mIndBlock = new J3DIndBlockNull();
|
||||
mat->mPEBlock = new J3DPEBlockNull();
|
||||
mat->mIndex = idx;
|
||||
mat->mMaterialMode = field_0x84[idx];
|
||||
}
|
||||
|
||||
mat->mCurrentMtx = J3DCurrentMtx(mpCurrentMtxInfo[idx]);
|
||||
mat->mColorBlock->setMatColorOffset(mpPatchingInfo[idx].mMatColorOffset);
|
||||
mat->mColorBlock->setColorChanOffset(mpPatchingInfo[idx].mColorChanOffset);
|
||||
mat->mTexGenBlock->setTexMtxOffset(mpPatchingInfo[idx].mTexMtxOffset);
|
||||
mat->mTevBlock->setTexNoOffset(mpPatchingInfo[idx].mTexNoOffset);
|
||||
mat->mTevBlock->setTevRegOffset(mpPatchingInfo[idx].mTevRegOffset);
|
||||
mat->mPEBlock->setFogOffset(mpPatchingInfo[idx].mFogOffset);
|
||||
if (mat->mSharedDLObj == NULL) {
|
||||
mat->mSharedDLObj = new J3DDisplayListObj();
|
||||
mat->mSharedDLObj->setSingleDisplayList((void*)(mpDisplayListInit[idx].mOffset + (u32)&mpDisplayListInit[idx]), mpDisplayListInit[idx].mSize);
|
||||
}
|
||||
return mat;
|
||||
}
|
||||
|
||||
/* 802F83A0-802F8420 .text calcSize__18J3DMaterialFactoryCFP11J3DMaterialQ218J3DMaterialFactory12MaterialTypeiUl */
|
||||
u32 J3DMaterialFactory::calcSize(J3DMaterial*, J3DMaterialFactory::MaterialType, int, unsigned long) const {
|
||||
/* Nonmatching */
|
||||
u32 J3DMaterialFactory::calcSize(J3DMaterial* mat, J3DMaterialFactory::MaterialType type, int idx, u32 flag) const {
|
||||
u32 ret = 0;
|
||||
switch (type) {
|
||||
case MATERIAL_TYPE_NORMAL:
|
||||
ret = calcSizeNormalMaterial(mat, idx, flag);
|
||||
break;
|
||||
case MATERIAL_TYPE_LOCKED:
|
||||
ret = calcSizeLockedMaterial(mat, idx, flag);
|
||||
break;
|
||||
case MATERIAL_TYPE_PATCHED:
|
||||
ret = calcSizePatchedMaterial(mat, idx, flag);
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8420-802F8554 .text calcSizeNormalMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
u32 J3DMaterialFactory::calcSizeNormalMaterial(J3DMaterial*, int, u32) const {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 802F8554-802F8624 .text calcSizePatchedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial*, int, u32) const {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 802F8624-802F863C .text calcSizeLockedMaterial__18J3DMaterialFactoryCFP11J3DMaterialiUl */
|
||||
u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial*, int, unsigned long) const {
|
||||
u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial*, int, u32) const {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 802F863C-802F86CC .text newMatColor__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newMatColor(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DGXColor J3DMaterialFactory::newMatColor(int idx, int stage) const {
|
||||
GXColor _ret = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
J3DGXColor ret(_ret);
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mMatColorIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return mpMatColor[no];
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F86CC-802F8704 .text newColorChanNum__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newColorChanNum(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newColorChanNum(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mColorChanNumIdx;
|
||||
if (no != 0xFF)
|
||||
return mpColorChanNum[no];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802F8704-802F88A8 .text newColorChan__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newColorChan(int, int) const {
|
||||
J3DColorChan J3DMaterialFactory::newColorChan(int idx, int stage) const {
|
||||
/* Nonmatching */
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mColorChanIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return J3DColorChan(mpColorChanInfo[no]);
|
||||
else
|
||||
return J3DColorChan();
|
||||
}
|
||||
|
||||
/* 802F88A8-802F8938 .text newAmbColor__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newAmbColor(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DGXColor J3DMaterialFactory::newAmbColor(int idx, int stage) const {
|
||||
GXColor _ret = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
J3DGXColor ret(_ret);
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mAmbColorIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return mpAmbColor[no];
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8938-802F8970 .text newTexGenNum__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newTexGenNum(int) const {
|
||||
/* Nonmatching */
|
||||
u32 J3DMaterialFactory::newTexGenNum(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mTexGenNumIdx;
|
||||
if (no != 0xFF)
|
||||
return mpTexGenNum[no];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802F8970-802F89E4 .text newTexCoord__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTexCoord(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DTexCoord J3DMaterialFactory::newTexCoord(int idx, int stage) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTexCoordIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return J3DTexCoord(mpTexCoordInfo[no]);
|
||||
else
|
||||
return J3DTexCoord();
|
||||
}
|
||||
|
||||
/* 802F89E4-802F8AF4 .text newTexMtx__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTexMtx(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DTexMtx* J3DMaterialFactory::newTexMtx(int idx, int stage) const {
|
||||
J3DTexMtx* ret = NULL;
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
if (initData->mTexMtxIdx[stage] != 0xFFFF)
|
||||
ret = new J3DTexMtx(mpTexMtxInfo[initData->mTexMtxIdx[stage]]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8AF4-802F8B34 .text newCullMode__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newCullMode(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newCullMode(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mCullModeIdx;
|
||||
if (no != 0xFF)
|
||||
return mpCullMode[no];
|
||||
else
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
/* 802F8B34-802F8B7C .text newTexNo__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTexNo(int, int) const {
|
||||
/* Nonmatching */
|
||||
u16 J3DMaterialFactory::newTexNo(int idx, int stage) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTexNoIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return mpTexNo[no];
|
||||
else
|
||||
return 0xFFFF;
|
||||
}
|
||||
|
||||
/* 802F8B7C-802F8BF0 .text newTevOrder__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTevOrder(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DTevOrder J3DMaterialFactory::newTevOrder(int idx, int stage) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTevOrderIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return J3DTevOrder(mpTevOrderInfo[no]);
|
||||
else
|
||||
return J3DTevOrder();
|
||||
}
|
||||
|
||||
/* 802F8BF0-802F8C88 .text newTevColor__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTevColor(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DGXColorS10 J3DMaterialFactory::newTevColor(int idx, int stage) const {
|
||||
GXColorS10 _ret = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
J3DGXColorS10 ret(_ret);
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTevColorIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return mpTevColor[no];
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8C88-802F8D18 .text newTevKColor__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTevKColor(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DGXColor J3DMaterialFactory::newTevKColor(int idx, int stage) const {
|
||||
GXColor _ret = { 0xFF, 0xFF, 0xFF, 0xFF };
|
||||
J3DGXColor ret(_ret);
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTevKColorIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return mpTevKColor[no];
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8D18-802F8D50 .text newTevStageNum__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newTevStageNum(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newTevStageNum(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mTevStageNumIdx;
|
||||
if (no != 0xFF)
|
||||
return mpTevStageNum[no];
|
||||
else
|
||||
return 0xFF;
|
||||
}
|
||||
|
||||
/* 802F8D50-802F8DB0 .text newTevStage__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTevStage(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DTevStage J3DMaterialFactory::newTevStage(int idx, int stage) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTevStageIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return J3DTevStage(mpTevStageInfo[no]);
|
||||
else
|
||||
return J3DTevStage();
|
||||
}
|
||||
|
||||
/* 802F8DB0-802F8E4C .text newTevSwapModeTable__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newTevSwapModeTable(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int idx, int stage) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mTevSwapModeTableIdx[stage];
|
||||
if (no != 0xFFFF)
|
||||
return J3DTevSwapModeTable(mpTevSwapModeTableInfo[no]);
|
||||
else
|
||||
return J3DTevSwapModeTable(j3dDefaultTevSwapModeTable);
|
||||
}
|
||||
|
||||
/* 802F8E4C-802F8E74 .text newIndTexStageNum__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newIndTexStageNum(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newIndTexStageNum(int idx) const {
|
||||
if (mpIndInitData[idx].mEnabled == true)
|
||||
return mpIndInitData[idx].mIndTexStageNum;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802F8E74-802F8ED4 .text newIndTexOrder__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newIndTexOrder(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DIndTexOrder J3DMaterialFactory::newIndTexOrder(int idx, int stage) const {
|
||||
J3DIndTexOrder ret;
|
||||
if (mpIndInitData[idx].mEnabled == true)
|
||||
return J3DIndTexOrder(mpIndInitData[idx].mIndTexOrderInfo[stage]);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8ED4-802F8FD0 .text newIndTexMtx__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newIndTexMtx(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DIndTexMtx J3DMaterialFactory::newIndTexMtx(int idx, int stage) const {
|
||||
J3DIndTexMtx ret;
|
||||
if (mpIndInitData[idx].mEnabled == true)
|
||||
return J3DIndTexMtx(mpIndInitData[idx].mIndTexMtxInfo[stage]);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F8FD0-802F9164 .text newIndTevStage__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newIndTevStage(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DIndTevStage J3DMaterialFactory::newIndTevStage(int idx, int stage) const {
|
||||
J3DIndTevStage ret;
|
||||
if (mpIndInitData[idx].mEnabled == true)
|
||||
return J3DIndTevStage(mpIndInitData[idx].mIndTevStageInfo[stage]);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F9164-802F91C4 .text newIndTexCoordScale__18J3DMaterialFactoryCFii */
|
||||
void J3DMaterialFactory::newIndTexCoordScale(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DIndTexCoordScale J3DMaterialFactory::newIndTexCoordScale(int idx, int stage) const {
|
||||
J3DIndTexCoordScale ret;
|
||||
if (mpIndInitData[idx].mEnabled == true)
|
||||
return J3DIndTexCoordScale(mpIndInitData[idx].mIndTexCoordScaleInfo[stage]);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802F91C4-802F9348 .text newFog__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newFog(int) const {
|
||||
/* Nonmatching */
|
||||
J3DFog* J3DMaterialFactory::newFog(int idx) const {
|
||||
J3DMaterialInitData* initData = &mpMaterialInitData[mpMaterialID[idx]];
|
||||
if (initData->mFogIdx != 0xFFFF)
|
||||
return new J3DFog(mpFogInfo[initData->mFogIdx]);
|
||||
else
|
||||
return new J3DFog();
|
||||
}
|
||||
|
||||
/* 802F9348-802F93C8 .text newAlphaComp__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newAlphaComp(int) const {
|
||||
/* Nonmatching */
|
||||
J3DAlphaComp J3DMaterialFactory::newAlphaComp(int idx) const {
|
||||
/* Nonmatching - default constructor loads id 0xFFFF rather than j3dDefaultAlphaCompInfo */
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mAlphaCompIdx;
|
||||
if (no != 0xFFFF)
|
||||
return J3DAlphaComp(mpAlphaCompInfo[no]);
|
||||
else
|
||||
return J3DAlphaComp();
|
||||
}
|
||||
|
||||
/* 802F93C8-802F9444 .text newBlend__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newBlend(int) const {
|
||||
/* Nonmatching */
|
||||
J3DBlend J3DMaterialFactory::newBlend(int idx) const {
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mBlendIdx;
|
||||
if (no != 0xFFFF)
|
||||
return J3DBlend(mpBlendInfo[no]);
|
||||
else
|
||||
return J3DBlend();
|
||||
}
|
||||
|
||||
/* 802F9444-802F94A4 .text newZMode__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newZMode(int) const {
|
||||
/* Nonmatching */
|
||||
J3DZMode J3DMaterialFactory::newZMode(int idx) const {
|
||||
/* Nonmatching - J3DZModeInfo array seems to be 0x04-sized */
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mZModeIdx;
|
||||
if (no != 0xFF)
|
||||
return J3DZMode(mpZModeInfo[no]);
|
||||
else
|
||||
return J3DZMode();
|
||||
}
|
||||
|
||||
/* 802F94A4-802F94DC .text newZCompLoc__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newZCompLoc(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newZCompLoc(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mZCompLocIdx;
|
||||
if (no != 0xFF)
|
||||
return mpZCompLoc[no];
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 802F94DC-802F9514 .text newDither__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newDither(int) const {
|
||||
/* Nonmatching */
|
||||
u8 J3DMaterialFactory::newDither(int idx) const {
|
||||
u8 no = mpMaterialInitData[mpMaterialID[idx]].mDitherIdx;
|
||||
if (no != 0xFF)
|
||||
return mpDither[no];
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 802F9514-802F95B8 .text newNBTScale__18J3DMaterialFactoryCFi */
|
||||
void J3DMaterialFactory::newNBTScale(int) const {
|
||||
/* Nonmatching */
|
||||
J3DNBTScale J3DMaterialFactory::newNBTScale(int idx) const {
|
||||
J3DNBTScale ret;
|
||||
u16 no = mpMaterialInitData[mpMaterialID[idx]].mNBTScaleIdx;
|
||||
if (no != 0xFFFF)
|
||||
return J3DNBTScale(mpNBTScaleInfo[no]);
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -4,44 +4,228 @@
|
||||
//
|
||||
|
||||
#include "JSystem/J3DGraphLoader/J3DShapeFactory.h"
|
||||
#include "JSystem/J3DGraphBase/J3DShape.h"
|
||||
#include "JSystem/J3DGraphBase/J3DShapeDraw.h"
|
||||
#include "JSystem/J3DGraphBase/J3DShapeMtx.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "dolphin/gx/GXAttr.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
/* 802FE3A8-802FE458 .text __ct__15J3DShapeFactoryFRC13J3DShapeBlock */
|
||||
J3DShapeFactory::J3DShapeFactory(const J3DShapeBlock&) {
|
||||
/* Nonmatching */
|
||||
J3DShapeFactory::J3DShapeFactory(const J3DShapeBlock& block) {
|
||||
mpShapeInitData = JSUConvertOffsetToPtr<J3DShapeInitData>(&block, (u32)block.mpShapeInitData);
|
||||
mpIndexTable = JSUConvertOffsetToPtr<u16>(&block, (u32)block.mpIndexTable);
|
||||
mpVtxDescList = JSUConvertOffsetToPtr<GXVtxDescList>(&block, (u32)block.mpVtxDescList);
|
||||
mpMtxTable = JSUConvertOffsetToPtr<u16>(&block, (u32)block.mpMtxTable);
|
||||
mpDisplayListData = JSUConvertOffsetToPtr<u8>(&block, (u32)block.mpDisplayListData);
|
||||
mpMtxInitData = JSUConvertOffsetToPtr<J3DShapeMtxInitData>(&block, (u32)block.mpMtxInitData);
|
||||
mpDrawInitData = JSUConvertOffsetToPtr<J3DShapeDrawInitData>(&block, (u32)block.mpDrawInitData);
|
||||
mpVcdVatCmdBuffer = NULL;
|
||||
}
|
||||
|
||||
/* 802FE458-802FE614 .text create__15J3DShapeFactoryFiUlP14_GXVtxDescList */
|
||||
J3DShape* J3DShapeFactory::create(int, u32, GXVtxDescList*) {
|
||||
/* Nonmatching */
|
||||
J3DShape* J3DShapeFactory::create(int no, u32 flag, GXVtxDescList* vtxDesc) {
|
||||
J3DShape* shape = new J3DShape();
|
||||
shape->mMtxGroupNum = getMtxGroupNum(no);
|
||||
shape->mRadius = getRadius(no);
|
||||
shape->mVtxDesc = getVtxDescList(no);
|
||||
shape->mShapeMtx = new J3DShapeMtx*[shape->mMtxGroupNum];
|
||||
shape->mShapeDraw = new J3DShapeDraw*[shape->mMtxGroupNum];
|
||||
shape->mMin = getMin(no);
|
||||
shape->mMax = getMax(no);
|
||||
shape->mVcdVatCmd = mpVcdVatCmdBuffer + no * J3DShape::kVcdVatDLSize;
|
||||
|
||||
for (s32 i = 0; i < shape->mMtxGroupNum; i++) {
|
||||
shape->mShapeMtx[i] = newShapeMtx(flag, no, i);
|
||||
shape->mShapeDraw[i] = newShapeDraw(no, i);
|
||||
}
|
||||
|
||||
shape->mIndex = no;
|
||||
return shape;
|
||||
}
|
||||
|
||||
static inline u32 getMdlDataFlag_MtxLoadType(u32 flag) {
|
||||
return flag & 0xF0;
|
||||
}
|
||||
|
||||
enum {
|
||||
J3DMdlDataFlag_Imm = 0x10,
|
||||
J3DMdlDataFlag_ConcatView = 0x20,
|
||||
};
|
||||
|
||||
enum {
|
||||
J3DShapeMtxType_Mtx = 0x00,
|
||||
J3DShapeMtxType_BBoard = 0x01,
|
||||
J3DShapeMtxType_YBBoard = 0x02,
|
||||
J3DShapeMtxType_Multi = 0x03,
|
||||
};
|
||||
|
||||
/* 802FE614-802FEA40 .text newShapeMtx__15J3DShapeFactoryCFUlii */
|
||||
J3DShapeMtx* J3DShapeFactory::newShapeMtx(u32, int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DShapeMtx* J3DShapeFactory::newShapeMtx(u32 flag, int shapeNo, int mtxGroupNo) const {
|
||||
J3DShapeMtx* ret = NULL;
|
||||
const J3DShapeInitData& shapeInitData = mpShapeInitData[mpIndexTable[shapeNo]];
|
||||
const J3DShapeMtxInitData& mtxInitData = (&mpMtxInitData[shapeInitData.mMtxInitDataIndex])[mtxGroupNo];
|
||||
|
||||
switch (getMdlDataFlag_MtxLoadType(flag)) {
|
||||
case J3DMdlDataFlag_Imm:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
ret = new J3DShapeMtxImm(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_BBoard:
|
||||
ret = new J3DShapeMtxBBoardImm(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = new J3DShapeMtxYBBoardImm(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = new J3DShapeMtxMultiImm(mtxInitData.mUseMtxIndex, mtxInitData.mUseMtxCount, &mpMtxTable[mtxInitData.mFirstUseMtxIndex]);
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case J3DMdlDataFlag_ConcatView:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
ret = new J3DShapeMtxConcatView(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_BBoard:
|
||||
ret = new J3DShapeMtxBBoardConcatView(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = new J3DShapeMtxYBBoardConcatView(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = new J3DShapeMtxMultiConcatView(mtxInitData.mUseMtxIndex, mtxInitData.mUseMtxCount, &mpMtxTable[mtxInitData.mFirstUseMtxIndex]);
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
default:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
case J3DShapeMtxType_BBoard:
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = new J3DShapeMtx(mtxInitData.mUseMtxIndex);
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = new J3DShapeMtxMulti(mtxInitData.mUseMtxIndex, mtxInitData.mUseMtxCount, &mpMtxTable[mtxInitData.mFirstUseMtxIndex]);
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802FEA40-802FEACC .text newShapeDraw__15J3DShapeFactoryCFii */
|
||||
J3DShapeDraw* J3DShapeFactory::newShapeDraw(int, int) const {
|
||||
/* Nonmatching */
|
||||
J3DShapeDraw* J3DShapeFactory::newShapeDraw(int shapeNo, int mtxGroupNo) const {
|
||||
const J3DShapeInitData& shapeInitData = mpShapeInitData[mpIndexTable[shapeNo]];
|
||||
const J3DShapeDrawInitData& drawInitData = (&mpDrawInitData[shapeInitData.mDrawInitDataIndex])[mtxGroupNo];
|
||||
return new J3DShapeDraw(&mpDisplayListData[drawInitData.mDisplayListIndex], drawInitData.mDisplayListSize);
|
||||
}
|
||||
|
||||
/* 802FEACC-802FEB38 .text allocVcdVatCmdBuffer__15J3DShapeFactoryFUl */
|
||||
void J3DShapeFactory::allocVcdVatCmdBuffer(u32) {
|
||||
/* Nonmatching */
|
||||
void J3DShapeFactory::allocVcdVatCmdBuffer(u32 count) {
|
||||
mpVcdVatCmdBuffer = new (0x20) u8[J3DShape::kVcdVatDLSize * count];
|
||||
for (u32 i = 0; i < (J3DShape::kVcdVatDLSize * count) / 4; i++)
|
||||
((u32*)mpVcdVatCmdBuffer)[i] = 0;
|
||||
}
|
||||
|
||||
/* 802FEB38-802FEBCC .text calcSize__15J3DShapeFactoryFiUl */
|
||||
s32 J3DShapeFactory::calcSize(int, u32) {
|
||||
/* Nonmatching */
|
||||
s32 J3DShapeFactory::calcSize(int shapeNo, u32 flag) {
|
||||
s32 size = 0x68;
|
||||
|
||||
s32 mtxGroupNo = getMtxGroupNum(shapeNo);
|
||||
size += mtxGroupNo * 4;
|
||||
size += mtxGroupNo * 4;
|
||||
|
||||
for (u32 i = 0; i < mtxGroupNo; i++) {
|
||||
s32 shapeMtxSize = calcSizeShapeMtx(flag, shapeNo, i);
|
||||
size += shapeMtxSize;
|
||||
size += 0x0C;
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
/* 802FEBCC-802FEBDC .text calcSizeVcdVatCmdBuffer__15J3DShapeFactoryFUl */
|
||||
s32 J3DShapeFactory::calcSizeVcdVatCmdBuffer(u32) {
|
||||
/* Nonmatching */
|
||||
s32 J3DShapeFactory::calcSizeVcdVatCmdBuffer(u32 count) {
|
||||
return ALIGN_NEXT(count * J3DShape::kVcdVatDLSize, 0x20);
|
||||
}
|
||||
|
||||
/* 802FEBDC-802FED40 .text calcSizeShapeMtx__15J3DShapeFactoryCFUlii */
|
||||
s32 J3DShapeFactory::calcSizeShapeMtx(u32, int, int) const {
|
||||
/* Nonmatching */
|
||||
s32 J3DShapeFactory::calcSizeShapeMtx(u32 flag, int shapeNo, int mtxGrouNo) const {
|
||||
const J3DShapeInitData& shapeInitData = mpShapeInitData[mpIndexTable[shapeNo]];
|
||||
u32 ret = 0;
|
||||
|
||||
u32 mtxLoadType = getMdlDataFlag_MtxLoadType(flag);
|
||||
switch (mtxLoadType) {
|
||||
case J3DMdlDataFlag_Imm:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_BBoard:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = 0x10;
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case J3DMdlDataFlag_ConcatView:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_BBoard:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = 0x10;
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
}
|
||||
break;
|
||||
|
||||
case 0:
|
||||
default:
|
||||
switch (shapeInitData.mShapeMtxType) {
|
||||
case J3DShapeMtxType_Mtx:
|
||||
case J3DShapeMtxType_BBoard:
|
||||
case J3DShapeMtxType_YBBoard:
|
||||
ret = 0x08;
|
||||
break;
|
||||
case J3DShapeMtxType_Multi:
|
||||
ret = 0x10;
|
||||
break;
|
||||
default:
|
||||
OSReport("WRONG SHAPE MATRIX TYPE (J3DModelInit.cpp)\n");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "MSL_C/new.h"
|
||||
|
||||
/* 802B1558-802B15D0 .text createRoot__10JKRExpHeapFib */
|
||||
JKRExpHeap* JKRExpHeap::createRoot(int maxHeaps, bool errorFlag) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "JSystem/JParticle/JPADrawVisitor.h"
|
||||
#include "JSystem/JParticle/JPABaseShape.h"
|
||||
#include "JSystem/JParticle/JPAEmitter.h"
|
||||
#include "JSystem/JParticle/JPAExtraShape.h"
|
||||
#include "JSystem/JParticle/JPAParticle.h"
|
||||
#include "JSystem/JParticle/JPAResourceManager.h"
|
||||
#include "JSystem/JParticle/JPASweepShape.h"
|
||||
@@ -13,6 +14,10 @@
|
||||
#include "dolphin/gx/GX.h"
|
||||
#include "dolphin/mtx/mtx.h"
|
||||
|
||||
static inline u32 COLOR_MULTI(u32 a, u32 b) {
|
||||
return ((a * (b + 1)) * 0x10000) >> 24;
|
||||
}
|
||||
|
||||
JPADrawClipBoard* JPADrawContext::pcb;
|
||||
|
||||
/* 8025F960-8025FBE4 .text exec__20JPADrawExecLoadExTexFPC14JPADrawContext */
|
||||
@@ -338,7 +343,15 @@ void JPADrawExecRotationCross::exec(const JPADrawContext* ctx, JPABaseParticle*
|
||||
|
||||
/* 802632EC-80263380 .text exec__16JPADrawExecPointFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawExecPoint::exec(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
if (ptcl->isInvisibleParticle())
|
||||
return;
|
||||
|
||||
JGeometry::TVec3<f32> pos(ptcl->mPosition);
|
||||
|
||||
GXBegin(GX_POINTS, GX_VTXFMT0, 1);
|
||||
GXPosition3f32(pos.x, pos.y, pos.z);
|
||||
GXTexCoord2f32(0.0f, 0.0f);
|
||||
GXEnd();
|
||||
}
|
||||
|
||||
/* 80263380-80263508 .text exec__15JPADrawExecLineFPC14JPADrawContextP15JPABaseParticle */
|
||||
@@ -427,45 +440,50 @@ void JPADrawCalcColorEnv::calc(const JPADrawContext* ctx) {
|
||||
|
||||
/* 802647E0-8026486C .text calc__30JPADrawCalcColorAnmFrameNormalFPC14JPADrawContext */
|
||||
void JPADrawCalcColorAnmFrameNormal::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
s16 tick = ctx->pbe->mTick;
|
||||
s16 frame;
|
||||
if (tick < ctx->pbsp->getColorRegAnmMaxFrm()) {
|
||||
frame = tick;
|
||||
} else {
|
||||
frame = ctx->pbsp->getColorRegAnmMaxFrm();
|
||||
}
|
||||
s32 tick = ctx->pbe->mTick;
|
||||
s32 frame = (tick < ctx->pbsp->getColorRegAnmMaxFrm()) ? tick : ctx->pbsp->getColorRegAnmMaxFrm();
|
||||
JPADrawContext::pcb->mColorAnmFrame = frame;
|
||||
}
|
||||
|
||||
/* 8026486C-802648E0 .text calc__30JPADrawCalcColorAnmFrameRepeatFPC14JPADrawContext */
|
||||
void JPADrawCalcColorAnmFrameRepeat::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
f32 tick = ctx->pbe->mTick;
|
||||
s32 frame = ((u32)tick) % (ctx->pbsp->getColorRegAnmMaxFrm() + 1);
|
||||
JPADrawContext::pcb->mColorAnmFrame = frame;
|
||||
}
|
||||
|
||||
/* 802648E0-8026495C .text calc__31JPADrawCalcColorAnmFrameReverseFPC14JPADrawContext */
|
||||
void JPADrawCalcColorAnmFrameReverse::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
s32 tick = ctx->pbe->mTick;
|
||||
s32 frame = tick / ctx->pbsp->getColorRegAnmMaxFrm();
|
||||
JPADrawContext::pcb->mColorAnmFrame = frame;
|
||||
}
|
||||
|
||||
/* 8026495C-8026496C .text calc__29JPADrawCalcColorAnmFrameMergeFPC14JPADrawContext */
|
||||
void JPADrawCalcColorAnmFrameMerge::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
JPADrawContext::pcb->mColorAnmFrame = 0;
|
||||
}
|
||||
|
||||
/* 8026496C-8026497C .text calc__30JPADrawCalcColorAnmFrameRandomFPC14JPADrawContext */
|
||||
void JPADrawCalcColorAnmFrameRandom::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
JPADrawContext::pcb->mColorAnmFrame = 0;
|
||||
}
|
||||
|
||||
/* 8026497C-80264A34 .text calc__32JPADrawCalcTextureAnmIndexNormalFPC14JPADrawContext */
|
||||
void JPADrawCalcTextureAnmIndexNormal::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
s32 tick = ctx->pbe->mTick;
|
||||
s32 idx = ((ctx->pbsp->getTextureAnmKeyNum() - 1) < tick) ? ctx->pbsp->getTextureAnmKeyNum() - 1 : tick;
|
||||
ctx->mpDraw->mTexIdx = ctx->pTexIdx[ctx->pbsp->getTextureIndex(idx)];
|
||||
}
|
||||
|
||||
/* 80264A34-80264AD0 .text calc__32JPADrawCalcTextureAnmIndexRepeatFPC14JPADrawContext */
|
||||
void JPADrawCalcTextureAnmIndexRepeat::calc(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
f32 tick = ctx->pbe->mTick;
|
||||
s32 maxFrame = ctx->pbsp->getTextureAnmKeyNum();
|
||||
s32 idx = ctx->pbsp->getTextureIndex((s32)tick % maxFrame);
|
||||
ctx->mpDraw->mTexIdx = ctx->pTexIdx[idx];
|
||||
}
|
||||
|
||||
/* 80264AD0-80264B80 .text calc__33JPADrawCalcTextureAnmIndexReverseFPC14JPADrawContext */
|
||||
@@ -485,12 +503,15 @@ void JPADrawCalcTextureAnmIndexRandom::calc(const JPADrawContext* ctx) {
|
||||
|
||||
/* 80264C10-80264C4C .text exec__19JPADrawExecCallBackFPC14JPADrawContext */
|
||||
void JPADrawExecCallBack::exec(const JPADrawContext* ctx) {
|
||||
/* Nonmatching */
|
||||
if (ctx->pbe->mpEmitterCallBack != NULL)
|
||||
ctx->pbe->mpEmitterCallBack->draw(ctx->pbe);
|
||||
}
|
||||
|
||||
/* 80264C4C-80264C88 .text exec__19JPADrawExecCallBackFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawExecCallBack::exec(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
JPABaseEmitter* pbe = ctx->pbe;
|
||||
if (ptcl->mpCallBack2 != NULL)
|
||||
ptcl->mpCallBack2->draw(pbe, ptcl);
|
||||
}
|
||||
|
||||
/* 80264C88-80264DB8 .text calc__17JPADrawCalcScaleXFPC14JPADrawContextP15JPABaseParticle */
|
||||
@@ -515,22 +536,24 @@ void JPADrawCalcScaleYBySpeed::calc(const JPADrawContext* ctx, JPABaseParticle*
|
||||
|
||||
/* 80265288-80265294 .text calc__23JPADrawCalcScaleCopyX2YFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcScaleCopyX2Y::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mScaleY = ptcl->mScaleX;
|
||||
}
|
||||
|
||||
/* 80265294-802652A4 .text calc__31JPADrawCalcScaleAnmTimingNormalFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcScaleAnmTimingNormal::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
JPADrawContext::pcb->mScaleAnmTiming = ptcl->mCurNormTime;
|
||||
}
|
||||
|
||||
/* 802652A4-80265374 .text calc__32JPADrawCalcScaleAnmTimingRepeatXFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcScaleAnmTimingRepeatX::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
s32 frame = ptcl->mCurFrame;
|
||||
JPADrawContext::pcb->mScaleAnmTiming = (frame % ctx->pesp->getAnmCycleX()) / (f32)ctx->pesp->getAnmCycleX();
|
||||
}
|
||||
|
||||
/* 80265374-80265444 .text calc__32JPADrawCalcScaleAnmTimingRepeatYFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcScaleAnmTimingRepeatY::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
s32 frame = ptcl->mCurFrame;
|
||||
JPADrawContext::pcb->mScaleAnmTiming = (frame % ctx->pesp->getAnmCycleY()) / (f32)ctx->pesp->getAnmCycleY();
|
||||
}
|
||||
|
||||
/* 80265444-80265588 .text calc__33JPADrawCalcScaleAnmTimingReverseXFPC14JPADrawContextP15JPABaseParticle */
|
||||
@@ -545,17 +568,18 @@ void JPADrawCalcScaleAnmTimingReverseY::calc(const JPADrawContext* ctx, JPABaseP
|
||||
|
||||
/* 802656CC-80265734 .text calc__19JPADrawCalcColorPrmFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcColorPrm::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mPrmColor = ctx->pbsp->getPrmColor(JPADrawContext::pcb->mColorAnmFrame);
|
||||
}
|
||||
|
||||
/* 80265734-8026579C .text calc__19JPADrawCalcColorEnvFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcColorEnv::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mEnvColor = ctx->pbsp->getEnvColor(JPADrawContext::pcb->mColorAnmFrame);
|
||||
}
|
||||
|
||||
/* 8026579C-802657E8 .text calc__31JPADrawCalcColorCopyFromEmitterFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcColorCopyFromEmitter::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mPrmColor = ctx->mpDraw->mPrmColor;
|
||||
ptcl->mEnvColor = ctx->mpDraw->mEnvColor;
|
||||
}
|
||||
|
||||
/* 802657E8-80265880 .text calc__30JPADrawCalcColorAnmFrameNormalFPC14JPADrawContextP15JPABaseParticle */
|
||||
@@ -630,10 +654,11 @@ void JPADrawCalcTextureAnmIndexRandom::calc(const JPADrawContext* ctx, JPABasePa
|
||||
|
||||
/* 8026640C-80266420 .text calc__24JPADrawCalcChildAlphaOutFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcChildAlphaOut::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mAlphaOut = 1.0f - ptcl->mCurNormTime;
|
||||
}
|
||||
|
||||
/* 80266420-80266450 .text calc__24JPADrawCalcChildScaleOutFPC14JPADrawContextP15JPABaseParticle */
|
||||
void JPADrawCalcChildScaleOut::calc(const JPADrawContext* ctx, JPABaseParticle* ptcl) {
|
||||
/* Nonmatching */
|
||||
ptcl->mScaleX = ptcl->mScaleOut * (1.0f - ptcl->mCurNormTime);
|
||||
ptcl->mScaleY = ptcl->mAlphaWaveRandom * (1.0f - ptcl->mCurNormTime);
|
||||
}
|
||||
|
||||
+283
-11
@@ -11,10 +11,17 @@
|
||||
#include "d/actor/d_a_item.h"
|
||||
#include "d/d_item_data.h"
|
||||
#include "d/actor/d_a_boko.h"
|
||||
#include "d/actor/d_a_bomb.h"
|
||||
#include "d/d_bg_s_lin_chk.h"
|
||||
#include "m_Do/m_Do_mtx.h"
|
||||
#include "d/actor/d_a_player.h"
|
||||
#include "d/d_s_play.h"
|
||||
#include "d/d_path.h"
|
||||
|
||||
static u8 hio_set;
|
||||
static u8 another_hit;
|
||||
static u32 ken;
|
||||
static u8 search_sp;
|
||||
static bkHIO_c l_bkHIO;
|
||||
|
||||
enum BK_RES_FILE_ID { // IDs and indexes are synced
|
||||
@@ -120,11 +127,11 @@ static void anm_init(bk_class* i_this, int bckFileIdx, f32 morf, u8 loopMode, f3
|
||||
return;
|
||||
}
|
||||
if (soundFileIdx >= 0) {
|
||||
void* soundAnm = dComIfG_getObjectRes("AM2", soundFileIdx);
|
||||
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM2", bckFileIdx);
|
||||
void* soundAnm = dComIfG_getObjectRes("Bk", soundFileIdx);
|
||||
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("Bk", bckFileIdx);
|
||||
i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, soundAnm);
|
||||
} else {
|
||||
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("AM2", bckFileIdx);
|
||||
J3DAnmTransform* bckAnm = (J3DAnmTransform*)dComIfG_getObjectRes("Bk", bckFileIdx);
|
||||
i_this->mpMorf->setAnm(bckAnm, loopMode, morf, speed, 0.0f, -1.0f, NULL);
|
||||
}
|
||||
}
|
||||
@@ -167,8 +174,60 @@ static void yari_off_check(bk_class* i_this) {
|
||||
}
|
||||
|
||||
/* 00000A1C-00000EE8 .text smoke_set_s__FP8bk_classf */
|
||||
static void smoke_set_s(bk_class* i_this, f32) {
|
||||
/* Nonmatching */
|
||||
static void smoke_set_s(bk_class* i_this, f32 rate) {
|
||||
dBgS_LinChk linChk;
|
||||
s32 attribCode;
|
||||
attribCode = 0;
|
||||
cXyz startPos = i_this->m0338;
|
||||
startPos.y += 100.0f;
|
||||
cXyz endPos = i_this->m0338;
|
||||
endPos.y -= 100.0f;
|
||||
linChk.Set(&startPos, &endPos, i_this);
|
||||
|
||||
dBgS* bgs = dComIfG_Bgsp(); // Fakematch? fixes regalloc
|
||||
if (bgs->LineCross(&linChk)) {
|
||||
endPos = linChk.GetCross();
|
||||
i_this->m0338.y = endPos.y;
|
||||
attribCode = bgs->GetAttributeCode(linChk);
|
||||
} else {
|
||||
i_this->m0338.y -= 20000.0f;
|
||||
}
|
||||
|
||||
if (i_this->m034F != 0 && attribCode != dBgS_Attr_GRASS_e) {
|
||||
return;
|
||||
}
|
||||
|
||||
i_this->m034F++;
|
||||
|
||||
switch (attribCode) {
|
||||
case dBgS_Attr_NORMAL_e:
|
||||
case dBgS_Attr_DIRT_e:
|
||||
case dBgS_Attr_WOOD_e:
|
||||
case dBgS_Attr_STONE_e:
|
||||
case dBgS_Attr_SAND_e:
|
||||
i_this->m0350.end();
|
||||
JPABaseEmitter* emitter1 = dComIfGp_particle_setToon(
|
||||
0x2022, &i_this->m0338, &i_this->m0344, NULL, 0xB9,
|
||||
&i_this->m0350, fopAcM_GetRoomNo(i_this)
|
||||
);
|
||||
if (emitter1) {
|
||||
emitter1->setRate(rate);
|
||||
emitter1->setSpread(1.0f);
|
||||
JGeometry::TVec3<f32> scale;
|
||||
scale.x = scale.y = scale.z = 1.2f;
|
||||
emitter1->setGlobalScale(scale);
|
||||
scale.x = scale.y = scale.z = 1.5f + g_regHIO.mChild[0].mFloatRegs[16];
|
||||
emitter1->setGlobalParticleScale(scale);
|
||||
}
|
||||
break;
|
||||
case dBgS_Attr_GRASS_e:
|
||||
JPABaseEmitter* emitter2 = dComIfGp_particle_set(0x24, &i_this->m0338, &i_this->m0344);
|
||||
if (emitter2) {
|
||||
emitter2->setRate(rate * 0.5f);
|
||||
emitter2->setMaxFrame(3);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* 00000EE8-000011F0 .text ground_smoke_set__FP8bk_class */
|
||||
@@ -245,8 +304,18 @@ static u32 search_wepon(bk_class* i_this) {
|
||||
}
|
||||
|
||||
/* 00002FB0-0000302C .text s_b_sub__FPvPv */
|
||||
static void s_b_sub(void*, void*) {
|
||||
/* Nonmatching */
|
||||
static void* s_b_sub(void* param_1, void*) {
|
||||
if (fopAc_IsActor(param_1) && fopAcM_GetName(param_1) == PROC_BOMB) {
|
||||
daBomb_c* bomb = (daBomb_c*)param_1;
|
||||
// TODO: why is it checking the bomb's params as a single field instead of just one param? bug?
|
||||
if (fopAcM_GetParam(bomb) != 0) {
|
||||
if (target_info_count < (s32)ARRAY_SIZE(target_info)) {
|
||||
target_info[target_info_count] = bomb;
|
||||
target_info_count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* 0000302C-000033BC .text search_bomb__FP8bk_classi */
|
||||
@@ -317,7 +386,7 @@ static void walk_set(bk_class* i_this) {
|
||||
|
||||
/* 00003C34-00003C74 .text fight_run_set__FP8bk_class */
|
||||
static void fight_run_set(bk_class* i_this) {
|
||||
/* Nonmatching */
|
||||
anm_init(i_this, BK_BCK_BK_RUN, 10.0f, J3DFrameCtrl::LOOP_REPEAT_e, l_bkHIO.m070, BK_BAS_BK_RUN);
|
||||
}
|
||||
|
||||
/* 00003C74-00004104 .text path_check__FP8bk_classUc */
|
||||
@@ -553,9 +622,212 @@ static BOOL useHeapInit(fopAc_ac_c* i_this) {
|
||||
}
|
||||
|
||||
/* 0000E310-0000EA2C .text daBk_Create__FP10fopAc_ac_c */
|
||||
static s32 daBk_Create(fopAc_ac_c* i_this) {
|
||||
/* Nonmatching */
|
||||
fopAcM_SetupActor(i_this, bk_class);
|
||||
static s32 daBk_Create(fopAc_ac_c* i_actor) {
|
||||
/* Nonmatching - data */
|
||||
fopAcM_SetupActor(i_actor, bk_class);
|
||||
bk_class* i_this = (bk_class*)i_actor;
|
||||
|
||||
s32 phase_state = dComIfG_resLoad(&i_this->mPhs, "Bk");
|
||||
if (phase_state == cPhs_COMPLEATE_e) {
|
||||
i_this->mGbaName = 1;
|
||||
|
||||
if (strcmp(dComIfGp_getStartStageName(), "ITest63") == 0 ||
|
||||
strcmp(dComIfGp_getStartStageName(), "GanonJ") == 0)
|
||||
{
|
||||
search_sp = 1;
|
||||
} else {
|
||||
search_sp = 0;
|
||||
}
|
||||
|
||||
i_this->mType = fopAcM_GetParam(i_this) & 0xF;
|
||||
i_this->m02B9 = fopAcM_GetParam(i_this) & 0x10;
|
||||
i_this->m02D4 = fopAcM_GetParam(i_this) & 0x20;
|
||||
if (i_this->mType == 0xB) {
|
||||
i_this->m02D4 = 0;
|
||||
i_this->m02DC = 1;
|
||||
i_this->mType = 4;
|
||||
}
|
||||
i_this->m02D5 = fopAcM_GetParam(i_this) & 0xC0;
|
||||
i_this->m02B5 = fopAcM_GetParam(i_this) >> 8 & 0xFF;
|
||||
i_this->m02B6 = fopAcM_GetParam(i_this) >> 16 & 0xFF;
|
||||
i_this->m02B7 = fopAcM_GetParam(i_this) >> 24 & 0xFF;
|
||||
i_this->m02B8 = i_this->current.angle.z;
|
||||
i_this->current.angle.z = 0;
|
||||
i_this->current.angle.x = 0;
|
||||
if (i_this->m02B8 == 0xFF) {
|
||||
i_this->m02B8 = 0;
|
||||
}
|
||||
|
||||
if (i_this->m02B8 != 0) {
|
||||
if (dComIfGs_isSwitch(i_this->m02B8, fopAcM_GetRoomNo(i_this))) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
}
|
||||
if (i_this->m02B9 != 0) {
|
||||
if (dComIfGs_isSwitch(i_this->m02B7, fopAcM_GetRoomNo(i_this))) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
i_this->m02B7 = 0xFF;
|
||||
}
|
||||
|
||||
i_this->mItemTableIdx = dComIfGp_CharTbl()->GetNameIndex("Bk", 0);
|
||||
|
||||
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 0x17B20)) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
if (!hio_set) {
|
||||
l_bkHIO.mChildID = mDoHIO_root.mDoHIO_createChild("ボコちゃん", &l_bkHIO);
|
||||
i_this->m121D = 1;
|
||||
hio_set = 1;
|
||||
}
|
||||
|
||||
ken = 0;
|
||||
|
||||
if (!i_this->mpMorf || !i_this->mpMorf->getModel()) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
fopAcM_SetMin(i_this, -200.0f, -50.0f, -100.0f);
|
||||
fopAcM_SetMax(i_this, 125.0f, 250.0f, 250.0f);
|
||||
fopAcM_SetMtx(i_this, i_this->mpMorf->getModel()->getBaseTRMtx());
|
||||
i_this->mpMorf->getModel()->setUserArea((u32)i_this);
|
||||
i_this->initBt(162.5f, 125.0f);
|
||||
|
||||
i_this->mDamageReaction.m70C = 1;
|
||||
i_this->mDamageReaction.mSpawnY = i_this->current.pos.y;
|
||||
i_this->mDamageReaction.mMaxFallDistance = 1000.0f;
|
||||
|
||||
if (i_this->m02B6 != 0xFF) {
|
||||
i_this->m1218 = dPath_GetRoomPath(i_this->m02B6, fopAcM_GetRoomNo(i_this));
|
||||
if (i_this->m1218 == NULL) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
i_this->m1215 = i_this->m02B6 + 1;
|
||||
i_this->m1217 = 1;
|
||||
}
|
||||
|
||||
if (i_this->mType == 4 || i_this->mType == 0xA) {
|
||||
i_this->mDamageReaction.mState = 1;
|
||||
if (i_this->mType == 0xA) {
|
||||
i_this->mDamageReaction.m004 = -0x14;
|
||||
fopAcM_OnStatus(i_this, fopAcStts_BOSS_e);
|
||||
} else {
|
||||
i_this->mDamageReaction.m004 = -1;
|
||||
}
|
||||
i_this->m0302 = 1000.0f + cM_rndF(1000.0f);
|
||||
} else if (i_this->mType == 6) {
|
||||
i_this->mDamageReaction.mState = 2;
|
||||
i_this->mDamageReaction.mMaxFallDistance = 300.0f;
|
||||
} else if (i_this->mType == 7) {
|
||||
i_this->mDamageReaction.mState = 0x1D;
|
||||
i_this->mDamageReaction.mMaxFallDistance = 300.0f;
|
||||
} else if (i_this->mType == 5) {
|
||||
anm_init(i_this, BK_BCK_BK_HAKOBI, 1.0f, J3DFrameCtrl::LOOP_REPEAT_e, 1.0f, -1);
|
||||
i_this->mDamageReaction.mState = 0x1E;
|
||||
i_this->mDamageReaction.mMaxFallDistance = 100000.0f;
|
||||
} else if (i_this->mType == 2 || i_this->mType == 3) {
|
||||
i_this->m02BA = 0xFF;
|
||||
i_this->mDamageReaction.mState = 0xF;
|
||||
i_this->m030E = 0xA;
|
||||
} else if (i_this->mType == 9) {
|
||||
i_this->mDamageReaction.mState = 3;
|
||||
i_this->m1216 = i_this->current.angle.z;
|
||||
i_this->m1217 = i_this->current.angle.y;
|
||||
i_this->current.angle.z = 0;
|
||||
i_this->current.angle.y = 0;
|
||||
}
|
||||
|
||||
if (i_this->m02B7 != 0xFF) {
|
||||
if (i_this->mType != 6) {
|
||||
i_this->m02BA = i_this->m02B7 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (i_this->mType == 0xF) {
|
||||
i_this->mDamageReaction.mState = 0x17;
|
||||
i_this->m02BA = 0;
|
||||
}
|
||||
|
||||
if (i_this->mType != 8 && i_this->m02DC == 0 &&
|
||||
strcmp(dComIfGp_getStartStageName(), "A_mori") != 0)
|
||||
{
|
||||
u32 weaponType; // TODO enum
|
||||
if (i_this->m02D5 & 0x40) {
|
||||
weaponType = 1;
|
||||
} else if (i_this->m02D5 & 0x80) {
|
||||
weaponType = 7;
|
||||
} else {
|
||||
weaponType = 0;
|
||||
}
|
||||
i_this->m1200 = fopAcM_create(PROC_BOKO, weaponType, &i_this->current.pos, fopAcM_GetRoomNo(i_this));
|
||||
i_this->m1214 = 1;
|
||||
i_this->m02D5 &= 0x40;
|
||||
} else {
|
||||
i_this->m11F3 = 1;
|
||||
}
|
||||
|
||||
i_this->mDamageReaction.mAcch.Set(
|
||||
&fopAcM_GetPosition_p(i_this), &fopAcM_GetOldPosition_p(i_this),
|
||||
i_this, 1, &i_this->mDamageReaction.mAcchCir,
|
||||
&fopAcM_GetSpeed_p(i_this)
|
||||
);
|
||||
i_this->mDamageReaction.mAcchCir.SetWall(40.0f, 40.0f);
|
||||
i_this->mDamageReaction.mAcch.ClrRoofNone();
|
||||
i_this->mDamageReaction.mAcch.SetRoofCrrHeight(80.0f + g_regHIO.mChild[0].mFloatRegs[7]);
|
||||
i_this->mDamageReaction.mAcch.OnLineCheck();
|
||||
i_this->mDamageReaction.mInvincibleTimer = 5;
|
||||
|
||||
if (i_this->m02D4 != 0) {
|
||||
i_this->mMaxHealth = i_this->mHealth = 7;
|
||||
} else {
|
||||
i_this->mMaxHealth = i_this->mHealth = 5;
|
||||
}
|
||||
|
||||
i_this->mDamageReaction.mStts.Init(0xC8, 0xFF, i_this);
|
||||
static dCcD_SrcCyl co_cyl_src = {}; // TODO
|
||||
i_this->m0B88.Set(co_cyl_src);
|
||||
i_this->m0B88.SetStts(&i_this->mDamageReaction.mStts);
|
||||
static dCcD_SrcCyl tg_cyl_src = {}; // TODO
|
||||
i_this->m0CB8.Set(tg_cyl_src);
|
||||
i_this->m0CB8.SetStts(&i_this->mDamageReaction.mStts);
|
||||
static dCcD_SrcSph head_sph_src = {}; // TODO
|
||||
i_this->m0DE8.Set(head_sph_src);
|
||||
i_this->m0DE8.SetStts(&i_this->mDamageReaction.mStts);
|
||||
static dCcD_SrcSph wepon_sph_src = {}; // TODO
|
||||
i_this->m1040.Set(wepon_sph_src);
|
||||
i_this->m1040.SetStts(&i_this->mDamageReaction.mStts);
|
||||
static dCcD_SrcSph defence_sph_src = {}; // TODO
|
||||
i_this->m0F14.Set(defence_sph_src);
|
||||
i_this->m0F14.SetStts(&i_this->mDamageReaction.mStts);
|
||||
|
||||
i_this->m02CC = 5;
|
||||
i_this->model = i_this->mpMorf->getModel();
|
||||
|
||||
i_this->mEnemyIce.mpActor = i_this;
|
||||
i_this->mEnemyIce.mWallRadius = 50.0f + g_regHIO.mChild[0].mFloatRegs[4];
|
||||
i_this->mEnemyIce.mCylHeight = 180.0f + g_regHIO.mChild[0].mFloatRegs[5];
|
||||
i_this->mEnemyIce.mDeathSwitch = i_this->m02B8;
|
||||
|
||||
i_this->mEnemyFire.mpMcaMorf = i_this->mpMorf;
|
||||
i_this->mEnemyFire.mpActor = i_this;
|
||||
static u8 fire_j[10] = {
|
||||
// TODO
|
||||
};
|
||||
static f32 fire_sc[10] = {
|
||||
// TODO
|
||||
};
|
||||
for (int i = 0; i < ARRAY_SIZE(i_this->mEnemyFire.mFlameJntIdxs); i++) {
|
||||
i_this->mEnemyFire.mFlameJntIdxs[i] = fire_j[i];
|
||||
i_this->mEnemyFire.mParticleScale[i] = fire_sc[i];
|
||||
}
|
||||
|
||||
i_this->mItemStealLeft = 3;
|
||||
|
||||
daBk_Execute(i_this);
|
||||
}
|
||||
|
||||
return phase_state;
|
||||
}
|
||||
|
||||
static actor_method_class l_daBk_Method = {
|
||||
|
||||
Reference in New Issue
Block a user