summaryrefslogtreecommitdiff
path: root/src/koopatlas/mapdata.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-07-25 14:10:39 +0200
committerTreeki <treeki@gmail.com>2012-07-25 14:10:39 +0200
commit6895c831ad320c14b01ccabe1c8adcec354e3f9f (patch)
treea47ec4a7b2ce494c668771975e4880ada1d3557c /src/koopatlas/mapdata.cpp
parent0d20c172706178e5df2d426fcf5cb1b7ae85c225 (diff)
downloadkamek-6895c831ad320c14b01ccabe1c8adcec354e3f9f.tar.gz
kamek-6895c831ad320c14b01ccabe1c8adcec354e3f9f.zip
lots more work completed, basic unlocks workingfreeform-unlocks
Diffstat (limited to '')
-rw-r--r--src/koopatlas/mapdata.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/koopatlas/mapdata.cpp b/src/koopatlas/mapdata.cpp
index 650f1e3..63fd0b7 100644
--- a/src/koopatlas/mapdata.cpp
+++ b/src/koopatlas/mapdata.cpp
@@ -2,17 +2,31 @@
// HELPER FUNCTIONS
-dKPPath_s *dKPNode_s::getOppositeExitTo(dKPPath_s *path) {
+dKPPath_s *dKPNode_s::getOppositeExitTo(dKPPath_s *path, bool mustBeAvailable) {
for (int i = 0; i < 4; i++) {
dKPPath_s *check = exits[i];
- if (check != 0 && check != path)
+ if (check != 0 && check != path) {
+ if (mustBeAvailable && !check->isAvailable)
+ continue;
+
return check;
+ }
}
return 0;
}
+int dKPNode_s::getExitCount(bool mustBeAvailable) {
+ int ct = 0;
+
+ for (int i = 0; i < 4; i++)
+ if (exits[i] && (mustBeAvailable ? exits[i]->isAvailable : true))
+ ct++;
+
+ return ct;
+}
+
bool dKPNode_s::isUnlocked() {
for (int i = 0; i < 4; i++)
if (exits[i])
@@ -89,6 +103,20 @@ void dKPNode_s::setupNodeExtra() {
this->extra->mallocator.unlink();
}
+void dKPNode_s::setLayerAlpha(u8 alpha) {
+ if (tileLayer)
+ tileLayer->alpha = alpha;
+ if (doodadLayer)
+ doodadLayer->alpha = alpha;
+}
+
+void dKPPath_s::setLayerAlpha(u8 alpha) {
+ if (tileLayer)
+ tileLayer->alpha = alpha;
+ if (doodadLayer)
+ doodadLayer->alpha = alpha;
+}
+
int dKPLayer_s::findNodeID(dKPNode_s *node) {
for (int i = 0; i < nodeCount; i++)
if (nodes[i] == node)