summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorReid <reidyaro@gmail.com>2011-08-24 22:42:17 +0200
committerReid <reidyaro@gmail.com>2011-08-24 22:42:17 +0200
commit43c19a8321bd0c4bcf36655d74e895397aff7eea (patch)
treec8f7933367ae1e757a3166a04772274896d58c9c /src/compoundsprite.cpp
parentc1ec2b921389cb5c44d9ae572ea4851891cf8bc9 (diff)
parent9505e3789cc9db6a10a68b9794a586604271b76f (diff)
downloadmanaplus-43c19a8321bd0c4bcf36655d74e895397aff7eea.tar.gz
manaplus-43c19a8321bd0c4bcf36655d74e895397aff7eea.tar.bz2
manaplus-43c19a8321bd0c4bcf36655d74e895397aff7eea.tar.xz
manaplus-43c19a8321bd0c4bcf36655d74e895397aff7eea.zip
Merge branch 'master' of gitorious.org:manaplus/manaplus
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r--src/compoundsprite.cpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp
index 1642416ea..99fae4f88 100644
--- a/src/compoundsprite.cpp
+++ b/src/compoundsprite.cpp
@@ -21,6 +21,7 @@
#include "compoundsprite.h"
+#include "configuration.h"
#include "game.h"
#include "graphics.h"
#ifdef USE_OPENGL
@@ -52,6 +53,9 @@ CompoundSprite::CompoundSprite():
mNeedsRedraw(false)
{
mAlpha = 1.0f;
+ mEnableAlphaFix = config.getBoolValue("enableAlphaFix");
+ mDisableAdvBeingCaching = config.getBoolValue("disableAdvBeingCaching");
+ mDisableBeingCaching = config.getBoolValue("disableBeingCaching");
}
CompoundSprite::~CompoundSprite()
@@ -406,7 +410,7 @@ void CompoundSprite::setAlpha(float alpha)
{
if (alpha != mAlpha)
{
- if (Image::mUseOpenGL == 0 && size() > 3)
+ if (mEnableAlphaFix && Image::mUseOpenGL == 0 && size() > 3)
{
SpriteConstIterator it, it_end;
for (it = begin(), it_end = end(); it != it_end; ++ it)
@@ -426,18 +430,28 @@ void CompoundSprite::updateImages() const
return;
#endif
- if (size() <= 3)
- return;
-
mNeedsRedraw = false;
- if (updateFromCache())
- return;
+ if (!mDisableBeingCaching)
+ {
+ if (size() <= 3)
+ return;
+
+ if (!mDisableAdvBeingCaching)
+ {
+ if (updateFromCache())
+ return;
- redraw();
+ redraw();
- if (mImage)
- initCurrentCacheItem();
+ if (mImage)
+ initCurrentCacheItem();
+ }
+ else
+ {
+ redraw();
+ }
+ }
}
bool CompoundSprite::updateFromCache() const