summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-04 00:13:18 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-18 19:36:33 +0300
commitf97a167c445790fb380c2f730c377271e80e0d97 (patch)
tree24525423d2e50bab0dd519d016da33c0c5387e6d /src/resources/openglimagehelper.cpp
parentd99a3f4a96b754a788c4a147be27dd212d90f743 (diff)
downloadmv-f97a167c445790fb380c2f730c377271e80e0d97.tar.gz
mv-f97a167c445790fb380c2f730c377271e80e0d97.tar.bz2
mv-f97a167c445790fb380c2f730c377271e80e0d97.tar.xz
mv-f97a167c445790fb380c2f730c377271e80e0d97.zip
improve OpenGL A,S dye speed.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 79cd12512..d392fead1 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -71,32 +71,15 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
case 1:
{
DyePalette *const pal = dye.getSPalete();
-
if (pal)
- {
- for (uint32_t *p_end = pixels + surf->w * surf->h;
- pixels != p_end; ++pixels)
- {
- uint8_t *p = reinterpret_cast<uint8_t *>(pixels);
- const int alpha = *p & 255;
- if (!alpha)
- continue;
- pal->replaceSOGLColor(p);
- }
- }
+ pal->replaceSOGLColor(pixels, surf->w * surf->h);
break;
}
case 2:
{
DyePalette *const pal = dye.getAPalete();
if (pal)
- {
- for (uint32_t *p_end = pixels + surf->w * surf->h;
- pixels != p_end; ++pixels)
- {
- pal->replaceAOGLColor(reinterpret_cast<uint8_t *>(pixels));
- }
- }
+ pal->replaceAOGLColor(pixels, surf->w * surf->h);
break;
}
case 0: