diff options
author | Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> | 2020-11-04 16:57:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-04 16:57:47 +0100 |
commit | 3e16c3a78fff61c20e63ba730d15e94e3bb877b4 (patch) | |
tree | c070350db219f2c4241d22bc31949685c7b42fe9 /src/gui/guiAnimatedImage.cpp | |
parent | 5d9ae5a91c544fc7fbd475decf47cef7e09ef8fc (diff) | |
parent | 6ccb5835ff55d85156be91473c598eca9d6cb9a6 (diff) | |
download | dragonfireclient-3e16c3a78fff61c20e63ba730d15e94e3bb877b4.tar.xz |
Merge branch 'master' into master
Diffstat (limited to 'src/gui/guiAnimatedImage.cpp')
-rw-r--r-- | src/gui/guiAnimatedImage.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/guiAnimatedImage.cpp b/src/gui/guiAnimatedImage.cpp index d8648111f..b1447c45f 100644 --- a/src/gui/guiAnimatedImage.cpp +++ b/src/gui/guiAnimatedImage.cpp @@ -9,14 +9,13 @@ #include <vector> GUIAnimatedImage::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) : - gui::IGUIElement(gui::EGUIET_ELEMENT, env, parent, id, rectangle), - m_tsrc(tsrc) + s32 id, const core::rect<s32> &rectangle, const std::string &texture_name, + s32 frame_count, s32 frame_duration, ISimpleTextureSource *tsrc) : + gui::IGUIElement(gui::EGUIET_ELEMENT, env, parent, id, rectangle), m_tsrc(tsrc) { m_texture = m_tsrc->getTexture(texture_name); - m_frame_count = std::max(frame_count, 1); + m_frame_count = std::max(frame_count, 1); m_frame_duration = std::max(frame_duration, 0); if (m_texture != nullptr) { @@ -42,10 +41,8 @@ void GUIAnimatedImage::draw() size.Height /= m_frame_count; draw2DImageFilterScaled(driver, m_texture, AbsoluteRect, - core::rect<s32>(core::position2d<s32>(0, - size.Height * m_frame_idx), - size), - NoClip ? nullptr : &AbsoluteClippingRect, colors, true); + core::rect<s32>(core::position2d<s32>(0, size.Height * m_frame_idx), size), + NoClip ? nullptr : &AbsoluteClippingRect, colors, true); } // Step the animation @@ -67,6 +64,7 @@ void GUIAnimatedImage::draw() } } + void GUIAnimatedImage::setFrameIndex(s32 frame) { s32 idx = std::max(frame, 0); |