Skip to content

Commit 51aea50

Browse files
committed
cc debug work
1 parent 6694c1b commit 51aea50

24 files changed

+675
-377
lines changed

include/SSystem/SComponent/c_bg_s_lin_chk.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
3636
void SetHit() { mStts |= STTS_HIT; }
3737
u32 ChkHit() const { return mStts & STTS_HIT; }
3838
void SetCross(const cXyz& pos) { mLin.SetEnd(pos); }
39-
cXyz* GetCrossP() { return &mLin.GetEndP(); }
39+
cXyz* GetCrossP() { return mLin.GetEndP(); }
4040
cM3dGLin* GetLinP() { return &mLin; }
4141
bool ChkBackFlag() const { return mBackFlag; }
4242
void OnBackFlag() { mBackFlag = true; }
@@ -45,13 +45,17 @@ class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo {
4545
bool GetPreWallChk() const { return mPreWallChk; }
4646
bool GetPreGroundChk() const { return mPreGroundChk; }
4747
bool GetPreRoofChk() const { return mPreRoofChk; }
48-
cXyz* GetStartP() { return &mLin.GetStartP(); }
48+
cXyz* GetStartP() { return mLin.GetStartP(); }
4949
void ClrSttsRoofOff() { mStts &= ~STTS_ROOF_OFF; }
5050
void SetSttsRoofOff() { mStts |= STTS_ROOF_OFF; }
5151
void ClrSttsWallOff() { mStts &= ~STTS_WALL_OFF; }
5252
void SetSttsWallOff() { mStts |= STTS_WALL_OFF; }
5353
void ClrSttsGroundOff() { mStts &= ~STTS_GROUND_OFF; }
5454
void SetSttsGroundOff() { mStts |= STTS_GROUND_OFF; }
55+
void ClearCheckIndex() { ClearPi(); }
56+
bool ChkSttsWallOff() const { return (mStts & STTS_WALL_OFF); }
57+
bool ChkSttsGroundOff() const { return (mStts & STTS_GROUND_OFF); }
58+
bool ChkSttsRoofOff() const { return (mStts & STTS_ROOF_OFF); }
5559
};
5660

5761
#endif /* C_BG_S_LIN_CHK_H */

include/SSystem/SComponent/c_cc_d.h

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ class cCcD_Stts {
188188
cXyz* GetCCMoveP() { return &m_cc_move; }
189189
fpc_ProcID GetApid() const { return m_apid; }
190190
u8 GetDmg() const { return m_dmg; }
191+
void ClrCo() { ClrCcMove(); }
191192
}; // Size = 0x1C
192193

