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, 9 insertions, 7 deletions
diff --git a/src/gui/guiAnimatedImage.cpp b/src/gui/guiAnimatedImage.cpp
index b1447c45f..d8648111f 100644
--- a/src/gui/guiAnimatedImage.cpp
+++ b/src/gui/guiAnimatedImage.cpp
@@ -9,13 +9,14 @@
#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) {
@@ -41,8 +42,10 @@ 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
@@ -64,7 +67,6 @@ void GUIAnimatedImage::draw()
}
}
-
void GUIAnimatedImage::setFrameIndex(s32 frame)
{
s32 idx = std::max(frame, 0);