summaryrefslogtreecommitdiff
path: root/src/apDebug.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-12-08 06:47:53 +0100
committerTreeki <treeki@gmail.com>2012-12-08 06:47:53 +0100
commit3e1eddbcca15042a7a63f29f5db3ce66237355b9 (patch)
treec71c3479d714df558e333f4120133b1c6c0aa9e6 /src/apDebug.cpp
parente7801309b3862b052e6cb43946fea889cd297cd9 (diff)
downloadkamek-3e1eddbcca15042a7a63f29f5db3ce66237355b9.tar.gz
kamek-3e1eddbcca15042a7a63f29f5db3ce66237355b9.zip
assorted updates and fixes
Diffstat (limited to '')
-rw-r--r--src/apDebug.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/apDebug.cpp b/src/apDebug.cpp
index f485474..ee31c28 100644
--- a/src/apDebug.cpp
+++ b/src/apDebug.cpp
@@ -241,4 +241,72 @@ void APDebugDrawer::drawXlu() {
p = p->next;
}
+
+
+ // Now, the hardest one.. CollisionMgr_c!
+ fBase_c *fb = 0;
+ while ((fb = fBase_c::searchByBaseType(2, fb))) {
+ u8 *testMe = ((u8*)fb) + 0x1EC;
+ if (*((u32*)testMe) != 0x8030F6D0)
+ continue;
+
+ u32 uptr = (u32)fb;
+ u8 r = u8((uptr>>16)&0xFF)+0x20;
+ u8 g = u8((uptr>>8)&0xFF)-0x30;
+ u8 b = u8(uptr&0xFF)+0x80;
+ u8 a = 0xFF;
+
+ dStageActor_c *ac = (dStageActor_c*)fb;
+
+ sensorBase_s *sensors[4] = {
+ ac->collMgr.pBelowInfo, ac->collMgr.pAboveInfo,
+ ac->collMgr.pAdjacentInfo, ac->collMgr.pAdjacentInfo};
+
+ for (int i = 0; i < 4; i++) {
+ sensorBase_s *s = sensors[i];
+ if (!s)
+ continue;
+
+ float mult = (i == 3) ? -1.0f : 1.0f;
+
+ switch (s->flags & SENSOR_TYPE_MASK) {
+ case SENSOR_POINT:
+ GXBegin(GX_POINTS, GX_VTXFMT0, 1);
+ GXPosition3f32(
+ ac->pos.x + (mult * (s->asPoint()->x / 4096.0f)),
+ ac->pos.y + (s->asPoint()->y / 4096.0f),
+ 8005.0f);
+ GXColor4u8(r,g,b,a);
+ GXEnd();
+ break;
+ case SENSOR_LINE:
+ GXBegin(GX_LINES, GX_VTXFMT0, 2);
+ if (i < 2) {
+ GXPosition3f32(
+ ac->pos.x + (s->asLine()->lineA / 4096.0f),
+ ac->pos.y + (s->asLine()->distanceFromCenter / 4096.0f),
+ 8005.0f);
+ GXColor4u8(r,g,b,a);
+ GXPosition3f32(
+ ac->pos.x + (s->asLine()->lineB / 4096.0f),
+ ac->pos.y + (s->asLine()->distanceFromCenter / 4096.0f),
+ 8005.0f);
+ GXColor4u8(r,g,b,a);
+ } else {
+ GXPosition3f32(
+ ac->pos.x + (mult * (s->asLine()->distanceFromCenter / 4096.0f)),
+ ac->pos.y + (s->asLine()->lineA / 4096.0f),
+ 8005.0f);
+ GXColor4u8(r,g,b,a);
+ GXPosition3f32(
+ ac->pos.x + (mult * (s->asLine()->distanceFromCenter / 4096.0f)),
+ ac->pos.y + (s->asLine()->lineB / 4096.0f),
+ 8005.0f);
+ GXColor4u8(r,g,b,a);
+ }
+ GXEnd();
+ break;
+ }
+ }
+ }
}