summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhatal175 <hatal175@users.noreply.github.com>2026-01-08 16:53:40 +0200
committerGitHub <noreply@github.com>2026-01-08 07:53:40 -0700
commit2d4a8ee46a04ad49313f35c9062f8194de36deb2 (patch)
tree38ad1ae296aa9d245773e23de668ce2a7fa6d27b
parent0e7b42e9ea78e960647ce25528cf7b65a6ddfc9d (diff)
Work on d_debug_camera (#3024)
-rw-r--r--include/d/d_bg_s.h1
-rw-r--r--include/d/d_bg_w_base.h7
-rw-r--r--include/d/d_debug_camera.h2
-rw-r--r--src/d/actor/d_a_obj_bemos.cpp2
-rw-r--r--src/d/actor/d_a_obj_fallobj.cpp2
-rw-r--r--src/d/actor/d_a_obj_rotBridge.cpp2
-rw-r--r--src/d/actor/d_a_obj_smgdoor.cpp2
-rw-r--r--src/d/actor/d_a_obj_swLight.cpp2
-rw-r--r--src/d/actor/d_a_obj_tobyhouse.cpp2
-rw-r--r--src/d/d_bg_s.cpp11
-rw-r--r--src/d/d_debug_camera.cpp40
11 files changed, 47 insertions, 26 deletions
diff --git a/include/d/d_bg_s.h b/include/d/d_bg_s.h
index 2ce6493260..c0804bd07c 100644
--- a/include/d/d_bg_s.h
+++ b/include/d/d_bg_s.h
@@ -151,6 +151,7 @@ public:
u32 GetMtrlSndId(const cBgS_PolyInfo& param_0) { return dKy_pol_sound_get(&param_0); }
void DebugDrawPoly(dBgW_Base *param_1) {}
void DebugDrawPoly(dBgW_Base const& param_1) {}
+ void DrawPoly(cBgS_PolyInfo const& param_0, GXColor const& param_1);
fopAc_ac_c* GetActorPointer(cBgS_PolyInfo const& param_0) const { return cBgS::GetActorPointer(param_0); }
bool LineCross(cBgS_LinChk* i_linChk) {
#if DEBUG
diff --git a/include/d/d_bg_w_base.h b/include/d/d_bg_w_base.h
index e593093960..0eb10e977e 100644
--- a/include/d/d_bg_w_base.h
+++ b/include/d/d_bg_w_base.h
@@ -4,6 +4,7 @@
#include "SSystem/SComponent/c_bg_s_poly_info.h"
#include "SSystem/SComponent/c_bg_w.h"
#include "SSystem/SComponent/c_m3d_g_pla.h"
+#include "dolphin/gx.h"
#include "f_pc/f_pc_base.h"
class cBgS_GndChk;
@@ -104,6 +105,12 @@ public:
virtual void CallRideCallBack(fopAc_ac_c*, fopAc_ac_c*);
virtual void CallArrowStickCallBack(fopAc_ac_c*, fopAc_ac_c*, cXyz&);
+ #if DEBUG
+ virtual void DebugDraw() {}
+ virtual void DrawPoly(cBgS_PolyInfo const& param_0, GXColor const& param_1) {}
+ virtual void DebugBox() {}
+ #endif
+
PushPull_CallBack GetPushPullCallback() const { return m_pushPull_Callback; }
s16 GetDiffShapeAngleY() { return m_diff_ShapeAngleY; }
int GetRoomId() { return m_roomId; }
diff --git a/include/d/d_debug_camera.h b/include/d/d_debug_camera.h
index 854cf0ecfa..600e1beb10 100644
--- a/include/d/d_debug_camera.h
+++ b/include/d/d_debug_camera.h
@@ -161,7 +161,7 @@ public:
public:
/* 0x000 */ int field_0x0;
/* 0x004 */ int field_0x4;
- /* 0x008 */ u8 field_0x8[0x010 - 0x008];
+ /* 0x008 */ int field_0x8[2];
/* 0x010 */ cXyz field_0x10[32];
/* 0x190 */ cXyz field_0x190[32];
} /* 0x704 */ field_0x704;
diff --git a/src/d/actor/d_a_obj_bemos.cpp b/src/d/actor/d_a_obj_bemos.cpp
index 44a8c086e7..9f80da3f3e 100644
--- a/src/d/actor/d_a_obj_bemos.cpp
+++ b/src/d/actor/d_a_obj_bemos.cpp
@@ -1823,7 +1823,7 @@ void daObjBm_c::debugDraw() {
}
if (CHECK_DRAW) {
- mpBgW->CalcPlane();
+ mpBgW->DebugDraw();
}
}
#endif
diff --git a/src/d/actor/d_a_obj_fallobj.cpp b/src/d/actor/d_a_obj_fallobj.cpp
index 063df5327a..f5acf8a7b7 100644
--- a/src/d/actor/d_a_obj_fallobj.cpp
+++ b/src/d/actor/d_a_obj_fallobj.cpp
@@ -365,7 +365,7 @@ int daObjFallObj_c::Draw() {
#if DEBUG
if (l_HIO.mCheckDisplay) {
- mpBgW->CalcPlane();
+ mpBgW->DebugDraw();
daPy_py_c* player = daPy_getPlayerActorClass();
GXColor color = (GXColor){0xff, 0, 0, 0xff};
cXyz cStack_1c(attention_info.position);
diff --git a/src/d/actor/d_a_obj_rotBridge.cpp b/src/d/actor/d_a_obj_rotBridge.cpp
index cdc6e7fb42..bee843be0f 100644
--- a/src/d/actor/d_a_obj_rotBridge.cpp
+++ b/src/d/actor/d_a_obj_rotBridge.cpp
@@ -210,7 +210,7 @@ void daRotBridge_c::moveBridge() {
int daRotBridge_c::Draw() {
#if DEBUG
if (l_HIO.draw_wall_collision && mpBgW2 != NULL) {
- mpBgW2->CalcPlane();
+ mpBgW2->DebugDraw();
}
#endif
diff --git a/src/d/actor/d_a_obj_smgdoor.cpp b/src/d/actor/d_a_obj_smgdoor.cpp
index 7df8c9e12f..000df5e1c3 100644
--- a/src/d/actor/d_a_obj_smgdoor.cpp
+++ b/src/d/actor/d_a_obj_smgdoor.cpp
@@ -387,7 +387,7 @@ int daObjSmgDoor_c::Draw() {
#if DEBUG
if (l_HIO.field_0x6 != 0) {
- mpBgW->CalcPlane();
+ mpBgW->DebugDraw();
}
#endif
diff --git a/src/d/actor/d_a_obj_swLight.cpp b/src/d/actor/d_a_obj_swLight.cpp
index f5e8efc05f..688aea247c 100644
--- a/src/d/actor/d_a_obj_swLight.cpp
+++ b/src/d/actor/d_a_obj_swLight.cpp
@@ -437,7 +437,7 @@ int daObjSwLight_c::Draw() {
#if DEBUG
if (l_HIO.mCheckRendering) {
- mpBgW->CalcPlane();
+ mpBgW->DebugDraw();
}
#endif
diff --git a/src/d/actor/d_a_obj_tobyhouse.cpp b/src/d/actor/d_a_obj_tobyhouse.cpp
index 2c9738b6bb..beee845586 100644
--- a/src/d/actor/d_a_obj_tobyhouse.cpp
+++ b/src/d/actor/d_a_obj_tobyhouse.cpp
@@ -521,7 +521,7 @@ int daObjTobyHouse_c::Draw() {
#if DEBUG
if (l_HIO.mDrawCollision) {
- mpBgW->CalcPlane();
+ mpBgW->DebugDraw();
}
#endif
diff --git a/src/d/d_bg_s.cpp b/src/d/d_bg_s.cpp
index 256f343ca3..190e2badc9 100644
--- a/src/d/d_bg_s.cpp
+++ b/src/d/d_bg_s.cpp
@@ -789,6 +789,17 @@ fopAc_ac_c* dBgS::PushPullCallBack(cBgS_PolyInfo const& param_0, fopAc_ac_c* i_p
i_label);
}
+#if DEBUG
+
+void dBgS::DrawPoly(cBgS_PolyInfo const& polyInfo, GXColor const& color) {
+ dBgW_Base* pdBgw = dComIfG_Bgsp().GetBgWBasePointer(polyInfo);
+ if (pdBgw != NULL) {
+ pdBgw->DrawPoly(polyInfo, color);
+ }
+}
+
+#endif
+
bool dBgS_CheckBWallPoly(cBgS_PolyInfo const& poly) {
cM3dGPla pla;
diff --git a/src/d/d_debug_camera.cpp b/src/d/d_debug_camera.cpp
index d80eb3202b..32f281e527 100644
--- a/src/d/d_debug_camera.cpp
+++ b/src/d/d_debug_camera.cpp
@@ -519,26 +519,27 @@ int dDbgCamera_c::moveTool() {
mKeys[field_0x58] = PlaneKey();
}
- mRunKey.mCenter = mKeys[field_0x58].mCenter;
+ mRunKey = mKeys[field_0x58];
break;
}
+ cXyz* sp30;
+ fopAc_ac_c* player;
+
if (mCmdMode == 3) {
- fopAc_ac_c* sp2C = dComIfGp_getPlayer(0);
- /* if (this->unk730 != 0x3E7) {
- &field_0x704 = &sp2C->unk558
- this->unk730 = 0x3E7;
+ player = dComIfGp_getPlayer(0);
+ if (*(int*)&field_0x704.field_0x10[2].y != 999) {
+ *(cXyz*)&field_0x704.field_0x0 = player->attention_info.position;
+ *(int*)&field_0x704.field_0x10[2].y = 999;
} else {
- (sp15C, (Vec* ) &sp2C->unk558);
- &mRunKey.mCenter += sp15C
- &field_0x704 = &sp2C->unk558
- } */
+ mRunKey.mCenter += player->attention_info.position - *(cXyz*)&field_0x704.field_0x0;
+ *(cXyz*)&field_0x704.field_0x0 = player->attention_info.position;
+ }
} else {
- // this->unk730 = 3;
+ *(int*)&field_0x704.field_0x10[2].y = 3;
}
cXyz* var_r28;
- cXyz* sp30;
f32 temp_f31;
f32 var_f30;
f32 var_f29;
@@ -634,11 +635,9 @@ int dDbgCamera_c::moveTool() {
mRunKey.mBank -= cDegree(mCamSetup.FovyTick()) * 0.1f;
break;
case 8:
- s16 temp_r26 = mCamSetup.Rotate(var_f29 * (stick_x * field_0xc14));
- field_0x44.U(field_0x44.U() + temp_r26);
-
- temp_r26 = mCamSetup.Rotate(var_f29 * (stick_y * field_0xc14));
- field_0x44.V(field_0x44.V() + temp_r26);
+ field_0x44.U(field_0x44.U() + mCamSetup.Rotate(var_f29 * (stick_x * field_0xc14)));
+ field_0x44.V(field_0x44.V() + mCamSetup.Rotate(var_f29 * (stick_y * field_0xc14)));
+ break;
}
if (sp8 != 0) {
@@ -1697,11 +1696,14 @@ int dDbgCamera_c::DrawShape() {
if (mCamSetup.CheckFlag(0x10)) {
switch (mLchkNum) {
- case 2:
- // dComIfG_Bgsp().DrawPoly(mLchk[1], l_color2);
+ case 2: {
+ static GXColor l_color2 = {0xC0, 0x78, 0x0, 0x80};
+ dComIfG_Bgsp().DrawPoly(mLchk[1], l_color2);
/* fallthrough */
+ }
case 1:
- // dComIfG_Bgsp().DrawPoly(mLchk[0], l_color1);
+ static GXColor l_color1 = {0xC0, 0x78, 0x78, 0x80};
+ dComIfG_Bgsp().DrawPoly(mLchk[0], l_color1);
break;
}
}