diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-28 20:56:41 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-01-28 20:57:58 +0100 |
commit | 264be2108c51837fa92085f6c839e66aebbcfc9e (patch) | |
tree | e1f535d4cda5f399e5e622f6154690a0a4e08c4b /src/map.h | |
parent | d86a1df562e00a6e930683534b9d001f45a951ff (diff) | |
download | mana-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.h | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 |