diff options
Diffstat (limited to 'src/wm_map.cpp')
-rw-r--r-- | src/wm_map.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/wm_map.cpp b/src/wm_map.cpp index 83ed637..ad3500d 100644 --- a/src/wm_map.cpp +++ b/src/wm_map.cpp @@ -16,8 +16,9 @@ dWMMap_c *dWMMap_c::build() { - int dWMMap_c::onCreate() { + SpammyReport("dWMMap_c::onCreate() called\n"); + // Get the resource void *scnRes = dScNewerWorldMap_c::instance->resMng['SCN0']; if (scnRes == 0) { @@ -25,12 +26,17 @@ int dWMMap_c::onCreate() { return false; } + testID++; + data = (WMSceneDataHeader*)scnRes; + SpammyReport("Loaded resource: %d nodes\n", data->nodeCount); // load up all the nodes, and fix up all the name offsets while we're at it + SpammyReport("Allocating node array\n"); nodes = new WMSceneNode[data->nodeCount]; // link the mHeapAllocator so it can be used for models + SpammyReport("Linking allocator\n"); allocator.link(-1, GameHeaps[0], 0, 0x20); for (int i = 0; i < data->nodeCount; i++) { @@ -41,8 +47,10 @@ int dWMMap_c::onCreate() { node->loadFrom(nodeData, &allocator); } + SpammyReport("Unlinking allocator\n"); allocator.unlink(); + SpammyReport("dWMMap_c::onCreate() completed\n"); return true; } @@ -60,10 +68,14 @@ int dWMMap_c::onExecute() { int dWMMap_c::onDraw() { + SpammyReport("dWMMap_c::onDraw() called\n"); + for (int i = 0; i < data->nodeCount; i++) { + SpammyReport("Drawing node %d\n", i); nodes[i].draw(); } + SpammyReport("dWMMap_c::onDraw() completed\n"); return true; } @@ -88,12 +100,17 @@ void WMSceneNode::loadFrom(WMSceneDataNode *data, mHeapAllocator_c *allocator) { MapReport(model.setup(&mdl, allocator, 0, 1, 0) ? "Success\n" : "Fail\n"); // todo: more types + SpammyReport("Setting up lightmaps\n"); + if (data->lmType == 0) SetupTextures_Map(&model, 1); else if (data->lmType == 1) SetupTextures_MapObj(&model, 1); + SpammyReport("Lightmaps done\n"); + model.setDrawMatrix(data->matrix); + SpammyReport("Node is ready\n"); } |