From 487a86fe7dc9904f445d91667095f641f72f7c81 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Thu, 20 May 2010 01:35:17 -0600 Subject: 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 --- src/animatedsprite.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/animatedsprite.h') diff --git a/src/animatedsprite.h b/src/animatedsprite.h index 833a07a3..aae116be 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -54,11 +54,11 @@ class AnimatedSprite : public Sprite virtual ~AnimatedSprite(); - void reset(); + bool reset(); - void play(SpriteAction action); + bool play(SpriteAction action); - void update(int time); + bool update(int time); bool draw(Graphics* graphics, int posX, int posY) const; @@ -66,9 +66,9 @@ class AnimatedSprite : public Sprite int getHeight() const; - Image* getImage() const; + const Image* getImage() const; - void setDirection(SpriteDirection direction); + bool setDirection(SpriteDirection direction); int getNumberOfLayers() { return 1; } -- cgit v1.2.3-70-g09d2