summaryrefslogtreecommitdiff
path: root/src/wm_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wm_map.cpp')
-rw-r--r--src/wm_map.cpp94
1 files changed, 93 insertions, 1 deletions
diff --git a/src/wm_map.cpp b/src/wm_map.cpp
index 4520a00..a4b8a48 100644
--- a/src/wm_map.cpp
+++ b/src/wm_map.cpp
@@ -1,4 +1,89 @@
#include "worldmap.h"
+#include <rvl/PPCWGPipe.h>
+#include <rvl/GXEnum.h>
+#include <rvl/GXCull.h>
+#include <rvl/GXVert.h>
+#include <rvl/GXTev.h>
+#include <rvl/GXGeometry.h>
+#include <rvl/GXTexture.h>
+#include <rvl/GXLighting.h>
+#include <rvl/GXPixel.h>
+#include <rvl/GXTransform.h>
+
+
+void dPathTest_c::drawOpa() {
+ GXClearVtxDesc();
+ GXSetVtxDesc(GX_VA_POS, GX_DIRECT);
+ GXSetVtxDesc(GX_VA_TEX0, GX_DIRECT);
+ GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_POS, GX_POS_XYZ, GX_F32, 0);
+ GXSetVtxAttrFmt(GX_VTXFMT0, GX_VA_TEX0, GX_TEX_ST, GX_F32, 0);
+
+ m3d::DisableIndirectTexturing();
+
+ GXSetNumChans(0);
+
+ GXSetNumTexGens(1);
+ GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX2x4, GX_TG_NRM, GX_IDENTITY, GX_FALSE, GX_PTIDENTITY);
+
+ GXSetNumTevStages(0);
+ GXSetTevSwapModeTable(GX_TEV_SWAP0, GX_CH_RED, GX_CH_GREEN, GX_CH_BLUE, GX_CH_ALPHA);
+
+ GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR0A0);
+ GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_TEXC, GX_CC_ZERO);
+ GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_C1, GX_CC_C0, GX_CC_C0, GX_CC_ZERO);
+ GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
+ GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_TEXA, GX_CA_ZERO);
+ GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_A0, GX_CA_A1, GX_CA_ZERO);
+ GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, GX_TRUE, GX_TEVPREV);
+ //GXSetTevOp(GX_TEVSTAGE0, GX_PASSCLR);
+
+ GXSetZCompLoc(0);
+ GXSetBlendMode(GX_BM_BLEND, GX_BL_SRCALPHA, GX_BL_INVSRCALPHA, GX_LO_SET);
+ GXSetZMode(GX_TRUE, GX_LEQUAL, GX_FALSE);
+ GXSetAlphaCompare(GX_GREATER, 0, GX_AOP_OR, GX_GREATER, 0);
+
+ GXSetFog(GX_FOG_NONE, 0.0f, 0.0f, 0.0f, 0.0f, (GXColor){0,0,0,0});
+ GXSetFogRangeAdj(0, 0, 0);
+
+ GXSetCullMode(GX_CULL_NONE);
+ GXSetDither(GX_TRUE);
+
+ GXSetTevColor(GX_TEVREG0, (GXColor){128,128,128,128});
+ GXSetTevColor(GX_TEVREG1, (GXColor){128,128,128,128});
+
+ nw4r::g3d::Camera cam(GetCameraByID(GetCurrentCameraID()));
+ Mtx camMtx;
+ cam.GetCameraMtx(&camMtx);
+ //MTXInverse(camMtx, camMtx);
+
+ Mtx viewMatrix;
+ getViewMatrix(&viewMatrix);
+
+ //camMtx[0][3] = 0.0f;
+ //camMtx[1][3] = 0.0f;
+ //camMtx[2][3] = 0.0f;
+
+ //MTXConcat(viewMatrix, camMtx, viewMatrix);
+
+ GXLoadPosMtxImm(camMtx, GX_PNMTX0);
+ GXSetCurrentMtx(GX_PNMTX0);
+
+ GXBegin(GX_QUADS, GX_VTXFMT0, 4);
+ GXPosition3f32(-400, 0, -400);
+ GXTexCoord2f32(0, 0);
+ GXPosition3f32(400, 0, -400);
+ GXTexCoord2f32(1, 0);
+ GXPosition3f32(400, 0, 400);
+ GXTexCoord2f32(1, 1);
+ GXPosition3f32(-400, 0, 400);
+ GXTexCoord2f32(0, 1);
+ GXEnd();
+}
+
+void dPathTest_c::drawXlu() {
+}
+
+
dWMMap_c *dWMMap_c::instance = 0;
@@ -45,6 +130,9 @@ int dWMMap_c::onCreate() {
node->loadFrom(nodeData, &allocator);
}
+ SpammyReport("Making path test\n");
+ pathTest.setup(&allocator);
+
SpammyReport("Unlinking allocator\n");
allocator.unlink();
@@ -56,6 +144,8 @@ int dWMMap_c::onCreate() {
int dWMMap_c::onDelete() {
delete[] nodes;
+ pathTest.free();
+
return true;
}
@@ -73,6 +163,8 @@ int dWMMap_c::onDraw() {
nodes[i].draw();
}
+ pathTest.scheduleForDrawing();
+
SpammyReport("dWMMap_c::onDraw() completed\n");
return true;
}
@@ -113,6 +205,6 @@ void WMSceneNode::loadFrom(WMSceneDataNode *data, mHeapAllocator_c *allocator) {
void WMSceneNode::draw() {
- model.scheduleForDrawing();
+ //model.scheduleForDrawing();
}