summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
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