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/resources/ambientlayer.cpp | |
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/resources/ambientlayer.cpp')
-rw-r--r-- | src/resources/ambientlayer.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp index 301927f8..b71378cb 100644 --- a/src/resources/ambientlayer.cpp +++ b/src/resources/ambientlayer.cpp @@ -25,20 +25,12 @@ #include "resources/image.h" #include "resources/resourcemanager.h" -AmbientLayer::AmbientLayer(Image *img, float parallax, - float speedX, float speedY, bool keepRatio): - mImage(img), mParallax(parallax), - mPosX(0), mPosY(0), - mSpeedX(speedX), mSpeedY(speedY), - mKeepRatio(keepRatio) -{ - mImage->incRef(); -} +AmbientLayer::AmbientLayer(Image *img) + : mImage(img) +{} AmbientLayer::~AmbientLayer() -{ - mImage->decRef(); -} +{} void AmbientLayer::update(int timePassed, float dx, float dy) { |