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/>.
10 * This file defines all the the animated cursors.
11 * Animated cursors consist of the number of sprites that are
12 * displayed in a round-robin manner. Each sprite also has a time
13 * associated that indicates how many ticks the corresponding sprite
18 * Creates two array entries that define one
19 * status of the cursor.
20 * @param Sprite The Sprite to be displayed
21 * @param display_time The Number of ticks to display the sprite
23 #define ANIM_CURSOR_LINE(Sprite, display_time) { Sprite, display_time },
26 * This indicates the termination of the cursor list
28 #define ANIM_CURSOR_END() ANIM_CURSOR_LINE(AnimCursor::LAST, 0)
31 * Animated cursor elements for demolition
33 static const AnimCursor _demolish_animcursor
[] = {
34 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_FIRST
, 8)
35 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_1
, 8)
36 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_2
, 8)
37 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_LAST
, 8)
42 * Animated cursor elements for lower land
44 static const AnimCursor _lower_land_animcursor
[] = {
45 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_FIRST
, 10)
46 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_1
, 10)
47 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_LAST
, 29)
52 * Animated cursor elements for raise land
54 static const AnimCursor _raise_land_animcursor
[] = {
55 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_FIRST
, 10)
56 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_1
, 10)
57 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_LAST
, 29)
62 * Animated cursor elements for the goto icon
64 static const AnimCursor _order_goto_animcursor
[] = {
65 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_FIRST
, 10)
66 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_1
, 10)
67 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_LAST
, 29)
72 * Animated cursor elements for the build signal icon
74 static const AnimCursor _build_signals_animcursor
[] = {
75 ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_FIRST
, 20)
76 ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_LAST
, 20)
81 * This is an array of pointers to all the animated cursor
82 * definitions we have above. This is the only thing that is
83 * accessed directly from other files
85 static const AnimCursor
* const _animcursors
[] = {
87 _lower_land_animcursor
,
88 _raise_land_animcursor
,
89 _order_goto_animcursor
,
90 _build_signals_animcursor