aboutsummaryrefslogtreecommitdiff
path: root/src/gui/guiAnimatedImage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/guiAnimatedImage.cpp')
-rw-r--r--src/gui/guiAnimatedImage.cpp16
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);