summaryrefslogtreecommitdiff
path: root/viewport.h
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2005-01-19 20:55:23 +0000
committerdominik <dominik@openttd.org>2005-01-19 20:55:23 +0000
commitaaf09ceb268cc79fde648ab0bba8026c5277d77e (patch)
tree4721eddc93c76f7d2ab9c04a82bbb528732eeda1 /viewport.h
parent28df4a0e25d3f66dad54cee776a2b39821c686f0 (diff)
downloadopenttd-aaf09ceb268cc79fde648ab0bba8026c5277d77e.tar.xz
(svn r1571) Feature: Visually enhanced autorail placing
When using the autorail tool, the rail pieces which are going to be build are highlighted. If a piece is shown in red, this indicates that the slope/rail combination is impossible. It does not tell you if the rail line construction might not be possible because of other obstacles, e.g. houses or water.
Diffstat (limited to 'viewport.h')
-rw-r--r--viewport.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/viewport.h b/viewport.h
index 85652efa8..beba02b40 100644
--- a/viewport.h
+++ b/viewport.h
@@ -54,16 +54,39 @@ enum {
VPM_RAILDIRS = 3,
VPM_X_AND_Y = 4,
VPM_X_AND_Y_LIMITED = 5,
- VPM_SIGNALDIRS = 6,
+ VPM_SIGNALDIRS = 6
+};
+
+// viewport highlight mode (for highlighting tiles below cursor)
+enum {
+ VHM_NONE = 0, // default
+ VHM_RECT = 1, // rectangle (stations, depots, ...)
+ VHM_POINT = 2, // point (lower land, raise land, level land, ...)
+ VHM_SPECIAL = 3, // special mode used for highlighting while dragging (and for tunnels/docks)
+ VHM_DRAG = 4, // dragging items in the depot windows
+ VHM_RAIL = 5, // rail pieces
};
void VpSelectTilesWithMethod(int x, int y, int method);
+// highlighting draw styles
enum {
HT_NONE = 0,
HT_RECT = 0x80,
HT_POINT = 0x40,
- HT_LINE = 0x20,
+ HT_LINE = 0x20, /* used for autorail highlighting (longer streches)
+ * (uses lower bits to indicate direction) */
+ HT_RAIL = 0x10, /* autorail (one piece)
+ * (uses lower bits to indicate direction) */
+
+ /* lower bits (used with HT_LINE and HT_RAIL):
+ * (see ASCII art in autorail.h for a visual interpretation) */
+ HT_DIR_X = 0, // X direction
+ HT_DIR_Y = 1, // Y direction
+ HT_DIR_HU = 2, // horizontal upper
+ HT_DIR_HL = 3, // horizontal lower
+ HT_DIR_VL = 4, // vertical left
+ HT_DIR_VR = 5, // vertical right
};
typedef struct TileHighlightData {
@@ -81,9 +104,9 @@ typedef struct TileHighlightData {
byte dirty;
byte sizelimit;
- byte drawstyle;
- byte new_drawstyle;
- byte next_drawstyle;
+ byte drawstyle; // lower bits 0-3 are reserved for detailed highlight information information
+ byte new_drawstyle; // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
+ byte next_drawstyle; // queued, but not yet drawn style
byte place_mode;
bool make_square_red;