From 8e4fe8414eed9fc4934a0d0e34eee578e0216dc7 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sat, 28 Jan 2012 23:36:15 +0100 Subject: Removed Sprite::getCurrentFrame and Sprite::getFrameCount They are apparently no longer being used. Reviewed-by: Erik Schilling --- src/animatedsprite.cpp | 12 ------------ src/animatedsprite.h | 4 ---- src/compoundsprite.cpp | 49 ------------------------------------------------- src/compoundsprite.h | 14 -------------- src/imagesprite.h | 6 ------ src/sprite.h | 12 +----------- 6 files changed, 1 insertion(+), 96 deletions(-) (limited to 'src') diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 222ae9ac..54a11d87 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -194,18 +194,6 @@ bool AnimatedSprite::setDirection(SpriteDirection direction) return false; } -size_t AnimatedSprite::getCurrentFrame() const -{ - return mFrameIndex; -} - -size_t AnimatedSprite::getFrameCount() const -{ - if (mAnimation) - return mAnimation->getLength(); - return 0; -} - int AnimatedSprite::getDuration() const { if (mAnimation) diff --git a/src/animatedsprite.h b/src/animatedsprite.h index 3440e1be..32a63bf6 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -80,10 +80,6 @@ class AnimatedSprite : public Sprite virtual bool drawnWhenBehind() const { return true; } - size_t getCurrentFrame() const; - - size_t getFrameCount() const; - int getDuration() const; private: diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index fc782980..cd07ca51 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -163,26 +163,6 @@ bool CompoundSprite::drawnWhenBehind() const return (getNumberOfLayers() == 1); } -size_t CompoundSprite::getCurrentFrame() const -{ - SpriteConstIterator it, it_end; - for (it = mSprites.begin(), it_end = mSprites.end(); it != it_end; it++) - if (*it) - return (*it)->getCurrentFrame(); - - return 0; -} - -size_t CompoundSprite::getFrameCount() const -{ - SpriteConstIterator it, it_end; - for (it = mSprites.begin(), it_end = mSprites.end(); it != it_end; it++) - if (*it) - return (*it)->getFrameCount(); - - return 0; -} - void CompoundSprite::addSprite(Sprite *sprite) { mSprites.push_back(sprite); @@ -232,35 +212,6 @@ void CompoundSprite::ensureSize(size_t layerCount) mSprites.resize(layerCount); } -/** - * Returns the curent frame in the current animation of the given layer. - */ -size_t CompoundSprite::getCurrentFrame(size_t layer) -{ - if (layer >= mSprites.size()) - return 0; - - if (Sprite *s = getSprite(layer)) - return s->getCurrentFrame(); - - return 0; -} - -/** - * Returns the frame count in the current animation of the given layer. - */ -size_t CompoundSprite::getFrameCount(size_t layer) -{ - if (layer >= mSprites.size()) - return 0; - - Sprite *s = getSprite(layer); - if (s) - return s->getFrameCount(); - - return 0; -} - int CompoundSprite::getDuration() const { int duration = 0; diff --git a/src/compoundsprite.h b/src/compoundsprite.h index 10ee01e1..eed40231 100644 --- a/src/compoundsprite.h +++ b/src/compoundsprite.h @@ -68,10 +68,6 @@ public: virtual bool drawnWhenBehind() const; - size_t getCurrentFrame() const; - - size_t getFrameCount() const; - int getDuration() const; size_t size() const @@ -90,16 +86,6 @@ public: void ensureSize(size_t layerCount); - /** - * Returns the curent frame in the current animation of the given layer. - */ - virtual size_t getCurrentFrame(size_t layer); - - /** - * Returns the frame count in the current animation of the given layer. - */ - virtual size_t getFrameCount(size_t layer); - void doRedraw() { mNeedsRedraw = true; } diff --git a/src/imagesprite.h b/src/imagesprite.h index ef599d17..3ee8fc61 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -60,12 +60,6 @@ public: int getNumberOfLayers() { return 1; } - size_t getCurrentFrame() const - { return 0; } - - size_t getFrameCount() const - { return 1; } - int getDuration() const { return 0; } diff --git a/src/sprite.h b/src/sprite.h index 35df7115..3af6eb7c 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -87,7 +87,7 @@ class Sprite /** * Returns a reference to the current image being drawn. */ - virtual const Image* getImage() const = 0; + virtual const Image *getImage() const = 0; /** * Sets the direction. @@ -108,16 +108,6 @@ class Sprite virtual float getAlpha() const { return mAlpha; } - /** - * Returns the current frame number for the sprite. - */ - virtual size_t getCurrentFrame() const = 0; - - /** - * Returns the frame count for the sprite. - */ - virtual size_t getFrameCount() const = 0; - /** * Returns the duration of the current sprite animation in milliseconds. */ -- cgit v1.2.3-60-g2f50