summaryrefslogtreecommitdiff
path: root/src/compoundsprite.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/compoundsprite.h')
-rw-r--r--src/compoundsprite.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/compoundsprite.h b/src/compoundsprite.h
index 834ccd835..0841bcfb8 100644
--- a/src/compoundsprite.h
+++ b/src/compoundsprite.h
@@ -24,10 +24,26 @@
#include "sprite.h"
+#include <list>
#include <vector>
class Image;
+typedef std::list <void*> VectorPointers;
+
+class CompoundItem
+{
+ public:
+ CompoundItem();
+
+ ~CompoundItem();
+
+// float alpha;
+ VectorPointers data;
+ Image *image;
+ Image *alphaImage;
+};
+
class CompoundSprite : public Sprite, private std::vector<Sprite*>
{
public:
@@ -101,9 +117,18 @@ public:
virtual void setAlpha(float alpha);
private:
-
void redraw() const;
+ void updateImages() const;
+
+ bool updateFromCache() const;
+
+ void initCurrentCacheItem() const;
+
+ typedef std::list<CompoundItem*> ImagesCache;
+ mutable ImagesCache imagesCache;
+ mutable CompoundItem *mCacheItem;
+
mutable Image *mImage;
mutable Image *mAlphaImage;