diff options
| author | hatal175 <hatal175@users.noreply.github.com> | 2025-12-29 14:12:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-29 04:12:01 -0800 |
| commit | e77f841d351a2623490acdf0913eaf8f97f844d2 (patch) | |
| tree | 7e1b0b2f04f945cb053899eef9fbf2041e212c41 /src/d/d_cc_d.cpp | |
| parent | 1f391dc5bde660c21b4f9d5cf942049f94c6ac2e (diff) | |
Work on d_cc_d debug (#3002)
Diffstat (limited to 'src/d/d_cc_d.cpp')
| -rw-r--r-- | src/d/d_cc_d.cpp | 89 |
1 files changed, 81 insertions, 8 deletions
diff --git a/src/d/d_cc_d.cpp b/src/d/d_cc_d.cpp index 5a76e1b4c0..cf09711b3e 100644 --- a/src/d/d_cc_d.cpp +++ b/src/d/d_cc_d.cpp @@ -4,6 +4,10 @@ #include "f_op/f_op_actor_mng.h" #include "f_pc/f_pc_searcher.h" +#if DEBUG +#include "d/d_debug_viewer.h" +#endif + void dCcD_GAtTgCoCommonBase::ClrActorInfo() { mApid = -1; mAc = NULL; @@ -51,7 +55,10 @@ void dCcD_GAtTgCoCommonBase::SubtractEffCounter() { } bool dCcD_GAtTgCoCommonBase::ChkEffCounter() { - return mEffCounter > 0; + if (mEffCounter > 0) { + return true; + } + return false; } dCcD_GStts::dCcD_GStts() { @@ -197,7 +204,11 @@ cCcD_GObjInf* dCcD_GObjInf::GetAtHitGObj() { } u8 dCcD_GObjInf::ChkAtNoGuard() { - return GetAtSpl() >= 12; + dCcG_At_Spl spl = GetAtSpl(); + if (spl >= 12) { + return 1; + } + return 0; } void dCcD_GObjInf::ClrTgHit() { @@ -313,8 +324,11 @@ void dCcD_GObjInf::Set(dCcD_SrcGObjInf const& src) { mGObjCo.Set(src.mGObjCo); } -dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* p_obj) { - return (dCcD_GObjInf*)p_obj->GetGObjInf(); +dCcD_GObjInf* dCcD_GetGObjInf(cCcD_Obj* pobj) { + JUT_ASSERT(687, pobj != NULL); + cCcD_GObjInf* cgobj = pobj->GetGObjInf(); + dCcD_GObjInf* dgobj = (dCcD_GObjInf*)cgobj; + return dgobj; } cCcD_ShapeAttr* dCcD_Pnt::GetShapeAttr() { @@ -340,17 +354,57 @@ void dCcD_Cps::CalcTgVec() { CalcVec(dest); } +#if DEBUG + +void dCcD_Cps::Draw(const GXColor& color) { + Mtx auStack_68; + Mtx auStack_98; + Mtx auStack_c8; + + MTXIdentity(auStack_68); + + cXyz cStack_d8; + CalcVec(&cStack_d8); + cMtx_trans(auStack_98, GetStartP().x, GetStartP().y, GetStartP().z); + cM3d_UpMtx(cStack_d8, auStack_c8); + cMtx_concat(auStack_98, auStack_c8, auStack_68); + cMtx_scale(auStack_98, GetR(), 0.5f * GetLen(), GetR()); + cMtx_concat(auStack_68, auStack_98, auStack_68); + cMtx_trans(auStack_98, 0.0f, 1.0f, 0.0f); + cMtx_concat(auStack_68, auStack_98, auStack_68); + cMtx_XrotS(auStack_98, 0x4000); + cMtx_concat(auStack_68, auStack_98, auStack_68); + dDbVw_drawCylinderMXlu(auStack_68, color, 1); + dDbVw_drawSphereXlu(GetStartP(), GetR(), color, 1); + dDbVw_drawSphereXlu(GetEndP(), GetR(), color, 1); +} + +#endif + void dCcD_Tri::Set(dCcD_SrcTri const& src) { dCcD_GObjInf::Set(src.mObjInf); + cCcD_TriAttr* attr = this; } cCcD_ShapeAttr* dCcD_Tri::GetShapeAttr() { return this; } +#if DEBUG + +void dCcD_Tri::Draw(const GXColor& color) { + cXyz cStack_34[3]; + cStack_34[0] = mA; + cStack_34[1] = mB; + cStack_34[2] = mC; + dDbVw_drawTriangleXlu(cStack_34, color, 1); +} + +#endif + void dCcD_Cyl::Set(dCcD_SrcCyl const& src) { dCcD_GObjInf::Set(src.mObjInf); - cCcD_CylAttr::Set(src.mCyl); + cCcD_CylAttr::Set(src.mCylAttr); } cCcD_ShapeAttr* dCcD_Cyl::GetShapeAttr() { @@ -365,18 +419,28 @@ void dCcD_Cyl::StartCAt(cXyz& pos) { void dCcD_Cyl::MoveCAt(cXyz& pos) { const cXyz* center = GetCP(); - cXyz diff = pos - *center; + cXyz diff; + diff = pos - *center; SetAtVec(diff); SetC(pos); } void dCcD_Cyl::MoveCTg(cXyz& pos) { const cXyz* center = GetCP(); - cXyz diff = pos - *center; + cXyz diff; + diff = pos - *center; SetTgVec(diff); SetC(pos); } +#if DEBUG + +void dCcD_Cyl::Draw(const GXColor& color) { + dDbVw_drawCylinderXlu(*GetCP(), GetR(), GetH(), color, 1); +} + +#endif + void dCcD_Sph::Set(dCcD_SrcSph const& src) { dCcD_GObjInf::Set(src.mObjInf); cCcD_SphAttr::Set(src.mSphAttr); @@ -390,7 +454,8 @@ void dCcD_Sph::StartCAt(cXyz& pos) { void dCcD_Sph::MoveCAt(cXyz& pos) { const cXyz* center = GetCP(); - cXyz diff = pos - *center; + cXyz diff; + diff = pos - *center; SetAtVec(diff); SetC(pos); } @@ -398,3 +463,11 @@ void dCcD_Sph::MoveCAt(cXyz& pos) { cCcD_ShapeAttr* dCcD_Sph::GetShapeAttr() { return this; } + +#if DEBUG + +void dCcD_Sph::Draw(const GXColor& color) { + dDbVw_drawSphereXlu(*GetCP(), GetR(), color, 1); +} + +#endif |
