summaryrefslogtreecommitdiff
path: root/src/koopatlas/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/koopatlas/map.cpp')
-rw-r--r--src/koopatlas/map.cpp96
1 files changed, 16 insertions, 80 deletions
diff --git a/src/koopatlas/map.cpp b/src/koopatlas/map.cpp
index f9403ba..a03d819 100644
--- a/src/koopatlas/map.cpp
+++ b/src/koopatlas/map.cpp
@@ -63,25 +63,6 @@ int dWMMap_c::onCreate() {
bgSrtAnm.bindEntry(&bgModel, anmRes, 0, 0);
bgModel.bindAnim(&bgSrtAnm, 0.0f);
-
- nw4r::g3d::ResFile rg(getResource("cobCourse", "g3d/model.brres"));
- renderer.nodeModel.setup(rg.GetResMdl("cobCourse"), &allocator, 0x224, 1, 0);
-
- // nw4r::g3d::ResFile rg(dScKoopatlas_c::instance->mapData.nodeLoader.buffer);
- // rg.CheckRevision();
- // rg.Init();
- // rg.Bind(rg);
-
- // nw4r::g3d::ResMdl mdl = rg.GetResMdl("cobCourse");
- // nw4r::g3d::ResAnmVis anmResVis = rg.GetResAnmVis("cobCourse");
-
- // renderer.nodeModel.setup(mdl, &allocator, 0x224, 1, 0);
- renderer.nodeMatrix.identity();
- // renderer.nodeColor.setup(mdl, anmResVis, &allocator, 0);
- // renderer.nodeColor.bind(&renderer.nodeModel, anmResVis, 0);
- // renderer.nodeModel.bindAnim(&renderer.nodeColor, 0.0f);
- SetupTextures_MapObj(&renderer.nodeModel, 0);
-
allocator.unlink();
return true;
@@ -100,21 +81,6 @@ int dWMMap_c::onExecute() {
int dWMMap_c::onDraw() {
- short rz = 0x6000;
- short rx = 0x4000;
- short ry = 0x8000;
-
- // Node rotation (0x6000, 0x4000, 0x8000)
- // Node Position (node->x, -node->y + 4.0, 498.0)
- // Node Scale (0.8)
- renderer.nodeMatrix.translation(384.0, -504.0 + 4.0, 498.0);
- renderer.nodeMatrix.applyRotationYXZ(&ry, &rx, &rz);
- renderer.nodeModel.setDrawMatrix(renderer.nodeMatrix);
- renderer.nodeModel.setScale(0.8f, 0.8f, 0.8f);
- renderer.nodeModel.calcWorld(false);
-
- renderer.nodeModel.scheduleForDrawing();
-
renderer.scheduleForDrawing();
bgModel.scheduleForDrawing();
@@ -485,57 +451,27 @@ void dWMMap_c::renderer_c::renderDoodadLayer(dKPLayer_s *layer) {
}
void dWMMap_c::renderer_c::renderPathLayer(dKPLayer_s *layer) {
- // return;
for (int i = 0; i < layer->nodeCount; i++) {
dKPNode_s *node = layer->nodes[i];
- // int world = node->levelNumber[0];
- // int level = node->levelNumber[1];
-
- // SaveBlock *save = GetSaveFile()->GetBlock(-1);
- // u32 conds = save->GetLevelCondition(world-1, level-1);
-
- // bool isUnlocked = true;
- // bool exitComplete = false;
- // bool secretComplete = false;
-
- // if (conds & 0x10)
- // exitComplete = true;
- // if (conds & 0x20)
- // secretComplete = true;
-
- // // Is it unlocked?
- // if (!isUnlocked)
- // node->color.setCurrentFrame(0); // Black
-
- // // Is it complete?
- // else if ((exitComplete) || (secretComplete))
- // // Does it have two exits?
- // if ((node->hasSecret) && ((!exitComplete) || (!secretComplete)))
- // node->color.setCurrentFrame(2); // Yellow
-
- // // All exits are complete
- // else
- // node->color.setCurrentFrame(1); // Blue
-
- // // Not complete after all
- // else
- // node->color.setCurrentFrame(3); // Red
-
if (node->type == dKPNode_s::LEVEL) {
- float nx = (float)node->x;
- float ny = (float)node->y;
-
- // OSReport("Rendering the node @ %f, %f", nx, ny);
-
- // nodeMatrix.translation(node->x, node->y, 498.0);
- // nodeMatrix.applyRotationYXZ(0, 0, 0);
- // nodeModel.setDrawMatrix(nodeMatrix);
- // nodeModel.setScale(1.0f, 1.0f, 1.0f);
- // nodeModel.calcWorld(false);
-
- // nodeModel.scheduleForDrawing();
+ // OSReport("Node Extra: %x", node->extra);
+ // float nx = (float)node->x;
+ // float ny = (float)node->y;
+ // OSReport("Node Extra: %x, model: %x, matrix: %x, pos: %f, %f", node->extra, node->extra->model, node->extra->matrix, nx, ny);
+
+ short rz = 0x6000;
+ short rx = 0x4000;
+ short ry = 0x8000;
+
+ node->extra->matrix.translation(node->x, -node->y + 4.0, 498.0);
+ node->extra->matrix.applyRotationYXZ(&ry, &rx, &rz);
+ node->extra->model.setDrawMatrix(node->extra->matrix);
+ node->extra->model.setScale(0.8f, 0.8f, 0.8f);
+ node->extra->model.calcWorld(false);
+
+ node->extra->model.scheduleForDrawing();
}
}
}