From dadee3d63794537750fccc11006f954c314847de Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 25 Oct 2015 18:28:35 +0300 Subject: Dont reduce map layers with any conditional attributes. --- src/resources/map/map.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/resources') 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( x + y * layer2->mWidth); img = layer2->mTiles[pos].image; -- cgit v1.2.3-70-g09d2