1
/* $Id: tilehighlight_type.h 15413 2009-02-08 15:45:34Z rubidium $ */
3
/** @file tilehighlight_type.h Types related to highlighting tiles. */
5
#ifndef TILEHIGHLIGHT_TYPE_H
6
#define TILEHIGHLIGHT_TYPE_H
8
#include "core/geometry_type.hpp"
10
#include "window_type.h"
11
#include "tile_type.h"
13
/** Viewport highlight mode (for highlighting tiles below cursor) */
14
enum ViewportHighlightMode {
15
VHM_NONE = 0, ///< default
16
VHM_RECT = 1, ///< rectangle (stations, depots, ...)
17
VHM_POINT = 2, ///< point (lower land, raise land, level land, ...)
18
VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
19
VHM_DRAG = 4, ///< dragging items in the depot windows
20
VHM_RAIL = 5, ///< rail pieces
23
/** Highlighting draw styles */
28
HT_LINE = 0x20, ///< used for autorail highlighting (longer streches)
29
///< (uses lower bits to indicate direction)
30
HT_RAIL = 0x10, ///< autorail (one piece)
31
///< (uses lower bits to indicate direction)
32
HT_DRAG_MASK = 0xF0, ///< masks the drag-type
34
/* lower bits (used with HT_LINE and HT_RAIL):
35
* (see ASCII art in autorail.h for a visual interpretation) */
36
HT_DIR_X = 0, ///< X direction
37
HT_DIR_Y = 1, ///< Y direction
38
HT_DIR_HU = 2, ///< horizontal upper
39
HT_DIR_HL = 3, ///< horizontal lower
40
HT_DIR_VL = 4, ///< vertical left
41
HT_DIR_VR = 5, ///< vertical right
42
HT_DIR_MASK = 0x7 ///< masks the drag-direction
44
DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
47
struct TileHighlightData {
57
Point selend, selstart;
62
byte drawstyle; // lower bits 0-3 are reserved for detailed highlight information information
63
byte new_drawstyle; // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
64
byte next_drawstyle; // queued, but not yet drawn style
66
ViewportHighlightMode place_mode;
68
WindowClass window_class;
69
WindowNumber window_number;
71
ViewportPlaceMethod select_method;
72
ViewportDragDropSelectionProcess select_proc;
77
#endif /* TILEHIGHLIGHT_TYPE_H */