From fe9994c45c1e464125186ae14e482ae155d9ec53 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 19 Aug 2013 22:17:05 +0300 Subject: improve a bit normal dye code. move dye code to methods. --- src/resources/sdlimagehelper.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/resources/sdlimagehelper.cpp') diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 7cba9b0dc..ab0b0663b 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -92,20 +92,7 @@ Image *SDLImageHelper::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 & 255; - if (!alpha) - continue; - int v[3]; - v[0] = (p >> 24) & 255; - v[1] = (p >> 16) & 255; - v[2] = (p >> 8) & 255; - dye.update(v); - *pixels = (v[0] << 24) | (v[1] << 16) | (v[2] << 8) | alpha; - } + dye.normalDye(pixels, surf->w * surf->h); break; } } -- cgit v1.2.3-60-g2f50