Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
tileanimation.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2016 sfan5 <sfan5@live.de>
4
5#pragma once
6
7#include <iostream>
9
16
18{
20 union
21 {
22 // struct {
23 // } none;
24 struct
25 {
26 int aspect_w; // width for aspect ratio
27 int aspect_h; // height for aspect ratio
28 float length; // seconds
30 struct
31 {
32 int frames_w; // number of frames left-to-right
33 int frames_h; // number of frames top-to-bottom
34 float frame_length; // seconds
36 };
37
38 void serialize(std::ostream &os, u16 protocol_ver) const;
39 void deSerialize(std::istream &is, u16 protocol_ver);
40 void determineParams(v2u32 texture_size, int *frame_count, int *frame_length_ms,
41 v2u32 *frame_size) const;
42 void getTextureModifer(std::ostream &os, v2u32 texture_size, int frame) const;
43 v2f getTextureCoords(v2u32 texture_size, int frame) const;
44};
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector2d< u32 > v2u32
Definition irr_v2d.h:14
Definition tileanimation.h:18
enum TileAnimationType type
Definition tileanimation.h:19
struct TileAnimationParams::@30::@32 vertical_frames
int aspect_h
Definition tileanimation.h:27
int frames_h
Definition tileanimation.h:33
v2f getTextureCoords(v2u32 texture_size, int frame) const
Definition tileanimation.cpp:91
void getTextureModifer(std::ostream &os, v2u32 texture_size, int frame) const
Definition tileanimation.cpp:74
float length
Definition tileanimation.h:28
float frame_length
Definition tileanimation.h:34
struct TileAnimationParams::@30::@33 sheet_2d
int frames_w
Definition tileanimation.h:32
void deSerialize(std::istream &is, u16 protocol_ver)
Definition tileanimation.cpp:27
int aspect_w
Definition tileanimation.h:26
void serialize(std::ostream &os, u16 protocol_ver) const
Definition tileanimation.cpp:7
void determineParams(v2u32 texture_size, int *frame_count, int *frame_length_ms, v2u32 *frame_size) const
Definition tileanimation.cpp:49
TileAnimationType
Definition tileanimation.h:11
@ TAT_NONE
Definition tileanimation.h:12
@ TAT_SHEET_2D
Definition tileanimation.h:14
@ TAT_VERTICAL_FRAMES
Definition tileanimation.h:13