summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-01 14:56:23 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-01 14:56:23 +0300
commitd7bab2611a940265583bcd22401199ae23ecbe94 (patch)
treea826ab84a01f42ad23595da5a86644c87dbe3c8d
parentaca306abdee1921d5536fc1e10aea110f599d471 (diff)
downloadplus-d7bab2611a940265583bcd22401199ae23ecbe94.tar.gz
plus-d7bab2611a940265583bcd22401199ae23ecbe94.tar.bz2
plus-d7bab2611a940265583bcd22401199ae23ecbe94.tar.xz
plus-d7bab2611a940265583bcd22401199ae23ecbe94.zip
Remove extra checks from draw map layers.
-rw-r--r--src/resources/map/maplayer.cpp80
1 files changed, 17 insertions, 63 deletions
diff --git a/src/resources/map/maplayer.cpp b/src/resources/map/maplayer.cpp
index 90ef48e4a..15a0bf5eb 100644
--- a/src/resources/map/maplayer.cpp
+++ b/src/resources/map/maplayer.cpp
@@ -150,21 +150,6 @@ void MapLayer::draw(Graphics *const graphics,
}
for (int x = x0; x < endX; x++, tilePtr++)
{
- if (!tilePtr->isEnabled)
- {
- if (x + tilePtr->count + 1 >= endX)
- break;
- reportAlways("error tiles: %s (%d,%d) to %d, +%d, %d",
- mName.c_str(),
- x, y,
- endX,
- tilePtr->count,
- tilePtr->nextTile);
- const int c = tilePtr->count;
- x += c;
- tilePtr += c;
- continue;
- }
const int x32 = x * mapTileSize;
const Image *const img = tilePtr->image;
@@ -577,43 +562,26 @@ void MapLayer::drawFringe(Graphics *const graphics,
{
const int x32 = x * mapTileSize;
int c = 0;
- if (tilePtr->isEnabled)
+ const Image *const img = tilePtr->image;
+ if (mSpecialFlag ||
+ img->mBounds.h <= mapTileSize)
{
- const Image *const img = tilePtr->image;
- if (mSpecialFlag ||
- img->mBounds.h <= mapTileSize)
+ const int px = x32 + dx;
+ const int py = py0 - img->mBounds.h;
+ c = tilePtr->count;
+
+ if (c == 0)
{
- const int px = x32 + dx;
- const int py = py0 - img->mBounds.h;
- c = tilePtr->count;
-
- if (c == 0)
- {
- graphics->drawImage(img, px, py);
- }
- else
- {
- graphics->drawPattern(img,
- px,
- py,
- tilePtr->width,
- img->mBounds.h);
- }
+ graphics->drawImage(img, px, py);
+ }
+ else
+ {
+ graphics->drawPattern(img,
+ px,
+ py,
+ tilePtr->width,
+ img->mBounds.h);
}
- }
- else
- {
- if (x + tilePtr->count + 1 >= endX)
- break;
- reportAlways("error tiles1: (%d,%d) to %d, +%d, %d",
- x, y,
- endX,
- tilePtr->count,
- tilePtr->nextTile);
- c = tilePtr->count;
- x += c;
- tilePtr += c;
- continue;
}
const int nextTile = tilePtr->nextTile;
@@ -663,20 +631,6 @@ void MapLayer::drawFringe(Graphics *const graphics,
}
for (int x = x0; x < endX; x++, tilePtr++)
{
- if (!tilePtr->isEnabled)
- {
- if (x + tilePtr->count + 1 >= endX)
- break;
- reportAlways("error tiles2: (%d,%d) to %d, +%d, %d",
- x, y,
- endX,
- tilePtr->count,
- tilePtr->nextTile);
- const int c = tilePtr->count;
- x += c;
- tilePtr += c;
- continue;
- }
const int x32 = x * mapTileSize;
const Image *const img = tilePtr->image;
const int px = x32 + dx;