diff options
Diffstat (limited to 'src/graphics/animation.h')
-rw-r--r-- | src/graphics/animation.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/graphics/animation.h b/src/graphics/animation.h index 87b4427..9f5dfa5 100644 --- a/src/graphics/animation.h +++ b/src/graphics/animation.h @@ -9,26 +9,29 @@ namespace Graphics{ protected: int i_; int count_; + int row_; int lastTime_; int switchTime_; unsigned int w_, h_; sf::IntRect rect_; sf::Texture texture_; - sf::Sprite sprite_; bool ticked(int deltaTime); public: Animation(); ~Animation(); - Animation(const char* filename, int count, int switchTime); - sf::Sprite& next(int deltaTime); + Animation(const sf::Texture& texture, int count, int switchTime, + int height, int width, int row); + sf::IntRect& next(int deltaTime); + void reset(); }; class OneShotAnimation : Animation { public: OneShotAnimation(); - OneShotAnimation(const char* filename, int count, int switchTime); + OneShotAnimation(const sf::Texture& texture, int count, int + switchTime, int height, int width, int row); bool finished(); - sf::Sprite& next(int deltaTime); + sf::IntRect& next(int deltaTime); }; class BouncingAnimation : Animation{ @@ -36,9 +39,10 @@ namespace Graphics{ bool up_; public: BouncingAnimation(); - BouncingAnimation(const char* filename, int count, int switchTime); + BouncingAnimation(const sf::Texture& texture, int count, int + switchTime, int height, int width, int row); ~BouncingAnimation(); - sf::Sprite& next(int deltaTime); + sf::IntRect& next(int deltaTime); }; } #endif // GRAPHICS_ANIMATION_H |