diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-03 23:02:14 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-18 19:36:33 +0300 |
commit | d99a3f4a96b754a788c4a147be27dd212d90f743 (patch) | |
tree | 72e4ca7b883db78c3fd5564ce0f9496b0e440343 /src/resources/sdlimagehelper.cpp | |
parent | 3d94db98d119b011646893468bb61f88a0019173 (diff) | |
download | manaplus-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.gz manaplus-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.bz2 manaplus-d99a3f4a96b754a788c4a147be27dd212d90f743.tar.xz manaplus-d99a3f4a96b754a788c4a147be27dd212d90f743.zip |
improve software A,S dye speed.
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r-- | src/resources/sdlimagehelper.cpp | 20 |
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: |