summaryrefslogtreecommitdiff
path: root/src/apDebug.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-12-08 14:13:53 -0600
committerColin Noga <Tempus@chronometry.ca>2012-12-08 14:13:53 -0600
commitda3aa8b641e21a766b4212385e434ff2f9927e98 (patch)
tree16ed9a79f04bbc4bfdc0bb6b1b4d551df044c812 /src/apDebug.cpp
parent16d563a330e1a3190b6212a0bca2a4c80e2b5cff (diff)
parent3e1eddbcca15042a7a63f29f5db3ce66237355b9 (diff)
downloadkamek-da3aa8b641e21a766b4212385e434ff2f9927e98.tar.gz
kamek-da3aa8b641e21a766b4212385e434ff2f9927e98.zip
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/apDebug.cpp')
-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;
+ }
+ }
+ }
}