summaryrefslogtreecommitdiff
path: root/src/koopatlas/mapdata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/koopatlas/mapdata.cpp')
-rw-r--r--src/koopatlas/mapdata.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp
index 37565ea..a6031b1 100644
--- a/src/koopatlas/mapdata.cpp
+++ b/src/koopatlas/mapdata.cpp
@@ -1,6 +1,31 @@
#include "koopatlas/mapdata.h"
+// HELPER FUNCTIONS
+dKPPath_s *dKPNode_s::getOppositeExitTo(dKPPath_s *path) {
+ for (int i = 0; i < 4; i++) {
+ dKPPath_s *check = exits[i];
+
+ if (check != 0 && check != path)
+ return check;
+ }
+
+ return 0;
+}
+
+
+int dKPLayer_s::findNodeID(dKPNode_s *node) {
+ for (int i = 0; i < nodeCount; i++)
+ if (nodes[i] == node)
+ return i;
+
+ return -1;
+}
+
+
+
+
+
dKPMapData_c::dKPMapData_c() {
data = 0;
fixedUp = false;
@@ -83,6 +108,8 @@ void dKPMapData_c::fixup() {
break;
case dKPLayer_s::PATHS:
+ pathLayer = layer;
+
fixRef(layer->paths);
fixRef(layer->nodes);
@@ -112,14 +139,6 @@ void dKPMapData_c::fixup() {
}
}
- fixRef(data->unlocks);
-
- for (int iUnlock = 0; iUnlock < data->unlockCount; iUnlock++) {
- dKPUnlock_s *unlock = &data->unlocks[iUnlock];
-
- fixRef(unlock->targetPath);
- }
-
fixRef(data->tilesets);
}