summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 908d6178..5b89cd69 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -151,14 +151,13 @@ void MapLayer::draw(Graphics *graphics,
for (int x = startX; x < endX; x++)
{
- Image *img = getTile(x, y);
- if (img)
+ if (Image *img = getTile(x, y))
{
- const int px = (x * mMap->getTileWidth()) + dx;
- const int py = py0 - img->getHeight();
if (!(debugFlags & (Map::DEBUG_SPECIAL1 | Map::DEBUG_SPECIAL2))
|| img->getHeight() <= mMap->getTileHeight())
{
+ const int px = (x * mMap->getTileWidth()) + dx;
+ const int py = py0 - img->getHeight();
int width = 0;
int c = getTileDrawWidth(x, y, endX, width);
if (!c)
@@ -983,7 +982,7 @@ void Map::addAnimation(int gid, TileAnimation animation)
auto const [_, inserted] = mTileAnimations.try_emplace(gid, std::move(animation));
if (!inserted)
{
- logger->error(strprintf("Duplicate tile animation for gid %d", gid));
+ Log::warn("Duplicate tile animation for gid %d", gid);
}
}