summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-28 20:56:41 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-28 20:57:58 +0100
commit264be2108c51837fa92085f6c839e66aebbcfc9e (patch)
treee1f535d4cda5f399e5e622f6154690a0a4e08c4b /src/map.h
parentd86a1df562e00a6e930683534b9d001f45a951ff (diff)
downloadmana-264be2108c51837fa92085f6c839e66aebbcfc9e.tar.gz
mana-264be2108c51837fa92085f6c839e66aebbcfc9e.tar.bz2
mana-264be2108c51837fa92085f6c839e66aebbcfc9e.tar.xz
mana-264be2108c51837fa92085f6c839e66aebbcfc9e.zip
Added support for map/layer mask
A custom "Mask" property on a layer or a "foregroundXmask" property on a map can now be used in combination with the SMSG_MAP_MASK to dynamically disable certain map layers from the server. Feature previously seen on ManaPlus and implemented for Mana client for compatibility. Also added a ResourceRef class for automating the Resource reference counting. Closes #44
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/map.h b/src/map.h
index 2900b4d1..410ae16e 100644
--- a/src/map.h
+++ b/src/map.h
@@ -131,9 +131,13 @@ class MapLayer
int getTileDrawWidth(int x1, int y1, int endX, int &width) const;
+ void setMask(int mask) { mMask = mask; }
+ int getMask() const { return mMask; }
+
private:
int mX, mY;
int mWidth, mHeight;
+ int mMask = 1;
bool mIsFringeLayer; /**< Whether the actors are drawn. */
Image **mTiles;
Map *mMap; /** The mother map pointer */
@@ -335,6 +339,8 @@ class Map : public Properties
*/
TileAnimation *getAnimationForGid(int gid) const;
+ void setMask(int mask);
+
protected:
friend class Actor;
@@ -415,6 +421,7 @@ class Map : public Properties
std::map<int, TileAnimation*> mTileAnimations;
+ int mMask = 1;
};
#endif