diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-04-01 02:43:11 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-04-01 02:43:11 +0300 |
commit | 5468fd625168cdbb085f96a84ff48660457e8f54 (patch) | |
tree | ddf123b6506956232d157e572ebb8f70ba30feb3 /src | |
parent | 3997e89e06844c78aca425537911d5fbd090bf51 (diff) | |
download | mv-5468fd625168cdbb085f96a84ff48660457e8f54.tar.gz mv-5468fd625168cdbb085f96a84ff48660457e8f54.tar.bz2 mv-5468fd625168cdbb085f96a84ff48660457e8f54.tar.xz mv-5468fd625168cdbb085f96a84ff48660457e8f54.zip |
Small optimisation in map drawing.
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 5 |
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) |