1 /* $Id: animcursors.h 24900 2013-01-08 22:46:42Z planetmaker $ */
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
12 * This file defines all the the animated cursors.
13 * Animated cursors consist of the number of sprites that are
14 * displayed in a round-robin manner. Each sprite also has a time
15 * associated that indicates how many ticks the corresponding sprite
20 * Creates two array entries that define one
21 * status of the cursor.
22 * @param Sprite The Sprite to be displayed
23 * @param display_time The Number of ticks to display the sprite
25 #define ANIM_CURSOR_LINE(Sprite, display_time) { Sprite, display_time },
28 * This indicates the termination of the cursor list
30 #define ANIM_CURSOR_END() ANIM_CURSOR_LINE(AnimCursor::LAST, 0)
33 * Animated cursor elements for demolition
35 static const AnimCursor _demolish_animcursor
[] = {
36 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_FIRST
, 8)
37 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_1
, 8)
38 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_2
, 8)
39 ANIM_CURSOR_LINE(SPR_CURSOR_DEMOLISH_LAST
, 8)
44 * Animated cursor elements for lower land
46 static const AnimCursor _lower_land_animcursor
[] = {
47 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_FIRST
, 10)
48 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_1
, 10)
49 ANIM_CURSOR_LINE(SPR_CURSOR_LOWERLAND_LAST
, 29)
54 * Animated cursor elements for raise land
56 static const AnimCursor _raise_land_animcursor
[] = {
57 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_FIRST
, 10)
58 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_1
, 10)
59 ANIM_CURSOR_LINE(SPR_CURSOR_RAISELAND_LAST
, 29)
64 * Animated cursor elements for the goto icon
66 static const AnimCursor _order_goto_animcursor
[] = {
67 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_FIRST
, 10)
68 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_1
, 10)
69 ANIM_CURSOR_LINE(SPR_CURSOR_PICKSTATION_LAST
, 29)
74 * Animated cursor elements for the build signal icon
76 static const AnimCursor _build_signals_animcursor
[] = {
77 ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_FIRST
, 20)
78 ANIM_CURSOR_LINE(SPR_CURSOR_BUILDSIGNALS_LAST
, 20)
83 * This is an array of pointers to all the animated cursor
84 * definitions we have above. This is the only thing that is
85 * accessed directly from other files
87 static const AnimCursor
* const _animcursors
[] = {
89 _lower_land_animcursor
,
90 _raise_land_animcursor
,
91 _order_goto_animcursor
,
92 _build_signals_animcursor