OpenTTD Source 20250529-master-g10c159a79f
newgrf_animation_type.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef NEWGRF_ANIMATION_TYPE_H
11#define NEWGRF_ANIMATION_TYPE_H
12
13enum class AnimationStatus : uint8_t {
14 NonLooping = 0x00,
15 Looping = 0x01,
16 NoAnimation = 0xFF,
17};
18
20template <class AnimationTriggers>
22 uint8_t frames = 0;
24 uint8_t speed = 2;
25 AnimationTriggers triggers;
26};
27
28template <>
29struct AnimationInfo<void> {
30 uint8_t frames = 0;
32 uint8_t speed = 2;
33};
34
35#endif /* NEWGRF_ANIMATION_TYPE_H */
@ NonLooping
Animation is not looping.
@ Looping
Animation is looping.
@ NoAnimation
There is no animation.
Information about animation.
AnimationStatus status
Status.
uint8_t speed
The speed: time between frames = 2^speed ticks.
uint8_t frames
The number of frames.
AnimationTriggers triggers
The enabled animation triggers.