src/tilehighlight_type.h
author belugas
Sun, 15 Jun 2008 02:48:25 +0000
changeset 10965 a2b5f6f9be0c
parent 10466 54dfadd481b0
permissions -rw-r--r--
(svn r13519) -Feature[newGRF]: Implement var 63, variational action2 variable for Houses.
Or, in more simple terms, the check for the animation frame of nearby house.
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2116
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2116
diff changeset
     2
10445
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10083
diff changeset
     3
/** @file tilehighlight_type.h Types related to highlighting tiles. */
6919
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
     4
10445
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10083
diff changeset
     5
#ifndef TILEHIGHLIGHT_TYPE_H
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10083
diff changeset
     6
#define TILEHIGHLIGHT_TYPE_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8721
b7971ad9bdd9 (svn r11788) -Fix (11787): makedepend doesn't mark delete files as changed...
rubidium
parents: 8720
diff changeset
     8
#include "core/geometry_type.hpp"
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     9
#include "zoom_type.h"
8602
9e75e594a068 (svn r11667) -Codechange: split window.h into a header that defines some 'global' window related types, on that defined 'global' window functions and one that defines functions and types only used by *_gui.cpps.
rubidium
parents: 8414
diff changeset
    10
#include "window_type.h"
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
    11
#include "tile_type.h"
7120
e31767effc16 (svn r9844) -Codechange: replace zoomlevel with an enum
truelight
parents: 6919
diff changeset
    12
8414
8c2ecc2dc12c (svn r11471) -Codechange: one more variable retyped to enum ViewportHighlightMode
smatz
parents: 8385
diff changeset
    13
/** Viewport highlight mode (for highlighting tiles below cursor) */
8385
aedd7656cfd1 (svn r11440) -Codechange: replace magic numbers with enumified WindowHighlightMode constants. Patch by SmatZ.
rubidium
parents: 8384
diff changeset
    14
enum ViewportHighlightMode {
6919
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    15
	VHM_NONE    = 0, ///< default
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    16
	VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    17
	VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    18
	VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    19
	VHM_DRAG    = 4, ///< dragging items in the depot windows
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    20
	VHM_RAIL    = 5, ///< rail pieces
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    22
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    23
/** Highlighting draw styles */
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
    24
enum HighLightStyle {
4344
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 2817
diff changeset
    25
	HT_NONE   = 0x00,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 2817
diff changeset
    26
	HT_RECT   = 0x80,
5d0e40cd67b9 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct.
rubidium
parents: 2817
diff changeset
    27
	HT_POINT  = 0x40,
6919
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    28
	HT_LINE   = 0x20,    ///< used for autorail highlighting (longer streches)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    29
	                     ///< (uses lower bits to indicate direction)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    30
	HT_RAIL   = 0x10,    ///< autorail (one piece)
339210ecccd3 (svn r9559) -Documentation: doxygen and comment changes: 'U' and 'V' now. Almost done. Yeah. I know, I've already said that...
belugas
parents: 6574
diff changeset
    31
	                     ///< (uses lower bits to indicate direction)
4799
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    32
	HT_DRAG_MASK = 0xF0, ///< masks the drag-type
1070
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    33
1109
1bab892228cd (svn r1610) Remove trailing whitespace (last time ever, i hope)
tron
parents: 1093
diff changeset
    34
	/* lower bits (used with HT_LINE and HT_RAIL):
1070
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    35
	 * (see ASCII art in autorail.h for a visual interpretation) */
4799
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    36
	HT_DIR_X  = 0,    ///< X direction
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    37
	HT_DIR_Y  = 1,    ///< Y direction
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    38
	HT_DIR_HU = 2,    ///< horizontal upper
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    39
	HT_DIR_HL = 3,    ///< horizontal lower
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    40
	HT_DIR_VL = 4,    ///< vertical left
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    41
	HT_DIR_VR = 5,    ///< vertical right
a32af5dd7b6c (svn r6721) -Codechange: some comments, aligning, types and variable localization.
Darkvater
parents: 4344
diff changeset
    42
	HT_DIR_MASK = 0x7 ///< masks the drag-direction
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
};
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
    44
DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
    45
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    47
struct TileHighlightData {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    48
	Point size;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    49
	Point outersize;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
	Point pos;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
	Point offs;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
	Point new_pos;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
	Point new_size;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
	Point new_outersize;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
	Point selend, selstart;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    58
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    59
	byte dirty;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    60
	byte sizelimit;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
1070
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    62
	byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    63
	byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    64
	byte next_drawstyle; // queued, but not yet drawn style
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
8414
8c2ecc2dc12c (svn r11471) -Codechange: one more variable retyped to enum ViewportHighlightMode
smatz
parents: 8385
diff changeset
    66
	ViewportHighlightMode place_mode;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
	bool make_square_red;
873
46e892485be3 (svn r1354) Use WindowClass/WindowNumber to store/pass window class/number, not some arbitrary data types
tron
parents: 849
diff changeset
    68
	WindowClass window_class;
46e892485be3 (svn r1354) Use WindowClass/WindowNumber to store/pass window class/number, not some arbitrary data types
tron
parents: 849
diff changeset
    69
	WindowNumber window_number;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
8384
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    71
	ViewportPlaceMethod select_method;
10466
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10445
diff changeset
    72
	ViewportDragDropSelectionProcess select_proc;
7165
37eb253f3c06 (svn r9900) -Codechange: Separate the variables for how to highlight a land area and what to do with it afterwards.
maedhros
parents: 7120
diff changeset
    73
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    74
	TileIndex redsq;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6573
diff changeset
    75
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    76
10445
2dd7d9d0a957 (svn r12987) -Codechange: split viewport and tile selection.
rubidium
parents: 10083
diff changeset
    77
#endif /* TILEHIGHLIGHT_TYPE_H */