From 1c62988a9e7ed1038250a2d044889eda046500c5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 13 Sep 2011 23:20:44 +0300 Subject: Again a bit improve map draw speed. --- src/map.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/map.cpp b/src/map.cpp index 41b80d02e..dc742d6bb 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -263,11 +263,11 @@ void MapLayer::updateSDL(Graphics *graphics, int startX, int startY, const int yWidth = y * mWidth; const int py0 = y * 32 + dy; - int tilePtr = startX + yWidth; + Image **tilePtr = mTiles + startX + yWidth; for (int x = startX; x < endX; x++, tilePtr++) { - Image *img = mTiles[tilePtr]; + Image *img = *tilePtr; if (img) { const int px = x * 32 + dx; @@ -344,10 +344,10 @@ void MapLayer::updateOGL(Graphics *graphics, int startX, int startY, const int py0 = y * 32 + dy; std::map imgSet; - int tilePtr = startX + yWidth; + Image **tilePtr = mTiles + startX + yWidth; for (int x = startX; x < endX; x++, tilePtr++) { - Image *img = mTiles[tilePtr]; + Image *img = *tilePtr; if (img) { const int px = x * 32 + dx; @@ -472,7 +472,6 @@ void MapLayer::drawFringe(Graphics *graphics, int startX, int startY, const int py0 = y32 + dy; const int py1 = y32 - scrollY; -// int tilePtr = startX + yWidth; Image **tilePtr = mTiles + startX + yWidth; for (int x = startX; x < endX; x++, tilePtr++) { -- cgit v1.2.3-70-g09d2