diff options
Diffstat (limited to 'src/wm_path_manager.cpp')
-rw-r--r-- | src/wm_path_manager.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/wm_path_manager.cpp b/src/wm_path_manager.cpp index d94e5be..03c11d4 100644 --- a/src/wm_path_manager.cpp +++ b/src/wm_path_manager.cpp @@ -209,3 +209,50 @@ void dWMPathManager_c::setup() { } + + +void dWMPathManager_c::setInitialPathVisibility() { + for (int i = 0; i < pathData.pathCount(); i++) { + WMPathDef *path = pathData.getPath(i); + + char **materials = path->getMaterialArray(); + u8 alphaToUse = 255; + if (path->eventRequired != 0xFFFF) { + if (!events[path->eventRequired]) + alphaToUse = 128; + } + + for (int j = 0; j < path->materialCount; j++) { + // TODO: fix this + dWMMap_c::instance->nodes[0].updateAlpha(materials[j], alphaToUse); + } + } +} + + + +void dWMPathManager_c::computeEvents() { + for (int i = 0; i < EVENT_COUNT; i++) + events[i] = false; + + SaveBlock *save = GetSaveFile()->GetBlock(-1); + + // loop through every point, and apply the event from it if necessary + for (int i = 0; i < pathData.pointCount(); i++) { + WMPathPoint *point = pathData.getPoint(i); + + if (point->type == WMPathPoint::LEVEL_TYPE) { + // TODO: check if the world/level need to be -1 or not + u32 conds = save->GetLevelCondition(point->params[0], point->params[1]); + + if (conds & COND_NORMAL && point->params[2] != -1) + events[point->params[2]] = true; + if (conds & COND_SECRET && point->params[3] != -1) + events[point->params[3]] = true; + + OSReport("checking level %d-%d with events %d,%d set them to %d,%d\n", point->params[0], point->params[1], point->params[2], point->params[3], events[point->params[2]], events[point->params[3]]); + } + } +} + + |