summaryrefslogtreecommitdiff
path: root/src/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-08-09 03:46:04 +0300
committerAndrei Karas <akaras@inbox.ru>2011-08-09 03:46:04 +0300
commit7d52a82733acb8f9e328392d8b4c3aef22cf3d96 (patch)
treec9f97ccbb99c2eae4077e7523acb954504c69433 /src/compoundsprite.cpp
parent08e646812a6881552141bed7cdb6f05f8b81dd0f (diff)
downloadmanaplus-7d52a82733acb8f9e328392d8b4c3aef22cf3d96.tar.gz
manaplus-7d52a82733acb8f9e328392d8b4c3aef22cf3d96.tar.bz2
manaplus-7d52a82733acb8f9e328392d8b4c3aef22cf3d96.tar.xz
manaplus-7d52a82733acb8f9e328392d8b4c3aef22cf3d96.zip
Add new perfomance parameters.
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