summaryrefslogtreecommitdiff
path: root/src/maplayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-06 15:26:12 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-06 15:26:12 +0300
commitfdbd1a4c521c537597b63cd4f2262517cab1f81a (patch)
treea873f6567942bfc8241703eb34a00abc671a2999 /src/maplayer.cpp
parent4fb8f9f0905038f3180f108ec56b2a326ceb3483 (diff)
downloadplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.gz
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.bz2
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.xz
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.zip
Improve map draw speed in fast opengl.
Diffstat (limited to 'src/maplayer.cpp')
-rw-r--r--src/maplayer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/maplayer.cpp b/src/maplayer.cpp
index cf40cfae7..f79c8c042 100644
--- a/src/maplayer.cpp
+++ b/src/maplayer.cpp
@@ -232,6 +232,7 @@ void MapLayer::updateOGL(Graphics *const graphics, int startX, int startY,
const int scrollX, const int scrollY,
const int debugFlags)
{
+#ifdef USE_OPENGL
delete_all(mTempRows);
mTempRows.clear();
@@ -276,7 +277,7 @@ void MapLayer::updateOGL(Graphics *const graphics, int startX, int startY,
const int py = py0 - img->mBounds.h;
if (flag || img->mBounds.h <= 32)
{
- if (lastImage != img)
+ if (!lastImage || lastImage->mGLImage != img->mGLImage)
{
if (img->mBounds.w > 32)
imgSet.clear();
@@ -294,11 +295,13 @@ void MapLayer::updateOGL(Graphics *const graphics, int startX, int startY,
}
lastImage = img;
}
- graphics->calcTile(imgVert, px, py);
+ lastImage = img;
+ graphics->calcTile(imgVert, lastImage, px, py);
}
}
}
}
+#endif
}
void MapLayer::drawOGL(Graphics *const graphics)