summaryrefslogtreecommitdiff
path: root/soh/src/code
diff options
context:
space:
mode:
authorrozlette <Rozelette@users.noreply.github.com>2022-04-08 17:11:21 -0500
committerKenix3 <kenixwhisperwind@gmail.com>2022-05-01 01:27:00 -0400
commite4dd7027a9f4f36a199545dc30e05955444030be (patch)
treec5fed668be469e3b437ecd2249f1c2b387d4283d /soh/src/code
parentd009c2a539653649fd306b726d5167f1a044a9f1 (diff)
POC
Diffstat (limited to 'soh/src/code')
-rw-r--r--soh/src/code/z_play.c60
1 files changed, 58 insertions, 2 deletions
diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c
index 6218b7d76..6cb04bec3 100644
--- a/soh/src/code/z_play.c
+++ b/soh/src/code/z_play.c
@@ -1222,8 +1222,64 @@ void Gameplay_Draw(GlobalContext* globalCtx) {
sp80 = HREG(84);
}
Scene_Draw(globalCtx);
- Room_Draw(globalCtx, &globalCtx->roomCtx.curRoom, sp80 & 3);
- Room_Draw(globalCtx, &globalCtx->roomCtx.prevRoom, sp80 & 3);
+ //Room_Draw(globalCtx, &globalCtx->roomCtx.curRoom, sp80 & 3);
+ //Room_Draw(globalCtx, &globalCtx->roomCtx.prevRoom, sp80 & 3);
+
+ Vec3f asd = { 0.0f, 0.0f, 0.0f };
+ func_800342EC(&asd, globalCtx);
+ //func_80093C80(globalCtx);
+ {
+ uint32_t rm;
+ uint32_t blc1;
+ uint32_t blc2;
+
+
+ rm = Z_CMP | Z_UPD | CVG_DST_CLAMP | FORCE_BL;
+ blc1 = GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1);
+ blc2 = GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1);
+ rm |= ZMODE_OPA;
+
+ gSPLoadGeometryMode(POLY_OPA_DISP++, G_ZBUFFER | G_SHADE | G_LIGHTING);
+ gSPTexture(POLY_OPA_DISP++, 0, 0, 0, G_TX_RENDERTILE, G_OFF);
+
+ //gDPPipeSync(POLY_OPA_DISP++);
+ gDPSetCycleType(POLY_OPA_DISP++, G_CYC_1CYCLE);
+ gDPSetRenderMode(POLY_OPA_DISP++, rm | blc1, rm | blc2);
+ gDPSetCombineMode(POLY_OPA_DISP++, G_CC_HILITERGB, G_CC_HILITERGB);
+ gDPSetEnvColor(POLY_OPA_DISP++, 0xFF, 0xFF, 0xFF, 0xFF);
+ }
+ gSPMatrix(POLY_OPA_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
+ gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 0xFF, 0, 0, 0xFF);
+
+ CollisionHeader* col = globalCtx->colCtx.colHeader;
+ //for (int i = 0; i < col->numPolygons; i++) {
+ for (int i = 0; i < col->numPolygons / 2; i++) {
+ CollisionPoly* poly = &col->polyList[i];
+ u16 a = poly->flags_vIA & 0x1FFF;
+ u16 b = poly->flags_vIB & 0x1FFF;
+ u16 c = poly->vIC & 0x1FFF;
+
+ Vec3s* va = &col->vtxList[a];
+ Vec3s* vb = &col->vtxList[b];
+ Vec3s* vc = &col->vtxList[c];
+#define qs105(n) ((int16_t)((n)*0x0020))
+#define gdSPDefVtxN(x, y, z, s, t, nx, ny, nz, ca) \
+ ((Vtx){ .n = { .ob = { x, y, z }, .tc = { qs105(s), qs105(t) }, .n = { nx, ny, nz }, .a = ca } })
+ Vtx v[3] = {
+ gdSPDefVtxN(va->x, va->y, va->z, 0, 0, poly->normal.x / 0x100, poly->normal.y / 0x100,
+ poly->normal.z / 0x100, 0xFF),
+ gdSPDefVtxN(vb->x, vb->y, vb->z, 0, 0, poly->normal.x / 0x100, poly->normal.y / 0x100,
+ poly->normal.z / 0x100, 0xFF),
+ gdSPDefVtxN(vc->x, vc->y, vc->z, 0, 0, poly->normal.x / 0x100, poly->normal.y / 0x100,
+ poly->normal.z / 0x100, 0xFF),
+ };
+
+ void* vtxBuf = Graph_Alloc(gfxCtx, sizeof(Vtx) * 3);
+ memcpy(vtxBuf, v, sizeof(Vtx) * 3);
+ gSPVertex(POLY_OPA_DISP++, vtxBuf, 3, 0);
+ gSP1Triangle(POLY_OPA_DISP++, 0, 1, 2, 0);
+
+ }
}
}