OpenTTD Source  20241120-master-g6d3adc6169
tilehighlight_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 <http://www.gnu.org/licenses/>.
6  */
7 
10 #ifndef TILEHIGHLIGHT_TYPE_H
11 #define TILEHIGHLIGHT_TYPE_H
12 
13 #include "core/geometry_type.hpp"
14 #include "window_type.h"
15 #include "tile_type.h"
16 #include "viewport_type.h"
17 
20  HT_NONE = 0x000,
21  HT_RECT = 0x010,
22  HT_POINT = 0x020,
23  HT_SPECIAL = 0x030,
24  HT_DRAG = 0x040,
25  HT_LINE = 0x008,
26  HT_RAIL = 0x080,
27  HT_VEHICLE = 0x100,
28  HT_DIAGONAL = 0x200,
29  HT_DRAG_MASK = 0x0F8,
30 
31  /* lower bits (used with HT_LINE and HT_RAIL):
32  * (see ASCII art in table/autorail.h for a visual interpretation) */
33  HT_DIR_X = 0,
34  HT_DIR_Y = 1,
35  HT_DIR_HU = 2,
36  HT_DIR_HL = 3,
37  HT_DIR_VL = 4,
38  HT_DIR_VR = 5,
40  HT_DIR_MASK = 0x7,
41 };
43 
44 
45 
51  bool diagonal;
52 
53  bool freeze;
54 
58  uint8_t dirty;
59 
62  uint8_t sizelimit;
63 
66 
70 
73 
76 
77  void Reset();
78 
79  bool IsDraggingDiagonal();
80  Window *GetCallbackWnd();
81 };
82 
83 #endif /* TILEHIGHLIGHT_TYPE_H */
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
All geometry types in OpenTTD.
Coordinates of a point in 2D.
Metadata about the current highlighting.
TileIndex redsq
The tile that has to get a red selection.
Point new_pos
New value for pos; used to determine whether to redraw the selection.
bool make_square_red
Whether to give a tile a red selection.
ViewportDragDropSelectionProcess select_proc
The procedure that has to be called when the selection is done.
Point selstart
The location where the dragging started.
Point new_outersize
New value for outersize; used to determine whether to redraw the selection.
HighLightStyle drawstyle
Lower bits 0-3 are reserved for detailed highlight information.
HighLightStyle place_mode
Method which is used to place the selection.
WindowClass window_class
The WindowClass of the window that is responsible for the selection mode.
uint8_t dirty
Whether the build station window needs to redraw due to the changed selection.
Point offs
Offset, in tile "units", for the blue coverage area from the selected area's northern tile.
Point size
Size, in tile "units", of the white/red selection area.
uint8_t sizelimit
Whether the selection is limited in length, and what the maximum length is.
Point pos
Location, in tile "units", of the northern tile of the selected area.
Point outersize
Size, in tile "units", of the blue coverage area excluding the side of the selected area.
bool diagonal
Whether the dragged area is a 45 degrees rotated rectangle.
Point selend
The location where the drag currently ends.
Point new_size
New value for size; used to determine whether to redraw the selection.
bool freeze
Freeze highlight in place.
HighLightStyle next_drawstyle
Queued, but not yet drawn style.
ViewportPlaceMethod select_method
The method which governs how tiles are selected.
WindowNumber window_number
The WindowNumber of the window that is responsible for the selection mode.
Data structure for an opened window.
Definition: window_gui.h:273
Types related to tiles.
HighLightStyle
Highlighting draw styles.
@ HT_LINE
used for autorail highlighting (longer stretches), lower bits: direction
@ HT_DIR_HL
horizontal lower
@ HT_DIR_HU
horizontal upper
@ HT_DRAG
dragging items in the depot windows
@ HT_NONE
default
@ HT_DIR_X
X direction.
@ HT_DIAGONAL
Also allow 'diagonal rectangles'. Only usable in combination with HT_RECT or HT_POINT.
@ HT_POINT
point (lower land, raise land, level land, ...)
@ HT_RECT
rectangle (stations, depots, ...)
@ HT_DIR_MASK
masks the drag-direction
@ HT_RAIL
autorail (one piece), lower bits: direction
@ HT_DIR_END
end marker
@ HT_DRAG_MASK
Mask for the tile drag-type modes.
@ HT_DIR_VL
vertical left
@ HT_VEHICLE
vehicle is accepted as target as well (bitmask)
@ HT_DIR_VR
vertical right
@ HT_SPECIAL
special mode used for highlighting while dragging (and for tunnels/docks)
@ HT_DIR_Y
Y direction.
Types related to viewports.
ViewportDragDropSelectionProcess
Drag and drop selection process, or, what to do with an area of land when you've selected it.
ViewportPlaceMethod
Viewport place method (type of highlighted area and placed objects)
Definition: viewport_type.h:92
Types related to windows.
int32_t WindowNumber
Number to differentiate different windows of the same class.
Definition: window_type.h:737
WindowClass
Window classes.
Definition: window_type.h:44