From d7bab2611a940265583bcd22401199ae23ecbe94 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Feb 2017 14:56:23 +0300 Subject: Remove extra checks from draw map layers. --- src/resources/map/maplayer.cpp | 80 +++++++++--------------------------------- 1 file changed, 17 insertions(+), 63 deletions(-) (limited to 'src') 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; -- cgit v1.2.3-70-g09d2