summaryrefslogtreecommitdiff
path: root/src/imagesprite.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-05-20 01:35:17 -0600
committerJared Adams <jaxad0127@gmail.com>2010-05-20 12:25:37 -0600
commit487a86fe7dc9904f445d91667095f641f72f7c81 (patch)
tree57191d175f7b2fe771f6b2da225bc2d9cb5ff1d9 /src/imagesprite.h
parent36832f3a5378f739da7040f0711b7101dbc2af02 (diff)
downloadmana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.gz
mana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.bz2
mana-487a86fe7dc9904f445d91667095f641f72f7c81.tar.xz
mana-487a86fe7dc9904f445d91667095f641f72f7c81.zip
Buffer layered sprites under SDL
This improves framerate and allows transparent overlay for complex sprites. Two copies of the buffer are kept, one at full opacity, one with variable opactiy, to reduce calls to setAlpha. Reviewed-by: Bertram
Diffstat (limited to 'src/imagesprite.h')
-rw-r--r--src/imagesprite.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/imagesprite.h b/src/imagesprite.h
index 83fcfa12..20f9fbef 100644
--- a/src/imagesprite.h
+++ b/src/imagesprite.h
@@ -34,11 +34,14 @@ public:
~ImageSprite();
- virtual void reset() {}
+ virtual bool reset()
+ { return false; }
- virtual void play(SpriteAction action) {}
+ virtual bool play(SpriteAction action)
+ { return false; }
- virtual void update(int time) {}
+ virtual bool update(int time)
+ { return false; }
virtual bool draw(Graphics* graphics, int posX, int posY) const;
@@ -48,10 +51,11 @@ public:
virtual int getHeight() const
{ return mImage->getHeight(); }
- virtual Image* getImage() const
+ virtual const Image* getImage() const
{ return mImage; }
- virtual void setDirection(SpriteDirection direction) {}
+ virtual bool setDirection(SpriteDirection direction)
+ { return false; }
int getNumberOfLayers()
{ return 1; }