From d34bee39f28fdc14a0a1c493b4f6c5c8552f5357 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 3 Aug 2011 04:59:10 +0300 Subject: Small optimisation in loading images in software mode. --- src/resources/image.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/resources/image.cpp') diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 6bb0a9faa..b1f83e258 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -664,16 +664,18 @@ Image *Image::_SDLload(SDL_Surface *tmpImage) { if (SDL_ALPHA_OPAQUE != 255) hasAlpha = true; - for (int i = 0; i < sz; ++ i) - alphaChannel[i] = SDL_ALPHA_OPAQUE; + memset(alphaChannel, SDL_ALPHA_OPAQUE, sz); +// for (int i = 0; i < sz; ++ i) +// alphaChannel[i] = SDL_ALPHA_OPAQUE; } } else { if (SDL_ALPHA_OPAQUE != 255) hasAlpha = true; - for (int i = 0; i < sz; ++ i) - alphaChannel[i] = SDL_ALPHA_OPAQUE; + memset(alphaChannel, SDL_ALPHA_OPAQUE, sz); +// for (int i = 0; i < sz; ++ i) +// alphaChannel[i] = SDL_ALPHA_OPAQUE; } SDL_Surface *image; -- cgit v1.2.3-70-g09d2