d_cloth_packet matching (#928)

* Match dCloth_packet_c::setMtx

* Match dCloth_packet_c::setGlobalWind

* Match dCloth_packet_c::dCloth_packet_c constructor implementation

* Match dCloth_packet_c::getFactor and get_cloth_anim_sub_factor implementation

* Match dCloth_packet_c::cloth_move implementation

* Match dCloth_packet_c::setNrm implementation

* Match dCloth_packet_c::init and default_factor_checkCB implementation

* Match dCloth_packet_c::draw implementation

* Match dCloth_packet_c::cloth_draw implementation

* Match dCloth_packet_c::plot implementation

* Match dCloth_packet_c::TexObjLoad implementation

* Match dCloth_packet_c::TexObjInit implementation

* Match dCloth_packet_c::TevSetting implementation

* Match dCloth_packet_c::dCloth_packet_create implementation

* Match dCloth_packet_c::TevSetting implementation

* Match dCloth_packetXlu_c::TevSetting implementation and make dCloth_packet_c members protected

* Match dCloth_packetXlu_c::cloth_draw implementation

* Match dClothVobj03_c::cloth_copy implementation and update member definitions

* Match dClothVobj04_c, dClothVobj05_c, and dClothVobj07_0_c::cloth_copy implementations and update member definitions

* Match dClothVobj03_c::init implementation, update cloth_counter definitions, and add new member variables

* Match `dClothVobj04_c::init`, `dClothVobj05_c::init`, and `dClothVobj07_0_c::init` implementations, and add new member variables.

* Match `dClothVobj03_c::dClothVobj03_create` and constructor implementations, update member definitions, and add new logic checks.

* Match `dClothVobj03_c::cloth_move` implementation

* Match `dClothVobj04_c`, `dClothVobj05_c`, and `dClothVobj07_0_c::cloth_move` implementations

* Match `dClothVobj03_c`, `dClothVobj04_c`, `dClothVobj05_c`, and `dClothVobj07_0_c::TexObjInit` implementations, update member definitions, and initialize `mTlutObj`.

* Match `TexObjLoad` implementations for `dClothVobj03_c`, `dClothVobj04_c`, `dClothVobj05_c`, and `dClothVobj07_0_c`.

* Fix `dClothVobj04_c::cloth_move`

* Match `dClothVobj04_create`, `dClothVobj05_create`, and `dClothVobj07_0_create` implementations, update parameter definitions, and add new constructor logic.

* Update parameter names in `dClothVobj05_VtxFactorCB` and `dClothVobj07_0_VtxFactorCB` for consistency.

* Adjust parameter values in `dClothVobj05_create` and `dClothVobj07_0_create` for consistency with expected behavior.

* Match `dClothVobj05_VtxFactorCB` and `dClothVobj07_0_VtxFactorCB` implementations and update return logic.

* Fix constructors

* Refactor repetitive parameter assignments in `dCloth_packet_c` with `setParam` and `setWindPower` for cleaner and more maintainable code.

* Add `setFactorCheckCB` call in `dCloth_packet_c` initialization

* Refactor `dCloth_packet_c` and related classes to eliminate redundant success checks with `chkCreateBuff` helper method.

* Refactor `dCloth_packet_c` and related classes to use getter methods for cleaner access and rename methods for improved clarity.

* Simplify constructors for `dClothVobj03_c`, `dClothVobj04_c`, `dClothVobj05_c`, and `dClothVobj07_0_c` by removing redundant parameters.

* Replace `field_0x109` with `mIsIndoors` for improved clarity and consistency across `dCloth_packet_c` and related classes.

* Replace `VECDotProduct` with `inprod` method in `dCloth_packet_c` for improved readability and modern syntax usage.

* Make `top_pointer` and `cloth_counter` members private in multiple `dClothVobjXX_c` classes for encapsulation.

* Match cloth creation functions

* Add `l_alpha_matDL` assets and update `GXCallDisplayList` usage in `dCloth_packetXlu_c`

* Match dCloth_packet_c::init

* Match dCloth_packet_c::setNrm

* Refactor dCloth_packet_c to use mDoMtx_stack_c methods

* Match `get_cloth_anim_sub_factor` implementation in `dCloth_packet_c`.

* Refactor `getFactor` in `dCloth_packet_c` to use a bitmask for neighbor checks, enhancing code clarity and efficiency.

* Match dCloth_packet_c::cloth_move

* Match dCloth_packet_c::setGlobalWind

* Match dCloth_packet_c::plot implementation

* Remove unused virtual function declarations

* Update `d/d_cloth_packet.cpp` to Matching in configure.py

* Refactor field_0x108 and mIsIndoors to boolean types, rename, and add explanatory comments.

* Update `d/d_cloth_packet.cpp` to `MatchingFor("GZLE01")` in configure.py

* Add new material and alpha material configurations for `d_cloth_packet` across GZLP01, GZLJ01, and D44J01

* Update `d/d_cloth_packet.cpp` to `Matching` in configure.py

* Update `d/d_cloth_packet.cpp` to `MatchingFor("GZLE01", "GZLP01")` in configure.py

* Add conditional GXSetNumIndStages and resetVcdVatCache for non-JPN versions in `dCloth_packet_c::draw`

* Update `d/d_cloth_packet.cpp` to `MatchingFor("GZLJ01", "GZLE01", "GZLP01")` in configure.py

* Matched dCloth_packet_c::dCloth_packet_c for `VERSION_DEMO` in `d/d_cloth_packet.cpp`

* Matched dCloth_packet_c::cloth_move for `VERSION_DEMO` in `d/d_cloth_packet.cpp`

* Matched dCloth_packet_c::draw for `VERSION_DEMO` in `d/d_cloth_packet.cpp`

* Matched dCloth_packet_c::TexObjInit for `VERSION_DEMO` in `d/d_cloth_packet.cpp`

* Matched dClothVobjXX_c::TexObjInit for `VERSION_DEMO` in `d/d_cloth_packet.cpp`

* Update `d/d_cloth_packet.cpp` to `Matching` in configure.py

* Replaced direct member access with getter methods in `d/d_cloth_packet.cpp`

* Added `f` suffix to floating-point literals in `d/d_cloth_packet.cpp` for consistency.
This commit is contained in:
Briggs Baltzell
2026-02-12 00:42:21 -06:00
committed by GitHub
parent 579931b72c
commit ca9481dcc9
7 changed files with 1022 additions and 108 deletions
+7
View File
@@ -3246,3 +3246,10 @@ extract:
binary: assets/l_DL__drawSpot__FP10view_class.bin
header: assets/l_DL__drawSpot__FP10view_class.h
rename: l_DL
- symbol: l_matDL!.data:0x8036ADA0
binary: assets/l_matDL__d_cloth_packet.bin
header: assets/l_matDL__d_cloth_packet.h
- symbol: l_alpha_matDL!.data:0x8036ADE0
binary: assets/l_alpha_matDL__d_cloth_packet.bin
header: assets/l_alpha_matDL__d_cloth_packet.h
+7
View File
@@ -2795,3 +2795,10 @@ extract:
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
- symbol: l_matDL!.data:0x80376e20
binary: assets/l_matDL__d_cloth_packet.bin
header: assets/l_matDL__d_cloth_packet.h
- symbol: l_alpha_matDL!.data:0x80376e60
binary: assets/l_alpha_matDL__d_cloth_packet.bin
header: assets/l_alpha_matDL__d_cloth_packet.h
+7
View File
@@ -2379,3 +2379,10 @@ extract:
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
- symbol: l_matDL!.data:0x8036A2C0
binary: assets/l_matDL__d_cloth_packet.bin
header: assets/l_matDL__d_cloth_packet.h
- symbol: l_alpha_matDL!.data:0x8036A300
binary: assets/l_alpha_matDL__d_cloth_packet.bin
header: assets/l_alpha_matDL__d_cloth_packet.h
+7
View File
@@ -2391,3 +2391,10 @@ extract:
- symbol: l_toonMat1DL
binary: assets/l_toonMat1DL.bin
header: assets/l_toonMat1DL.h
- symbol: l_matDL!.data:0x8037DB00
binary: assets/l_matDL__d_cloth_packet.bin
header: assets/l_matDL__d_cloth_packet.h
- symbol: l_alpha_matDL!.data:0x8037DB40
binary: assets/l_alpha_matDL__d_cloth_packet.bin
header: assets/l_alpha_matDL__d_cloth_packet.h
+1 -1
View File
@@ -498,7 +498,7 @@ config.libs = [
Object(Matching, "d/d_shop.cpp"),
Object(Matching, "d/d_jnt_hit.cpp"),
Object(Matching, "d/d_chain.cpp"),
Object(NonMatching, "d/d_cloth_packet.cpp"),
Object(Matching, "d/d_cloth_packet.cpp"),
Object(NonMatching, "d/d_a_obj.cpp"),
Object(MatchingFor("GZLJ01", "GZLE01", "GZLP01"), "d/d_a_obj_tribox_static.cpp"),
Object(Matching, "d/d_a_ship_static.cpp"),
+125 -35
View File
@@ -13,18 +13,18 @@ public:
typedef dCloth_packet_c* (*CreateFunc)(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
typedef int (*FactorCheck)(dCloth_packet_c*, int, int);
dCloth_packet_c(ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
dCloth_packet_c(ResTIMG* i_toonimage, int flyGridSize, int hoistGridSize, float flyLength, float hoistLength, dKy_tevstr_c* tevstr, cXyz** posArr);
~dCloth_packet_c();
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjInit(ResTIMG* i_img);
virtual void TexObjLoad();
virtual void TevSetting();
void draw();
void setGlobalWind(cXyz*);
void getFactor(cXyz*, cXyz*, cXyz*, float, float, float, int, int);
void setGlobalWind(cXyz* wind);
cXyz getFactor(cXyz* pPos, cXyz* pNrm, cXyz* pSpeed, float distFly, float distHoist, float distBoth, int x, int y);
void setNrm();
void plot();
@@ -48,7 +48,27 @@ public:
setWindPower(wind, windWave);
}
private:
void changeCurrentBuff() { mCurArr ^= 1; }
bool chkCreateBuff() {
if (mpPosArr[0] != NULL && mpPosArr[1] != NULL && mpNrmArr[0] != NULL && mpNrmArr[1] != NULL && mpNrmArrBack[0] != NULL && mpNrmArrBack[1] != NULL &&
mpSpeedArr != NULL)
return true;
return false;
}
cXyz* getPosP() const { return mpPosArr[mCurArr]; }
cXyz* getNrmP() const { return mpNrmArr[mCurArr]; }
cXyz* getBackNrmP() const { return mpNrmArrBack[mCurArr]; }
cXyz* getSpdP() const { return mpSpeedArr; }
u32 getVerticalNum() const { return mHoistGridSize; }
GXTexObj* getTexObjP() { return &mTexObj; }
GXTexObj* getToonTexObjP() { return &mToonTex; }
friend int default_factor_checkCB(dCloth_packet_c* pPkt, int x, int y);
friend dCloth_packet_c* dCloth_packet_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
protected:
/* 0x10 */ s32 mFlyGridSize;
/* 0x14 */ s32 mHoistGridSize;
/* 0x18 */ f32 mFlyLength;
@@ -80,76 +100,146 @@ private:
/* 0xF6 */ s16 mRotateY;
/* 0xF8 */ u8 mCurArr;
}; // Size: 0xFC
dCloth_packet_c* dCloth_packet_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
dCloth_packet_c* dCloth_packet_create(
ResTIMG* i_flagimage, ResTIMG* i_toonimage, int flyGridSize, int hoistGridSize, float flyLength, float hoistLength, dKy_tevstr_c* tevstr, cXyz** posArr
);
class dCloth_packetXlu_c : public dCloth_packet_c {
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjLoad();
virtual void TevSetting();
private:
dCloth_packetXlu_c(ResTIMG* i_toonimage, int flyGridSize, int hoistGridSize, float flyLength, float hoistLength, dKy_tevstr_c* tevstr, cXyz** posArr)
: dCloth_packet_c(i_toonimage, flyGridSize, hoistGridSize, flyLength, hoistLength, tevstr, posArr) {}
friend dCloth_packetXlu_c* dCloth_packetXlu_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
private:
u32 field_0xFC;
};
dCloth_packetXlu_c* dCloth_packetXlu_create(ResTIMG*, ResTIMG*, int, int, float, float, dKy_tevstr_c*, cXyz**);
dCloth_packetXlu_c* dCloth_packetXlu_create(
ResTIMG* i_flagimage, ResTIMG* i_toonimage, int flyGridSize, int hoistGridSize, float flyLength, float hoistLength, dKy_tevstr_c* tevstr, cXyz** posArr
);
class dClothVobj03_c : public dCloth_packet_c {
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjLoad();
virtual void TevSetting();
void cloth_copy();
public:
static void* top_pointer;
static const s32 cloth_counter;
private:
dClothVobj03_c(ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr)
: dCloth_packet_c(i_toonimage, 5, 5, 120.0f, 60.0f, tevstr, posArr) {
if (posArr) {
mIsStandItem = true;
} else {
mIsStandItem = false;
}
}
private:
static dClothVobj03_c* top_pointer;
static s32 cloth_counter;
friend dClothVobj03_c* dClothVobj03_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
private:
GXTlutObj mTlutObj;
bool mIsStandItem;
bool mIsIndoors;
};
dClothVobj03_c* dClothVobj03_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dClothVobj03_c* dClothVobj03_create(ResTIMG* i_flagimage, ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr);
class dClothVobj04_c : public dCloth_packet_c {
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjLoad();
virtual void TevSetting();
void cloth_copy();
public:
static void* top_pointer;
static const s32 cloth_counter;
private:
dClothVobj04_c(ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr)
: dCloth_packet_c(i_toonimage, 5, 5, 120.0f, 60.0f, tevstr, posArr) {
if (posArr) {
mIsStandItem = true;
} else {
mIsStandItem = false;
}
};
private:
static dClothVobj04_c* top_pointer;
static s32 cloth_counter;
friend dClothVobj04_c* dClothVobj04_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
private:
GXTlutObj mTlutObj;
bool mIsStandItem;
bool mIsIndoors;
};
dClothVobj04_c* dClothVobj04_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dClothVobj04_c* dClothVobj04_create(ResTIMG* i_flagimage, ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr);
class dClothVobj05_c : public dCloth_packet_c {
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjLoad();
virtual void TevSetting();
void cloth_copy();
public:
static void* top_pointer;
static const s32 cloth_counter;
private:
dClothVobj05_c(ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr)
: dCloth_packet_c(i_toonimage, 5, 5, 50.0f, 120.0f, tevstr, posArr) {
if (posArr) {
mIsStandItem = true;
} else {
mIsStandItem = false;
}
}
private:
static dClothVobj05_c* top_pointer;
static s32 cloth_counter;
friend dClothVobj05_c* dClothVobj05_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
private:
GXTlutObj mTlutObj;
bool mIsStandItem;
bool mIsIndoors;
};
dClothVobj05_c* dClothVobj05_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dClothVobj05_c* dClothVobj05_create(ResTIMG* i_flagimage, ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr);
class dClothVobj07_0_c : public dCloth_packet_c {
virtual void init();
virtual void cloth_move();
virtual void cloth_draw();
virtual void TexObjInit(ResTIMG*);
virtual void TexObjLoad();
virtual void TevSetting();
void cloth_copy();
public:
static void* top_pointer;
static const s32 cloth_counter;
private:
dClothVobj07_0_c(ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr)
: dCloth_packet_c(i_toonimage, 5, 5, 120.0f, 70.0f, tevstr, posArr) {
if (posArr) {
mIsStandItem = true;
} else {
mIsStandItem = false;
}
}
private:
static dClothVobj07_0_c* top_pointer;
static s32 cloth_counter;
friend dClothVobj07_0_c* dClothVobj07_0_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
private:
GXTlutObj mTlutObj;
bool mIsStandItem;
bool mIsIndoors;
};
dClothVobj07_0_c* dClothVobj07_0_create(ResTIMG*, ResTIMG*, dKy_tevstr_c*, cXyz**);
dClothVobj07_0_c* dClothVobj07_0_create(ResTIMG* i_flagimage, ResTIMG* i_toonimage, dKy_tevstr_c* tevstr, cXyz** posArr);
#endif /* D_A_CLOTH_PACKET_H */
+868 -72
View File
File diff suppressed because it is too large Load Diff