summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-25 18:28:35 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-25 18:28:35 +0300
commitdadee3d63794537750fccc11006f954c314847de (patch)
tree04e95d10bfb84539b574dbeab84553a8401f3aa0
parent314d315f8f1003073bbabec3188d7c1bdf395ea3 (diff)
downloadplus-dadee3d63794537750fccc11006f954c314847de.tar.gz
plus-dadee3d63794537750fccc11006f954c314847de.tar.bz2
plus-dadee3d63794537750fccc11006f954c314847de.tar.xz
plus-dadee3d63794537750fccc11006f954c314847de.zip
Dont reduce map layers with any conditional attributes.
-rw-r--r--src/resources/map/map.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index d05bb2c23..d0c091186 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -1426,6 +1426,10 @@ void Map::reduce()
if (x >= layer->mWidth || y >= layer->mHeight)
continue;
+ // skip layers with flags
+ if (layer->mTileCondition != -1 || layer->mMask != 1)
+ continue;
+
Image *const img = layer->mTiles[x + y * layer->mWidth].image;
if (img)
{
@@ -1508,6 +1512,13 @@ void Map::reduce()
continue;
}
+ // skip layers with flags
+ if (layer->mTileCondition != -1 || layer->mMask != 1)
+ {
+ ++ ri;
+ continue;
+ }
+
const Image *img = layer->mTiles[x + y * layer->mWidth].image;
if (img && !img->isAlphaVisible())
{ // removing all down tiles
@@ -1515,6 +1526,12 @@ void Map::reduce()
while (ri != mLayers.rend())
{
MapLayer *const layer2 = *ri;
+ // skip layers with flags
+ if (layer2->mTileCondition != -1 || layer2->mMask != 1)
+ {
+ ++ ri;
+ continue;
+ }
const size_t pos = static_cast<size_t>(
x + y * layer2->mWidth);
img = layer2->mTiles[pos].image;