193194
STATIC_ASSERT(0x1C == sizeof(cCcD_Stts));
@@ -213,7 +214,7 @@ class cCcD_ObjCommonBase {
213214
void ct();
214215
void SetSPrm(u32 sprm) { mSPrm = sprm; }
215216
s32 getSPrm() const { return mSPrm; }
216-
void setRPrm(s32 rprm) { mRPrm = rprm; }
217+
void SetRPrm(u32 rprm) { mRPrm = rprm; }
217218
s32 getRPrm() const { return mRPrm; }
218219
cCcD_Obj* GetHitObj() { return mHitObj; }
219220
const cCcD_Obj* GetHitObj() const { return mHitObj; }
@@ -222,6 +223,9 @@ class cCcD_ObjCommonBase {
222223
void OnSPrmBit(u32 flag) { mSPrm |= flag; }
223224
void OffSPrmBit(u32 flag) { mSPrm &= ~flag; }
224225
u32 ChkSPrm(u32 prm) const { return MskSPrm(prm) != 0; }
226+
void SetHitObj(cCcD_Obj* pobj) { mHitObj = pobj; }
227+
void ClrRPrm(u32 prm) { mRPrm &= ~prm; }
228+
void ClrObj() { mHitObj = NULL; }
225229

226230
void Set(cCcD_SrcObjCommonBase const& src) { mSPrm = src.mSPrm; }
227231
};
@@ -240,7 +244,7 @@ class cCcD_ObjAt : public cCcD_ObjCommonBase {
240244
void ClrHit();
241245
int GetType() const { return mType; }
242246
u32 GetGrp() const { return MskSPrm(0x1E); }
243-
bool ChkSet() const { return MskSPrm(1); }
247+
BOOL ChkSet() const { return MskSPrm(1); }
244248
u8 GetAtp() const { return mAtp; }
245249
u32 MskType(u32 msk) const { return mType & msk; }
246250
void SetType(u32 type) { mType = type; }
@@ -269,7 +273,7 @@ class cCcD_ObjTg : public cCcD_ObjCommonBase {
269273
int GetType() const { return mType; }
270274
void SetType(u32 type) { mType = type; }
271275
u32 GetGrp() const { return MskSPrm(0x1E); }
272-
bool ChkSet() const { return MskSPrm(1); }
276+
BOOL ChkSet() const { return MskSPrm(1); }
273277
void ClrSet() { OffSPrmBit(1); }
274278
u32 ChkHit() const { return MskRPrm(1); }
275279

@@ -289,7 +293,7 @@ class cCcD_ObjCo : public cCcD_ObjCommonBase {
289293
void SetIGrp(u32);
290294
void SetVsGrp(u32);
291295
u32 GetGrp() const { return MskSPrm(0x1E); }
292-
bool ChkSet() const { return MskSPrm(1); }
296+
BOOL ChkSet() const { return MskSPrm(1); }
293297
u32 GetVsGrp() const { return MskSPrm(0x70); }
294298
u32 GetIGrp() const { return MskSPrm(0xE); }
295299
u32 ChkNoCrr() const { return MskSPrm(0x100); }
@@ -323,19 +327,19 @@ class cCcD_ObjHitInf {
323327
u32 GetCoGrp() const { return mObjCo.GetGrp(); }
324328
int GetTgType() const { return mObjTg.GetType(); }
325329
u32 GetAtType() const { return mObjAt.GetType(); }
326-
bool ChkTgSet() const { return mObjTg.ChkSet(); }
327-
bool ChkAtSet() const { return mObjAt.ChkSet(); }
328-
bool ChkCoSet() const { return mObjCo.ChkSet(); }
329-
u32 ChkCoSameActorHit() const { return mObjCo.ChkCoSameActorHit(); }
330+
BOOL ChkTgSet() const { return mObjTg.ChkSet(); }
331+
BOOL ChkAtSet() const { return mObjAt.ChkSet(); }
332+
BOOL ChkCoSet() const { return mObjCo.ChkSet(); }
333+
u32 ChkCoSameActorHit() { return mObjCo.MskSPrm(0x400); }
330334
void OnCoSameActorHit() { mObjCo.OnCoSameActorHit(); }
331335
void OffCoSameActorHit() { mObjCo.OffCoSameActorHit(); }
332336
u32 GetCoVsGrp() const { return mObjCo.GetVsGrp(); }
333337
u32 GetCoIGrp() const { return mObjCo.GetIGrp(); }
334338
u8 GetAtAtp() const { return mObjAt.GetAtp(); }
335339
u32 ChkAtNoTgHitInfSet() const { return mObjAt.MskSPrm(0x20); }
336340
u32 ChkTgNoAtHitInfSet() const { return mObjTg.MskSPrm(0x20); }
337-
u32 ChkCoNoCoHitInfSet() const { return mObjCo.MskSPrm(0x200); }
338-
bool ChkTgNoSlingHitInfSet() const { return mObjTg.MskSPrm(0x40); }
341+
u32 ChkCoNoCoHitInfSet() { return mObjCo.MskSPrm(0x200); }
342+
BOOL ChkTgNoSlingHitInfSet() { return mObjTg.MskSPrm(0x40); }
339343
void SetAtHit(cCcD_Obj* obj) { mObjAt.SetHit(obj); }
340344
void SetTgHit(cCcD_Obj* obj) { mObjTg.SetHit(obj); }
341345
void SetCoHit(cCcD_Obj* obj) { mObjCo.SetHit(obj); }
@@ -430,7 +434,6 @@ class cCcD_ShapeAttr {
430434
/* vt[21]*/ virtual void getShapeAccess(cCcD_ShapeAttr::Shape*) const;
431435

432436
cM3dGAab& GetWorkAab() { return mAab; }
433-
cM3dGAab const& GetWorkAab() const { return mAab; }
434437

435438
static cXyz m_virtual_center;
436439
};
@@ -456,7 +459,7 @@ class cCcD_Obj : public cCcD_ObjHitInf {
456459
void SetStts(cCcD_Stts* stts) { mStts = stts; }
457460
cCcD_DivideInfo& GetDivideInfo() { return mDivideInfo; }
458461
cCcD_DivideInfo* GetPDivideInfo() { return &mDivideInfo; }
459-
int ChkBsRevHit() const { return mFlags & 2; }
462+
int ChkBsRevHit() { return mFlags & 2; }
460463

461464
private:
462465
/* 0x040 */ int mFlags;

include/SSystem/SComponent/c_cc_s.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class cCcS {
1616
/* 0x1000 */ cCcD_Obj* mpObjCo[0x100];
1717
/* 0x1400 */ cCcD_Obj* mpObj[0x500];
1818
#if DEBUG
19-
/* 0x2800 */ int m_debug_code;
19+
/* 0x2800 */ u32 m_debug_code;
2020
#endif
2121
/* 0x2800 */ u16 mObjAtCount;
2222
/* 0x2802 */ u16 mObjTgCount;

include/SSystem/SComponent/c_m3d_g_aab.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ class cM3dGAab {
1818
bool CrossY(const cXyz*) const;
1919
bool UnderPlaneYUnder(f32) const;
2020
bool TopPlaneYUnder(f32) const;
21-
void ClearForMinMax(void);
21+
void ClearForMinMax();
2222
void SetMinMax(const cXyz&);
2323
void SetMinMax(const cM3dGAab&);
2424
void SetMin(const cXyz&);
2525
void SetMax(const cXyz&);
2626
void CalcCenter(cXyz*) const;
2727
void PlusR(f32);
28-
const cXyz* GetMaxP(void) const { return &mMax; }
29-
cXyz* GetMaxP(void) { return &mMax; }
30-
const cXyz* GetMinP(void) const { return &mMin; }
31-
cXyz* GetMinP(void) { return &mMin; }
32-
const f32 GetMaxX(void) const { return mMax.x; }
33-
const f32 GetMaxY(void) const { return mMax.y; }
34-
const f32 GetMaxZ(void) const { return mMax.z; }
35-
const f32 GetMinX(void) const { return mMin.x; }
36-
const f32 GetMinY(void) const { return mMin.y; }
37-
const f32 GetMinZ(void) const { return mMin.z; }
28+
const cXyz* GetMaxP() const { return &mMax; }
29+
cXyz* GetMaxP() { return &mMax; }
30+
const cXyz* GetMinP() const { return &mMin; }
31+
cXyz* GetMinP() { return &mMin; }
32+
const f32 GetMaxX() const { return mMax.x; }
33+
const f32 GetMaxY() const { return mMax.y; }
34+
const f32 GetMaxZ() const { return mMax.z; }
35+
const f32 GetMinX() const { return mMin.x; }
36+
const f32 GetMinY() const { return mMin.y; }
37+
const f32 GetMinZ() const { return mMin.z; }
3838
bool Cross(const cM3dGLin *param_1) const {
39-
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), (Vec*)&param_1->GetStartP(), (Vec*)&param_1->GetEndP());
39+
return cM3d_Cross_MinMaxBoxLine(GetMinP(), GetMaxP(), param_1->GetStartP(), param_1->GetEndP());
4040
}
4141
bool Cross(const cM3dGAab *param_1) const {
4242
return cM3d_Cross_AabAab(this, param_1);

include/SSystem/SComponent/c_m3d_g_cps.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "SSystem/SComponent/c_m3d.h"
55
#include "SSystem/SComponent/c_m3d_g_lin.h"
6+
#include "SSystem/SComponent/c_m3d_g_tri.h"
67

78
struct cM3dGCpsS {
89
/* 0x00 */ Vec mStart;
@@ -14,8 +15,8 @@ class cM3dGCps : public cM3dGLin {
1415
public:
1516
/* 0x1C */ f32 mRadius;
1617

17-
cM3dGCps(void);
18-
virtual ~cM3dGCps(void);
18+
cM3dGCps();
19+
virtual ~cM3dGCps();
1920
void Set(const cXyz&, const cXyz&, f32);
2021
void Set(const cM3dGCpsS&);
2122
void SetCps(const cM3dGCps&);
@@ -24,6 +25,7 @@ class cM3dGCps : public cM3dGLin {
2425
}
2526
bool Cross(cM3dGCyl const* cyl, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*this, *cyl, xyz); }
2627
bool Cross(cM3dGSph const* sph, cXyz* xyz) const { return cM3d_Cross_CpsSph(*this, *sph, xyz); }
28+
bool Cross(cM3dGTri const& tri, cXyz* xyz) const { return cM3d_Cross_CpsTri(*this, tri, xyz); }
2729
void SetR(f32 r) { mRadius = r; }
2830
f32 GetR() const { return mRadius; }
2931

include/SSystem/SComponent/c_m3d_g_cyl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class cM3dGCyl {
4040

4141
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsCyl(*cps, *this, xyz); }
4242
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_CylTri(this, &tri, xyz); }
43-
bool Cross(const cM3dGCyl* other, f32* f) const { return cM3d_Cross_CylCyl(this, other, f); }
44-
bool Cross(const cM3dGSph* sph, f32* f) const { return cM3d_Cross_CylSph(this, sph, f); }
43+
bool cross(const cM3dGCyl* other, f32* f) const { return cM3d_Cross_CylCyl(this, other, f); }
44+
bool cross(const cM3dGSph* sph, f32* f) const { return cM3d_Cross_CylSph(this, sph, f); }
4545
}; // Size = 0x18
4646

4747
STATIC_ASSERT(0x18 == sizeof(cM3dGCyl));

include/SSystem/SComponent/c_m3d_g_lin.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ class cM3dGLin {
2222
void SetEnd(const cXyz&);
2323

2424
void set(const Vec& i_start, const Vec& i_end) { SetStartEnd(i_start, i_end); }
25-
const cXyz& GetStartP(void) const { return mStart; }
26-
cXyz& GetStartP(void) { return mStart; }
25+
const cXyz* GetStartP() const { return &mStart; }
26+
cXyz* GetStartP() { return &mStart; }
2727
cXyz& GetStart() { return mStart; }
2828
const cXyz& GetStart() const { return mStart; }
2929

30-
const cXyz& GetEndP(void) const { return mEnd; }
31-
cXyz& GetEndP(void) { return mEnd; }
30+
const cXyz* GetEndP() const { return &mEnd; }
31+
cXyz* GetEndP() { return &mEnd; }
3232
cXyz& GetEnd() { return mEnd; }
3333
const cXyz& GetEnd() const { return mEnd; }
3434
f32 GetLen() const { return PSVECDistance(&mStart, &mEnd); }

include/SSystem/SComponent/c_m3d_g_sph.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ class cM3dGSph {
3939
f32 GetCY(void) const { return mCenter.y; }
4040
f32 GetCZ(void) const { return mCenter.z; }
4141

42-
bool Cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); }
42+
bool cross(const cM3dGSph* other, f32* f) const { return cM3d_Cross_SphSph(this, other, f); }
4343
bool Cross(const cM3dGCps* cps, cXyz* xyz) const { return cM3d_Cross_CpsSph(*cps, *this, xyz); }
44-
bool Cross(const cM3dGCyl* cyl, f32* f) const { return cM3d_Cross_CylSph(cyl, this, f); }
44+
bool cross(const cM3dGCyl* cyl, f32* f) const { return cM3d_Cross_CylSph(cyl, this, f); }
45+
bool Cross(const cM3dGTri& tri, cXyz* xyz) const { return cM3d_Cross_SphTri(this, &tri, xyz); }
4546
}; // Size = 0x14
4647

4748
STATIC_ASSERT(0x14 == sizeof(cM3dGSph));

include/SSystem/SComponent/c_m3d_g_tri.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ class cM3dGTri : public cM3dGPla {
2525
void setPos(const Vec*, const Vec*, const Vec*);
2626
void setBg(const Vec*, const Vec*, const Vec*, const cM3dGPla*);
2727
void set(const Vec*, const Vec*, const Vec*, const Vec*);
28-
bool Cross(cM3dGCps const& cps, cXyz* xyz) const { return cM3d_Cross_CpsTri(cps, *this, xyz); }
29-
bool Cross(cM3dGCyl const& cyl, cXyz* xyz) const { return this->cross(&cyl, xyz); }
30-
bool Cross(cM3dGSph const& sph, cXyz* xyz) const { return cM3d_Cross_SphTri(&sph, this, xyz); }
31-
bool Cross(cM3dGTri const& other, cXyz* xyz) const {
28+
bool Cross(cM3dGCps const& cps, Vec* xyz) const { return cM3d_Cross_CpsTri(cps, *this, xyz); }
29+
bool Cross(cM3dGCyl const& cyl, Vec* xyz) const { return this->cross(&cyl, xyz); }
30+
bool Cross(cM3dGSph const& sph, Vec* xyz) const { return cM3d_Cross_SphTri(&sph, this, xyz); }
31+
bool Cross(cM3dGTri const& other, Vec* xyz) const {
3232
return cM3d_Cross_TriTri(*this, other, xyz);
3333
}
3434
bool cross(const cM3dGLin* lin, Vec* xyz, bool param_2, bool param_3) const {

include/d/d_cc_d.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class dCcD_GAtTgCoCommonBase {
144144
void ClrEffCounter() { mEffCounter = 0; }
145145
u32 GetGFlag() const { return mGFlag; }
146146
u32 GetRPrm() const { return mRPrm; }
147-
u32 MskSPrm(u32 mask) const { return mGFlag & mask; }
147+
u32 MskSPrm(u32 mask) { return mGFlag & mask; }
148148
u32 MskRPrm(u32 mask) const { return mRPrm & mask; }
149149
bool ChkSPrm(u32 mask) { return MskSPrm(mask); }
150150
void OnSPrm(u32 flag) { mGFlag |= flag; }
@@ -173,7 +173,7 @@ class dCcD_GObjAt : public dCcD_GAtTgCoCommonBase {
173173
u8 GetSe() { return mSe; }
174174
dCcG_At_Spl GetSpl() { return (dCcG_At_Spl)mSpl; }
175175
u8 GetMtrl() { return mMtrl; }
176-
u8 GetHitMark() { return mHitMark; }
176+
int GetHitMark() { return mHitMark; }
177177
void SetRVec(cXyz& vec) { mRVec = vec; }
178178
void SetHitPos(cXyz& pos) { mHitPos = pos; }
179179
cXyz* GetHitPosP() { return &mHitPos; }
@@ -203,10 +203,10 @@ class dCcD_GObjTg : public dCcD_GAtTgCoCommonBase {
203203
void SetHitMark(CcG_Tg_HitMark mark) { mHitMark = mark; }
204204
s16* GetShieldFrontRangeYAngle() { return mShieldFrontRangeYAngle; }
205205
s16 GetShieldRange() { return mShieldRange; }
206-
u8 GetSpl() { return mSpl; }
206+
int GetSpl() { return mSpl; }
207207
void SetSpl(dCcG_Tg_Spl tg_spl) { mSpl = tg_spl; }
208208
void SetSpl(u8 tg_spl) { mSpl = tg_spl; }
209-
u8 GetHitMark() { return mHitMark; }
209+
int GetHitMark() { return mHitMark; }
210210
void SetRVec(cXyz& vec) { mRVec = vec; }
211211
cXyz* GetVecP() { return &mVec; }
212212
cXyz* GetRVecP() { return &mRVec; }
@@ -250,7 +250,7 @@ class dCcD_GStts : public cCcD_GStts {
250250
void SetRoomId(int id) { mRoomId = id; }
251251
fpc_ProcID GetAtOldApid() { return mAtOldApid; }
252252
fpc_ProcID GetTgOldApid() { return mTgOldApid; }
253-
bool ChkNoActor() { return field_0x1C & 1;}
253+
BOOL ChkNoActor() { return field_0x1C & 1;}
254254
bool ChkNoneActorPerfTblId() { return field_0x08 == 0xFFFF; }
255255
dCcG_At_Spl GetAtSpl() { return (dCcG_At_Spl)mAt; }
256256
void SetAtSpl(dCcG_At_Spl spl) { mAt = spl; }

0 commit comments

Comments
 (0)