summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-01 02:43:11 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-01 02:43:11 +0300
commit5468fd625168cdbb085f96a84ff48660457e8f54 (patch)
treeddf123b6506956232d157e572ebb8f70ba30feb3
parent3997e89e06844c78aca425537911d5fbd090bf51 (diff)
downloadplus-5468fd625168cdbb085f96a84ff48660457e8f54.tar.gz
plus-5468fd625168cdbb085f96a84ff48660457e8f54.tar.bz2
plus-5468fd625168cdbb085f96a84ff48660457e8f54.tar.xz
plus-5468fd625168cdbb085f96a84ff48660457e8f54.zip
Small optimisation in map drawing.
-rw-r--r--src/map.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp
index d0f032b4b..69ce1331d 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -241,13 +241,14 @@ void MapLayer::draw(Graphics *graphics, int startX, int startY,
for (int x = startX; x < endX; x++)
{
- const int px1 = x * 32 - scrollX;
+ const int x32 = x * 32;
+ const int px1 = x32 - scrollX;
const int tilePtr = x + yWidth;
int c = 0;
Image *img = mTiles[tilePtr];
if (img)
{
- const int px = (x * 32) + dx;
+ const int px = x32 + dx;
const int py = py0 - img->getHeight();
if ((debugFlags != Map::MAP_SPECIAL
&& debugFlags != Map::MAP_SPECIAL2)