summaryrefslogtreecommitdiff
path: root/src/resources/openglimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-19 22:17:05 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-19 22:17:55 +0300
commitfe9994c45c1e464125186ae14e482ae155d9ec53 (patch)
tree0eef772d50979f869138a80a8ca983de4e5da900 /src/resources/openglimagehelper.cpp
parent582900e6c698823fc95bc6653707a328e96dd075 (diff)
downloadplus-fe9994c45c1e464125186ae14e482ae155d9ec53.tar.gz
plus-fe9994c45c1e464125186ae14e482ae155d9ec53.tar.bz2
plus-fe9994c45c1e464125186ae14e482ae155d9ec53.tar.xz
plus-fe9994c45c1e464125186ae14e482ae155d9ec53.zip
improve a bit normal dye code.
move dye code to methods.
Diffstat (limited to 'src/resources/openglimagehelper.cpp')
-rw-r--r--src/resources/openglimagehelper.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index d392fead1..1180135a0 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -85,20 +85,7 @@ Image *OpenGLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
case 0:
default:
{
- for (uint32_t *p_end = pixels + surf->w * surf->h;
- pixels != p_end; ++pixels)
- {
- const uint32_t p = *pixels;
- const int alpha = (p >> 24) & 255;
- if (!alpha)
- continue;
- int v[3];
- v[0] = (p) & 255;
- v[1] = (p >> 8) & 255;
- v[2] = (p >> 16) & 255;
- dye.update(v);
- *pixels = (v[0]) | (v[1] << 8) | (v[2] << 16) | (alpha << 24);
- }
+ dye.normalOGLDye(pixels, surf->w * surf->h);
break;
}
}