diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-07 03:37:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-07 03:37:30 +0300 |
commit | 0b4ce8c4594c2e70c2e3157c58491757e13558be (patch) | |
tree | ed3582b146eb1bcb984cbc44407b99a20fee60fd /src/map.cpp | |
parent | b2fa201dc05db0472fb9eeb0f8ef11ecb231dcb4 (diff) | |
download | mv-0b4ce8c4594c2e70c2e3157c58491757e13558be.tar.gz mv-0b4ce8c4594c2e70c2e3157c58491757e13558be.tar.bz2 mv-0b4ce8c4594c2e70c2e3157c58491757e13558be.tar.xz mv-0b4ce8c4594c2e70c2e3157c58491757e13558be.zip |
Add option "show beings transparency". Disabled by default.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index f8c4e007e..abf6d73f0 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -622,7 +622,8 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): mDrawY(-1), mDrawScrollX(-1), mDrawScrollY(-1), - mRedrawMap(true) + mRedrawMap(true), + mBeingOpacity(false) { const int size = mWidth * mHeight; @@ -639,6 +640,7 @@ Map::Map(int width, int height, int tileWidth, int tileHeight): config.addListener("OverlayDetail", this); config.addListener("guialpha", this); + config.addListener("beingopacity", this); #ifdef USE_OPENGL mOpenGL = config.getIntValue("opengl"); @@ -651,6 +653,7 @@ Map::~Map() { config.removeListener("OverlayDetail", this); config.removeListener("guialpha", this); + config.removeListener("beingopacity", this); // delete metadata, layers, tilesets and overlays delete[] mMetaTiles; @@ -675,9 +678,24 @@ Map::~Map() void Map::optionChanged(const std::string &value) { if (value == "OverlayDetail") + { mOverlayDetail = config.getIntValue("OverlayDetail"); + } else if (value == "guialpha") + { mOpacity = config.getFloatValue("guialpha"); + if (mOpacity != 1.0f) + mBeingOpacity = config.getBoolValue("beingopacity"); + else + mBeingOpacity = false; + } + else if (value == "beingopacity") + { + if (mOpacity != 1.0f) + mBeingOpacity = config.getBoolValue("beingopacity"); + else + mBeingOpacity = false; + } } void Map::initializeAmbientLayers() @@ -895,7 +913,7 @@ void Map::draw(Graphics *graphics, int scrollX, int scrollY) } // Dont draw if gui opacity == 1 - if (mOpacity != 1.0f) + if (mBeingOpacity && mOpacity != 1.0f) { // Draws beings with a lower opacity to make them visible // even when covered by a wall or some other elements... |