mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-06 17:41:04 +00:00
Draw node animation for items (#15930)
This commit is contained in:
parent
1db5a2f950
commit
a6d4cd7c15
9 changed files with 117 additions and 74 deletions
|
@ -151,6 +151,28 @@ struct TileLayer
|
|||
bool has_color = false;
|
||||
};
|
||||
|
||||
// Stores information for drawing an animated tile
|
||||
struct AnimationInfo {
|
||||
|
||||
AnimationInfo() = default;
|
||||
|
||||
AnimationInfo(const TileLayer &tile) :
|
||||
m_frame_length_ms(tile.animation_frame_length_ms),
|
||||
m_frame_count(tile.animation_frame_count),
|
||||
m_frames(tile.frames)
|
||||
{};
|
||||
|
||||
void updateTexture(video::SMaterial &material, float animation_time);
|
||||
|
||||
private:
|
||||
u16 m_frame = 0; // last animation frame
|
||||
u16 m_frame_length_ms = 0;
|
||||
u16 m_frame_count = 1;
|
||||
|
||||
/// @note not owned by this struct
|
||||
std::vector<FrameSpec> *m_frames = nullptr;
|
||||
};
|
||||
|
||||
enum class TileRotation: u8 {
|
||||
None,
|
||||
R90,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue