mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-08 21:54:50 -04:00
Refactor d_menu_cloth to improve pointer arithmetic in plot loop and add missing implementations for getOffsetVec and getShadowPos.
This commit is contained in:
@@ -12,11 +12,11 @@ public:
|
||||
dMCloth_c();
|
||||
virtual ~dMCloth_c();
|
||||
|
||||
cXyz* getBackNrm() { return field_0x52f8; }
|
||||
cXyz* getNrm() { return field_0x29a0[mCurArr]; }
|
||||
cXyz* getOffsetVec() {}
|
||||
cXyz* getPos() { return field_0x48[mCurArr]; }
|
||||
cXyz* getShadowPos() {}
|
||||
cXyz* getNrm() { return field_0x29a0[mCurArr]; }
|
||||
cXyz* getBackNrm() { return field_0x52f8; }
|
||||
cXyz* getOffsetVec() { return field_0x67a4; }
|
||||
cXyz* getShadowPos() { return field_0x7c50; }
|
||||
GXTexObj* getTexObj() { return &mTexObj; }
|
||||
void setArchive(JKRArchive* arc) { mpArc = arc; }
|
||||
void setClothType(u8 type) { mClothType = type; } // ?
|
||||
|
||||
@@ -130,15 +130,15 @@ void dMCloth_c::cloth_init() {
|
||||
for (int i = 0; i < INNER_SIZE; i++) {
|
||||
s16 xAngle = -(i * 3500);
|
||||
for (int j = 0; j < INNER_SIZE; j++) {
|
||||
cXyz* pPos = getPos() + i * INNER_SIZE + j;
|
||||
cXyz* pPos = &getPos()[i * INNER_SIZE + j];
|
||||
pPos->x = cM_ssin(j * 3276.8f) * 954.9299f + -1500.0f + j * 10.0f * cM_ssin(xAngle);
|
||||
pPos->y = i * 300.0f + -1500.0f;
|
||||
pPos->z = (1.0f - cM_scos(j * 3276.8f)) * 716.1974f - 3400.0f + j * -5.0f * cM_scos(xAngle);
|
||||
|
||||
pPos = field_0x29a0[mCurArr] + i * INNER_SIZE + j;
|
||||
pPos->x = cM_scos(j * 3276.8f - 1000.0f) * -320.0f;
|
||||
pPos->y = 0.0f;
|
||||
pPos->z = cM_ssin(j * 3276.8f - 1000.0f) * -270.0f;
|
||||
cXyz* pOff = &getOffsetVec()[i * INNER_SIZE + j];
|
||||
pOff->x = cM_scos(j * 3276.8f - 1000.0f) * -320.0f;
|
||||
pOff->y = 0.0f;
|
||||
pOff->z = cM_ssin(j * 3276.8f - 1000.0f) * -270.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user