src/openttd.h
author rubidium
Sun, 03 Feb 2008 20:17:54 +0000
branchnoai
changeset 9724 b39bc69bb2f2
parent 9723 eee46cb39750
child 9826 9707ad4c9b60
permissions -rw-r--r--
(svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     1
/* $Id$ */
2536
8c4e298f4886 (svn r3065) -Codechange/Add: Modified the bridge drawing code so that the basic offset is read from the RailTypeInfo struct. This is (hopefully) the last DrawTile change on the way to electrified railways. While being at it, de-mystified the function a bit and added some asserts.
celestar
parents: 2526
diff changeset
     2
/** @file openttd.h */
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     3
2075
7f0ca01392db (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2055
diff changeset
     4
#ifndef OPENTTD_H
7f0ca01392db (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2055
diff changeset
     5
#define OPENTTD_H
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
#ifndef VARDEF
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
#define VARDEF extern
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
#endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
// Forward declarations of structs.
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    12
struct Depot;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    13
struct Waypoint;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    14
struct Station;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    15
struct ViewPort;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    16
struct NewsItem;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    17
struct DrawPixelInfo;
9624
b71483f2330f (svn r9915) [NoAI] -Sync with trunk -r9815:9914
glx
parents: 9620
diff changeset
    18
struct Group;
4401
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    19
typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    20
typedef byte LandscapeID;
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    21
typedef uint16 EngineID;
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    22
typedef uint16 UnitID;
9629
66dde6412125 (svn r10350) [NoAI] -Sync with trunk r10194:10349
glx
parents: 9624
diff changeset
    23
5187
d1f4e447a7eb (svn r7299) -CodeChange: Train and Aircraft Build window GUI code simplified a bit:
KUDr
parents: 5108
diff changeset
    24
typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp)
4401
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    25
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    26
/* IDs used in Pools */
3347
d5d8ace1bb13 (svn r4131) - CodeChange: Add proper semantics for StationID for such variables instead of using the general uint16-type. StationID was added for depots, waypoints and stations where necessary. We probably need to change GetDepot(), IsDepotIndex(), IsStationIndex(), GetWaypoint() and IsWaypointIndex() as well to use StationID.
Darkvater
parents: 3346
diff changeset
    27
typedef uint16 StationID;
9629
66dde6412125 (svn r10350) [NoAI] -Sync with trunk r10194:10349
glx
parents: 9624
diff changeset
    28
static const StationID INVALID_STATION = 0xFFFF;
4397
e538e96d8f6a (svn r6150) -Codechange: introduced and used RoadStopID where needed
truelight
parents: 4394
diff changeset
    29
typedef uint16 RoadStopID;
4388
e5a166837162 (svn r6141) -Codechange: introduced DepotID and used it as much as possible
truelight
parents: 4349
diff changeset
    30
typedef uint16 DepotID;
4389
e4555522d257 (svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
truelight
parents: 4388
diff changeset
    31
typedef uint16 WaypointID;
4392
6e2600cb8972 (svn r6145) -Codechange: added OrderID to indicate Order indexes out of the pool
truelight
parents: 4391
diff changeset
    32
typedef uint16 OrderID;
4401
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    33
typedef uint16 SignID;
9624
b71483f2330f (svn r9915) [NoAI] -Sync with trunk -r9815:9914
glx
parents: 9620
diff changeset
    34
typedef uint16 GroupID;
4348
95ba9ff1612e (svn r6049) -Codechange: forgot EngineRenew in r6047
truelight
parents: 4344
diff changeset
    35
typedef uint16 EngineRenewID;
4527
b18634a31a4a (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
tron
parents: 4434
diff changeset
    36
typedef uint16 DestinationID;
9722
ebf0ece7d8f6 (svn r11503) [NoAI] -Sync: with trunk r11308:11502.
rubidium
parents: 9718
diff changeset
    37
4527
b18634a31a4a (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
tron
parents: 4434
diff changeset
    38
/* DestinationID must be at least as large as every these below, because it can
b18634a31a4a (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
tron
parents: 4434
diff changeset
    39
 * be any of them
b18634a31a4a (svn r6353) -Codechange: Make DestinationID a typedef of uin16, which is as large as any type of destinataion (StationID, DepotID, WaypointID) it can hold
tron
parents: 4434
diff changeset
    40
 */
9724
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
    41
assert_compile(sizeof(DestinationID) >= sizeof(DepotID));
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
    42
assert_compile(sizeof(DestinationID) >= sizeof(WaypointID));
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
    43
assert_compile(sizeof(DestinationID) >= sizeof(StationID));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
9723
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
    45
enum GameModes {
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
    46
	GM_MENU,
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
    47
	GM_NORMAL,
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
    48
	GM_EDITOR
4293
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    49
};
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    50
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
enum SwitchModes {
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: 4330
diff changeset
    52
	SM_NONE            =  0,
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: 4330
diff changeset
    53
	SM_NEWGAME         =  1,
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: 4330
diff changeset
    54
	SM_EDITOR          =  2,
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: 4330
diff changeset
    55
	SM_LOAD            =  3,
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: 4330
diff changeset
    56
	SM_MENU            =  4,
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: 4330
diff changeset
    57
	SM_SAVE            =  5,
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: 4330
diff changeset
    58
	SM_GENRANDLAND     =  6,
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: 4330
diff changeset
    59
	SM_LOAD_SCENARIO   =  9,
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: 4330
diff changeset
    60
	SM_START_SCENARIO  = 10,
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    61
	SM_START_HEIGHTMAP = 11,
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: 4330
diff changeset
    62
	SM_LOAD_HEIGHTMAP  = 12,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
2828
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    65
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    66
/* Modes for GenerateWorld */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    67
enum GenerateWorldModes {
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    68
	GW_NEWGAME   = 0,    /* Generate a map for a new game */
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    69
	GW_EMPTY     = 1,    /* Generate an empty map (sea-level) */
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    70
	GW_RANDOM    = 2,    /* Generate a random map for SE */
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    71
	GW_HEIGHTMAP = 3,    /* Generate a newgame from a heightmap */
2828
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    72
};
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    73
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    74
/* Modes for InitializeGame, those are _bits_! */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    75
enum InitializeGameModes {
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    76
	IG_NONE       = 0,  /* Don't do anything special */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    77
	IG_DATE_RESET = 1,  /* Reset the date when initializing a game */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    78
};
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    79
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    80
enum TransportType {
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
    81
	/* These constants are for now linked to the representation of bridges
3333
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
    82
	 * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
    83
	 * In an ideal world, these constants would be used everywhere when
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
    84
	 * accessing tunnels and bridges. For now, you should just not change
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
    85
	 * the values for road and rail.
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
    86
	 */
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    87
	TRANSPORT_BEGIN = 0,
3017
915fae59d5e0 (svn r3597) Miscellaneous (I like that word) changes: Fix some indentation, add consts, reduce indentation level by short-circuit logic, convert if cascades to switch, whitespace, bracing, plus some minor stuff
tron
parents: 2828
diff changeset
    88
	TRANSPORT_RAIL = 0,
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
    89
	TRANSPORT_ROAD = 1,
4434
4175805666a5 (svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
rubidium
parents: 4401
diff changeset
    90
	TRANSPORT_WATER, // = 2
1967
c57192f4c121 (svn r2473) - Add: VehicleMayEnterTile(), which checks if the tile owner of a tile is correct for a vehicle to enter it. Based upon glx's code.
matthijs
parents: 1932
diff changeset
    91
	TRANSPORT_END,
c57192f4c121 (svn r2473) - Add: VehicleMayEnterTile(), which checks if the tile owner of a tile is correct for a vehicle to enter it. Based upon glx's code.
matthijs
parents: 1932
diff changeset
    92
	INVALID_TRANSPORT = 0xff,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    93
};
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
    94
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    95
/* Display Options */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    96
enum {
9620
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
    97
	DO_SHOW_TOWN_NAMES    = 0,
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
    98
	DO_SHOW_STATION_NAMES = 1,
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
    99
	DO_SHOW_SIGNS         = 2,
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
   100
	DO_FULL_ANIMATION     = 3,
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
   101
	DO_FULL_DETAIL        = 5,
31e38d28a0af (svn r9816) [NoAI] -Sync with trunk r9712:9815 except r9759 (MorphOS threading) because that needs special attention.
rubidium
parents: 9601
diff changeset
   102
	DO_WAYPOINTS          = 6,
9574
698395509d12 (svn r9575) [NoAI] -Sync with trunk r9504:9574
glx
parents: 9517
diff changeset
   103
};
698395509d12 (svn r9575) [NoAI] -Sync with trunk r9504:9574
glx
parents: 9517
diff changeset
   104
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
/* Landscape types */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   106
enum {
9517
be1775555bbd (svn r9431) [NoAI] -Sync with trunk r9394:9430
truelight
parents: 6574
diff changeset
   107
	LT_TEMPERATE  = 0,
be1775555bbd (svn r9431) [NoAI] -Sync with trunk r9394:9430
truelight
parents: 6574
diff changeset
   108
	LT_ARCTIC     = 1,
be1775555bbd (svn r9431) [NoAI] -Sync with trunk r9394:9430
truelight
parents: 6574
diff changeset
   109
	LT_TROPIC     = 2,
be1775555bbd (svn r9431) [NoAI] -Sync with trunk r9394:9430
truelight
parents: 6574
diff changeset
   110
	LT_TOYLAND    = 3,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
	NUM_LANDSCAPE = 4,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   115
struct ViewportSign {
849
c6223dbdb202 (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   116
	int32 left;
c6223dbdb202 (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   117
	int32 top;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
	byte width_1, width_2;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   119
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   120
2526
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   121
enum {
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   122
	SORT_ASCENDING  = 0,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   123
	SORT_DESCENDING = 1,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   124
	SORT_BY_DATE    = 0,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   125
	SORT_BY_NAME    = 2
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   126
};
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   127
9724
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
   128
extern byte _savegame_sort_order;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
enum {
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: 4330
diff changeset
   131
	MAX_SCREEN_WIDTH  = 2048,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
	MAX_SCREEN_HEIGHT = 1200,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
1397
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   135
/* In certain windows you navigate with the arrow keys. Do not scroll the
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   136
 * gameview when here. Bitencoded variable that only allows scrolling if all
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   137
 * elements are zero */
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   138
enum {
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: 4330
diff changeset
   139
	SCROLL_CON  = 0,
1397
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   140
	SCROLL_EDIT = 1,
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   141
	SCROLL_SAVE = 2,
1843
733f83b6483a (svn r2348) - Fix: Do not scroll the game with the arrow keys when the chatbox is open
Darkvater
parents: 1802
diff changeset
   142
	SCROLL_CHAT = 4,
1397
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   143
};
9724
b39bc69bb2f2 (svn r12051) [NoAI] -Sync: with trunk (r11795:12050).
rubidium
parents: 9723
diff changeset
   144
extern byte _no_scroll;
1397
b04402b901cd (svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Darkvater
parents: 1363
diff changeset
   145
2380
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   146
/** To have a concurrently running thread interface with the main program, use
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   147
 * the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   148
 * in the ProcessSentMessage() function */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   149
enum ThreadMsg {
4323
78204e7c3100 (svn r5977) -Fix [FS#78]: never set I-am-a-thread bool to true IN the thread. Machines with
truelight
parents: 4312
diff changeset
   150
	MSG_OTTD_NO_MESSAGE,
78204e7c3100 (svn r5977) -Fix [FS#78]: never set I-am-a-thread bool to true IN the thread. Machines with
truelight
parents: 4312
diff changeset
   151
	MSG_OTTD_SAVETHREAD_DONE,
78204e7c3100 (svn r5977) -Fix [FS#78]: never set I-am-a-thread bool to true IN the thread. Machines with
truelight
parents: 4312
diff changeset
   152
	MSG_OTTD_SAVETHREAD_ERROR,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   153
};
2380
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   154
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   155
void OTTD_SendThreadMessage(ThreadMsg msg);
3b26659b4a9a (svn r2906) Fix some threaded saving problems. Now the thread only interfaces with the main program through a sort of mutex. Communication uses the function OTTD_SendThreadMessage() with the approiate message which is handled in ProcessSentMessage() during the main loop.
Darkvater
parents: 2254
diff changeset
   156
9723
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
   157
extern byte _game_mode;
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
   158
extern bool _exit_game;
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
   159
extern byte _pause_game;
eee46cb39750 (svn r11796) [NoAI] -Sync: with trunk r11502:11795.
rubidium
parents: 9722
diff changeset
   160
2075
7f0ca01392db (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2055
diff changeset
   161
#endif /* OPENTTD_H */