summaryrefslogtreecommitdiff
path: root/src/resources/map/maplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-22 20:00:52 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-22 20:54:30 +0300
commit94006f0111d07841d34a4f96e8899448efffa0f0 (patch)
treeb432113496b2561ebe2755bdfb6a2aba9d8e5632 /src/resources/map/maplayer.cpp
parentfa148213572d8c48428d55ed05f984fc19445885 (diff)
downloadplus-94006f0111d07841d34a4f96e8899448efffa0f0.tar.gz
plus-94006f0111d07841d34a4f96e8899448efffa0f0.tar.bz2
plus-94006f0111d07841d34a4f96e8899448efffa0f0.tar.xz
plus-94006f0111d07841d34a4f96e8899448efffa0f0.zip
Fix drawing map after last changes with conditional tiles.
Diffstat (limited to 'src/resources/map/maplayer.cpp')
-rw-r--r--src/resources/map/maplayer.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index 920a0f363..23e347483 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -139,7 +139,7 @@ void MapLayer::draw(Graphics *const graphics,
const int x32 = x * mapTileSize;
int c = 0;
- const Image *const img = (*tilePtr).image;
+ const Image *const img = tilePtr->image;
if (img)
{
const int px = x32 + dx;
@@ -163,6 +163,7 @@ void MapLayer::draw(Graphics *const graphics,
}
x += c;
+ tilePtr += c;
}
}
BLOCK_END("MapLayer::draw")
@@ -496,11 +497,13 @@ void MapLayer::drawFringe(Graphics *const graphics,
TileInfo *tilePtr = &mTiles[static_cast<size_t>(startX + yWidth)];
for (int x = startX; x < endX; x++, tilePtr++)
{
+ if (!tilePtr->isEnabled)
+ continue;
const int x32 = x * mapTileSize;
const int px1 = x32 - scrollX;
int c = 0;
- const Image *const img = (*tilePtr).image;
+ const Image *const img = tilePtr->image;
if (img)
{
if (mSpecialFlag || img->mBounds.h <= mapTileSize)
@@ -557,6 +560,7 @@ void MapLayer::drawFringe(Graphics *const graphics,
}
}
x += c;
+ tilePtr += c;
}
}
@@ -581,8 +585,10 @@ void MapLayer::drawFringe(Graphics *const graphics,
TileInfo *tilePtr = &mTiles[static_cast<size_t>(startX + yWidth)];
for (int x = startX; x < endX; x++, tilePtr++)
{
+ if (!tilePtr->isEnabled)
+ continue;
const int x32 = x * mapTileSize;
- const Image *const img = (*tilePtr).image;
+ const Image *const img = tilePtr->image;
if (img)
{
const int px = x32 + dx;
@@ -602,6 +608,7 @@ void MapLayer::drawFringe(Graphics *const graphics,
graphics->drawPattern(img, px, py,
width, img->mBounds.h);
x += c;
+ tilePtr += c;
}
}
}
@@ -672,7 +679,7 @@ int MapLayer::getTileDrawWidth(const TileInfo *tilePtr,
{
tilePtr ++;
const Image *const img = tilePtr->image;
- if (img != img1)
+ if (img != img1 || !tilePtr->isEnabled)
break;
c ++;
if (img)