tron@2186: /* $Id$ */ tron@2186: rubidium@10445: /** @file tilehighlight_type.h Types related to highlighting tiles. */ belugas@6919: rubidium@10445: #ifndef TILEHIGHLIGHT_TYPE_H rubidium@10445: #define TILEHIGHLIGHT_TYPE_H truelight@0: rubidium@8721: #include "core/geometry_type.hpp" rubidium@8619: #include "zoom_type.h" rubidium@8602: #include "window_type.h" rubidium@8720: #include "tile_type.h" truelight@7120: smatz@8414: /** Viewport highlight mode (for highlighting tiles below cursor) */ rubidium@8385: enum ViewportHighlightMode { belugas@6919: VHM_NONE = 0, ///< default belugas@6919: VHM_RECT = 1, ///< rectangle (stations, depots, ...) belugas@6919: VHM_POINT = 2, ///< point (lower land, raise land, level land, ...) belugas@6919: VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks) belugas@6919: VHM_DRAG = 4, ///< dragging items in the depot windows belugas@6919: VHM_RAIL = 5, ///< rail pieces truelight@0: }; truelight@0: rubidium@10083: /** Highlighting draw styles */ rubidium@8720: enum HighLightStyle { rubidium@4344: HT_NONE = 0x00, rubidium@4344: HT_RECT = 0x80, rubidium@4344: HT_POINT = 0x40, belugas@6919: HT_LINE = 0x20, ///< used for autorail highlighting (longer streches) belugas@6919: ///< (uses lower bits to indicate direction) belugas@6919: HT_RAIL = 0x10, ///< autorail (one piece) belugas@6919: ///< (uses lower bits to indicate direction) Darkvater@4799: HT_DRAG_MASK = 0xF0, ///< masks the drag-type dominik@1070: tron@1109: /* lower bits (used with HT_LINE and HT_RAIL): dominik@1070: * (see ASCII art in autorail.h for a visual interpretation) */ Darkvater@4799: HT_DIR_X = 0, ///< X direction Darkvater@4799: HT_DIR_Y = 1, ///< Y direction Darkvater@4799: HT_DIR_HU = 2, ///< horizontal upper Darkvater@4799: HT_DIR_HL = 3, ///< horizontal lower Darkvater@4799: HT_DIR_VL = 4, ///< vertical left Darkvater@4799: HT_DIR_VR = 5, ///< vertical right Darkvater@4799: HT_DIR_MASK = 0x7 ///< masks the drag-direction truelight@0: }; rubidium@8720: DECLARE_ENUM_AS_BIT_SET(HighLightStyle); rubidium@8720: truelight@0: rubidium@6574: struct TileHighlightData { truelight@0: Point size; truelight@0: Point outersize; truelight@0: Point pos; truelight@0: Point offs; truelight@0: truelight@0: Point new_pos; truelight@0: Point new_size; truelight@0: Point new_outersize; truelight@0: truelight@0: Point selend, selstart; truelight@0: truelight@0: byte dirty; truelight@0: byte sizelimit; truelight@0: dominik@1070: byte drawstyle; // lower bits 0-3 are reserved for detailed highlight information information dominik@1070: byte new_drawstyle; // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new dominik@1070: byte next_drawstyle; // queued, but not yet drawn style truelight@0: smatz@8414: ViewportHighlightMode place_mode; truelight@0: bool make_square_red; tron@873: WindowClass window_class; tron@873: WindowNumber window_number; truelight@0: rubidium@8384: ViewportPlaceMethod select_method; rubidium@10466: ViewportDragDropSelectionProcess select_proc; maedhros@7165: truelight@0: TileIndex redsq; rubidium@6574: }; truelight@0: rubidium@10445: #endif /* TILEHIGHLIGHT_TYPE_H */