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 
8 /** @file newgrf_animation_type.h Definitions related to NewGRF animation. */
9 
10 #ifndef NEWGRF_ANIMATION_TYPE_H
11 #define NEWGRF_ANIMATION_TYPE_H
12 
13 static const uint8 ANIM_STATUS_NON_LOOPING  = 0x00; ///< Animation is not looping.
14 static const uint8 ANIM_STATUS_LOOPING      = 0x01; ///< Animation is looping.
15 static const uint8 ANIM_STATUS_NO_ANIMATION = 0xFF; ///< There is no animation.
16 
17 /** Information about animation. */
18 struct AnimationInfo {
19 	uint8  frames;   ///< The number of frames.
20 	uint8  status;   ///< Status; 0: no looping, 1: looping, 0xFF: no animation.
21 	uint8  speed;    ///< The speed, i.e. the amount of time between frames.
22 	uint16 triggers; ///< The triggers that trigger animation.
23 };
24 
25 /** Animation triggers for station. */
26 enum StationAnimationTrigger {
27 	SAT_BUILT,         ///< Trigger tile when built.
28 	SAT_NEW_CARGO,     ///< Trigger station on new cargo arrival.
29 	SAT_CARGO_TAKEN,   ///< Trigger station when cargo is completely taken.
30 	SAT_TRAIN_ARRIVES, ///< Trigger platform when train arrives.
31 	SAT_TRAIN_DEPARTS, ///< Trigger platform when train leaves.
32 	SAT_TRAIN_LOADS,   ///< Trigger platform when train loads/unloads.
33 	SAT_250_TICKS,     ///< Trigger station every 250 ticks.
34 };
35 
36 /** Animation triggers of the industries. */
37 enum IndustryAnimationTrigger {
38 	IAT_CONSTRUCTION_STATE_CHANGE,  ///< Trigger whenever the construction state changes.
39 	IAT_TILELOOP,                   ///< Trigger in the periodic tile loop.
40 	IAT_INDUSTRY_TICK,              ///< Trigger every tick.
41 	IAT_INDUSTRY_RECEIVED_CARGO,    ///< Trigger when cargo is received .
42 	IAT_INDUSTRY_DISTRIBUTES_CARGO, ///< Trigger when cargo is distributed.
43 };
44 
45 /** Animation triggers for airport tiles */
46 enum AirpAnimationTrigger {
47 	AAT_BUILT,                   ///< Triggered when the airport is built (for all tiles at the same time).
48 	AAT_TILELOOP,                ///< Triggered in the periodic tile loop.
49 	AAT_STATION_NEW_CARGO,       ///< Triggered when new cargo arrives at the station (for all tiles at the same time).
50 	AAT_STATION_CARGO_TAKEN,     ///< Triggered when a cargo type is completely removed from the station (for all tiles at the same time).
51 	AAT_STATION_250_TICKS,       ///< Triggered every 250 ticks (for all tiles at the same time).
52 	AAT_STATION_AIRPLANE_LAND,   ///< Triggered when an airplane (not a helicopter) touches down at the airport (for single tile).
53 };
54 
55 /** Animation triggers for objects. */
56 enum ObjectAnimationTrigger {
57 	OAT_BUILT,     ///< Triggered when the object is built (for all tiles at the same time).
58 	OAT_TILELOOP,  ///< Triggered in the periodic tile loop.
59 	OAT_256_TICKS, ///< Triggered every 256 ticks (for all tiles at the same time).
60 };
61 
62 #endif /* NEWGRF_ANIMATION_TYPE_H */
63