summaryrefslogtreecommitdiff
path: root/src/resources/sdlimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-03 23:02:14 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-18 19:36:33 +0300
commitd99a3f4a96b754a788c4a147be27dd212d90f743 (patch)
tree72e4ca7b883db78c3fd5564ce0f9496b0e440343 /src/resources/sdlimagehelper.cpp
parent3d94db98d119b011646893468bb61f88a0019173 (diff)
downloadmanaverse-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.gz
manaverse-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.bz2
manaverse-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.xz
manaverse-d99a3f4a96b754a788c4a147be27dd212d90f743.zip
improve software A,S dye speed.
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r--src/resources/sdlimagehelper.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 32fbd0f35..678835edb 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -71,30 +71,14 @@ Image *SDLImageHelper::load(SDL_RWops *const rw, Dye const &dye) const
{
const DyePalette *const pal = dye.getSPalete();
if (pal)
- {
- for (uint32_t *p_end = pixels + surf->w * surf->h;
- pixels != p_end; ++pixels)
- {
- uint8_t *const p = reinterpret_cast<uint8_t *>(pixels);
- const int alpha = *p & 255;
- if (!alpha)
- continue;
- pal->replaceSColor(p);
- }
- }
+ pal->replaceSColor(pixels, surf->w * surf->h);
break;
}
case 2:
{
const DyePalette *const pal = dye.getAPalete();
if (pal)
- {
- for (uint32_t *p_end = pixels + surf->w * surf->h;
- pixels != p_end; ++pixels)
- {
- pal->replaceAColor(reinterpret_cast<uint8_t *>(pixels));
- }
- }
+ pal->replaceAColor(pixels, surf->w * surf->h);
break;
}
case 0: