From fdbd1a4c521c537597b63cd4f2262517cab1f81a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 6 Oct 2012 15:26:12 +0300 Subject: Improve map draw speed in fast opengl. --- src/maplayer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/maplayer.cpp') 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) -- cgit v1.2.3-60-g2f50