tron@2186: /* $Id$ */ celestar@2536: /** @file openttd.h */ tron@2186: Darkvater@2075: #ifndef OPENTTD_H Darkvater@2075: #define OPENTTD_H truelight@0: truelight@0: #ifndef VARDEF truelight@0: #define VARDEF extern truelight@0: #endif truelight@0: rubidium@5838: #include "helpers.hpp" truelight@0: rubidium@6574: struct Oblong { Darkvater@4956: int x, y; Darkvater@4956: int width, height; rubidium@6574: }; Darkvater@4956: rubidium@6574: struct BoundingRect { Darkvater@4609: int width; Darkvater@4609: int height; rubidium@6574: }; Darkvater@4609: rubidium@6574: struct Pair { truelight@0: int a; truelight@0: int b; rubidium@6574: }; truelight@0: tron@2159: #include "map.h" rubidium@8604: #include "slope_type.h" rubidium@8604: #include "vehicle_type.h" truelight@0: truelight@0: // Forward declarations of structs. rubidium@6574: struct Depot; rubidium@6574: struct Waypoint; rubidium@6574: struct Station; rubidium@6574: struct ViewPort; rubidium@6574: struct Town; rubidium@6574: struct NewsItem; rubidium@6574: struct Industry; rubidium@6574: struct DrawPixelInfo; rubidium@7139: struct Group; truelight@4401: typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related) truelight@4401: typedef byte CargoID; truelight@4401: typedef byte LandscapeID; truelight@4401: typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables rubidium@6574: struct PalSpriteID { peter1138@5919: SpriteID sprite; peter1138@5919: SpriteID pal; rubidium@6574: }; truelight@4401: typedef uint16 EngineID; truelight@4401: typedef uint16 UnitID; truelight@4401: typedef uint16 StringID; peter1138@7889: static const StringID INVALID_STRING_ID = 0xFFFF; rubidium@7446: KUDr@5187: typedef EngineID *EngineList; ///< engine list type placeholder acceptable for C code (see helpers.cpp) truelight@4401: truelight@4401: /* IDs used in Pools */ Darkvater@3347: typedef uint16 StationID; rubidium@7506: static const StationID INVALID_STATION = 0xFFFF; truelight@4397: typedef uint16 RoadStopID; Darkvater@3346: typedef uint16 TownID; rubidium@4330: typedef uint16 IndustryID; truelight@4388: typedef uint16 DepotID; truelight@4389: typedef uint16 WaypointID; truelight@4392: typedef uint16 OrderID; truelight@4401: typedef uint16 SignID; rubidium@7139: typedef uint16 GroupID; truelight@4348: typedef uint16 EngineRenewID; tron@4527: typedef uint16 DestinationID; rubidium@8259: rubidium@8259: typedef OverflowSafeInt OverflowSafeInt64; rubidium@8259: typedef OverflowSafeInt64 Money; truelight@4389: tron@4527: /* DestinationID must be at least as large as every these below, because it can tron@4527: * be any of them tron@4527: */ tron@4527: assert_compile(sizeof(DestinationID) == sizeof(DepotID)); tron@4527: assert_compile(sizeof(DestinationID) == sizeof(WaypointID)); tron@4527: assert_compile(sizeof(DestinationID) == sizeof(StationID)); truelight@0: truelight@0: rubidium@4293: enum { rubidium@4293: INVALID_YEAR = -1, rubidium@4326: INVALID_DATE = -1, rubidium@4293: }; rubidium@4293: rubidium@4326: typedef int32 Year; rubidium@4326: typedef int32 Date; rubidium@4261: rubidium@8230: typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h truelight@0: truelight@0: enum SwitchModes { rubidium@4344: SM_NONE = 0, rubidium@4344: SM_NEWGAME = 1, rubidium@4344: SM_EDITOR = 2, rubidium@4344: SM_LOAD = 3, rubidium@4344: SM_MENU = 4, rubidium@4344: SM_SAVE = 5, rubidium@4344: SM_GENRANDLAND = 6, rubidium@4344: SM_LOAD_SCENARIO = 9, rubidium@4344: SM_START_SCENARIO = 10, truelight@4300: SM_START_HEIGHTMAP = 11, rubidium@4344: SM_LOAD_HEIGHTMAP = 12, truelight@0: }; truelight@0: truelight@2828: truelight@2828: /* Modes for GenerateWorld */ truelight@2828: enum GenerateWorldModes { truelight@4300: GW_NEWGAME = 0, /* Generate a map for a new game */ truelight@4300: GW_EMPTY = 1, /* Generate an empty map (sea-level) */ truelight@4300: GW_RANDOM = 2, /* Generate a random map for SE */ truelight@4300: GW_HEIGHTMAP = 3, /* Generate a newgame from a heightmap */ truelight@2828: }; truelight@2828: truelight@2828: /* Modes for InitializeGame, those are _bits_! */ truelight@2828: enum InitializeGameModes { truelight@2828: IG_NONE = 0, /* Don't do anything special */ truelight@2828: IG_DATE_RESET = 1, /* Reset the date when initializing a game */ truelight@2828: }; truelight@2828: rubidium@5838: enum Owner { rubidium@5838: PLAYER_INACTIVE_CLIENT = 253, rubidium@5838: PLAYER_NEW_COMPANY = 254, rubidium@5838: PLAYER_SPECTATOR = 255, rubidium@5838: OWNER_BEGIN = 0x00, rubidium@5838: PLAYER_FIRST = 0x00, rubidium@5838: MAX_PLAYERS = 8, rubidium@5838: OWNER_TOWN = 0x0F, // a town owns the tile rubidium@5838: OWNER_NONE = 0x10, // nobody owns the tile rubidium@5838: OWNER_WATER = 0x11, // "water" owns the tile rubidium@5838: OWNER_END = 0x12, rubidium@5838: INVALID_OWNER = 0xFF, rubidium@5838: INVALID_PLAYER = 0xFF, rubidium@5838: /* Player identifiers All players below MAX_PLAYERS are playable rubidium@5838: * players, above, they are special, computer controlled players */ rubidium@5838: }; rubidium@5838: rubidium@5838: typedef Owner PlayerID; rubidium@5838: rubidium@5838: DECLARE_POSTFIX_INCREMENT(Owner); rubidium@5838: rubidium@5838: /** Define basic enum properties */ rubidium@5838: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@5838: typedef TinyEnumT OwnerByte; rubidium@5838: typedef OwnerByte PlayerByte; rubidium@5838: truelight@2828: rubidium@6574: enum TransportType { truelight@159: /* These constants are for now linked to the representation of bridges tron@3333: * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge. tron@3333: * In an ideal world, these constants would be used everywhere when tron@3333: * accessing tunnels and bridges. For now, you should just not change tron@3333: * the values for road and rail. truelight@159: */ rubidium@5838: TRANSPORT_BEGIN = 0, tron@3017: TRANSPORT_RAIL = 0, truelight@159: TRANSPORT_ROAD = 1, rubidium@4434: TRANSPORT_WATER, // = 2 matthijs@1967: TRANSPORT_END, matthijs@1967: INVALID_TRANSPORT = 0xff, rubidium@6574: }; truelight@159: rubidium@5838: /** Define basic enum properties */ rubidium@5838: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@5838: typedef TinyEnumT TransportTypeByte; rubidium@5838: rubidium@5838: rubidium@6574: struct TileInfo { truelight@0: uint x; truelight@0: uint y; tron@3636: Slope tileh; tron@1977: TileIndex tile; truelight@0: uint z; rubidium@6574: }; truelight@0: truelight@0: truelight@0: /* Display Options */ truelight@0: enum { peter1138@7087: DO_SHOW_TOWN_NAMES = 0, peter1138@7087: DO_SHOW_STATION_NAMES = 1, peter1138@7087: DO_SHOW_SIGNS = 2, peter1138@7087: DO_FULL_ANIMATION = 3, peter1138@7087: DO_FULL_DETAIL = 5, peter1138@7087: DO_WAYPOINTS = 6, peter1138@6923: }; peter1138@6923: truelight@0: /* Landscape types */ truelight@0: enum { belugas@6683: LT_TEMPERATE = 0, belugas@6683: LT_ARCTIC = 1, belugas@6683: LT_TROPIC = 2, belugas@6683: LT_TOYLAND = 3, truelight@0: truelight@0: NUM_LANDSCAPE = 4, truelight@0: }; truelight@0: belugas@7067: /** belugas@7067: * Town Layouts belugas@7067: */ belugas@7067: enum TownLayout { belugas@7067: TL_NO_ROADS = 0, ///< Build no more roads, but still build houses belugas@7067: TL_ORIGINAL, ///< Original algorithm (min. 1 distance between roads) belugas@7067: TL_BETTER_ROADS, ///< Extended original algorithm (min. 2 distance between roads) belugas@7067: TL_2X2_GRID, ///< Geometric 2x2 grid algorithm belugas@7067: TL_3X3_GRID, ///< Geometric 3x3 grid algorithm belugas@7067: belugas@7067: NUM_TLS, ///< Number of town layouts belugas@7067: }; belugas@7067: glx@7073: /* It needs to be 8bits, because we save and load it as such */ glx@7073: /** Define basic enum properties */ glx@7073: template <> struct EnumPropsT : MakeEnumPropsT {}; glx@7073: typedef TinyEnumT TownLayoutByte; //typedefing-enumification of TownLayout glx@7073: truelight@0: enum { truelight@0: NUM_PRICES = 49, truelight@0: }; truelight@0: rubidium@6574: struct Prices { rubidium@7449: Money station_value; rubidium@7449: Money build_rail; rubidium@7449: Money build_road; rubidium@7449: Money build_signals; rubidium@7449: Money build_bridge; rubidium@7449: Money build_train_depot; rubidium@7449: Money build_road_depot; rubidium@7449: Money build_ship_depot; rubidium@7449: Money build_tunnel; rubidium@7449: Money train_station_track; rubidium@7449: Money train_station_length; rubidium@7449: Money build_airport; rubidium@7449: Money build_bus_station; rubidium@7449: Money build_truck_station; rubidium@7449: Money build_dock; rubidium@7449: Money build_railvehicle; rubidium@7449: Money build_railwagon; rubidium@7449: Money aircraft_base; rubidium@7449: Money roadveh_base; rubidium@7449: Money ship_base; rubidium@7449: Money build_trees; rubidium@7449: Money terraform; belugas@8473: Money clear_grass; belugas@8473: Money clear_roughland; belugas@8473: Money clear_rocks; belugas@8473: Money clear_fields; rubidium@7449: Money remove_trees; rubidium@7449: Money remove_rail; rubidium@7449: Money remove_signals; rubidium@7449: Money clear_bridge; rubidium@7449: Money remove_train_depot; rubidium@7449: Money remove_road_depot; rubidium@7449: Money remove_ship_depot; rubidium@7449: Money clear_tunnel; rubidium@7449: Money clear_water; rubidium@7449: Money remove_rail_station; rubidium@7449: Money remove_airport; rubidium@7449: Money remove_bus_station; rubidium@7449: Money remove_truck_station; rubidium@7449: Money remove_dock; rubidium@7449: Money remove_house; rubidium@7449: Money remove_road; rubidium@7449: Money running_rail[3]; rubidium@7449: Money aircraft_running; rubidium@7449: Money roadveh_running; rubidium@7449: Money ship_running; rubidium@7449: Money build_industry; rubidium@6574: }; truelight@0: truelight@0: #define GAME_DIFFICULTY_NUM 18 truelight@0: rubidium@8238: /** Specific type for Game Difficulty to ease changing the type */ rubidium@8238: typedef uint16 GDType; rubidium@6574: struct GameDifficulty { rubidium@8238: GDType max_no_competitors; rubidium@8238: GDType competitor_start_time; rubidium@8238: GDType number_towns; rubidium@8238: GDType number_industries; rubidium@8238: GDType max_loan; rubidium@8238: GDType initial_interest; rubidium@8238: GDType vehicle_costs; rubidium@8238: GDType competitor_speed; rubidium@8238: GDType competitor_intelligence; // no longer in use rubidium@8238: GDType vehicle_breakdowns; rubidium@8238: GDType subsidy_multiplier; rubidium@8238: GDType construction_cost; rubidium@8238: GDType terrain_type; rubidium@8238: GDType quantity_sea_lakes; rubidium@8238: GDType economy; rubidium@8238: GDType line_reverse_mode; rubidium@8238: GDType disasters; rubidium@8238: GDType town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff rubidium@6574: }; truelight@0: tron@473: enum { tron@473: // Temperate rubidium@4344: CT_PASSENGERS = 0, rubidium@4344: CT_COAL = 1, rubidium@4344: CT_MAIL = 2, rubidium@4344: CT_OIL = 3, rubidium@4344: CT_LIVESTOCK = 4, rubidium@4344: CT_GOODS = 5, rubidium@4344: CT_GRAIN = 6, rubidium@4344: CT_WOOD = 7, rubidium@4344: CT_IRON_ORE = 8, rubidium@4344: CT_STEEL = 9, rubidium@4344: CT_VALUABLES = 10, tron@473: tron@473: // Arctic rubidium@4344: CT_WHEAT = 6, rubidium@4344: CT_HILLY_UNUSED = 8, rubidium@4344: CT_PAPER = 9, rubidium@4344: CT_GOLD = 10, belugas@6976: CT_FOOD = 11, tron@473: tron@473: // Tropic rubidium@4344: CT_RUBBER = 1, rubidium@4344: CT_FRUIT = 4, rubidium@4344: CT_MAIZE = 6, rubidium@4344: CT_COPPER_ORE = 8, rubidium@4344: CT_WATER = 9, rubidium@4344: CT_DIAMONDS = 10, tron@473: tron@473: // Toyland rubidium@4344: CT_SUGAR = 1, rubidium@4344: CT_TOYS = 3, rubidium@4344: CT_BATTERIES = 4, rubidium@4344: CT_CANDY = 5, rubidium@4344: CT_TOFFEE = 6, rubidium@4344: CT_COLA = 7, rubidium@4344: CT_COTTON_CANDY = 8, rubidium@4344: CT_BUBBLES = 9, rubidium@4344: CT_PLASTIC = 10, tron@473: CT_FIZZY_DRINKS = 11, tron@473: peter1138@6959: NUM_CARGO = 32, miham@1004: bjarni@4554: CT_NO_REFIT = 0xFE, rubidium@4344: CT_INVALID = 0xFF tron@473: }; tron@473: tron@473: typedef uint AcceptedCargo[NUM_CARGO]; truelight@0: rubidium@6574: struct TileDesc { truelight@0: StringID str; Darkvater@4849: Owner owner; rubidium@4297: Date build_date; rubidium@7498: uint64 dparam[2]; rubidium@6574: }; truelight@0: rubidium@6574: struct ViewportSign { tron@849: int32 left; tron@849: int32 top; truelight@0: byte width_1, width_2; rubidium@6574: }; truelight@0: rubidium@7446: /** rubidium@7446: * Common return value for all commands. Wraps the cost and rubidium@7446: * a possible error message/state together. rubidium@7446: */ rubidium@7446: class CommandCost { rubidium@7449: Money cost; ///< The cost of this action rubidium@7446: StringID message; ///< Warning message for when success is unset rubidium@7446: bool success; ///< Whether the comment went fine up to this moment rubidium@7446: rubidium@7446: public: rubidium@7446: /** rubidium@7446: * Creates a command cost return with no cost and no error rubidium@7446: */ rubidium@7446: CommandCost() : cost(0), message(INVALID_STRING_ID), success(true) {} rubidium@7446: rubidium@7446: /** rubidium@7446: * Creates a command return value the is failed with the given message rubidium@7446: */ rubidium@7446: CommandCost(StringID msg) : cost(0), message(msg), success(false) {} rubidium@7446: rubidium@7446: /** rubidium@7446: * Creates a command return value with the given start cost rubidium@7446: * @param cst the initial cost of this command rubidium@7446: */ rubidium@7449: CommandCost(Money cst) : cost(cst), message(INVALID_STRING_ID), success(true) {} rubidium@7446: rubidium@7446: /** rubidium@7446: * Adds the cost of the given command return value to this cost. rubidium@7446: * Also takes a possible error message when it is set. rubidium@7446: * @param ret the command to add the cost of. rubidium@7446: * @return this class. rubidium@7446: */ rubidium@7446: CommandCost AddCost(CommandCost ret); rubidium@7446: rubidium@7446: /** rubidium@7446: * Adds the given cost to the cost of the command. rubidium@7446: * @param cost the cost to add rubidium@7446: * @return this class. rubidium@7446: */ rubidium@7449: CommandCost AddCost(Money cost); rubidium@7446: rubidium@7446: /** rubidium@7446: * Multiplies the cost of the command by the given factor. rubidium@7446: * @param cost factor to multiply the costs with rubidium@7446: * @return this class rubidium@7446: */ rubidium@7446: CommandCost MultiplyCost(int factor); rubidium@7446: rubidium@7446: /** rubidium@7446: * The costs as made up to this moment rubidium@7446: * @return the costs rubidium@7446: */ rubidium@7449: Money GetCost() const; rubidium@7446: rubidium@7446: /** rubidium@7446: * Sets the global error message *if* this class has one. rubidium@7446: */ rubidium@7446: void SetGlobalErrorMessage() const; rubidium@7446: rubidium@7446: /** rubidium@7446: * Did this command succeed? rubidium@7446: * @return true if and only if it succeeded rubidium@7446: */ rubidium@7446: bool Succeeded() const; rubidium@7446: rubidium@7446: /** rubidium@7446: * Did this command fail? rubidium@7446: * @return true if and only if it failed rubidium@7446: */ rubidium@7446: bool Failed() const; rubidium@7446: }; rubidium@7446: truelight@0: truelight@0: typedef void DrawTileProc(TileInfo *ti); tron@4231: typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y); rubidium@7446: typedef CommandCost ClearTileProc(TileIndex tile, byte flags); tron@1977: typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res); tron@1977: typedef void GetTileDescProc(TileIndex tile, TileDesc *td); rubidium@7179: /** rubidium@7179: * GetTileTrackStatusProcs return a value that contains the possible tracks truelight@159: * that can be taken on a given tile by a given transport. The return value is truelight@159: * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs, truelight@159: * where bit n corresponds to trackdir n. ccdd are the trackdirs that are truelight@159: * present in the tile (1==present, 0==not present), aabb is the signal truelight@159: * status, if applicable (0==green/no signal, 1==red, note that this is truelight@159: * reversed from map3/2[tile] for railway signals). truelight@159: * truelight@159: * The result (let's call it ts) is often used as follows: truelight@159: * tracks = (byte)(ts | ts >>8) truelight@159: * This effectively converts the present part of the result (ccdd) to a truelight@159: * track bitmask, which disregards directions. Normally, this is the same as just truelight@193: * doing (byte)ts I think, although I am not really sure truelight@159: * truelight@159: * A trackdir is combination of a track and a dir, where the lower three bits truelight@159: * are a track, the fourth bit is the direction. these give 12 (or 14) truelight@159: * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask truelight@193: * above. rubidium@7179: * @param tile the tile to get the track status from rubidium@7179: * @param mode the mode of transportation rubidium@7179: * @param sub_mode used to differentiate between different kinds within the mode rubidium@7179: * @return the above mentions track status information truelight@159: */ rubidium@7179: typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode); Darkvater@3344: typedef void GetProducedCargoProc(TileIndex tile, CargoID *b); tron@1977: typedef void ClickTileProc(TileIndex tile); tron@1977: typedef void AnimateTileProc(TileIndex tile); tron@1977: typedef void TileLoopProc(TileIndex tile); Darkvater@2436: typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player); rubidium@6317: /** @see VehicleEnterTileStatus to see what the return values mean */ tron@1977: typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); rubidium@7831: typedef Foundation GetFoundationProc(TileIndex tile, Slope tileh); rubidium@7990: /** rubidium@7990: * Called when a tile is affected by a terraforming operation. rubidium@7990: * The function has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. rubidium@7990: * With DC_EXEC in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself). rubidium@7990: * rubidium@7990: * @note The terraforming has not yet taken place. So GetTileZ() and GetTileSlope() refer to the landscape before the terraforming operation. rubidium@7990: * rubidium@7990: * @param tile The involved tile. rubidium@7990: * @param flags Command flags passed to the terraform command (DC_EXEC, DC_QUERY_COST, etc.). rubidium@7990: * @param z_new TileZ after terraforming. rubidium@7990: * @param tileh_new Slope after terraforming. rubidium@7990: * @return Error code or extra cost for terraforming (like clearing land, building foundations, etc., but not the terraforming itself.) rubidium@7990: */ rubidium@7990: typedef CommandCost TerraformTileProc(TileIndex tile, uint32 flags, uint z_new, Slope tileh_new); truelight@0: rubidium@6574: struct TileTypeProcs { truelight@0: DrawTileProc *draw_tile_proc; truelight@0: GetSlopeZProc *get_slope_z_proc; truelight@0: ClearTileProc *clear_tile_proc; truelight@0: GetAcceptedCargoProc *get_accepted_cargo_proc; truelight@0: GetTileDescProc *get_tile_desc_proc; truelight@0: GetTileTrackStatusProc *get_tile_track_status_proc; truelight@0: ClickTileProc *click_tile_proc; truelight@0: AnimateTileProc *animate_tile_proc; truelight@0: TileLoopProc *tile_loop_proc; truelight@0: ChangeTileOwnerProc *change_tile_owner_proc; truelight@0: GetProducedCargoProc *get_produced_cargo_proc; truelight@0: VehicleEnterTileProc *vehicle_enter_tile_proc; rubidium@7831: GetFoundationProc *get_foundation_proc; rubidium@7990: TerraformTileProc *terraform_tile_proc; rubidium@6574: }; truelight@0: truelight@0: truelight@0: rubidium@7058: enum ExpensesType { rubidium@4344: EXPENSES_CONSTRUCTION = 0, rubidium@4344: EXPENSES_NEW_VEHICLES = 1, rubidium@4344: EXPENSES_TRAIN_RUN = 2, rubidium@4344: EXPENSES_ROADVEH_RUN = 3, rubidium@4344: EXPENSES_AIRCRAFT_RUN = 4, rubidium@4344: EXPENSES_SHIP_RUN = 5, rubidium@4344: EXPENSES_PROPERTY = 6, rubidium@4344: EXPENSES_TRAIN_INC = 7, rubidium@4344: EXPENSES_ROADVEH_INC = 8, rubidium@4344: EXPENSES_AIRCRAFT_INC = 9, rubidium@4344: EXPENSES_SHIP_INC = 10, rubidium@4344: EXPENSES_LOAN_INT = 11, rubidium@4344: EXPENSES_OTHER = 12, truelight@0: }; truelight@0: peter1138@5108: enum { peter1138@5108: MAX_LANG = 64, peter1138@5108: }; peter1138@5108: truelight@0: // special string constants truelight@0: enum SpecialStrings { truelight@193: truelight@0: // special strings for town names. the town name is generated dynamically on request. rubidium@4344: SPECSTR_TOWNNAME_START = 0x20C0, rubidium@4344: SPECSTR_TOWNNAME_ENGLISH = SPECSTR_TOWNNAME_START, truelight@0: SPECSTR_TOWNNAME_FRENCH, truelight@0: SPECSTR_TOWNNAME_GERMAN, truelight@0: SPECSTR_TOWNNAME_AMERICAN, truelight@0: SPECSTR_TOWNNAME_LATIN, truelight@0: SPECSTR_TOWNNAME_SILLY, truelight@0: SPECSTR_TOWNNAME_SWEDISH, truelight@0: SPECSTR_TOWNNAME_DUTCH, truelight@0: SPECSTR_TOWNNAME_FINNISH, truelight@0: SPECSTR_TOWNNAME_POLISH, truelight@0: SPECSTR_TOWNNAME_SLOVAKISH, miham@948: SPECSTR_TOWNNAME_NORWEGIAN, truelight@0: SPECSTR_TOWNNAME_HUNGARIAN, dominik@265: SPECSTR_TOWNNAME_AUSTRIAN, dominik@265: SPECSTR_TOWNNAME_ROMANIAN, dominik@265: SPECSTR_TOWNNAME_CZECH, darkvater@1030: SPECSTR_TOWNNAME_SWISS, Darkvater@2431: SPECSTR_TOWNNAME_DANISH, celestar@3698: SPECSTR_TOWNNAME_TURKISH, belugas@4143: SPECSTR_TOWNNAME_ITALIAN, bjarni@4312: SPECSTR_TOWNNAME_CATALAN, rubidium@4344: SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_CATALAN, truelight@0: truelight@0: // special strings for player names on the form "TownName transport". rubidium@4344: SPECSTR_PLAYERNAME_START = 0x70EA, truelight@0: SPECSTR_PLAYERNAME_ENGLISH = SPECSTR_PLAYERNAME_START, truelight@0: SPECSTR_PLAYERNAME_FRENCH, truelight@0: SPECSTR_PLAYERNAME_GERMAN, truelight@0: SPECSTR_PLAYERNAME_AMERICAN, truelight@0: SPECSTR_PLAYERNAME_LATIN, truelight@0: SPECSTR_PLAYERNAME_SILLY, rubidium@4344: SPECSTR_PLAYERNAME_LAST = SPECSTR_PLAYERNAME_SILLY, truelight@0: rubidium@4344: SPECSTR_ANDCO_NAME = 0x70E6, rubidium@4344: SPECSTR_PRESIDENT_NAME = 0x70E7, rubidium@4344: SPECSTR_SONGNAME = 0x70E8, truelight@0: peter1138@5108: // reserve MAX_LANG strings for the *.lng files rubidium@4344: SPECSTR_LANGUAGE_START = 0x7100, peter1138@5108: SPECSTR_LANGUAGE_END = SPECSTR_LANGUAGE_START + MAX_LANG - 1, truelight@0: truelight@0: // reserve 32 strings for various screen resolutions peter1138@5108: SPECSTR_RESOLUTION_START = SPECSTR_LANGUAGE_END + 1, peter1138@5108: SPECSTR_RESOLUTION_END = SPECSTR_RESOLUTION_START + 0x1F, truelight@0: truelight@0: // reserve 32 strings for screenshot formats peter1138@5108: SPECSTR_SCREENSHOT_START = SPECSTR_RESOLUTION_END + 1, peter1138@5108: SPECSTR_SCREENSHOT_END = SPECSTR_SCREENSHOT_START + 0x1F, truelight@0: ludde@2055: // Used to implement SetDParamStr rubidium@4344: STR_SPEC_DYNSTRING = 0xF800, rubidium@4344: STR_SPEC_USERSTRING = 0xF808, truelight@0: }; truelight@0: tron@1977: typedef void PlaceProc(TileIndex tile); truelight@0: tron@2526: enum { tron@2526: SORT_ASCENDING = 0, tron@2526: SORT_DESCENDING = 1, tron@2526: SORT_BY_DATE = 0, tron@2526: SORT_BY_NAME = 2 tron@2526: }; tron@2526: truelight@0: VARDEF byte _savegame_sort_order; truelight@0: truelight@0: enum { rubidium@4344: MAX_SCREEN_WIDTH = 2048, truelight@0: MAX_SCREEN_HEIGHT = 1200, truelight@0: }; truelight@0: Darkvater@1397: /* In certain windows you navigate with the arrow keys. Do not scroll the Darkvater@1397: * gameview when here. Bitencoded variable that only allows scrolling if all Darkvater@1397: * elements are zero */ Darkvater@1397: enum { rubidium@4344: SCROLL_CON = 0, Darkvater@1397: SCROLL_EDIT = 1, Darkvater@1397: SCROLL_SAVE = 2, Darkvater@1843: SCROLL_CHAT = 4, Darkvater@1397: }; Darkvater@1397: VARDEF byte _no_scroll; Darkvater@1397: Darkvater@2380: /** To have a concurrently running thread interface with the main program, use Darkvater@2380: * the OTTD_SendThreadMessage() function. Actions to perform upon the message are handled Darkvater@2380: * in the ProcessSentMessage() function */ rubidium@6574: enum ThreadMsg { truelight@4323: MSG_OTTD_NO_MESSAGE, truelight@4323: MSG_OTTD_SAVETHREAD_DONE, truelight@4323: MSG_OTTD_SAVETHREAD_ERROR, rubidium@6574: }; Darkvater@2380: Darkvater@2380: void OTTD_SendThreadMessage(ThreadMsg msg); Darkvater@2380: Darkvater@2075: #endif /* OPENTTD_H */