OpenTTD Source 20260129-master-g2bb01bd0e4
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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef NEWGRF_ANIMATION_TYPE_H
11#define NEWGRF_ANIMATION_TYPE_H
12
14enum class AnimationStatus : uint8_t {
15 NonLooping = 0x00,
16 Looping = 0x01,
17 NoAnimation = 0xFF,
18};
19
21template <class AnimationTriggers>
23 uint8_t frames = 0;
25 uint8_t speed = 2;
26 AnimationTriggers triggers;
27};
28
29template <>
30struct AnimationInfo<void> {
31 uint8_t frames = 0;
33 uint8_t speed = 2;
34};
35
36#endif /* NEWGRF_ANIMATION_TYPE_H */
AnimationStatus
Statuses of animation within NewGRFs.
@ 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.