# tilehighlight_type.h

Go to the documentation of this file.

    00001 /* $Id: tilehighlight_type.h 17248 2009-08-21 20:21:05Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef TILEHIGHLIGHT_TYPE_H
    00013 #define TILEHIGHLIGHT_TYPE_H
    00014
    00015 #include "core/geometry_type.hpp"
    00016 #include "zoom_type.h"
    00017 #include "window_type.h"
    00018 #include "tile_type.h"
    00019
    00021 enum HighLightStyle {
    00022   HT_NONE      = 0x00,
    00023   HT_RECT      = 0x10,
    00024   HT_POINT     = 0x20,
    00025   HT_SPECIAL   = 0x30,
    00026   HT_DRAG      = 0x40,
    00027   HT_LINE      = 0x08,
    00028   HT_RAIL      = 0x80,
    00029   HT_DRAG_MASK = 0xF8,
    00030
    00031   /* lower bits (used with HT_LINE and HT_RAIL):
    00032    * (see ASCII art in autorail.h for a visual interpretation) */
    00033   HT_DIR_X  = 0,
    00034   HT_DIR_Y  = 1,
    00035   HT_DIR_HU = 2,
    00036   HT_DIR_HL = 3,
    00037   HT_DIR_VL = 4,
    00038   HT_DIR_VR = 5,
    00039   HT_DIR_END,
    00040   HT_DIR_MASK = 0x7
    00041 };
    00042 DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
    00043
    00044
    00045 struct TileHighlightData {
    00046   Point size;
    00047   Point outersize;
    00048   Point pos;
    00049   Point offs;
    00050
    00051   Point new_pos;
    00052   Point new_size;
    00053   Point new_outersize;
    00054
    00055   Point selend, selstart;
    00056
    00057   byte dirty;
    00058   byte sizelimit;
    00059
    00060   HighLightStyle drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
    00061   HighLightStyle new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
    00062   HighLightStyle next_drawstyle; // queued, but not yet drawn style
    00063
    00064   HighLightStyle place_mode;
    00065   bool make_square_red;
    00066   WindowClass window_class;
    00067   WindowNumber window_number;
    00068
    00069   ViewportPlaceMethod select_method;
    00070   ViewportDragDropSelectionProcess select_proc;
    00071
    00072   TileIndex redsq;
    00073 };
    00074
    00075 #endif /* TILEHIGHLIGHT_TYPE_H */