Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formspecs: Add starting frame to
animated_image
(#9411)
- Loading branch information
Showing
8 changed files
with
115 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ typedef enum { | |
f_Box, | ||
f_ItemImage, | ||
f_HyperText, | ||
f_AnimatedImage, | ||
f_Unknown | ||
} FormspecFieldType; | ||
|
||
|