From f440f7fb52ca62715504e4a3c7076456de40f7b8 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 21 Nov 2018 08:39:28 +0800 Subject: =?UTF-8?q?*=E6=9B=B4=E6=96=B0=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/graphics/animations/je_animation.h | 86 +++------------------------ 1 file changed, 9 insertions(+), 77 deletions(-) (limited to 'src/libjin/graphics/animations/je_animation.h') diff --git a/src/libjin/graphics/animations/je_animation.h b/src/libjin/graphics/animations/je_animation.h index 4c2fd64..1c8a885 100644 --- a/src/libjin/graphics/animations/je_animation.h +++ b/src/libjin/graphics/animations/je_animation.h @@ -21,98 +21,30 @@ namespace JinEngine public: Animation(); - /// - /// - /// void addFrame(const Sprite* frame); - /// - /// - /// void addFrames(const std::vector& frames); - /// - /// - /// - void update(float dt); - - /// - /// - /// - void pause(); - - /// - /// - /// - void resume(); - - /// - /// Force rewind. - /// - void rewind(); - - /// - /// - /// + void setLoop(bool loop); + void setSpeed(float speed); - /// - /// - /// - void setLoop(bool isLoop); - - /// - /// Get current frame index. - /// - uint getCurrentFrameIndex(); - - /// - /// - /// - const Sprite* getCurrentFrame(); - - /// - /// Set current frame index. - /// - /// @param frame Current frame to play. - /// - void setCurrentFrame(uint frame); - - /// - /// - /// - void render(float x, float y, float sx, float sy, float r); - - /// - /// - /// - Animation clone(); + bool isLoop() const; - private: + float getSpeed() const; - void next(); + uint getFrameCount() const; - /// - /// Key frames. - /// - std::vector mFrames; + const Sprite* getFrame(uint index) const; - /// - /// Animation playing speed. - /// - float mSpeed; + private: - /// - /// - /// - float mTick; + std::vector mFrames; - uint mIndex; + float mSpeed; float mLoop; - bool mActive; - }; } // namespace Animations -- cgit v1.1-26-g67d0