mirror of
https://github.com/zeldaret/tp
synced 2026-05-23 23:05:36 -04:00
J3D debug work (#2949)
* J3D debug work * Clean up JSystem GXColor ctors, remove a couple fakematches * Update symbols.txt * Fix res include syntax * Remove fakematch that isn't necessary anymore * Fix some Shield regressions
This commit is contained in:
@@ -26322,7 +26322,7 @@ j2dDefaultTevSwapModeTable = .sdata2:0x8045619C; // type:object size:0x4 scope:g
|
||||
j2dDefaultBlendInfo = .sdata2:0x804561A0; // type:object size:0x4 scope:global align:4 data:byte
|
||||
j2dDefaultPEBlockDither = .sdata2:0x804561A4; // type:object size:0x1 scope:global align:1 data:byte
|
||||
j2dDefaultColorChanInfo = .sdata2:0x804561A8; // type:object size:0x4 scope:global align:4
|
||||
data_804561AC = .sdata2:0x804561AC; // type:object size:0x1 scope:global align:1 data:byte
|
||||
j2dDefaultTevSwapTableID = .sdata2:0x804561AC; // type:object size:0x1 scope:global align:1 data:byte
|
||||
j2dDefaultAlphaCmp = .sdata2:0x804561AE; // type:object size:0x2 scope:global align:2 data:2byte
|
||||
@1943 = .sdata2:0x804561B0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1944 = .sdata2:0x804561B4; // type:object size:0x4 scope:local align:4 data:float
|
||||
|
||||
@@ -26331,7 +26331,7 @@ j2dDefaultTevSwapModeTable = .sdata2:0x804502BC; // type:object size:0x4 scope:g
|
||||
j2dDefaultBlendInfo = .sdata2:0x804502C0; // type:object size:0x4 scope:global align:4 data:byte
|
||||
j2dDefaultPEBlockDither = .sdata2:0x804502C4; // type:object size:0x1 data:byte
|
||||
j2dDefaultColorChanInfo = .sdata2:0x804502C8; // type:object size:0x4 scope:global align:4
|
||||
data_804561AC = .sdata2:0x804502CC; // type:object size:0x1 data:byte
|
||||
j2dDefaultTevSwapTableID = .sdata2:0x804502CC; // type:object size:0x1 data:byte
|
||||
j2dDefaultAlphaCmp = .sdata2:0x804502CE; // type:object size:0x2 scope:global align:2 data:2byte
|
||||
@1943 = .sdata2:0x804502D0; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1944 = .sdata2:0x804502D4; // type:object size:0x4 scope:local align:4 data:float
|
||||
|
||||
@@ -26350,7 +26350,7 @@ j2dDefaultTevSwapModeTable = .sdata2:0x80458174; // type:object size:0x4 scope:g
|
||||
j2dDefaultBlendInfo = .sdata2:0x80458178; // type:object size:0x4 scope:global align:4 data:byte
|
||||
j2dDefaultPEBlockDither = .sdata2:0x8045817C; // type:object size:0x1 data:byte
|
||||
j2dDefaultColorChanInfo = .sdata2:0x80458180; // type:object size:0x4 scope:global align:4
|
||||
data_804561AC = .sdata2:0x80458184; // type:object size:0x1 data:byte
|
||||
j2dDefaultTevSwapTableID = .sdata2:0x80458184; // type:object size:0x1 data:byte
|
||||
j2dDefaultAlphaCmp = .sdata2:0x80458186; // type:object size:0x2 scope:global align:2 data:2byte
|
||||
@1943 = .sdata2:0x80458188; // type:object size:0x4 scope:local align:4 data:float
|
||||
@1944 = .sdata2:0x8045818C; // type:object size:0x4 scope:local align:4 data:float
|
||||
|
||||
@@ -30090,9 +30090,9 @@ j2dDefaultTevColor = .sdata2:0x8050E2C0; // type:object size:0x8 scope:global da
|
||||
j2dDefaultTevKColor = .sdata2:0x8050E2C8; // type:object size:0x4 scope:global data:4byte hash:0xAF4A8463
|
||||
j2dDefaultTevSwapModeTable = .sdata2:0x8050E2CC; // type:object size:0x4 scope:global data:byte hash:0xDA12C67D
|
||||
j2dDefaultBlendInfo = .sdata2:0x8050E2D0; // type:object size:0x4 scope:global data:byte hash:0x2B1A967D
|
||||
lbl_8050E2D4 = .sdata2:0x8050E2D4; // type:object size:0x1 data:byte hash:0x6770EFB4
|
||||
j2dDefaultPEBlockDither = .sdata2:0x8050E2D4; // type:object size:0x1 data:byte hash:0x6770EFB4
|
||||
j2dDefaultColorChanInfo = .sdata2:0x8050E2D8; // type:object size:0x4 scope:global hash:0xB6183BC5
|
||||
lbl_8050E2DC = .sdata2:0x8050E2DC; // type:object size:0x1 data:byte hash:0x5BCEF69E
|
||||
j2dDefaultTevSwapTableID = .sdata2:0x8050E2DC; // type:object size:0x1 data:byte hash:0x5BCEF69E
|
||||
j2dDefaultAlphaCmp = .sdata2:0x8050E2DE; // type:object size:0x2 scope:global data:2byte hash:0x9193BBD8
|
||||
@37844 = .sdata2:0x8050E2E0; // type:object size:0x4 scope:local align:4 data:float hash:0xA082A5D9
|
||||
@37845 = .sdata2:0x8050E2E4; // type:object size:0x4 scope:local align:4 data:float hash:0xA082A5D8
|
||||
|
||||
@@ -69775,9 +69775,9 @@ j2dDefaultTevColor = .sdata2:0x80752878; // type:object size:0x8 scope:global ha
|
||||
j2dDefaultTevKColor = .sdata2:0x80752880; // type:object size:0x4 scope:global data:4byte hash:0xAF4A8463
|
||||
j2dDefaultTevSwapModeTable = .sdata2:0x80752884; // type:object size:0x4 scope:global hash:0xDA12C67D
|
||||
j2dDefaultBlendInfo = .sdata2:0x80752888; // type:object size:0x4 scope:global hash:0x2B1A967D
|
||||
lbl_8075288C = .sdata2:0x8075288C; // type:object size:0x1 data:byte hash:0x6770EFB4
|
||||
j2dDefaultPEBlockDither = .sdata2:0x8075288C; // type:object size:0x1 data:byte hash:0x6770EFB4
|
||||
j2dDefaultColorChanInfo = .sdata2:0x80752890; // type:object size:0x4 scope:global hash:0xB6183BC5
|
||||
lbl_80752894 = .sdata2:0x80752894; // type:object size:0x1 data:byte hash:0x5BCEF69E
|
||||
j2dDefaultTevSwapTableID = .sdata2:0x80752894; // type:object size:0x1 data:byte hash:0x5BCEF69E
|
||||
j2dDefaultAlphaCmp = .sdata2:0x80752896; // type:object size:0x2 scope:global data:2byte hash:0x9193BBD8
|
||||
@37802 = .sdata2:0x80752898; // type:object size:0x4 scope:local align:4 data:float hash:0xA082A55B
|
||||
@37803 = .sdata2:0x8075289C; // type:object size:0x4 scope:local align:4 data:float hash:0xA082A55A
|
||||
|
||||
@@ -20,7 +20,7 @@ struct ResTLUT;
|
||||
struct J2DGXColorS10 : public GXColorS10 {
|
||||
J2DGXColorS10() {}
|
||||
|
||||
#if PLATFORM_GCN
|
||||
#if PLATFORM_GCN && __MWERKS__
|
||||
J2DGXColorS10(J2DGXColorS10& other) {
|
||||
r = other.r;
|
||||
g = other.g;
|
||||
@@ -637,6 +637,11 @@ struct J2DAlphaComp {
|
||||
mAlphaCmp = J2DCalcAlphaCmp(info.field_0x0, info.mRef0, info.mRef1);
|
||||
mRef0 = info.field_0x1;
|
||||
mRef1 = info.field_0x4;
|
||||
}
|
||||
void operator=(const J2DAlphaComp& other) {
|
||||
mAlphaCmp = other.mAlphaCmp;
|
||||
mRef0 = other.mRef0;
|
||||
mRef1 = other.mRef1;
|
||||
}
|
||||
u8 getComp0() { return mAlphaCmp >> 5 & 7; }
|
||||
u8 getRef0() { return mRef0; }
|
||||
|
||||
@@ -562,7 +562,7 @@ inline u8 J2DCalcTevSwapTable(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
|
||||
}
|
||||
|
||||
extern const J2DTevSwapModeTableInfo j2dDefaultTevSwapModeTable;
|
||||
extern const u8 data_804561AC;
|
||||
extern const u8 j2dDefaultTevSwapTableID;
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j2d
|
||||
@@ -571,21 +571,24 @@ extern const u8 data_804561AC;
|
||||
|
||||
class J2DTevSwapModeTable {
|
||||
public:
|
||||
J2DTevSwapModeTable() { field_0x0 = data_804561AC; }
|
||||
J2DTevSwapModeTable() { mIdx = j2dDefaultTevSwapTableID; }
|
||||
J2DTevSwapModeTable(const J2DTevSwapModeTableInfo& info) {
|
||||
field_0x0 = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
|
||||
mIdx = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
|
||||
}
|
||||
void operator=(const J2DTevSwapModeTable& other) {
|
||||
mIdx = other.mIdx;
|
||||
}
|
||||
|
||||
void setTevSwapModeTableInfo(const J2DTevSwapModeTableInfo& info) {
|
||||
field_0x0 = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
|
||||
mIdx = J2DCalcTevSwapTable(info.field_0x0, info.field_0x1, info.field_0x2, info.field_0x3);
|
||||
}
|
||||
u8 getR() const { return field_0x0 >> 6 & 3; }
|
||||
u8 getG() const { return field_0x0 >> 4 & 3; }
|
||||
u8 getB() const { return field_0x0 >> 2 & 3; }
|
||||
u8 getA() const { return field_0x0 & 3; }
|
||||
u8 getR() const { return mIdx >> 6 & 3; }
|
||||
u8 getG() const { return mIdx >> 4 & 3; }
|
||||
u8 getB() const { return mIdx >> 2 & 3; }
|
||||
u8 getA() const { return mIdx & 3; }
|
||||
|
||||
private:
|
||||
/* 0x0 */ u8 field_0x0;
|
||||
/* 0x0 */ u8 mIdx;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -638,7 +641,7 @@ extern const GXColorS10 j2dDefaultTevColor;
|
||||
extern const GXColor j2dDefaultTevKColor;
|
||||
extern const J2DTevOrderInfo j2dDefaultTevOrderInfoNull;
|
||||
extern const u8 j2dDefaultPEBlockDither;
|
||||
extern const u8 data_804561AC;
|
||||
extern const u8 j2dDefaultTevSwapTableID;
|
||||
extern const u16 j2dDefaultAlphaCmp;
|
||||
|
||||
#endif /* J2DTEVS_H */
|
||||
|
||||
@@ -14,17 +14,24 @@
|
||||
struct J3DGXColorS10 : public GXColorS10 {
|
||||
J3DGXColorS10() {}
|
||||
|
||||
#if PLATFORM_GCN
|
||||
#if PLATFORM_GCN && __MWERKS__
|
||||
J3DGXColorS10(J3DGXColorS10& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); }
|
||||
#elif DEBUG
|
||||
J3DGXColorS10(const J3DGXColorS10& other) {
|
||||
GXColorS10 sp08 = other;
|
||||
J3DGXColorS10* r31 = this;
|
||||
__memcpy(r31, &sp08, sizeof(GXColorS10));
|
||||
J3DGXColorS10* r30 = r31;
|
||||
}
|
||||
#else
|
||||
J3DGXColorS10(J3DGXColorS10 const& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); }
|
||||
J3DGXColorS10(const J3DGXColorS10& other) { __memcpy(this, &other, sizeof(J3DGXColorS10)); }
|
||||
#endif
|
||||
|
||||
// TODO: In theory, this copy ctor should be non-const in GCN versions, as seen in TWW maps
|
||||
J3DGXColorS10(GXColorS10 const& color) : GXColorS10(color) {}
|
||||
J3DGXColorS10(const GXColorS10& color) : GXColorS10(color) {}
|
||||
|
||||
J3DGXColorS10& operator=(const GXColorS10& color) {
|
||||
// FAKE match. __memcpy created issues in J3DTevBlockPatched::initialize
|
||||
// Fakematch? Instruction order is wrong with __memcpy or GXColorS10::operator=
|
||||
// Might be real as this matches on debug as well.
|
||||
((u32*)this)[0] = ((u32*)&color)[0];
|
||||
((u32*)this)[1] = ((u32*)&color)[1];
|
||||
return *this;
|
||||
@@ -37,20 +44,21 @@ struct J3DGXColorS10 : public GXColorS10 {
|
||||
*/
|
||||
struct J3DGXColor : public GXColor {
|
||||
J3DGXColor() {}
|
||||
// TODO: In theory, these copy ctors should be non-const in GCN versions, as seen in TWW maps
|
||||
J3DGXColor(J3DGXColor const& other) { __memcpy(this, &other, sizeof(J3DGXColor)); }
|
||||
J3DGXColor(GXColor const& color) : GXColor(color) {}
|
||||
|
||||
// making color a reference breaks J3DColorBlockLightOff::initialize et al
|
||||
J3DGXColor& operator=(GXColor color) {
|
||||
|
||||
#if PLATFORM_GCN && __MWERKS__
|
||||
J3DGXColor(J3DGXColor& other) { __memcpy(this, &other, sizeof(J3DGXColor)); }
|
||||
#else
|
||||
J3DGXColor(const J3DGXColor& other) { __memcpy(this, &other, sizeof(J3DGXColor)); }
|
||||
#endif
|
||||
|
||||
J3DGXColor(const GXColor color) : GXColor(color) {}
|
||||
|
||||
J3DGXColor& operator=(const GXColor color) {
|
||||
*(GXColor*)this = color;
|
||||
return *this;
|
||||
}
|
||||
J3DGXColor& operator=(const J3DGXColor& other) {
|
||||
r = other.r;
|
||||
g = other.g;
|
||||
b = other.b;
|
||||
a = other.a;
|
||||
GXColor::operator=(other);
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
@@ -71,7 +79,9 @@ struct J3DNBTScale : public J3DNBTScaleInfo {
|
||||
|
||||
J3DNBTScale(J3DNBTScaleInfo const& info) {
|
||||
mbHasScale = info.mbHasScale;
|
||||
mScale = info.mScale;
|
||||
mScale.x = info.mScale.x;
|
||||
mScale.y = info.mScale.y;
|
||||
mScale.z = info.mScale.z;
|
||||
}
|
||||
|
||||
Vec* getScale() { return &mScale; }
|
||||
@@ -139,7 +149,7 @@ struct J3DColorChan {
|
||||
info.mDiffuseFn, info.mAttnFn, ambSrc);
|
||||
}
|
||||
void setColorChanInfo(J3DColorChanInfo const& info) {
|
||||
// Bug: It compares info.mAmbSrc (an 8 bit integer) with 0xFFFF instead of 0xFF.
|
||||
// !@bug: It compares info.mAmbSrc (an 8 bit integer) with 0xFFFF instead of 0xFF.
|
||||
// This inline is only called by the default constructor J3DColorChan().
|
||||
// The J3DColorChan(const J3DColorChanInfo&) constructor does not call this inline, and instead duplicates the
|
||||
// same logic but without the bug.
|
||||
@@ -165,6 +175,10 @@ struct J3DColorChan {
|
||||
#endif
|
||||
return AttnArr[(u32)(mColorChanID & (3 << 9)) >> 9];
|
||||
}
|
||||
J3DColorChan& operator=(const J3DColorChan& other) {
|
||||
mColorChanID = other.mColorChanID;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void load() const {
|
||||
J3DGDWrite_u32(setChanCtrlMacro(getEnable(), (GXColorSrc)getAmbSrc(), (GXColorSrc)getMatSrc(), getLightMask(),
|
||||
@@ -1453,6 +1467,10 @@ struct J3DZMode {
|
||||
mZModeID = zModeID;
|
||||
return *this;
|
||||
}
|
||||
J3DZMode& operator=(const J3DZMode& other) {
|
||||
mZModeID = other.mZModeID;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void setZModeInfo(const J3DZModeInfo& info) {
|
||||
mZModeID = calcZModeID(info.field_0x0, info.field_0x1, info.field_0x2);
|
||||
@@ -1487,7 +1505,7 @@ struct J3DZMode {
|
||||
*/
|
||||
struct J3DBlendInfo {
|
||||
void operator=(J3DBlendInfo const& other) {
|
||||
*(int*)&mType = *(int*)&other.mType;
|
||||
__memcpy(this, &other, sizeof(J3DBlendInfo));
|
||||
}
|
||||
/* 0x0 */ u8 mType;
|
||||
/* 0x1 */ u8 mSrcFactor;
|
||||
@@ -1502,8 +1520,12 @@ extern const J3DBlendInfo j3dDefaultBlendInfo;
|
||||
*
|
||||
*/
|
||||
struct J3DBlend : public J3DBlendInfo {
|
||||
J3DBlend() : J3DBlendInfo(j3dDefaultBlendInfo) {}
|
||||
J3DBlend(J3DBlendInfo const& info) : J3DBlendInfo(info) {}
|
||||
J3DBlend() {
|
||||
J3DBlendInfo::operator=(j3dDefaultBlendInfo);
|
||||
}
|
||||
J3DBlend(J3DBlendInfo const& info) {
|
||||
J3DBlendInfo::operator=(info);
|
||||
}
|
||||
|
||||
void setType(u8 i_type) { mType = i_type; }
|
||||
void setSrcFactor(u8 i_factor) { mSrcFactor = i_factor; }
|
||||
@@ -1630,6 +1652,10 @@ struct J3DIndTexOrderInfo {
|
||||
/* 0x1 */ u8 mMap;
|
||||
/* 0x2 */ u8 field_0x2;
|
||||
/* 0x3 */ u8 field_0x3;
|
||||
|
||||
void operator=(J3DIndTexOrderInfo const& other) {
|
||||
__memcpy(this, &other, sizeof(J3DIndTexOrderInfo));
|
||||
}
|
||||
}; // Size: 0x04
|
||||
|
||||
extern const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull;
|
||||
@@ -1639,12 +1665,21 @@ extern const J3DIndTexOrderInfo j3dDefaultIndTexOrderNull;
|
||||
*
|
||||
*/
|
||||
struct J3DIndTexOrder : public J3DIndTexOrderInfo {
|
||||
J3DIndTexOrder() : J3DIndTexOrderInfo(j3dDefaultIndTexOrderNull) {}
|
||||
J3DIndTexOrder() {
|
||||
J3DIndTexOrderInfo::operator=(j3dDefaultIndTexOrderNull);
|
||||
}
|
||||
J3DIndTexOrder& operator=(J3DIndTexOrder const& other) {
|
||||
#if DEBUG
|
||||
J3DIndTexOrderInfo::operator=(other);
|
||||
#else
|
||||
// Fakematch: Instruction order is wrong with __memcpy or J3DIndTexCoordScaleInfo::operator=
|
||||
*(u32*)this = *(u32*)&other;
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
J3DIndTexOrder(J3DIndTexOrderInfo const& info) : J3DIndTexOrderInfo(info) {}
|
||||
J3DIndTexOrder(J3DIndTexOrderInfo const& info) {
|
||||
J3DIndTexOrderInfo::operator=(info);
|
||||
}
|
||||
u8 getMap() const { return (GXTexMapID)mMap; }
|
||||
u8 getCoord() const { return (GXTexCoordID)mCoord; }
|
||||
}; // Size: 0x04
|
||||
@@ -1657,7 +1692,10 @@ extern J3DIndTexMtxInfo const j3dDefaultIndTexMtxInfo;
|
||||
*/
|
||||
struct J3DIndTexMtx : public J3DIndTexMtxInfo {
|
||||
J3DIndTexMtx() { *(J3DIndTexMtxInfo*)this = j3dDefaultIndTexMtxInfo; }
|
||||
J3DIndTexMtx(J3DIndTexMtxInfo const& info) { *(J3DIndTexMtxInfo*)this = info; }
|
||||
J3DIndTexMtx(const J3DIndTexMtxInfo& info) { *(J3DIndTexMtxInfo*)this = info; }
|
||||
J3DIndTexMtx(const J3DIndTexMtx& other) {
|
||||
__memcpy(this, &other, sizeof(J3DIndTexMtx));
|
||||
}
|
||||
~J3DIndTexMtx() {}
|
||||
void load(u32 param_1) const {
|
||||
J3DGDSetIndTexMtx((GXIndTexMtxID)(param_1 + GX_ITM_0), (Mtx3P)field_0x0, field_0x18);
|
||||
@@ -1673,6 +1711,11 @@ struct J3DIndTexCoordScaleInfo {
|
||||
/* 0x1 */ u8 mScaleT;
|
||||
/* 0x2 */ u8 field_0x2;
|
||||
/* 0x3 */ u8 field_0x3;
|
||||
|
||||
J3DIndTexCoordScaleInfo& operator=(const J3DIndTexCoordScaleInfo& other) {
|
||||
__memcpy(this, &other, sizeof(J3DIndTexCoordScaleInfo));
|
||||
return *this;
|
||||
}
|
||||
}; // Size: 0x4
|
||||
|
||||
extern const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo;
|
||||
@@ -1682,15 +1725,26 @@ extern const J3DIndTexCoordScaleInfo j3dDefaultIndTexCoordScaleInfo;
|
||||
*
|
||||
*/
|
||||
struct J3DIndTexCoordScale : public J3DIndTexCoordScaleInfo {
|
||||
J3DIndTexCoordScale() : J3DIndTexCoordScaleInfo(j3dDefaultIndTexCoordScaleInfo) {}
|
||||
J3DIndTexCoordScale(J3DIndTexCoordScaleInfo const& info) : J3DIndTexCoordScaleInfo(info) {}
|
||||
J3DIndTexCoordScale() {
|
||||
J3DIndTexCoordScaleInfo::operator=(j3dDefaultIndTexCoordScaleInfo);
|
||||
}
|
||||
J3DIndTexCoordScale(const J3DIndTexCoordScaleInfo& info) {
|
||||
J3DIndTexCoordScaleInfo::operator=(info);
|
||||
}
|
||||
J3DIndTexCoordScale(const J3DIndTexCoordScale& other) {
|
||||
__memcpy(this, &other, sizeof(J3DIndTexCoordScale));
|
||||
}
|
||||
~J3DIndTexCoordScale() {}
|
||||
u8 getScaleS() { return mScaleS; }
|
||||
u8 getScaleT() { return mScaleT; }
|
||||
|
||||
J3DIndTexCoordScale& operator=(const J3DIndTexCoordScale& other) {
|
||||
//__memcpy(this, &other, sizeof(J3DIndTexCoordScaleInfo));
|
||||
#if DEBUG
|
||||
J3DIndTexCoordScaleInfo::operator=(other);
|
||||
#else
|
||||
// Fakematch: Instruction order is wrong with __memcpy or J3DIndTexCoordScaleInfo::operator=
|
||||
*(u32*)this = *(u32*)&other;
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
}; // Size: 0x4
|
||||
|
||||
@@ -259,7 +259,9 @@ extern const J3DTevOrderInfo j3dDefaultTevOrderInfoNull;
|
||||
*
|
||||
*/
|
||||
struct J3DTevOrder : public J3DTevOrderInfo {
|
||||
J3DTevOrder() : J3DTevOrderInfo(j3dDefaultTevOrderInfoNull) {}
|
||||
J3DTevOrder() {
|
||||
J3DTevOrderInfo::operator=(j3dDefaultTevOrderInfoNull);
|
||||
}
|
||||
J3DTevOrder(const J3DTevOrderInfo& info) : J3DTevOrderInfo(info) {}
|
||||
J3DTevOrderInfo& getTevOrderInfo() { return *this; }
|
||||
|
||||
@@ -269,6 +271,10 @@ struct J3DTevOrder : public J3DTevOrderInfo {
|
||||
extern u8 j3dTevSwapTableTable[1024];
|
||||
extern u8 const j3dDefaultTevSwapTableID;
|
||||
|
||||
inline u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
|
||||
return 0x40 * (u8)param_0 + 0x10 * (u8)param_1 + 4 * (u8)param_2 + param_3;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-j3d
|
||||
*
|
||||
@@ -289,10 +295,6 @@ struct J3DTevSwapModeTable {
|
||||
return *this;
|
||||
}
|
||||
|
||||
u8 calcTevSwapTableID(u8 param_0, u8 param_1, u8 param_2, u8 param_3) {
|
||||
return 0x40 * param_0 + 0x10 * param_1 + 4 * param_2 + param_3;
|
||||
}
|
||||
|
||||
u8 getR() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 0); }
|
||||
u8 getG() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 1); }
|
||||
u8 getB() const { return *(&j3dTevSwapTableTable[mIdx * 4] + 2); }
|
||||
|
||||
@@ -82,10 +82,7 @@ struct J3DTexCoordInfo {
|
||||
/* 0x3 */ u8 pad;
|
||||
|
||||
J3DTexCoordInfo& operator=(const J3DTexCoordInfo& other) {
|
||||
mTexGenType = other.mTexGenType;
|
||||
mTexGenSrc = other.mTexGenSrc;
|
||||
mTexGenMtx = other.mTexGenMtx;
|
||||
pad = other.pad;
|
||||
__memcpy(this, &other, sizeof(J3DTexCoordInfo));
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
@@ -98,14 +95,14 @@ extern J3DTexCoordInfo const j3dDefaultTexCoordInfo[8];
|
||||
*/
|
||||
struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
J3DTexCoord() {
|
||||
setTexCoordInfo(j3dDefaultTexCoordInfo[0]);
|
||||
resetTexMtxReg();
|
||||
J3DTexCoordInfo::operator=(j3dDefaultTexCoordInfo[0]);
|
||||
mTexMtxReg = mTexGenMtx;
|
||||
}
|
||||
J3DTexCoord(J3DTexCoordInfo const& info) {
|
||||
setTexCoordInfo(info);
|
||||
resetTexMtxReg();
|
||||
J3DTexCoord(const J3DTexCoordInfo& info) {
|
||||
J3DTexCoordInfo::operator=(info);
|
||||
mTexMtxReg = mTexGenMtx;
|
||||
}
|
||||
void setTexCoordInfo(J3DTexCoordInfo const& info) {
|
||||
void setTexCoordInfo(const J3DTexCoordInfo& info) {
|
||||
__memcpy(this, &info, sizeof(J3DTexCoordInfo));
|
||||
}
|
||||
|
||||
@@ -116,8 +113,12 @@ struct J3DTexCoord : public J3DTexCoordInfo {
|
||||
void setTexGenMtx(u8 param_1) { mTexGenMtx = param_1; }
|
||||
void setTexMtxReg(u16 reg) { mTexMtxReg = reg; }
|
||||
J3DTexCoord& operator=(const J3DTexCoord& other) {
|
||||
// Fake match (__memcpy or = doesn't match)
|
||||
#if DEBUG
|
||||
J3DTexCoordInfo::operator=(other);
|
||||
#else
|
||||
// Fakematch: Instruction order is wrong with __memcpy or J3DTexCoordInfo::operator=
|
||||
*(u32*)this = *(u32*)&other;
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
u32 calcSizePatchedMaterial(J3DMaterial*, int, u32) const;
|
||||
u32 calcSizeLockedMaterial(J3DMaterial*, int, u32) const;
|
||||
J3DGXColor newMatColor(int, int) const;
|
||||
u8 newColorChanNum(int) const;
|
||||
const u8 newColorChanNum(int) const;
|
||||
J3DColorChan newColorChan(int, int) const;
|
||||
J3DGXColor newAmbColor(int, int) const;
|
||||
u32 newTexGenNum(int) const;
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
J3DTevOrder newTevOrder(int, int) const;
|
||||
J3DGXColorS10 newTevColor(int, int) const;
|
||||
J3DGXColor newTevKColor(int, int) const;
|
||||
u8 newTevStageNum(int) const;
|
||||
const u8 newTevStageNum(int) const;
|
||||
J3DTevStage newTevStage(int, int) const;
|
||||
J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
|
||||
u8 newIndTexStageNum(int) const;
|
||||
@@ -136,8 +136,8 @@ public:
|
||||
J3DAlphaComp newAlphaComp(int) const;
|
||||
J3DBlend newBlend(int) const;
|
||||
J3DZMode newZMode(int) const;
|
||||
u8 newZCompLoc(int) const;
|
||||
u8 newDither(int) const;
|
||||
const u8 newZCompLoc(int) const;
|
||||
const u8 newDither(int) const;
|
||||
J3DNBTScale newNBTScale(int) const;
|
||||
|
||||
u16 getMaterialID(int idx) const { return mpMaterialID[idx]; }
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
u32 countStages(int) const;
|
||||
J3DMaterial* create(J3DMaterial*, int, u32) const;
|
||||
J3DGXColor newMatColor(int, int) const;
|
||||
u8 newColorChanNum(int) const;
|
||||
const u8 newColorChanNum(int) const;
|
||||
J3DColorChan newColorChan(int, int) const;
|
||||
u32 newTexGenNum(int) const;
|
||||
J3DTexCoord newTexCoord(int, int) const;
|
||||
@@ -66,15 +66,15 @@ public:
|
||||
J3DTevOrder newTevOrder(int, int) const;
|
||||
J3DGXColorS10 newTevColor(int, int) const;
|
||||
J3DGXColor newTevKColor(int, int) const;
|
||||
u8 newTevStageNum(int) const;
|
||||
const u8 newTevStageNum(int) const;
|
||||
J3DTevStage newTevStage(int, int) const;
|
||||
J3DTevSwapModeTable newTevSwapModeTable(int, int) const;
|
||||
J3DFog newFog(int) const;
|
||||
J3DAlphaComp newAlphaComp(int) const;
|
||||
J3DBlend newBlend(int) const;
|
||||
J3DZMode newZMode(int) const;
|
||||
u8 newZCompLoc(int) const;
|
||||
u8 newDither(int) const;
|
||||
const J3DZMode newZMode(int) const;
|
||||
const u8 newZCompLoc(int) const;
|
||||
const u8 newDither(int) const;
|
||||
J3DNBTScale newNBTScale(int) const;
|
||||
|
||||
u16 getMaterialID(u16 idx) { return mpMaterialID[idx]; }
|
||||
|
||||
@@ -239,7 +239,7 @@ enum J3DModelLoaderFlagTypes {
|
||||
J3DMLF_Material_Color_AmbientOn = 0x80000000
|
||||
};
|
||||
|
||||
static inline u32 getMdlDataFlag_TevStageNum(u32 flags) { return (flags >> 0x10) & 0x1f; }
|
||||
static inline u32 getMdlDataFlag_TevStageNum(u32 flags) { return (flags & 0x001f0000) >> 0x10; }
|
||||
static inline u32 getMdlDataFlag_TexGenFlag(u32 flags) { return flags & 0x0c000000; }
|
||||
static inline u32 getMdlDataFlag_ColorFlag(u32 flags) { return flags & 0xc0000000; }
|
||||
static inline u32 getMdlDataFlag_PEFlag(u32 flags) { return flags & 0x30000000; }
|
||||
|
||||
@@ -23,11 +23,13 @@ T* JSUConvertOffsetToPtr(const void* ptr, uintptr_t offset) {
|
||||
*/
|
||||
template <typename T>
|
||||
T* JSUConvertOffsetToPtr(const void* ptr, const void* offset) {
|
||||
T* ret;
|
||||
if (offset == NULL) {
|
||||
return NULL;
|
||||
ret = NULL;
|
||||
} else {
|
||||
return (T*)((intptr_t)ptr + (intptr_t)offset);
|
||||
ret = (T*)((intptr_t)ptr + (intptr_t)offset);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline u8 JSULoNibble(u8 param_0) { return param_0 & 0x0f; }
|
||||
|
||||
@@ -185,7 +185,6 @@ public:
|
||||
};
|
||||
|
||||
daNpcF_c() {
|
||||
FORCE_DONT_INLINE;
|
||||
initialize();
|
||||
}
|
||||
BOOL execute();
|
||||
|
||||
@@ -270,18 +270,8 @@ J2DTevOrder J2DMaterialFactory::newTevOrder(int param_0, int param_1) const {
|
||||
}
|
||||
|
||||
J2DGXColorS10 J2DMaterialFactory::newTevColor(int param_0, int param_1) const {
|
||||
// FAKEMATCH
|
||||
#if DEBUG || VERSION == VERSION_WII_USA_R0 || VERSION == VERSION_WII_USA_R2
|
||||
GXColorS10 color = {0, 0, 0, 0};
|
||||
J2DGXColorS10 rv = color;
|
||||
#else
|
||||
GXColorS10 color = {0, 0, 0, 0};
|
||||
J2DGXColorS10 rv;
|
||||
rv.r = color.r;
|
||||
rv.g = color.g;
|
||||
rv.b = color.b;
|
||||
rv.a = color.a;
|
||||
#endif
|
||||
J2DMaterialInitData* iVar2 = &field_0x4[field_0x8[param_0]];
|
||||
|
||||
if (iVar2->field_0x92[param_1] != 0xffff) {
|
||||
|
||||
@@ -149,6 +149,6 @@ extern const u8 j2dDefaultPEBlockDither = 0;
|
||||
|
||||
extern const J2DColorChanInfo j2dDefaultColorChanInfo = {0, 3, 0, 0};
|
||||
|
||||
extern const u8 data_804561AC = 0x1B;
|
||||
extern const u8 j2dDefaultTevSwapTableID = 0x1B;
|
||||
|
||||
extern const u16 j2dDefaultAlphaCmp = 0x00E7;
|
||||
|
||||
@@ -61,40 +61,41 @@ u16 J3DMaterialFactory::countUniqueMaterials() {
|
||||
s32 id = -1;
|
||||
for (u16 i = 0; i < mMaterialNum; i++) {
|
||||
if (id < mpMaterialID[i]) {
|
||||
count++;
|
||||
id = mpMaterialID[i];
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
u32 J3DMaterialFactory::countTexGens(int i_idx) const {
|
||||
u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
|
||||
if (tex_gen_num_index != 0xff) {
|
||||
return mpTexGenNum[tex_gen_num_index];
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexGenNumIdx != 0xff) {
|
||||
return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 J3DMaterialFactory::countStages(int i_idx) const {
|
||||
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
u32 count1 = 0;
|
||||
u32 count2 = 0;
|
||||
u8 tev_stage_num_index = init_data->mTevStageNumIdx;
|
||||
if (tev_stage_num_index != 0xff) {
|
||||
count2 = mpTevStageNum[tev_stage_num_index];
|
||||
if (mtl_init_data->mTevStageNumIdx != 0xff) {
|
||||
count2 = mpTevStageNum[mtl_init_data->mTevStageNumIdx];
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (init_data->mTexNoIdx[i] != 0xffff) {
|
||||
if (mtl_init_data->mTexNoIdx[i] != 0xffff) {
|
||||
count1++;
|
||||
}
|
||||
}
|
||||
if (count2 != count1 && count1 != 0) {
|
||||
u32 count3;
|
||||
if (count2 > count1) {
|
||||
return count2;
|
||||
count3 = count2;
|
||||
} else {
|
||||
return count1;
|
||||
count3 = count1;
|
||||
}
|
||||
return count3;
|
||||
}
|
||||
return count2;
|
||||
}
|
||||
@@ -343,24 +344,31 @@ J3DMaterial* J3DMaterialFactory::createLockedMaterial(J3DMaterial* i_material, i
|
||||
u32 i_flags) const {
|
||||
if (i_material == NULL) {
|
||||
i_material = new J3DLockedMaterial();
|
||||
J3D_ASSERT_ALLOCMEM(629, i_material);
|
||||
i_material->mColorBlock = new J3DColorBlockNull();
|
||||
J3D_ASSERT_ALLOCMEM(634, i_material->mColorBlock);
|
||||
i_material->mTexGenBlock = new J3DTexGenBlockNull();
|
||||
J3D_ASSERT_ALLOCMEM(636, i_material->mTexGenBlock);
|
||||
i_material->mTevBlock = new J3DTevBlockNull();
|
||||
J3D_ASSERT_ALLOCMEM(638, i_material->mTevBlock);
|
||||
i_material->mIndBlock = new J3DIndBlockNull();
|
||||
J3D_ASSERT_ALLOCMEM(640, i_material->mIndBlock);
|
||||
i_material->mPEBlock = new J3DPEBlockNull();
|
||||
J3D_ASSERT_ALLOCMEM(642, i_material->mPEBlock);
|
||||
i_material->mIndex = i_idx;
|
||||
i_material->mMaterialMode = mpMaterialMode[i_idx];
|
||||
}
|
||||
|
||||
i_material->mCurrentMtx = mpCurrentMtxInfo[i_idx];
|
||||
i_material->mColorBlock->setMatColorOffset(mpPatchingInfo[i_idx].mMatColorOffset);
|
||||
i_material->mColorBlock->setColorChanOffset(mpPatchingInfo[i_idx].mColorChanOffset);
|
||||
i_material->mTexGenBlock->setTexMtxOffset(mpPatchingInfo[i_idx].mTexMtxOffset);
|
||||
i_material->mTevBlock->setTexNoOffset(mpPatchingInfo[i_idx].mTexNoOffset);
|
||||
i_material->mTevBlock->setTevRegOffset(mpPatchingInfo[i_idx].mTevRegOffset);
|
||||
i_material->mPEBlock->setFogOffset(mpPatchingInfo[i_idx].mFogOffset);
|
||||
i_material->getColorBlock()->setMatColorOffset(mpPatchingInfo[i_idx].mMatColorOffset);
|
||||
i_material->getColorBlock()->setColorChanOffset(mpPatchingInfo[i_idx].mColorChanOffset);
|
||||
i_material->getTexGenBlock()->setTexMtxOffset(mpPatchingInfo[i_idx].mTexMtxOffset);
|
||||
i_material->getTevBlock()->setTexNoOffset(mpPatchingInfo[i_idx].mTexNoOffset);
|
||||
i_material->getTevBlock()->setTevRegOffset(mpPatchingInfo[i_idx].mTevRegOffset);
|
||||
i_material->getPEBlock()->setFogOffset(mpPatchingInfo[i_idx].mFogOffset);
|
||||
if (i_material->mSharedDLObj == NULL) {
|
||||
i_material->mSharedDLObj = new J3DDisplayListObj();
|
||||
J3D_ASSERT_ALLOCMEM(673, i_material->mSharedDLObj);
|
||||
i_material->mSharedDLObj->setSingleDisplayList((void*)(
|
||||
mpDisplayListInit[i_idx].mOffset + (uintptr_t)&mpDisplayListInit[i_idx]),
|
||||
mpDisplayListInit[i_idx].field_0x4
|
||||
@@ -374,13 +382,13 @@ u32 J3DMaterialFactory::calcSize(J3DMaterial* i_material, J3DMaterialFactory::Ma
|
||||
u32 size = 0;
|
||||
switch (i_type) {
|
||||
case MATERIAL_TYPE_NORMAL:
|
||||
size = calcSizeNormalMaterial(i_material, i_idx, i_flags);
|
||||
size += calcSizeNormalMaterial(i_material, i_idx, i_flags);
|
||||
break;
|
||||
case MATERIAL_TYPE_LOCKED:
|
||||
size = calcSizeLockedMaterial(i_material, i_idx, i_flags);
|
||||
size += calcSizeLockedMaterial(i_material, i_idx, i_flags);
|
||||
break;
|
||||
case MATERIAL_TYPE_PATCHED:
|
||||
size = calcSizePatchedMaterial(i_material, i_idx, i_flags);
|
||||
size += calcSizePatchedMaterial(i_material, i_idx, i_flags);
|
||||
break;
|
||||
}
|
||||
return size;
|
||||
@@ -423,15 +431,16 @@ u32 J3DMaterialFactory::calcSizePatchedMaterial(J3DMaterial* i_material, int i_i
|
||||
u32 i_flags) const {
|
||||
u32 size = 0;
|
||||
if (i_material == NULL) {
|
||||
size = sizeof(J3DPatchedMaterial);
|
||||
size += sizeof(J3DPatchedMaterial);
|
||||
}
|
||||
u8 ind_flag = (i_flags & 0x3000000) != 0 ? 1 : 0;
|
||||
u8 ind_flag = (i_flags & 0x3000000) != 0 ? (u8)1 : (u8)0;
|
||||
size += J3DMaterial::calcSizeColorBlock(0x40000000);
|
||||
size += 0x134; // TODO what is this
|
||||
size += sizeof(J3DTexGenBlockPatched);
|
||||
size += sizeof(J3DTevBlockPatched);
|
||||
size += J3DMaterial::calcSizeIndBlock(ind_flag);
|
||||
size += J3DMaterial::calcSizePEBlock(0x10000000, getMaterialMode(i_idx));
|
||||
J3DMaterialInitData* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
if (init_data->mTexMtxIdx[i] != 0xffff) {
|
||||
size += sizeof(J3DTexMtx);
|
||||
}
|
||||
@@ -443,28 +452,31 @@ u32 J3DMaterialFactory::calcSizeLockedMaterial(J3DMaterial* i_material, int i_id
|
||||
u32 i_flags) const {
|
||||
u32 size = 0;
|
||||
if (i_material == NULL) {
|
||||
size = sizeof(J3DLockedMaterial) + sizeof(J3DColorBlockNull) + sizeof(J3DTexGenBlockNull)
|
||||
+ sizeof(J3DTevBlockNull) + sizeof(J3DIndBlockNull) + sizeof(J3DPEBlockNull);
|
||||
size += sizeof(J3DLockedMaterial);
|
||||
size += sizeof(J3DColorBlockNull);
|
||||
size += sizeof(J3DTexGenBlockNull);
|
||||
size += sizeof(J3DTevBlockNull);
|
||||
size += sizeof(J3DIndBlockNull);
|
||||
size += sizeof(J3DPEBlockNull);
|
||||
}
|
||||
return size + sizeof(J3DDisplayListObj);
|
||||
size += sizeof(J3DDisplayListObj);
|
||||
return size;
|
||||
}
|
||||
|
||||
static GXColor const defaultMatColor = {0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newMatColor(int i_idx, int i_no) const {
|
||||
J3DGXColor dflt = (J3DGXColor)defaultMatColor;
|
||||
u16 mat_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mMatColorIdx[i_no];
|
||||
if (mat_color_index != 0xffff) {
|
||||
return mpMatColor[mat_color_index];
|
||||
J3DGXColor dflt = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) {
|
||||
return mpMatColor[mtl_init_data->mMatColorIdx[i_no]];
|
||||
} else {
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newColorChanNum(int i_idx) const {
|
||||
u8 color_chan_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanNumIdx;
|
||||
if (color_chan_num_index != 0xff) {
|
||||
return mpColorChanNum[color_chan_num_index];
|
||||
const u8 J3DMaterialFactory::newColorChanNum(int i_idx) const {
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mColorChanNumIdx != 0xff) {
|
||||
return mpColorChanNum[mtl_init_data->mColorChanNumIdx];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
@@ -480,31 +492,30 @@ J3DColorChan J3DMaterialFactory::newColorChan(int i_idx, int i_no) const {
|
||||
}
|
||||
}
|
||||
|
||||
static GXColor const defaultAmbColor = {0x32, 0x32, 0x32, 0x32};
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newAmbColor(int i_idx, int i_no) const {
|
||||
J3DGXColor dflt = (J3DGXColor)defaultAmbColor;
|
||||
u16 amb_color_index = mpMaterialInitData[mpMaterialID[i_idx]].mAmbColorIdx[i_no];
|
||||
if (amb_color_index != 0xffff) {
|
||||
return mpAmbColor[amb_color_index];
|
||||
J3DGXColor dflt = (GXColor){0x32, 0x32, 0x32, 0x32};
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mAmbColorIdx[i_no] != 0xffff) {
|
||||
return mpAmbColor[mtl_init_data->mAmbColorIdx[i_no]];
|
||||
} else {
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
|
||||
u32 J3DMaterialFactory::newTexGenNum(int i_idx) const {
|
||||
u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
|
||||
if (tex_gen_num_index != 0xff) {
|
||||
return mpTexGenNum[tex_gen_num_index];
|
||||
u32 r30 = 0;
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexGenNumIdx != 0xff) {
|
||||
return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
J3DTexCoord J3DMaterialFactory::newTexCoord(int i_idx, int i_no) const {
|
||||
u16 tex_coord_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexCoordIdx[i_no];
|
||||
if (tex_coord_index != 0xffff) {
|
||||
return J3DTexCoord(mpTexCoordInfo[tex_coord_index]);
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexCoordIdx[i_no] != 0xffff) {
|
||||
return J3DTexCoord(mpTexCoordInfo[mtl_init_data->mTexCoordIdx[i_no]]);
|
||||
} else {
|
||||
return J3DTexCoord();
|
||||
}
|
||||
@@ -520,18 +531,19 @@ J3DTexMtx* J3DMaterialFactory::newTexMtx(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newCullMode(int i_idx) const {
|
||||
u8 cull_mode_index = mpMaterialInitData[mpMaterialID[i_idx]].mCullModeIdx;
|
||||
if (cull_mode_index != 0xff) {
|
||||
return mpCullMode[cull_mode_index];
|
||||
u32 r30 = 0;
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mCullModeIdx != 0xff) {
|
||||
return mpCullMode[mtl_init_data->mCullModeIdx];
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
u16 J3DMaterialFactory::newTexNo(int i_idx, int i_no) const {
|
||||
u16 tex_no_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexNoIdx[i_no];
|
||||
if (tex_no_index != 0xffff) {
|
||||
return mpTexNo[tex_no_index];
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexNoIdx[i_no] != 0xffff) {
|
||||
return mpTexNo[mtl_init_data->mTexNoIdx[i_no]];
|
||||
} else {
|
||||
return 0xffff;
|
||||
}
|
||||
@@ -547,7 +559,8 @@ J3DTevOrder J3DMaterialFactory::newTevOrder(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const {
|
||||
J3DGXColorS10 dflt = (GXColorS10){0, 0, 0, 0};
|
||||
GXColorS10 _dflt = {0, 0, 0, 0};
|
||||
J3DGXColorS10 dflt = _dflt;
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) {
|
||||
return mpTevColor[mtl_init_data->mTevColorIdx[i_no]];
|
||||
@@ -556,50 +569,49 @@ J3DGXColorS10 J3DMaterialFactory::newTevColor(int i_idx, int i_no) const {
|
||||
}
|
||||
}
|
||||
|
||||
static GXColor const defaultTevKColor = {0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
J3DGXColor J3DMaterialFactory::newTevKColor(int i_idx, int i_no) const {
|
||||
J3DGXColor dflt = (J3DGXColor)defaultTevKColor;
|
||||
u16 tev_kcolor_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevKColorIdx[i_no];
|
||||
if (tev_kcolor_index != 0xffff) {
|
||||
return mpTevKColor[tev_kcolor_index];
|
||||
J3DGXColor dflt = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevKColorIdx[i_no] != 0xffff) {
|
||||
return mpTevKColor[mtl_init_data->mTevKColorIdx[i_no]];
|
||||
} else {
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newTevStageNum(int i_idx) const {
|
||||
u8 tev_stage_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageNumIdx;
|
||||
if (tev_stage_num_index != 0xff) {
|
||||
return mpTevStageNum[tev_stage_num_index];
|
||||
const u8 J3DMaterialFactory::newTevStageNum(int i_idx) const {
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevStageNumIdx != 0xff) {
|
||||
return mpTevStageNum[mtl_init_data->mTevStageNumIdx];
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
J3DTevStage J3DMaterialFactory::newTevStage(int i_idx, int i_no) const {
|
||||
u16 tev_stage_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageIdx[i_no];
|
||||
if (tev_stage_index != 0xffff) {
|
||||
return J3DTevStage(mpTevStageInfo[tev_stage_index]);
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevStageIdx[i_no] != 0xffff) {
|
||||
return J3DTevStage(mpTevStageInfo[mtl_init_data->mTevStageIdx[i_no]]);
|
||||
} else {
|
||||
return J3DTevStage();
|
||||
}
|
||||
}
|
||||
|
||||
J3DTevSwapModeTable J3DMaterialFactory::newTevSwapModeTable(int i_idx, int i_no) const {
|
||||
u16 tev_swap_mode_table_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevSwapModeTableIdx[i_no];
|
||||
if (tev_swap_mode_table_index != 0xffff) {
|
||||
return J3DTevSwapModeTable(mpTevSwapModeTableInfo[tev_swap_mode_table_index]);
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevSwapModeTableIdx[i_no] != 0xffff) {
|
||||
return J3DTevSwapModeTable(mpTevSwapModeTableInfo[mtl_init_data->mTevSwapModeTableIdx[i_no]]);
|
||||
} else {
|
||||
return J3DTevSwapModeTable(j3dDefaultTevSwapModeTable);
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newIndTexStageNum(int i_idx) const {
|
||||
u8 dflt = 0;
|
||||
if (mpIndInitData[i_idx].mEnabled == true) {
|
||||
return mpIndInitData[i_idx].mIndTexStageNum;
|
||||
} else {
|
||||
return 0;
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,9 +653,9 @@ J3DIndTexCoordScale J3DMaterialFactory::newIndTexCoordScale(int i_idx, int i_no)
|
||||
|
||||
J3DFog J3DMaterialFactory::newFog(int i_idx) const {
|
||||
J3DFog fog;
|
||||
u16 fog_index = mpMaterialInitData[mpMaterialID[i_idx]].mFogIdx;
|
||||
if (fog_index != 0xffff) {
|
||||
fog.setFogInfo(mpFogInfo[fog_index]);
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mFogIdx != 0xffff) {
|
||||
fog.setFogInfo(mpFogInfo[mtl_init_data->mFogIdx]);
|
||||
}
|
||||
return fog;
|
||||
}
|
||||
@@ -667,6 +679,7 @@ J3DBlend J3DMaterialFactory::newBlend(int i_idx) const {
|
||||
}
|
||||
|
||||
J3DZMode J3DMaterialFactory::newZMode(int i_idx) const {
|
||||
u32 r29 = 0;
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mZModeIdx != 0xff) {
|
||||
return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]);
|
||||
@@ -675,7 +688,7 @@ J3DZMode J3DMaterialFactory::newZMode(int i_idx) const {
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
|
||||
const u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mZCompLocIdx != 0xff){
|
||||
return mpZCompLoc[mtl_init_data->mZCompLocIdx];
|
||||
@@ -684,7 +697,7 @@ u8 J3DMaterialFactory::newZCompLoc(int i_idx) const {
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory::newDither(int i_idx) const {
|
||||
const u8 J3DMaterialFactory::newDither(int i_idx) const {
|
||||
J3DMaterialInitData* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mDitherIdx != 0xff){
|
||||
return mpDither[mtl_init_data->mDitherIdx];
|
||||
|
||||
@@ -39,14 +39,17 @@ J3DMaterialFactory_v21::J3DMaterialFactory_v21(J3DMaterialBlock_v21 const& i_blo
|
||||
u16 J3DMaterialFactory_v21::countUniqueMaterials() {
|
||||
u16 i;
|
||||
for (i = 0; i < mMaterialNum; i++) {
|
||||
if (mpMaterialID[i] - i == 0) {
|
||||
// No code, maybe commented out.
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
u32 J3DMaterialFactory_v21::countTexGens(int i_idx) const {
|
||||
u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
|
||||
if (tex_gen_num_index != 0xff) {
|
||||
return mpTexGenNum[tex_gen_num_index];
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexGenNumIdx != 0xff) {
|
||||
return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -55,9 +58,8 @@ u32 J3DMaterialFactory_v21::countStages(int i_idx) const {
|
||||
J3DMaterialInitData_v21* init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
u32 count1 = 0;
|
||||
u32 count2 = 0;
|
||||
u8 tev_stage_num_index = init_data->mTevStageNumIdx;
|
||||
if (tev_stage_num_index != 0xff) {
|
||||
count2 = mpTevStageNum[tev_stage_num_index];
|
||||
if (init_data->mTevStageNumIdx != 0xff) {
|
||||
count2 = mpTevStageNum[init_data->mTevStageNumIdx];
|
||||
}
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (init_data->mTexNoIdx[i] != 0xffff) {
|
||||
@@ -65,11 +67,13 @@ u32 J3DMaterialFactory_v21::countStages(int i_idx) const {
|
||||
}
|
||||
}
|
||||
if (count2 != count1 && count1 != 0) {
|
||||
u32 count3;
|
||||
if (count2 > count1) {
|
||||
return count2;
|
||||
count3 = count2;
|
||||
} else {
|
||||
return count1;
|
||||
count3 = count1;
|
||||
}
|
||||
return count3;
|
||||
}
|
||||
return count2;
|
||||
}
|
||||
@@ -163,25 +167,25 @@ J3DMaterial* J3DMaterialFactory_v21::create(J3DMaterial* i_material, int i_idx,
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory_v21::newMatColor(int i_idx, int i_no) const {
|
||||
GXColor defaultColor = {0xff,0xff,0xff,0xff};
|
||||
J3DGXColor defaultJ3DGXColor = J3DGXColor(defaultColor);
|
||||
J3DGXColor defaultColor = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mMatColorIdx[i_no] != 0xffff) {
|
||||
return J3DGXColor(mpMatColor[mtl_init_data->mMatColorIdx[i_no]]);
|
||||
}
|
||||
return J3DGXColor(defaultJ3DGXColor);
|
||||
return J3DGXColor(defaultColor);
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory_v21::newColorChanNum(int i_idx) const {
|
||||
u8 color_chan_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mColorChanNumIdx;
|
||||
if (color_chan_num_index != 0xff) {
|
||||
return mpColorChanNum[color_chan_num_index];
|
||||
const u8 J3DMaterialFactory_v21::newColorChanNum(int i_idx) const {
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mColorChanNumIdx != 0xff) {
|
||||
return mpColorChanNum[mtl_init_data->mColorChanNumIdx];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
J3DColorChan J3DMaterialFactory_v21::newColorChan(int i_idx, int i_no) const {
|
||||
u8 r29 = 0;
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mColorChanIdx[i_no] != 0xffff) {
|
||||
return J3DColorChan(mpColorChanInfo[mtl_init_data->mColorChanIdx[i_no]]);
|
||||
@@ -191,18 +195,19 @@ J3DColorChan J3DMaterialFactory_v21::newColorChan(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
u32 J3DMaterialFactory_v21::newTexGenNum(int i_idx) const {
|
||||
u8 tex_gen_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexGenNumIdx;
|
||||
if (tex_gen_num_index != 0xff) {
|
||||
return mpTexGenNum[tex_gen_num_index];
|
||||
u8 r30 = 0;
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexGenNumIdx != 0xff) {
|
||||
return mpTexGenNum[mtl_init_data->mTexGenNumIdx];
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
J3DTexCoord J3DMaterialFactory_v21::newTexCoord(int i_idx, int i_no) const {
|
||||
u16 tex_coord_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexCoordIdx[i_no];
|
||||
if (tex_coord_index != 0xffff) {
|
||||
return J3DTexCoord(mpTexCoordInfo[tex_coord_index]);
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexCoordIdx[i_no] != 0xffff) {
|
||||
return J3DTexCoord(mpTexCoordInfo[mtl_init_data->mTexCoordIdx[i_no]]);
|
||||
} else {
|
||||
return J3DTexCoord();
|
||||
}
|
||||
@@ -218,18 +223,19 @@ J3DTexMtx* J3DMaterialFactory_v21::newTexMtx(int i_idx, int i_no) const {
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory_v21::newCullMode(int i_idx) const {
|
||||
u8 cull_mode_index = mpMaterialInitData[mpMaterialID[i_idx]].mCullModeIdx;
|
||||
if (cull_mode_index != 0xff) {
|
||||
return mpCullMode[cull_mode_index];
|
||||
u8 r30 = 0;
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mCullModeIdx != 0xff) {
|
||||
return mpCullMode[mtl_init_data->mCullModeIdx];
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
u16 J3DMaterialFactory_v21::newTexNo(int i_idx, int i_no) const {
|
||||
u16 tex_no_index = mpMaterialInitData[mpMaterialID[i_idx]].mTexNoIdx[i_no];
|
||||
if (tex_no_index != 0xffff) {
|
||||
return mpTexNo[tex_no_index];
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTexNoIdx[i_no] != 0xffff) {
|
||||
return mpTexNo[mtl_init_data->mTexNoIdx[i_no]];
|
||||
} else {
|
||||
return 0xffff;
|
||||
}
|
||||
@@ -251,33 +257,32 @@ J3DGXColorS10 J3DMaterialFactory_v21::newTevColor(int i_idx, int i_no) const {
|
||||
if (mtl_init_data->mTevColorIdx[i_no] != 0xffff) {
|
||||
return mpTevColor[mtl_init_data->mTevColorIdx[i_no]];
|
||||
} else {
|
||||
return defaultTevColor;
|
||||
return dflt;
|
||||
}
|
||||
}
|
||||
|
||||
J3DGXColor J3DMaterialFactory_v21::newTevKColor(int i_idx, int param_1) const {
|
||||
GXColor defaultColor = {0xff,0xff,0xff,0xff};
|
||||
J3DGXColor defaultJ3DGXColor = J3DGXColor(defaultColor);
|
||||
J3DGXColor defaultColor = (GXColor){0xff, 0xff, 0xff, 0xff};
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevKColorIdx[param_1] != 0xffff) {
|
||||
return J3DGXColor(mpTevKColor[mtl_init_data->mTevKColorIdx[param_1]]);
|
||||
}
|
||||
return J3DGXColor(defaultJ3DGXColor);
|
||||
return J3DGXColor(defaultColor);
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory_v21::newTevStageNum(int i_idx) const {
|
||||
u8 tev_stage_num_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageNumIdx;
|
||||
if (tev_stage_num_index != 0xff) {
|
||||
return mpTevStageNum[tev_stage_num_index];
|
||||
const u8 J3DMaterialFactory_v21::newTevStageNum(int i_idx) const {
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevStageNumIdx != 0xff) {
|
||||
return mpTevStageNum[mtl_init_data->mTevStageNumIdx];
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
J3DTevStage J3DMaterialFactory_v21::newTevStage(int i_idx, int i_no) const {
|
||||
u16 tev_stage_index = mpMaterialInitData[mpMaterialID[i_idx]].mTevStageIdx[i_no];
|
||||
if (tev_stage_index != 0xffff) {
|
||||
return J3DTevStage(mpTevStageInfo[tev_stage_index]);
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mTevStageIdx[i_no] != 0xffff) {
|
||||
return J3DTevStage(mpTevStageInfo[mtl_init_data->mTevStageIdx[i_no]]);
|
||||
} else {
|
||||
return J3DTevStage();
|
||||
}
|
||||
@@ -293,9 +298,9 @@ J3DTevSwapModeTable J3DMaterialFactory_v21::newTevSwapModeTable(int i_idx, int p
|
||||
|
||||
J3DFog J3DMaterialFactory_v21::newFog(int i_idx) const {
|
||||
J3DFog fog;
|
||||
u16 fog_index = mpMaterialInitData[mpMaterialID[i_idx]].mFogIdx;
|
||||
if (fog_index != 0xffff) {
|
||||
fog.setFogInfo(mpFogInfo[fog_index]);
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mFogIdx != 0xffff) {
|
||||
fog.setFogInfo(mpFogInfo[mtl_init_data->mFogIdx]);
|
||||
}
|
||||
return fog;
|
||||
}
|
||||
@@ -317,7 +322,8 @@ J3DBlend J3DMaterialFactory_v21::newBlend(int i_idx) const {
|
||||
}
|
||||
}
|
||||
|
||||
J3DZMode J3DMaterialFactory_v21::newZMode(int i_idx) const {
|
||||
const J3DZMode J3DMaterialFactory_v21::newZMode(int i_idx) const {
|
||||
u8 r29 = 0;
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mZModeIdx != 0xff) {
|
||||
return J3DZMode(mpZModeInfo[mtl_init_data->mZModeIdx]);
|
||||
@@ -326,7 +332,7 @@ J3DZMode J3DMaterialFactory_v21::newZMode(int i_idx) const {
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory_v21::newZCompLoc(int i_idx) const {
|
||||
const u8 J3DMaterialFactory_v21::newZCompLoc(int i_idx) const {
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mZCompLocIdx != 0xff){
|
||||
return mpZCompLoc[mtl_init_data->mZCompLocIdx];
|
||||
@@ -335,7 +341,7 @@ u8 J3DMaterialFactory_v21::newZCompLoc(int i_idx) const {
|
||||
}
|
||||
}
|
||||
|
||||
u8 J3DMaterialFactory_v21::newDither(int i_idx) const {
|
||||
const u8 J3DMaterialFactory_v21::newDither(int i_idx) const {
|
||||
J3DMaterialInitData_v21* mtl_init_data = &mpMaterialInitData[mpMaterialID[i_idx]];
|
||||
if (mtl_init_data->mDitherIdx != 0xff){
|
||||
return mpDither[mtl_init_data->mDitherIdx];
|
||||
|
||||
@@ -1069,8 +1069,8 @@ int daArrow_c::draw() {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const GXColorS10 tmpColor = {0, 0, 0};
|
||||
J3DGXColorS10 color = (tmpColor);
|
||||
static const GXColorS10 tmpColor = {0x00, 0x00, 0x00, 0x00};
|
||||
J3DGXColorS10 color = tmpColor;
|
||||
|
||||
daAlink_c* link = daAlink_getAlinkActorClass();
|
||||
if (fopAcM_GetParam(this) == 0 && field_0x940 != 0) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "d/dolzel_rel.h" // IWYU pragma: keep
|
||||
|
||||
#include "d/actor/d_a_e_gb.h"
|
||||
#include "../assets/GZ2E01/res/Object/E_gb.h"
|
||||
#include "res/Object/E_gb.h"
|
||||
#include "d/d_cc_d.h"
|
||||
#include "d/d_camera.h"
|
||||
#include "d/d_bomb.h"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "Z2AudioLib/Z2Instances.h"
|
||||
#include "d/actor/d_a_e_hz.h"
|
||||
#include "../assets/GZ2E01/res/Object/E_hz.h"
|
||||
#include "res/Object/E_hz.h"
|
||||
#include "d/d_camera.h"
|
||||
#include "f_op/f_op_actor_enemy.h"
|
||||
#include "d/d_debug_viewer.h"
|
||||
|
||||
@@ -473,6 +473,7 @@ void daNpc_Zelda_c::srchActors() {
|
||||
switch (field_0xf80) {
|
||||
case 0:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -625,7 +626,7 @@ int daNpc_Zelda_c::drawDbgInfo() {
|
||||
attention_info.distances[fopAc_attn_JUEL_e]).mDistMax;
|
||||
f32 distMax2 = dComIfGp_getAttention()->getDistTable(
|
||||
attention_info.distances[fopAc_attn_TALK_e]).mDistMax;
|
||||
GXColor circle1Color = { 0xc8, 0x00, 0xff };
|
||||
GXColor circle1Color = { 0xc8, 0x00, 0xff, 0x00 };
|
||||
dDbVw_drawCircleOpa(attention_info.position, distMax1, circle1Color, 1, 0xc);
|
||||
GXColor circle2Color = { 0xc8, 0x00, 0x00, 0xff };
|
||||
dDbVw_drawCircleOpa(attention_info.position, distMax2, circle2Color, 1, 0xc);
|
||||
|
||||
@@ -3528,3 +3528,23 @@ OSThread* mDoExt_GetCurrentRunningThread() {
|
||||
|
||||
return thread;
|
||||
}
|
||||
|
||||
// TODO: hack to get these inlines to appear for debug
|
||||
static void dummy() {
|
||||
{ J3DZMode temp; temp = temp; J3DZMode temp2(temp); }
|
||||
{ J3DBlend temp; temp = temp; J3DBlend temp2(temp); }
|
||||
{ J3DAlphaComp temp; temp = temp; J3DAlphaComp temp2(temp); }
|
||||
{ J3DIndTexCoordScale temp; temp = temp; J3DIndTexCoordScale temp2(temp); }
|
||||
{ J3DIndTexMtx temp; temp = temp; J3DIndTexMtx temp2(temp); }
|
||||
{ J3DIndTevStage temp; temp = temp; J3DIndTevStage temp2(temp); }
|
||||
{ J3DTevStage temp; temp = temp; J3DTevStage temp2(temp); }
|
||||
{ J3DTevSwapModeTable temp; temp = temp; J3DTevSwapModeTable temp2(temp); }
|
||||
{ J3DTevOrder temp; temp = temp; J3DTevOrder temp2(temp); }
|
||||
{ J3DGXColorS10 temp; temp = temp; J3DGXColorS10 temp2(temp); }
|
||||
{ J3DTexCoord temp; temp = temp; J3DTexCoord temp2(temp); }
|
||||
{ J3DColorChan temp; temp = temp; J3DColorChan temp2(temp); }
|
||||
{ J3DGXColor temp; temp = temp; J3DGXColor temp2(temp); }
|
||||
{ J3DIndTexOrderInfo temp; temp = temp; J3DIndTexOrderInfo temp2(temp); }
|
||||
{ J3DFog temp; temp = temp; J3DFog temp2(temp); }
|
||||
{ J3DTexMtx temp; temp = temp; J3DTexMtx temp2(temp); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user