diff options
author | v-rob <robinsonvincent89@gmail.com> | 2020-03-16 14:56:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-16 22:56:48 +0100 |
commit | 13ad8e2a090eec97f31a1c62e2052a51dcff4434 (patch) | |
tree | f13d97357516f5ed427143a045f5daf14876a8be /src/gui/guiAnimatedImage.h | |
parent | 1441281809d9961ff7498df86601db151956b030 (diff) | |
download | dragonfireclient-13ad8e2a090eec97f31a1c62e2052a51dcff4434.tar.xz |
Formspecs: Add starting frame to `animated_image` (#9411)
Diffstat (limited to 'src/gui/guiAnimatedImage.h')
-rw-r--r-- | src/gui/guiAnimatedImage.h | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gui/guiAnimatedImage.h b/src/gui/guiAnimatedImage.h index 8fb2977f2..f8e6a506e 100644 --- a/src/gui/guiAnimatedImage.h +++ b/src/gui/guiAnimatedImage.h @@ -1,26 +1,28 @@ #pragma once #include "irrlichttypes_extrabloated.h" -#include "util/string.h" +#include <string> class ISimpleTextureSource; class GUIAnimatedImage : public gui::IGUIElement { public: - GUIAnimatedImage(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, - const core::rect<s32> &rectangle, const std::string &name, - ISimpleTextureSource *tsrc); + GUIAnimatedImage(gui::IGUIEnvironment *env, gui::IGUIElement *parent, + s32 id, const core::rect<s32> &rectangle, const std::string &texture_name, + s32 frame_count, s32 frame_duration, ISimpleTextureSource *tsrc); virtual void draw() override; + void setFrameIndex(s32 frame); + s32 getFrameIndex() const { return m_frame_idx; }; + private: - std::string m_name; ISimpleTextureSource *m_tsrc; - video::ITexture *m_texture; - u64 m_global_time; - s32 m_frame_idx; - s32 m_frame_count; - u64 m_frame_duration; - u64 m_frame_time; + video::ITexture *m_texture = nullptr; + u64 m_global_time = 0; + s32 m_frame_idx = 0; + s32 m_frame_count = 1; + u64 m_frame_duration = 1; + u64 m_frame_time = 0; }; |