viewport.h
changeset 1070 bd31ed783fd3
parent 873 732553f5b169
child 1093 4fdc46eaf423
equal deleted inserted replaced
1069:f6b7607231e5 1070:bd31ed783fd3
    52 	VPM_FIX_X = 1,
    52 	VPM_FIX_X = 1,
    53 	VPM_FIX_Y = 2,
    53 	VPM_FIX_Y = 2,
    54 	VPM_RAILDIRS = 3,
    54 	VPM_RAILDIRS = 3,
    55 	VPM_X_AND_Y = 4,
    55 	VPM_X_AND_Y = 4,
    56 	VPM_X_AND_Y_LIMITED = 5,
    56 	VPM_X_AND_Y_LIMITED = 5,
    57 	VPM_SIGNALDIRS = 6,
    57 	VPM_SIGNALDIRS = 6
       
    58 };
       
    59 
       
    60 // viewport highlight mode (for highlighting tiles below cursor)
       
    61 enum {
       
    62 	VHM_NONE = 0,    // default
       
    63 	VHM_RECT = 1,    // rectangle (stations, depots, ...)
       
    64 	VHM_POINT = 2,   // point (lower land, raise land, level land, ...)
       
    65 	VHM_SPECIAL = 3, // special mode used for highlighting while dragging (and for tunnels/docks)
       
    66 	VHM_DRAG = 4,    // dragging items in the depot windows
       
    67 	VHM_RAIL = 5,    // rail pieces
    58 };
    68 };
    59 
    69 
    60 void VpSelectTilesWithMethod(int x, int y, int method);
    70 void VpSelectTilesWithMethod(int x, int y, int method);
    61 
    71 
       
    72 // highlighting draw styles
    62 enum {
    73 enum {
    63 	HT_NONE = 0,
    74 	HT_NONE = 0,
    64 	HT_RECT = 0x80,
    75 	HT_RECT = 0x80,
    65 	HT_POINT = 0x40,
    76 	HT_POINT = 0x40,
    66 	HT_LINE = 0x20,
    77 	HT_LINE = 0x20, /* used for autorail highlighting (longer streches)
       
    78 									 * (uses lower bits to indicate direction) */
       
    79 	HT_RAIL = 0x10, /* autorail (one piece)
       
    80 									 * (uses lower bits to indicate direction) */
       
    81 
       
    82 	/* lower bits (used with HT_LINE and HT_RAIL): 
       
    83 	 * (see ASCII art in autorail.h for a visual interpretation) */
       
    84 	HT_DIR_X = 0,  // X direction
       
    85 	HT_DIR_Y = 1,  // Y direction
       
    86 	HT_DIR_HU = 2, // horizontal upper
       
    87 	HT_DIR_HL = 3, // horizontal lower
       
    88 	HT_DIR_VL = 4, // vertical left
       
    89 	HT_DIR_VR = 5, // vertical right
    67 };
    90 };
    68 
    91 
    69 typedef struct TileHighlightData {
    92 typedef struct TileHighlightData {
    70 	Point size;
    93 	Point size;
    71 	Point outersize;
    94 	Point outersize;
    79 	Point selend, selstart;
   102 	Point selend, selstart;
    80 
   103 
    81 	byte dirty;
   104 	byte dirty;
    82 	byte sizelimit;
   105 	byte sizelimit;
    83 
   106 
    84 	byte drawstyle;
   107 	byte drawstyle;      // lower bits 0-3 are reserved for detailed highlight information information
    85 	byte new_drawstyle;
   108 	byte new_drawstyle;  // only used in UpdateTileSelection() to as a buffer to compare if there was a change between old and new
    86 	byte next_drawstyle;
   109 	byte next_drawstyle; // queued, but not yet drawn style
    87 
   110 
    88 	byte place_mode;
   111 	byte place_mode;
    89 	bool make_square_red;
   112 	bool make_square_red;
    90 	WindowClass window_class;
   113 	WindowClass window_class;
    91 	WindowNumber window_number;
   114 	WindowNumber window_number;