diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-08-02 19:06:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-08-02 19:07:33 +0300 |
commit | ccbe435e2a97ffe3d371e992462ccf5af591d4cd (patch) | |
tree | 0dd0bccd99fa3ccc04602580c9c3e9c418065a12 /src/compoundsprite.cpp | |
parent | aac238cec9cab9efe7319d8397b95e7a77bdb5cd (diff) | |
download | plus-ccbe435e2a97ffe3d371e992462ccf5af591d4cd.tar.gz plus-ccbe435e2a97ffe3d371e992462ccf5af591d4cd.tar.bz2 plus-ccbe435e2a97ffe3d371e992462ccf5af591d4cd.tar.xz plus-ccbe435e2a97ffe3d371e992462ccf5af591d4cd.zip |
Dont create surface with alpha if alpha = 1 in software mode.
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r-- | src/compoundsprite.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
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) |