Skip to content

Commit ea6a13d

Browse files
committed
M3DUtil namingggg
1 parent 4d9f03c commit ea6a13d

12 files changed

Lines changed: 395 additions & 390 deletions

File tree

‎include/M3DUtil/MActor.hpp‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class MActor {
4242
public:
4343
MActor(MActorAnmData* anm_data);
4444

45-
void setMActorAnmData(MActorAnmData*);
46-
void setModel(J3DModel*, u32);
45+
void setMActorAnmData(MActorAnmData* anm_data);
46+
void setModel(J3DModel* model, u32);
4747

4848
bool isCurAnmAlreadyEnd(int type);
4949
BOOL curAnmEndsNext(int type, char* part_name);
@@ -56,14 +56,14 @@ class MActor {
5656
void onMakeDL();
5757
void offMakeDL();
5858
const char* getCurAnmName(int) const;
59-
void setJointCallback(int, J3DNodeCallBack);
59+
void setJointCallback(int joint_idx, J3DNodeCallBack callback);
6060
void updateInSubBck();
6161
void updateOutSubBck();
6262
void calcAnm();
6363
void calc();
6464
void viewCalc();
6565
void loadSetDeformData(const char*);
66-
void setLightID(s16);
66+
void setLightID(s16 light_id);
6767
void setLightData(const TBGCheckData*, const JGeometry::TVec3<f32>&);
6868
void setLightType(int);
6969
void update();
@@ -102,7 +102,7 @@ class MActor {
102102
void dumpReport();
103103

104104
// fabricated
105-
MActorAnmBase* getUnk28(int i) { return mAnmByType[i]; }
105+
MActorAnmBase* getAnmByType(int i) { return mAnmByType[i]; }
106106
MActorAnmBck* getAnmBck() { return mAnmBck; }
107107
J3DModel* getModel() const { return mModel; }
108108
void unmarkUnk40() { unk40 = false; }
@@ -181,7 +181,7 @@ class MActor {
181181
if (!mAnmBck)
182182
return nullptr;
183183

184-
return mAnmBck->unk24;
184+
return mAnmBck->getCurAnmPtr();
185185
}
186186

187187
void setBck(int index)
@@ -201,7 +201,7 @@ class MActor {
201201
/* 0x04 */ J3DModel* mModel;
202202
/* 0x08 */ J3DMtxCalc* unk8;
203203
/* 0x0C */ MActorAnmBck* mAnmBck;
204-
/* 0x10 */ MActorAnmBck** unk10;
204+
/* 0x10 */ MActorAnmBck** mSubBcks;
205205
/* 0x14 */ MActorAnmBpk* mAnmBpk;
206206
/* 0x18 */ MActorAnmBtp* mAnmBtp;
207207
/* 0x1C */ MActorAnmBtk* mAnmBtk;

‎include/M3DUtil/MActorAnm.hpp‎

Lines changed: 78 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,31 @@ class J3DMtxCalcSoftimageAnm;
2727
class TMotionBlendCtrl;
2828

2929
class MActorAnmBase {
30-
public:
31-
/* 0x0 */ s32 unk0;
32-
/* 0x4 */ J3DFrameCtrl unk4;
33-
/* 0x18 */ J3DModel* unk18;
34-
/* 0x1C */ MActorAnmDataBase* unk1C;
30+
protected:
31+
/* 0x0 */ s32 mCurAnmIdx;
32+
/* 0x4 */ J3DFrameCtrl mFrameCtrl;
33+
/* 0x18 */ J3DModel* mModel;
34+
/* 0x1C */ MActorAnmDataBase* mAnmData;
3535

3636
public:
3737
MActorAnmBase()
38-
: unk0(-1)
39-
, unk18(nullptr)
40-
, unk1C(nullptr)
38+
: mCurAnmIdx(-1)
39+
, mModel(nullptr)
40+
, mAnmData(nullptr)
4141
{
4242
}
4343
~MActorAnmBase() { }
4444

4545
// fabricated
46-
J3DFrameCtrl* getFrameCtrl() { return &unk4; }
47-
s32 getCurIdx() { return unk0; }
48-
void setUnk1C(MActorAnmDataBase* param_1) { unk1C = param_1; }
46+
J3DFrameCtrl* getFrameCtrl() { return &mFrameCtrl; }
47+
s32 getCurAnmIdx() { return mCurAnmIdx; }
48+
void setAnmData(MActorAnmDataBase* param_1) { mAnmData = param_1; }
49+
void stopAnm() { mCurAnmIdx = -1; }
4950

5051
BOOL endsNext()
5152
{
52-
if (unk4.getFrame() + unk4.getRate() + 0.1f >= unk4.getEnd())
53+
if (mFrameCtrl.getFrame() + mFrameCtrl.getRate() + 0.1f
54+
>= mFrameCtrl.getEnd())
5355
return true;
5456
else
5557
return false;
@@ -61,21 +63,21 @@ class MActorAnmBase {
6163

6264
int totalKeyMatches = 0;
6365
int match = -1;
64-
for (int i = 0; i < unk1C->getAnmNum(); ++i)
65-
if (key == unk1C->getKeyCode(i)) {
66+
for (int i = 0; i < mAnmData->getAnmNum(); ++i)
67+
if (key == mAnmData->getKeyCode(i)) {
6668
++totalKeyMatches;
6769
match = i;
6870
}
6971

7072
if (totalKeyMatches == 1)
7173
return match;
7274

73-
for (int i = 0; i < unk1C->getAnmNum(); ++i)
74-
if (key == unk1C->getKeyCode(i)
75-
&& strcmp(name, unk1C->getName(i)) == 0)
75+
for (int i = 0; i < mAnmData->getAnmNum(); ++i)
76+
if (key == mAnmData->getKeyCode(i)
77+
&& strcmp(name, mAnmData->getName(i)) == 0)
7678
return i;
7779

78-
unk1C->checkLower(name);
80+
mAnmData->checkLower(name);
7981
verifySuffix(name);
8082
return -1;
8183
}
@@ -86,8 +88,8 @@ class MActorAnmBase {
8688

8789
int totalKeyMatches = 0;
8890
int match = -1;
89-
for (int i = 0; i < unk1C->getAnmNum(); ++i)
90-
if (key == unk1C->getKeyCode(i)) {
91+
for (int i = 0; i < mAnmData->getAnmNum(); ++i)
92+
if (key == mAnmData->getKeyCode(i)) {
9193
++totalKeyMatches;
9294
match = i;
9395
}
@@ -98,15 +100,15 @@ class MActorAnmBase {
98100
if (totalKeyMatches == 1)
99101
return match;
100102

101-
for (int i = 0; i < unk1C->getAnmNum(); ++i)
102-
if (key == unk1C->getKeyCode(i)
103-
&& strcmp(name, unk1C->getName(i)) == 0)
103+
for (int i = 0; i < mAnmData->getAnmNum(); ++i)
104+
if (key == mAnmData->getKeyCode(i)
105+
&& strcmp(name, mAnmData->getName(i)) == 0)
104106
return i;
105107

106108
return -1;
107109
}
108110

109-
virtual void setModel(J3DModel* model) { unk18 = model; }
111+
virtual void setModel(J3DModel* model) { mModel = model; }
110112
virtual void updateIn() { }
111113
virtual void updateOut() { }
112114
virtual void checkUseMaterialIDInit(u16*);
@@ -118,7 +120,7 @@ class MActorAnmBase {
118120

119121
template <class T> class MActorAnmEach : public MActorAnmBase {
120122
public:
121-
MActorAnmEach() { unk24 = nullptr; }
123+
MActorAnmEach() { mCurAnmPtr = nullptr; }
122124
~MActorAnmEach() { }
123125

124126
virtual void setAnm(const char* name, u16* param_2)
@@ -127,59 +129,50 @@ template <class T> class MActorAnmEach : public MActorAnmBase {
127129
}
128130

129131
// matches in bossgesso.cpp
130-
bool setFrameCtrl(int param_1)
132+
bool setFrameCtrl(int anm_idx)
131133
{
132-
unk0 = param_1;
134+
mCurAnmIdx = anm_idx;
133135

134-
if (param_1 < 0)
136+
if (anm_idx < 0)
135137
return false;
136138

137-
unk24 = getData()->getAnmPtr(param_1);
138-
unk4.init(unk24->getFrameMax());
139-
unk4.setAttribute(unk24->getAttribute());
140-
unk4.setRate(SMSGetAnmFrameRate());
139+
mCurAnmPtr = getData()->getAnmPtr(anm_idx);
140+
mFrameCtrl.init(mCurAnmPtr->getFrameMax());
141+
mFrameCtrl.setAttribute(mCurAnmPtr->getAttribute());
142+
mFrameCtrl.setRate(SMSGetAnmFrameRate());
141143

142144
return true;
143145
}
144146

145147
// fabricated
146148
MActorAnmDataEach<T>* getData()
147149
{
148-
return static_cast<MActorAnmDataEach<T>*>(unk1C);
150+
return static_cast<MActorAnmDataEach<T>*>(mAnmData);
149151
}
150152

151-
public:
152-
/* 0x24 */ T* unk24;
153+
T* getCurAnmPtr() { return mCurAnmPtr; }
154+
155+
protected:
156+
/* 0x24 */ T* mCurAnmPtr;
153157
};
154158

155159
template <class T> class MActorAnmMatEach : public MActorAnmEach<T> {
156160
public:
157161
~MActorAnmMatEach() { }
158162

159-
virtual void setAnmFromIndex(int param_1, u16* param_2)
163+
virtual void setAnmFromIndex(int anm_idx, u16* param_2)
160164
{
161-
this->unk0 = param_1;
162-
bool thing;
163-
if (param_1 < 0) {
164-
thing = false;
165-
} else {
166-
this->unk24 = this->getData()->getAnmPtr(param_1);
167-
this->unk4.init(this->unk24->getFrameMax());
168-
this->unk4.setAttribute(this->unk24->getAttribute());
169-
this->unk4.setRate(SMSGetAnmFrameRate());
170-
thing = true;
171-
}
172-
173-
if (thing) {
174-
this->unk24->searchUpdateMaterialID(this->unk18->getModelData());
165+
if (this->setFrameCtrl(anm_idx)) {
166+
this->mCurAnmPtr->searchUpdateMaterialID(
167+
this->mModel->getModelData());
175168
this->checkUseMaterialID(param_2);
176169
}
177170
}
178171
};
179172

180173
class MActorAnmBlk : public MActorAnmEach<J3DAnmClusterKey> {
181174
public:
182-
MActorAnmBlk() { unk28 = nullptr; }
175+
MActorAnmBlk() { mDeformData = nullptr; }
183176

184177
virtual void updateIn();
185178
virtual void updateOut();
@@ -189,8 +182,8 @@ class MActorAnmBlk : public MActorAnmEach<J3DAnmClusterKey> {
189182
return strstr(param_1, ".blk");
190183
}
191184

192-
public:
193-
/* 0x28 */ J3DDeformData* unk28;
185+
private:
186+
/* 0x28 */ J3DDeformData* mDeformData;
194187
};
195188

196189
class MActorAnmBrk : public MActorAnmMatEach<J3DAnmTevRegKey> {
@@ -209,14 +202,14 @@ class MActorAnmBrk : public MActorAnmMatEach<J3DAnmTevRegKey> {
209202
void setTevKColorAnmKeyPtr();
210203
void setTevColorAnmKeyPtr();
211204

212-
public:
213-
/* 0x28 */ J3DTevColorAnm** unk28;
214-
/* 0x2C */ J3DTevKColorAnm** unk2C;
205+
private:
206+
/* 0x28 */ J3DTevColorAnm** mTevColorAnms;
207+
/* 0x2C */ J3DTevKColorAnm** mTevKColorAnms;
215208
};
216209

217210
class MActorAnmBpk : public MActorAnmMatEach<J3DAnmColorKey> {
218211
public:
219-
MActorAnmBpk() { unk28 = nullptr; }
212+
MActorAnmBpk() { mMatColorAnms = nullptr; }
220213

221214
virtual void updateIn();
222215
virtual void updateOut();
@@ -229,13 +222,13 @@ class MActorAnmBpk : public MActorAnmMatEach<J3DAnmColorKey> {
229222

230223
void setMatColorAnmKeyPtr();
231224

232-
public:
233-
/* 0x28 */ J3DMatColorAnm** unk28;
225+
private:
226+
/* 0x28 */ J3DMatColorAnm** mMatColorAnms;
234227
};
235228

236229
class MActorAnmBtk : public MActorAnmMatEach<J3DAnmTextureSRTKey> {
237230
public:
238-
MActorAnmBtk() { unk28 = nullptr; }
231+
MActorAnmBtk() { mTexMtxAnms = nullptr; }
239232

240233
virtual void updateIn();
241234
virtual void updateOut();
@@ -248,13 +241,13 @@ class MActorAnmBtk : public MActorAnmMatEach<J3DAnmTextureSRTKey> {
248241

249242
void setTexMtxAnmKeyPtr();
250243

251-
public:
252-
/* 0x28 */ J3DTexMtxAnm** unk28;
244+
private:
245+
/* 0x28 */ J3DTexMtxAnm** mTexMtxAnms;
253246
};
254247

255248
class MActorAnmBtp : public MActorAnmMatEach<J3DAnmTexPattern> {
256249
public:
257-
MActorAnmBtp() { unk28 = nullptr; }
250+
MActorAnmBtp() { mTexNoAnms = nullptr; }
258251

259252
virtual void updateIn();
260253
virtual void updateOut();
@@ -267,8 +260,8 @@ class MActorAnmBtp : public MActorAnmMatEach<J3DAnmTexPattern> {
267260

268261
void setTexNoAnmFullPtr();
269262

270-
public:
271-
/* 0x28 */ J3DTexNoAnm** unk28;
263+
private:
264+
/* 0x28 */ J3DTexNoAnm** mTexNoAnms;
272265
};
273266

274267
enum MActorMtxCalcType {
@@ -282,12 +275,12 @@ class MActorAnmBck : public MActorAnmEach<J3DAnmTransformKey> {
282275
public:
283276
MActorAnmBck()
284277
{
285-
unk28 = 0;
286-
unk2A = MACTOR_MTX_CALC_SOFTIMAGE;
287-
unk2C = nullptr;
288-
unk30 = nullptr;
289-
unk34 = nullptr;
290-
unk38 = nullptr;
278+
mJointIndex = 0;
279+
mMtxCalcType = MACTOR_MTX_CALC_SOFTIMAGE;
280+
mMtxCalcBasic = nullptr;
281+
mMtxCalcSoftimage = nullptr;
282+
mMotionBlendCtrl = nullptr;
283+
mUserMtxCalc = nullptr;
291284
}
292285

293286
virtual void updateIn();
@@ -299,34 +292,34 @@ class MActorAnmBck : public MActorAnmEach<J3DAnmTransformKey> {
299292
}
300293

301294
void setModel(J3DModel* model);
302-
float getOldMotionBlendFrame() const;
303-
void setOldMotionBlendAnmPtr(J3DAnmTransform*);
295+
f32 getOldMotionBlendFrame() const;
296+
void setOldMotionBlendAnmPtr(J3DAnmTransform* anm_ptr);
304297
J3DAnmTransform* getOldMotionBlendAnmPtr() const;
305-
void setMotionBlendRatio(float);
306-
float getMotionBlendRatio() const;
298+
void setMotionBlendRatio(f32 ratio);
299+
f32 getMotionBlendRatio() const;
307300
void initNormalMotionBlend();
308301
void initSimpleMotionBlend(int);
309302
void changeMtxCalcType(u8);
310303

311304
// fabricated
312-
u8 getMtxCalcType() const { return unk2A; }
305+
u8 getMtxCalcType() const { return mMtxCalcType; }
313306

314307
// fabricated
315308
void setCalc(J3DMtxCalc* calc)
316309
{
317-
unk38 = calc;
318-
unk2A = MACTOR_MTX_CALC_USER;
310+
mUserMtxCalc = calc;
311+
mMtxCalcType = MACTOR_MTX_CALC_USER;
319312
}
320313

321-
void setUnk28(u16 value) { unk28 = value; }
314+
void setJointIndex(u16 value) { mJointIndex = value; }
322315

323316
private:
324-
/* 0x28 */ u16 unk28;
325-
/* 0x2A */ u8 unk2A;
326-
/* 0x2C */ J3DMtxCalcBasicAnm* unk2C;
327-
/* 0x30 */ J3DMtxCalcSoftimageAnm* unk30;
328-
/* 0x34 */ TMotionBlendCtrl* unk34;
329-
/* 0x38 */ J3DMtxCalc* unk38;
317+
/* 0x28 */ u16 mJointIndex;
318+
/* 0x2A */ u8 mMtxCalcType;
319+
/* 0x2C */ J3DMtxCalcBasicAnm* mMtxCalcBasic;
320+
/* 0x30 */ J3DMtxCalcSoftimageAnm* mMtxCalcSoftimage;
321+
/* 0x34 */ TMotionBlendCtrl* mMotionBlendCtrl;
322+
/* 0x38 */ J3DMtxCalc* mUserMtxCalc;
330323
};
331324

332325
#endif

0 commit comments

Comments
 (0)