src/openttd.h
author rubidium
Sun, 23 Dec 2007 10:56:02 +0000
changeset 8619 c2434269c3eb
parent 8617 931e0970d509
child 8626 440dfcd14c4a
permissions -rw-r--r--
(svn r11684) -Codechange: split gfx.h in a type and functional header.
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
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
    11
#include "helpers.hpp"
8610
17cc343a23dd (svn r11675) -Codechange: split the string types from the string functions.
rubidium
parents: 8609
diff changeset
    12
#include "strings_type.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
2159
3b634157c3b2 (svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents: 2153
diff changeset
    14
#include "map.h"
8604
8afdd9877afd (svn r11669) -Codechange: refactor tile.h -> tile_type.h and tile_map.h
rubidium
parents: 8602
diff changeset
    15
#include "slope_type.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
// Forward declarations of structs.
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    18
struct Depot;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    19
struct Waypoint;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    20
struct Station;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    21
struct ViewPort;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    22
struct Town;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    23
struct NewsItem;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    24
struct Industry;
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
    25
struct DrawPixelInfo;
7139
4ae3ab180d05 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13.
rubidium
parents: 7087
diff changeset
    26
struct Group;
4401
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    27
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
    28
typedef byte LandscapeID;
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    29
typedef uint16 EngineID;
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    30
typedef uint16 UnitID;
7446
1c4d469f986e (svn r10205) -Codechange: refactor returning of cost, so it can be more easily modified.
rubidium
parents: 7439
diff changeset
    31
5187
d1f4e447a7eb (svn r7299) -CodeChange: Train and Aircraft Build window GUI code simplified a bit:
KUDr
parents: 5108
diff changeset
    32
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
    33
9320726518bf (svn r6154) -Cleanup: ordered the IDs that have to do with pools from the others
truelight
parents: 4397
diff changeset
    34
/* 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
    35
typedef uint16 StationID;
7506
e52d89f5c7c1 (svn r10266) -Codechange: keep track of the origin, time of travel and accumulated feeder share (transfers) of individual pieces of cargo. This means that cargo isn't thrown on a big pile when it's put in a station or unloaded at a station, however the GUI does not reflect these changes yet so you will not actually see it.
rubidium
parents: 7498
diff changeset
    36
static const StationID INVALID_STATION = 0xFFFF;
4397
e538e96d8f6a (svn r6150) -Codechange: introduced and used RoadStopID where needed
truelight
parents: 4394
diff changeset
    37
typedef uint16 RoadStopID;
3346
96c5db77aa83 (svn r4130) - CodeChange: Add proper semantics for TownID for such variables instead of using the general uint16-type. We probably need to change GetTown() and IsTownIndex() as well to use TownID.
Darkvater
parents: 3344
diff changeset
    38
typedef uint16 TownID;
4330
7306bda145ab (svn r6005) -Cleanup: introduce IndustryID and use it
rubidium
parents: 4326
diff changeset
    39
typedef uint16 IndustryID;
4388
e5a166837162 (svn r6141) -Codechange: introduced DepotID and used it as much as possible
truelight
parents: 4349
diff changeset
    40
typedef uint16 DepotID;
4389
e4555522d257 (svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
truelight
parents: 4388
diff changeset
    41
typedef uint16 WaypointID;
4392
6e2600cb8972 (svn r6145) -Codechange: added OrderID to indicate Order indexes out of the pool
truelight
parents: 4391
diff changeset
    42
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
    43
typedef uint16 SignID;
7139
4ae3ab180d05 (svn r9874) -Feature: advanced vehicle lists a.k.a. group interface. Now you can make groups of vehicles and perform all kinds of tasks on that given group. Original code by nycom and graphics by skidd13.
rubidium
parents: 7087
diff changeset
    44
typedef uint16 GroupID;
4348
95ba9ff1612e (svn r6049) -Codechange: forgot EngineRenew in r6047
truelight
parents: 4344
diff changeset
    45
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
    46
typedef uint16 DestinationID;
8259
127e5d73637d (svn r11312) -Codechange: implement a overflow safe integer and use that for money and don't misuses CommandCost to have a overflow safe integer. Based on a patch by Noldo.
rubidium
parents: 8238
diff changeset
    47
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
    48
/* 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
    49
 * 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
    50
 */
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
    51
assert_compile(sizeof(DestinationID) == sizeof(DepotID));
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
    52
assert_compile(sizeof(DestinationID) == sizeof(WaypointID));
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
    53
assert_compile(sizeof(DestinationID) == sizeof(StationID));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
4293
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    56
enum {
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    57
	INVALID_YEAR = -1,
4326
c2ae4dbc1074 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
rubidium
parents: 4323
diff changeset
    58
	INVALID_DATE = -1,
4293
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    59
};
2c24234a7aec (svn r5926) -Codechange: make _cur_year contain the full year, instead of the offset since 1920
rubidium
parents: 4268
diff changeset
    60
4326
c2ae4dbc1074 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
rubidium
parents: 4323
diff changeset
    61
typedef int32 Year;
c2ae4dbc1074 (svn r5999) -Feature: change the original date format to a 32 bits format based at the year 0.
rubidium
parents: 4323
diff changeset
    62
typedef int32 Date;
4261
2ec8f5a9747b (svn r5887) -Cleanup: move date related functions, defines and variables to date.[ch]
rubidium
parents: 4238
diff changeset
    63
8230
7b40f75cba12 (svn r11269) -Feature: user customisable faces. Patch by BigBB.
rubidium
parents: 7990
diff changeset
    64
typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    65
8617
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    66
enum GameModes {
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    67
	GM_MENU,
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    68
	GM_NORMAL,
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    69
	GM_EDITOR
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    70
};
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
    71
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
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
    73
	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
    74
	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
    75
	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
    76
	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
    77
	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
    78
	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
    79
	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
    80
	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
    81
	SM_START_SCENARIO  = 10,
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    82
	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
    83
	SM_LOAD_HEIGHTMAP  = 12,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    84
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    85
2828
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    86
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    87
/* Modes for GenerateWorld */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    88
enum GenerateWorldModes {
4300
687a17c9c557 (svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
truelight
parents: 4297
diff changeset
    89
	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
    90
	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
    91
	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
    92
	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
    93
};
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    94
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    95
/* Modes for InitializeGame, those are _bits_! */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    96
enum InitializeGameModes {
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    97
	IG_NONE       = 0,  /* Don't do anything special */
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
    98
	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
    99
};
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
   100
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   101
enum Owner {
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   102
	PLAYER_INACTIVE_CLIENT = 253,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   103
	PLAYER_NEW_COMPANY = 254,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   104
	PLAYER_SPECTATOR = 255,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   105
	OWNER_BEGIN     = 0x00,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   106
	PLAYER_FIRST    = 0x00,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   107
	MAX_PLAYERS     = 8,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   108
	OWNER_TOWN      = 0x0F, // a town owns the tile
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   109
	OWNER_NONE      = 0x10, // nobody owns the tile
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   110
	OWNER_WATER     = 0x11, // "water" owns the tile
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   111
	OWNER_END       = 0x12,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   112
	INVALID_OWNER   = 0xFF,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   113
	INVALID_PLAYER  = 0xFF,
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   114
	/* Player identifiers All players below MAX_PLAYERS are playable
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   115
	* players, above, they are special, computer controlled players */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   116
};
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   117
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   118
typedef Owner PlayerID;
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   119
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   120
DECLARE_POSTFIX_INCREMENT(Owner);
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   121
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   122
/** Define basic enum properties */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   123
template <> struct EnumPropsT<Owner> : MakeEnumPropsT<Owner, byte, OWNER_BEGIN, OWNER_END, INVALID_OWNER> {};
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   124
typedef TinyEnumT<Owner> OwnerByte;
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   125
typedef OwnerByte PlayerByte;
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   126
2828
996de8e891c7 (svn r3376) -Codechange: made enums for GenerateWorld and InitializeGame 'mode'
truelight
parents: 2794
diff changeset
   127
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   128
enum TransportType {
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
   129
	/* 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
   130
	 * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge.
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
   131
	 * In an ideal world, these constants would be used everywhere when
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
   132
	 * accessing tunnels and bridges. For now, you should just not change
41f8abe65d1e (svn r4111) Fix/Remove some stale comments
tron
parents: 3173
diff changeset
   133
	 * the values for road and rail.
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
   134
	 */
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   135
	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
   136
	TRANSPORT_RAIL = 0,
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
   137
	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
   138
	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
   139
	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
   140
	INVALID_TRANSPORT = 0xff,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   141
};
159
139cf78bfb28 (svn r160) -Codechange: made GetTileTrackStatus more readable (blathijs)
truelight
parents: 152
diff changeset
   142
5838
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   143
/** Define basic enum properties */
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   144
template <> struct EnumPropsT<TransportType> : MakeEnumPropsT<TransportType, byte, TRANSPORT_BEGIN, TRANSPORT_END, INVALID_TRANSPORT> {};
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   145
typedef TinyEnumT<TransportType> TransportTypeByte;
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   146
9c3129cb019b (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5726
diff changeset
   147
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   148
struct TileInfo {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   149
	uint x;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   150
	uint y;
3636
d87b21df2944 (svn r4541) Add a type for slopes and replace many magic numbers by the appropriate enums
tron
parents: 3529
diff changeset
   151
	Slope tileh;
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1967
diff changeset
   152
	TileIndex tile;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   153
	uint z;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   154
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   155
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   156
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
/* Display Options */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   158
enum {
7087
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   159
	DO_SHOW_TOWN_NAMES    = 0,
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   160
	DO_SHOW_STATION_NAMES = 1,
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   161
	DO_SHOW_SIGNS         = 2,
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   162
	DO_FULL_ANIMATION     = 3,
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   163
	DO_FULL_DETAIL        = 5,
b65f7298f106 (svn r9805) -Codechange: Use HASBIT() et al for display options bits.
peter1138
parents: 7073
diff changeset
   164
	DO_WAYPOINTS          = 6,
6923
6913c8a82cc0 (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138
parents: 6683
diff changeset
   165
};
6913c8a82cc0 (svn r9563) -Feature: Add more finer control to transparency options, including a new toolbar, accessible from the map menu or Ctrl X. Patch by Wolf01.
peter1138
parents: 6683
diff changeset
   166
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
/* Landscape types */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   168
enum {
6683
7ec558346172 (svn r9400) -Codechange: Use some more representative enum names for landscape types.
belugas
parents: 6574
diff changeset
   169
	LT_TEMPERATE  = 0,
7ec558346172 (svn r9400) -Codechange: Use some more representative enum names for landscape types.
belugas
parents: 6574
diff changeset
   170
	LT_ARCTIC     = 1,
7ec558346172 (svn r9400) -Codechange: Use some more representative enum names for landscape types.
belugas
parents: 6574
diff changeset
   171
	LT_TROPIC     = 2,
7ec558346172 (svn r9400) -Codechange: Use some more representative enum names for landscape types.
belugas
parents: 6574
diff changeset
   172
	LT_TOYLAND    = 3,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   173
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   174
	NUM_LANDSCAPE = 4,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
7067
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   177
/**
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   178
 * Town Layouts
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   179
 */
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   180
enum TownLayout {
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   181
	TL_NO_ROADS     = 0, ///< Build no more roads, but still build houses
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   182
	TL_ORIGINAL,         ///< Original algorithm (min. 1 distance between roads)
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   183
	TL_BETTER_ROADS,     ///< Extended original algorithm (min. 2 distance between roads)
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   184
	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   185
	TL_3X3_GRID,         ///< Geometric 3x3 grid algorithm
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   186
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   187
	NUM_TLS,             ///< Number of town layouts
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   188
};
ea55b6046015 (svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
belugas
parents: 7058
diff changeset
   189
7073
72dc5a55e16b (svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
glx
parents: 7067
diff changeset
   190
/* It needs to be 8bits, because we save and load it as such */
72dc5a55e16b (svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
glx
parents: 7067
diff changeset
   191
/** Define basic enum properties */
72dc5a55e16b (svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
glx
parents: 7067
diff changeset
   192
template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
72dc5a55e16b (svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
glx
parents: 7067
diff changeset
   193
typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
72dc5a55e16b (svn r9791) -Fix (r9779, FS#766): add TownLayoutByte to correctly save town layout value
glx
parents: 7067
diff changeset
   194
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   195
#define GAME_DIFFICULTY_NUM 18
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   196
8238
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   197
/** Specific type for Game Difficulty to ease changing the type */
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   198
typedef uint16 GDType;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   199
struct GameDifficulty {
8238
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   200
	GDType max_no_competitors;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   201
	GDType competitor_start_time;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   202
	GDType number_towns;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   203
	GDType number_industries;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   204
	GDType max_loan;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   205
	GDType initial_interest;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   206
	GDType vehicle_costs;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   207
	GDType competitor_speed;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   208
	GDType competitor_intelligence; // no longer in use
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   209
	GDType vehicle_breakdowns;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   210
	GDType subsidy_multiplier;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   211
	GDType construction_cost;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   212
	GDType terrain_type;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   213
	GDType quantity_sea_lakes;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   214
	GDType economy;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   215
	GDType line_reverse_mode;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   216
	GDType disasters;
29844a206bbe (svn r11279) -Codechange: use a typedeffed type for all magic with GameDifficulty instead on relying ints to always be 32 bits, which they are not.
rubidium
parents: 8230
diff changeset
   217
	GDType town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   218
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   219
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   220
struct TileDesc {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   221
	StringID str;
4849
9a3c3ae7f62f (svn r6775) -Codechange: Use some more proper types, especially Owner and PlayerID as
Darkvater
parents: 4659
diff changeset
   222
	Owner owner;
4297
47ce9665b4af (svn r5934) -Cleanup: forgot some conversions to Year and to Date
rubidium
parents: 4293
diff changeset
   223
	Date build_date;
7498
ce6588257e8d (svn r10258) -Codechange: as we are now using int64 all over the place, it's better to use int64 variables in the string generating too instead of packing them into two int32s.
rubidium
parents: 7494
diff changeset
   224
	uint64 dparam[2];
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   225
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   227
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
   228
	int32 left;
c6223dbdb202 (svn r1330) Increase size of some vars from int16 to int32 to guard against future overflows
tron
parents: 842
diff changeset
   229
	int32 top;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
	byte width_1, width_2;
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   231
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1967
diff changeset
   233
typedef void PlaceProc(TileIndex tile);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
2526
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   235
enum {
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   236
	SORT_ASCENDING  = 0,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   237
	SORT_DESCENDING = 1,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   238
	SORT_BY_DATE    = 0,
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   239
	SORT_BY_NAME    = 2
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   240
};
cae4842086a9 (svn r3055) Give the savegame/scenarion sort order flags symbolic names
tron
parents: 2436
diff changeset
   241
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
VARDEF byte _savegame_sort_order;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   244
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
   245
	MAX_SCREEN_WIDTH  = 2048,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   246
	MAX_SCREEN_HEIGHT = 1200,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
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
   249
/* 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
   250
 * 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
   251
 * 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
   252
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
   253
	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
   254
	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
   255
	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
   256
	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
   257
};
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
   258
VARDEF byte _no_scroll;
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
   259
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
   260
/** 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
   261
 * 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
   262
 * in the ProcessSentMessage() function */
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   263
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
   264
	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
   265
	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
   266
	MSG_OTTD_SAVETHREAD_ERROR,
6574
e1d1a12faaf7 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6317
diff changeset
   267
};
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
   268
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
   269
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
   270
8617
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
   271
extern byte _game_mode;
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
   272
extern bool _exit_game;
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
   273
extern byte _pause_game;
931e0970d509 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type.
rubidium
parents: 8615
diff changeset
   274
2075
7f0ca01392db (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2055
diff changeset
   275
#endif /* OPENTTD_H */