diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-06 15:26:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-06 15:26:12 +0300 |
commit | fdbd1a4c521c537597b63cd4f2262517cab1f81a (patch) | |
tree | a873f6567942bfc8241703eb34a00abc671a2999 /src/maplayer.cpp | |
parent | 4fb8f9f0905038f3180f108ec56b2a326ceb3483 (diff) | |
download | manaplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.gz manaplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.bz2 manaplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.xz manaplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.zip |
Improve map draw speed in fast opengl.
Diffstat (limited to 'src/maplayer.cpp')
-rw-r--r-- | src/maplayer.cpp | 7 |
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) |