00001
00004 #ifndef OPENTTD_H
00005 #define OPENTTD_H
00006
00007 #ifndef VARDEF
00008 #define VARDEF extern
00009 #endif
00010
00011
00012 struct Depot;
00013 struct Waypoint;
00014 struct Station;
00015 struct ViewPort;
00016 struct NewsItem;
00017 struct DrawPixelInfo;
00018 struct Group;
00019 typedef byte VehicleOrderID;
00020 typedef byte LandscapeID;
00021 typedef uint16 EngineID;
00022 typedef uint16 UnitID;
00023
00024 typedef EngineID *EngineList;
00025
00026
00027 typedef uint16 StationID;
00028 static const StationID INVALID_STATION = 0xFFFF;
00029 typedef uint16 RoadStopID;
00030 typedef uint16 DepotID;
00031 typedef uint16 WaypointID;
00032 typedef uint16 OrderID;
00033 typedef uint16 SignID;
00034 typedef uint16 GroupID;
00035 typedef uint16 EngineRenewID;
00036 typedef uint16 DestinationID;
00037
00038
00039
00040
00041 assert_compile(sizeof(DestinationID) >= sizeof(DepotID));
00042 assert_compile(sizeof(DestinationID) >= sizeof(WaypointID));
00043 assert_compile(sizeof(DestinationID) >= sizeof(StationID));
00044
00045 enum GameModes {
00046 GM_MENU,
00047 GM_NORMAL,
00048 GM_EDITOR
00049 };
00050
00051 enum SwitchModes {
00052 SM_NONE = 0,
00053 SM_NEWGAME = 1,
00054 SM_EDITOR = 2,
00055 SM_LOAD = 3,
00056 SM_MENU = 4,
00057 SM_SAVE = 5,
00058 SM_GENRANDLAND = 6,
00059 SM_LOAD_SCENARIO = 9,
00060 SM_START_SCENARIO = 10,
00061 SM_START_HEIGHTMAP = 11,
00062 SM_LOAD_HEIGHTMAP = 12,
00063 };
00064
00065
00066
00067 enum GenerateWorldModes {
00068 GW_NEWGAME = 0,
00069 GW_EMPTY = 1,
00070 GW_RANDOM = 2,
00071 GW_HEIGHTMAP = 3,
00072 };
00073
00074
00075 enum InitializeGameModes {
00076 IG_NONE = 0,
00077 IG_DATE_RESET = 1,
00078 };
00079
00080 enum TransportType {
00081
00082
00083
00084
00085
00086
00087 TRANSPORT_BEGIN = 0,
00088 TRANSPORT_RAIL = 0,
00089 TRANSPORT_ROAD = 1,
00090 TRANSPORT_WATER,
00091 TRANSPORT_END,
00092 INVALID_TRANSPORT = 0xff,
00093 };
00094
00095
00096 enum {
00097 DO_SHOW_TOWN_NAMES = 0,
00098 DO_SHOW_STATION_NAMES = 1,
00099 DO_SHOW_SIGNS = 2,
00100 DO_FULL_ANIMATION = 3,
00101 DO_FULL_DETAIL = 5,
00102 DO_WAYPOINTS = 6,
00103 };
00104
00105
00106 enum {
00107 LT_TEMPERATE = 0,
00108 LT_ARCTIC = 1,
00109 LT_TROPIC = 2,
00110 LT_TOYLAND = 3,
00111
00112 NUM_LANDSCAPE = 4,
00113 };
00114
00115 struct ViewportSign {
00116 int32 left;
00117 int32 top;
00118 uint16 width_1, width_2;
00119 };
00120
00121 enum {
00122 SORT_ASCENDING = 0,
00123 SORT_DESCENDING = 1,
00124 SORT_BY_DATE = 0,
00125 SORT_BY_NAME = 2
00126 };
00127
00128 extern byte _savegame_sort_order;
00129
00130 enum {
00131 MAX_SCREEN_WIDTH = 2048,
00132 MAX_SCREEN_HEIGHT = 1200,
00133 };
00134
00135
00136
00137
00138 enum {
00139 SCROLL_CON = 0,
00140 SCROLL_EDIT = 1,
00141 SCROLL_SAVE = 2,
00142 SCROLL_CHAT = 4,
00143 };
00144 extern byte _no_scroll;
00145
00149 enum ThreadMsg {
00150 MSG_OTTD_NO_MESSAGE,
00151 MSG_OTTD_SAVETHREAD_DONE,
00152 MSG_OTTD_SAVETHREAD_ERROR,
00153 };
00154
00155 void OTTD_SendThreadMessage(ThreadMsg msg);
00156
00157 extern byte _game_mode;
00158 extern bool _exit_game;
00159 extern int8 _pause_game;
00160
00161 #endif