src/viewport_type.h
author Tero Marttila <terom@fixme.fi>
Fri, 18 Jul 2008 22:41:08 +0300
changeset 11177 6d9a43c48924
parent 10466 54dfadd481b0
permissions -rw-r--r--
set the GRFConfig's next ptr to NULL
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
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
     3
/** @file viewport_type.h Types related to viewports. */
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
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
     5
#ifndef VIEWPORT_TYPE_H
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
     6
#define VIEWPORT_TYPE_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
8619
c2434269c3eb (svn r11684) -Codechange: split gfx.h in a type and functional header.
rubidium
parents: 8617
diff changeset
     8
#include "zoom_type.h"
7120
e31767effc16 (svn r9844) -Codechange: replace zoomlevel with an enum
truelight
parents: 6919
diff changeset
     9
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    10
/**
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    11
 * Data structure for viewport, display of a part of the world
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    12
 */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
struct ViewPort {
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    14
	int left;    ///< Screen coordinate left egde of the viewport
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    15
	int top;     ///< Screen coordinate top edge of the viewport
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    16
	int width;   ///< Screen width of the viewport
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    17
	int height;  ///< Screen height of the viewport
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
10083
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    19
	int virtual_left;    ///< Virtual left coordinate
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    20
	int virtual_top;     ///< Virtual top coordinate
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    21
	int virtual_width;   ///< width << zoom
9fb63cf5cc90 (svn r12619) -Codechange: lots of documentation about window related stuff. Patch by Alberth.
rubidium
parents: 8721
diff changeset
    22
	int virtual_height;  ///< height << zoom
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
7120
e31767effc16 (svn r9844) -Codechange: replace zoomlevel with an enum
truelight
parents: 6919
diff changeset
    24
	ZoomLevel zoom;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    25
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
10447
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    27
struct ViewportSign {
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    28
	int32 left;
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    29
	int32 top;
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    30
	byte width_1, width_2;
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    31
};
a73b8ec66203 (svn r12989) -Codechange: move ViewportSign to viewport_type.h.
rubidium
parents: 10445
diff changeset
    32
5044
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    33
enum {
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    34
	ZOOM_IN   = 0,
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    35
	ZOOM_OUT  = 1,
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    36
	ZOOM_NONE = 2, // hack, used to update the button status
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    37
};
7e70387677e5 (svn r7093) -Codechange: Move DoZoomInOutWindow declaration to viewport.h and rewrite the function
Darkvater
parents: 5026
diff changeset
    38
8097
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    39
/**
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    40
 * Some values for constructing bounding boxes (BB). The Z positions under bridges are:
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    41
 * z=0..5  Everything that can be built under low bridges.
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    42
 * z=6     reserved, currently unused.
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    43
 * z=7     Z separator between bridge/tunnel and the things under/above it.
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    44
 */
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    45
enum {
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    46
	BB_HEIGHT_UNDER_BRIDGE = 6, ///< Everything that can be built under low bridges, must not exceed this Z height.
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    47
	BB_Z_SEPARATOR  = 7,        ///< Separates the bridge/tunnel from the things under/above it.
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    48
};
68eefbb4ff46 (svn r11128) -Fix: a lot of graphical glitches by changing some bounding boxes. It's not perfect yet, but a *very* good step into the right direction. Patch by frosch.
rubidium
parents: 8076
diff changeset
    49
8384
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    50
/** Viewport place method (type of highlighted area and placed objects) */
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    51
enum ViewportPlaceMethod {
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    52
	VPM_X_OR_Y          = 0, ///< drag in X or Y direction
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    53
	VPM_FIX_X           = 1, ///< drag only in X axis
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    54
	VPM_FIX_Y           = 2, ///< drag only in Y axis
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    55
	VPM_RAILDIRS        = 3, ///< all rail directions
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    56
	VPM_X_AND_Y         = 4, ///< area of land in X and Y directions
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    57
	VPM_X_AND_Y_LIMITED = 5, ///< area of land of limited size
cda01fb6ec2a (svn r11439) -Codechange: replace some magic numbers by a ViewportPlaceMethod enumified constant. Patch by SmatZ.
rubidium
parents: 8177
diff changeset
    58
	VPM_SIGNALDIRS      = 6, ///< similiar to VMP_RAILDIRS, but with different cursor
1070
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    59
};
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 873
diff changeset
    60
10466
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    61
/** Drag and drop selection process, or, what to do with an area of land when
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    62
 * you've selected it. */
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    63
enum ViewportDragDropSelectionProcess {
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    64
	DDSP_DEMOLISH_AREA,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    65
	DDSP_RAISE_AND_LEVEL_AREA,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    66
	DDSP_LOWER_AND_LEVEL_AREA,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    67
	DDSP_LEVEL_AREA,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    68
	DDSP_CREATE_DESERT,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    69
	DDSP_CREATE_ROCKS,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    70
	DDSP_CREATE_WATER,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    71
	DDSP_CREATE_RIVER,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    72
	DDSP_PLANT_TREES,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    73
	DDSP_BUILD_BRIDGE,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    74
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    75
	/* Rail specific actions */
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    76
	DDSP_PLACE_RAIL_NE,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    77
	DDSP_PLACE_RAIL_NW,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    78
	DDSP_PLACE_AUTORAIL,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    79
	DDSP_BUILD_SIGNALS,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    80
	DDSP_BUILD_STATION,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    81
	DDSP_REMOVE_STATION,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    82
	DDSP_CONVERT_RAIL,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    83
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    84
	/* Road specific actions */
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    85
	DDSP_PLACE_ROAD_X_DIR,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    86
	DDSP_PLACE_ROAD_Y_DIR,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    87
	DDSP_PLACE_AUTOROAD,
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    88
};
54dfadd481b0 (svn r13009) -Codechange: move more tile highlighting related functions/types to tilehighlight_*.h.
rubidium
parents: 10447
diff changeset
    89
8720
4e60c30e2006 (svn r11787) -Codechange: more header rewrites. This time related to viewport.h.
rubidium
parents: 8634
diff changeset
    90
#endif /* VIEWPORT_TYPE_H */