summaryrefslogtreecommitdiff
path: root/src/koopatlas/mapdata.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-01-17 00:40:00 +0100
committerTreeki <treeki@gmail.com>2012-01-17 00:40:00 +0100
commitbb5d7f7e737e318d095d23939b7d288eaf5f9e63 (patch)
treeec41984cd10376e7fec2b24e22b1b695c3692b36 /src/koopatlas/mapdata.cpp
parent28efd888af3ffe227565683e2cd2960ea5b52f61 (diff)
downloadkamek-bb5d7f7e737e318d095d23939b7d288eaf5f9e63.tar.gz
kamek-bb5d7f7e737e318d095d23939b7d288eaf5f9e63.zip
added path support and the new API LevelInfo
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);
}