summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-02 19:06:53 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-02 19:07:33 +0300
commitccbe435e2a97ffe3d371e992462ccf5af591d4cd (patch)
tree0dd0bccd99fa3ccc04602580c9c3e9c418065a12
parentaac238cec9cab9efe7319d8397b95e7a77bdb5cd (diff)
downloadplus-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.
-rw-r--r--src/compoundsprite.cpp12
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)