~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/tilehighlight_type.h

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: tilehighlight_type.h 15413 2009-02-08 15:45:34Z rubidium $ */
 
2
 
 
3
/** @file tilehighlight_type.h Types related to highlighting tiles. */
 
4
 
 
5
#ifndef TILEHIGHLIGHT_TYPE_H
 
6
#define TILEHIGHLIGHT_TYPE_H
 
7
 
 
8
#include "core/geometry_type.hpp"
 
9
#include "zoom_type.h"
 
10
#include "window_type.h"
 
11
#include "tile_type.h"
 
12
 
 
13
/** Viewport highlight mode (for highlighting tiles below cursor) */
 
14
enum ViewportHighlightMode {
 
15
        VHM_NONE    = 0, ///< default
 
16
        VHM_RECT    = 1, ///< rectangle (stations, depots, ...)
 
17
        VHM_POINT   = 2, ///< point (lower land, raise land, level land, ...)
 
18
        VHM_SPECIAL = 3, ///< special mode used for highlighting while dragging (and for tunnels/docks)
 
19
        VHM_DRAG    = 4, ///< dragging items in the depot windows
 
20
        VHM_RAIL    = 5, ///< rail pieces
 
21
};
 
22
 
 
23
/** Highlighting draw styles */
 
24
enum HighLightStyle {
 
25
        HT_NONE   = 0x00,
 
26
        HT_RECT   = 0x80,
 
27
        HT_POINT  = 0x40,
 
28
        HT_LINE   = 0x20,    ///< used for autorail highlighting (longer streches)
 
29
                             ///< (uses lower bits to indicate direction)
 
30
        HT_RAIL   = 0x10,    ///< autorail (one piece)
 
31
                             ///< (uses lower bits to indicate direction)
 
32
        HT_DRAG_MASK = 0xF0, ///< masks the drag-type
 
33
 
 
34
        /* lower bits (used with HT_LINE and HT_RAIL):
 
35
         * (see ASCII art in autorail.h for a visual interpretation) */
 
36
        HT_DIR_X  = 0,    ///< X direction
 
37
        HT_DIR_Y  = 1,    ///< Y direction
 
38
        HT_DIR_HU = 2,    ///< horizontal upper
 
39
        HT_DIR_HL = 3,    ///< horizontal lower
 
40
        HT_DIR_VL = 4,    ///< vertical left
 
41
        HT_DIR_VR = 5,    ///< vertical right
 
42
        HT_DIR_MASK = 0x7 ///< masks the drag-direction
 
43
};
 
44
DECLARE_ENUM_AS_BIT_SET(HighLightStyle);
 
45
 
 
46
 
 
47
struct TileHighlightData {
 
48
        Point size;
 
49
        Point outersize;
 
50
        Point pos;
 
51
        Point offs;
 
52
 
 
53
        Point new_pos;
 
54
        Point new_size;
 
55
        Point new_outersize;
 
56
 
 
57
        Point selend, selstart;
 
58
 
 
59
        byte dirty;
 
60
        byte sizelimit;
 
61
 
 
62
        byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
 
63
        byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
 
64
        byte next_drawstyle; // queued, but not yet drawn style
 
65
 
 
66
        ViewportHighlightMode place_mode;
 
67
        bool make_square_red;
 
68
        WindowClass window_class;
 
69
        WindowNumber window_number;
 
70
 
 
71
        ViewportPlaceMethod select_method;
 
72
        ViewportDragDropSelectionProcess select_proc;
 
73
 
 
74
        TileIndex redsq;
 
75
};
 
76
 
 
77
#endif /* TILEHIGHLIGHT_TYPE_H */