Files
@ r17613:a9b2554a5d79
Branch filter:
Location: cpp/openttd-patchpack/source/src/viewport_type.h - annotation
r17613:a9b2554a5d79
4.8 KiB
text/x-c
(svn r22387) -Fix-ish [FS#4601]: Windows' recv seems to return "graceful closed" before having passed the remaining buffer which causes OpenTTD to think all connections are "incorrectly" terminated, i.e. without the "I'm leaving" packet from the client. So let the client wait a tiny bit after sending the "I'm leaving" packet and before gracefully closing the connection
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | r8224:194097dc7288 r8224:194097dc7288 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r12768:980ae0491352 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r12331:4957eff8b184 r8224:194097dc7288 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8224:194097dc7288 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8224:194097dc7288 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8857:5317aca8d1c7 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r14049:815b288b8078 r12335:832893ebf982 r9129:db82b80b0a0b r14049:815b288b8078 r14049:815b288b8078 r12335:832893ebf982 r12335:832893ebf982 r12331:4957eff8b184 r12331:4957eff8b184 r12334:57fa457522c9 r9129:db82b80b0a0b r9129:db82b80b0a0b r16300:dae54be93b98 r16300:dae54be93b98 r16300:dae54be93b98 r16300:dae54be93b98 r15168:33f1c6a4cf31 r16300:dae54be93b98 r16300:dae54be93b98 r16300:dae54be93b98 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r15173:a59afd6301a6 r15173:a59afd6301a6 r8224:194097dc7288 r8224:194097dc7288 r8224:194097dc7288 r11704:8083118c4aa4 r11704:8083118c4aa4 r11704:8083118c4aa4 r11704:8083118c4aa4 r11704:8083118c4aa4 r11704:8083118c4aa4 r11704:8083118c4aa4 r14417:ef850931da5a r14417:ef850931da5a r11704:8083118c4aa4 r11704:8083118c4aa4 r8224:194097dc7288 r14900:c679fdaeebe6 r8224:194097dc7288 r15610:623a23fb6560 r15610:623a23fb6560 r15613:193c12018337 r15613:193c12018337 r9147:6e8812a42759 r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r9147:6e8812a42759 r9147:6e8812a42759 r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r9147:6e8812a42759 r9147:6e8812a42759 r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14410:5a7b6bd2710b r14640:07a4f29e1226 r14640:07a4f29e1226 r14641:37c0a6312793 r14641:37c0a6312793 r9147:6e8812a42759 r9147:6e8812a42759 r8224:194097dc7288 | /* $Id$ */
/*
* This file is part of OpenTTD.
* 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.
* 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.
* 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/>.
*/
/** @file viewport_type.h Types related to viewports. */
#ifndef VIEWPORT_TYPE_H
#define VIEWPORT_TYPE_H
#include "zoom_type.h"
#include "strings_type.h"
/**
* Data structure for viewport, display of a part of the world
*/
struct ViewPort {
int left; ///< Screen coordinate left egde of the viewport
int top; ///< Screen coordinate top edge of the viewport
int width; ///< Screen width of the viewport
int height; ///< Screen height of the viewport
int virtual_left; ///< Virtual left coordinate
int virtual_top; ///< Virtual top coordinate
int virtual_width; ///< width << zoom
int virtual_height; ///< height << zoom
ZoomLevel zoom;
};
/** Margings for the viewport sign */
enum ViewportSignMargin {
VPSM_LEFT = 1, ///< Left margin
VPSM_RIGHT = 1, ///< Right margin
VPSM_TOP = 1, ///< Top margin
VPSM_BOTTOM = 1, ///< Bottom margin
};
/** Location information about a sign as seen on the viewport */
struct ViewportSign {
int32 center; ///< The center position of the sign
int32 top; ///< The top of the sign
uint16 width_normal; ///< The width when not zoomed out (normal font)
uint16 width_small; ///< The width when zoomed out (small font)
void UpdatePosition(int center, int top, StringID str);
void MarkDirty() const;
};
/**
* Directions of zooming.
* @see DoZoomInOutWindow
*/
enum ZoomStateChange {
ZOOM_IN = 0, ///< Zoom in (get more detailed view).
ZOOM_OUT = 1, ///< Zoom out (get helicopter view).
ZOOM_NONE = 2, ///< Hack, used to update the button status.
};
/**
* Some values for constructing bounding boxes (BB). The Z positions under bridges are:
* z=0..5 Everything that can be built under low bridges.
* z=6 reserved, currently unused.
* z=7 Z separator between bridge/tunnel and the things under/above it.
*/
static const uint BB_HEIGHT_UNDER_BRIDGE = 6; ///< Everything that can be built under low bridges, must not exceed this Z height.
static const uint BB_Z_SEPARATOR = 7; ///< Separates the bridge/tunnel from the things under/above it.
/** Viewport place method (type of highlighted area and placed objects) */
enum ViewportPlaceMethod {
VPM_X_OR_Y = 0, ///< drag in X or Y direction
VPM_FIX_X = 1, ///< drag only in X axis
VPM_FIX_Y = 2, ///< drag only in Y axis
VPM_X_AND_Y = 3, ///< area of land in X and Y directions
VPM_X_AND_Y_LIMITED = 4, ///< area of land of limited size
VPM_FIX_HORIZONTAL = 5, ///< drag only in horizontal direction
VPM_FIX_VERTICAL = 6, ///< drag only in vertical direction
VPM_X_LIMITED = 7, ///< Drag only in X axis with limited size
VPM_Y_LIMITED = 8, ///< Drag only in Y axis with limited size
VPM_RAILDIRS = 0x40, ///< all rail directions
VPM_SIGNALDIRS = 0x80, ///< similiar to VMP_RAILDIRS, but with different cursor
};
DECLARE_ENUM_AS_BIT_SET(ViewportPlaceMethod)
/**
* Drag and drop selection process, or, what to do with an area of land when
* you've selected it.
*/
enum ViewportDragDropSelectionProcess {
DDSP_DEMOLISH_AREA, ///< Clear area
DDSP_RAISE_AND_LEVEL_AREA, ///< Raise / level area
DDSP_LOWER_AND_LEVEL_AREA, ///< Lower / level area
DDSP_LEVEL_AREA, ///< Level area
DDSP_CREATE_DESERT, ///< Fill area with desert
DDSP_CREATE_ROCKS, ///< Fill area with rocks
DDSP_CREATE_WATER, ///< Create a canal
DDSP_CREATE_RIVER, ///< Create rivers
DDSP_PLANT_TREES, ///< Plant trees
DDSP_BUILD_BRIDGE, ///< Bridge placement
/* Rail specific actions */
DDSP_PLACE_RAIL, ///< Rail placement
DDSP_BUILD_SIGNALS, ///< Signal placement
DDSP_BUILD_STATION, ///< Station placement
DDSP_REMOVE_STATION, ///< Station removal
DDSP_CONVERT_RAIL, ///< Rail conversion
/* Road specific actions */
DDSP_PLACE_ROAD_X_DIR, ///< Road placement (X axis)
DDSP_PLACE_ROAD_Y_DIR, ///< Road placement (Y axis)
DDSP_PLACE_AUTOROAD, ///< Road placement (auto)
DDSP_BUILD_BUSSTOP, ///< Road stop placement (buses)
DDSP_BUILD_TRUCKSTOP, ///< Road stop placement (trucks)
DDSP_REMOVE_BUSSTOP, ///< Road stop removal (buses)
DDSP_REMOVE_TRUCKSTOP, ///< Road stop removal (trucks)
};
#endif /* VIEWPORT_TYPE_H */
|