OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

tilehighlight_type.h
Go to the documentation of this file.
1 /* $Id: tilehighlight_type.h 23595 2011-12-19 17:48:04Z rubidium $ */
2
3 /*
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/>.
8 */
9
12 #ifndef TILEHIGHLIGHT_TYPE_H
13 #define TILEHIGHLIGHT_TYPE_H
14
15 #include "core/geometry_type.hpp"
16 #include "window_type.h"
17 #include "tile_type.h"
18 #include "viewport_type.h"
19
21 enum HighLightStyle {
22 HT_NONE = 0x000,
23 HT_RECT = 0x010,
24 HT_POINT = 0x020,
25 HT_SPECIAL = 0x030,
26 HT_DRAG = 0x040,
27 HT_LINE = 0x008,
28 HT_RAIL = 0x080,
29 HT_VEHICLE = 0x100,
30 HT_DIAGONAL = 0x200,
31 HT_DRAG_MASK = 0x0F8,
32
33 /* lower bits (used with HT_LINE and HT_RAIL):
34 * (see ASCII art in table/autorail.h for a visual interpretation) */
35 HT_DIR_X = 0,
36 HT_DIR_Y = 1,
37 HT_DIR_HU = 2,
38 HT_DIR_HL = 3,
39 HT_DIR_VL = 4,
40 HT_DIR_VR = 5,
41 HT_DIR_END,
42 HT_DIR_MASK = 0x7,
43 };
44 DECLARE_ENUM_AS_BIT_SET(HighLightStyle)
45
46
47
48 struct TileHighlightData {
49 Point pos;
50 Point size;
51 Point offs;
52 Point outersize;
53 bool diagonal;
54
55 Point new_pos;
56 Point new_size;
57 Point new_outersize;
58 byte dirty;
59
60 Point selstart;
61 Point selend;
62 byte sizelimit;
63
64 HighLightStyle drawstyle;
65 HighLightStyle next_drawstyle;
66
67 HighLightStyle place_mode;
68 WindowClass window_class;
69 WindowNumber window_number;
70
71 bool make_square_red;
72 TileIndex redsq;
73
74 ViewportPlaceMethod select_method;
75 ViewportDragDropSelectionProcess select_proc;
76
77 void Reset();
78
79 bool IsDraggingDiagonal();
80 Window *GetCallbackWnd();
81 };
82
83 #endif /* TILEHIGHLIGHT_TYPE_H */