From ccbe435e2a97ffe3d371e992462ccf5af591d4cd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 2 Aug 2011 19:06:53 +0300 Subject: Dont create surface with alpha if alpha = 1 in software mode. --- src/compoundsprite.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index e391a6f87..2792e20bb 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -391,9 +391,15 @@ void CompoundSprite::redraw() const mImage = Image::load(surface); SDL_FreeSurface(surface); - mAlphaImage = Image::load(surfaceA); - SDL_FreeSurface(surfaceA); - + if (mAlpha != 1.0f) + { + mAlphaImage = Image::load(surfaceA); + SDL_FreeSurface(surfaceA); + } + else + { + mAlphaImage = 0; + } } void CompoundSprite::setAlpha(float alpha) -- cgit v1.2.3-70-g09d2