diff options
author | Treeki <treeki@gmail.com> | 2012-07-25 14:10:39 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-07-25 14:10:39 +0200 |
commit | 6895c831ad320c14b01ccabe1c8adcec354e3f9f (patch) | |
tree | a47ec4a7b2ce494c668771975e4880ada1d3557c /src/koopatlas/mapdata.h | |
parent | 0d20c172706178e5df2d426fcf5cb1b7ae85c225 (diff) | |
download | kamek-6895c831ad320c14b01ccabe1c8adcec354e3f9f.tar.gz kamek-6895c831ad320c14b01ccabe1c8adcec354e3f9f.zip |
lots more work completed, basic unlocks workingfreeform-unlocks
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/mapdata.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/koopatlas/mapdata.h b/src/koopatlas/mapdata.h index 48a1720..40e1a43 100644 --- a/src/koopatlas/mapdata.h +++ b/src/koopatlas/mapdata.h @@ -70,6 +70,8 @@ struct dKPNode_s { NodeTypes type; + bool isNew; + dKPNodeExtra_c *extra; // The union is placed at the very end so we can leave out padding in the @@ -89,24 +91,37 @@ struct dKPNode_s { bool isUnlocked(); void setupNodeExtra(); - dKPPath_s *getOppositeExitTo(dKPPath_s *path); + dKPPath_s *getOppositeExitTo(dKPPath_s *path, bool mustBeAvailable=false); + dKPPath_s *getOppositeAvailableExitTo(dKPPath_s *path) { + return getOppositeExitTo(path, true); + } + + int getExitCount(bool mustBeAvailable=false); + int getAvailableExitCount() { + return getExitCount(true); + } + + void setLayerAlpha(u8 alpha); }; struct dKPPath_s { enum Availability { NOT_AVAILABLE = 0, AVAILABLE = 1, - NEWLY_AVAILABLE = 2 + NEWLY_AVAILABLE = 2, + ALWAYS_AVAILABLE = 3 }; dKPNode_s *start, *end; dKPLayer_s *tileLayer, *doodadLayer; - u8 isAvailable; // computed on-the-fly - default from Koopatlas is 1 - u8 hasSecret; + u8 isAvailable; // computed on-the-fly - default from Koopatlas is NOT or ALWAYS + u8 isSecret; u8 _padding[2]; float speed; int animation; + + void setLayerAlpha(u8 alpha); }; /****************************************************************************** @@ -118,6 +133,8 @@ struct dKPLayer_s { }; LayerTypes type; + u8 alpha; + u8 _padding[3]; typedef u16 sector_s[16][16]; @@ -180,7 +197,7 @@ class dKPMapData_c { template <typename T> inline T* fixRef(T*& indexAsPtr) { unsigned int index = (unsigned int)indexAsPtr; - if (index == 0xFFFFFFFF) + if (index == 0xFFFFFFFF || index == 0) indexAsPtr = 0; else indexAsPtr = (T*)(((char*)data) + index); @@ -190,7 +207,7 @@ class dKPMapData_c { template <typename T> inline T* fixRefSafe(T*& indexAsPtr) { unsigned int index = (unsigned int)indexAsPtr; - if (index == 0xFFFFFFFF) + if (index == 0xFFFFFFFF || index == 0) indexAsPtr = 0; else if (index < 0x80000000) indexAsPtr = (T*)(((char*)data) + index); |