From 037d8c6149baf8e404459f679d005042dfbb64ef Mon Sep 17 00:00:00 2001 From: Juanjo Date: Fri, 27 Dec 2013 18:30:36 +0000 Subject: [PATCH] Add: Add two "tracks": depot and wormhole. --- src/track_type.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/track_type.h b/src/track_type.h index e3c3f22b67..89a30cd5d2 100644 --- a/src/track_type.h +++ b/src/track_type.h @@ -14,7 +14,8 @@ /** * These are used to specify a single track. - * Can be translated to a trackbit with TrackToTrackbit + * Can be translated to a trackbit with TrackToTrackbit. + * TRACK_WORMHOLE and TRACK_DEPOT do not represent single tracks but states; they cannot be translated to trackbits. */ enum Track : uint8_t { TRACK_BEGIN = 0, ///< Used for iterations @@ -24,7 +25,9 @@ enum Track : uint8_t { TRACK_LOWER = 3, ///< Track in the lower corner of the tile (south) TRACK_LEFT = 4, ///< Track in the left corner of the tile (west) TRACK_RIGHT = 5, ///< Track in the right corner of the tile (east) - TRACK_END, ///< Used for iterations + TRACK_END = 6, ///< Used for iterations + TRACK_WORMHOLE = TRACK_END, + TRACK_DEPOT = 7, INVALID_TRACK = 0xFF, ///< Flag for an invalid track }; @@ -49,8 +52,8 @@ enum TrackBits : uint8_t { TRACK_BIT_3WAY_NW = TRACK_BIT_Y | TRACK_BIT_UPPER | TRACK_BIT_LEFT, ///< "Arrow" to the north-west TRACK_BIT_ALL = TRACK_BIT_CROSS | TRACK_BIT_HORZ | TRACK_BIT_VERT, ///< All possible tracks TRACK_BIT_MASK = 0x3FU, ///< Bitmask for the first 6 bits - TRACK_BIT_WORMHOLE = 0x40U, ///< Bitflag for a wormhole (used for tunnels) - TRACK_BIT_DEPOT = 0x80U, ///< Bitflag for a depot + TRACK_BIT_WORMHOLE = 1U << TRACK_WORMHOLE, ///< Bitflag for a wormhole (used for tunnels) + TRACK_BIT_DEPOT = 1U << TRACK_DEPOT, ///< Bitflag for a depot INVALID_TRACK_BIT = 0xFF, ///< Flag for an invalid trackbits value }; DECLARE_ENUM_AS_BIT_SET(TrackBits)