tron@2186: /* $Id$ */ 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: truelight@0: // use this on non static functions truelight@193: #define PUBLIC truelight@0: truelight@0: typedef struct Rect { truelight@0: int left,top,right,bottom; truelight@0: } Rect; truelight@0: truelight@0: typedef struct SmallPoint { truelight@0: int16 x,y; truelight@0: } SmallPoint; truelight@0: truelight@0: typedef struct Point { truelight@0: int x,y; truelight@0: } Point; truelight@0: truelight@0: typedef struct Pair { truelight@0: int a; truelight@0: int b; truelight@0: } Pair; truelight@0: matthijs@1752: /** matthijs@1752: * Is used as a general sortable struct (using qsort and friends). Is used for matthijs@1752: * sorting vehicles and stations at the moment matthijs@1752: */ matthijs@1752: typedef struct SortStruct { matthijs@1752: uint32 index; matthijs@1752: byte owner; matthijs@1752: } SortStruct; matthijs@1752: truelight@0: typedef struct YearMonthDay { truelight@0: int year, month, day; truelight@0: } YearMonthDay; truelight@0: darkvater@164: /* --- 1 Day is 74 ticks --- darkvater@164: * The game's internal structure is dictated by ticks. The date counter (date_fract) is an integer of truelight@193: * uint16 type, so it can have a max value of 65536. Every tick this variable (date_fract) is truelight@193: * increased by 885. When it overflows, the new day loop is called. darkvater@164: * * this that means 1 day is : 65536 / 885 = 74 ticks truelight@193: * * 1 tick is approximately 27ms. darkvater@164: * * 1 day is thus about 2 seconds (74*27 = 1998) on a machine that can run OpenTTD normally darkvater@164: */ darkvater@164: #define DAY_TICKS 74 darkvater@970: #define MAX_YEAR_BEGIN_REAL 1920 darkvater@970: #define MAX_YEAR_END_REAL 2090 darkvater@970: #define MAX_YEAR_END 170 darkvater@164: tron@2159: #include "map.h" truelight@0: truelight@0: // Forward declarations of structs. truelight@0: typedef struct Vehicle Vehicle; truelight@0: typedef struct Depot Depot; darkvater@395: typedef struct Waypoint Waypoint; truelight@0: typedef struct Window Window; truelight@0: typedef struct Station Station; truelight@0: typedef struct ViewPort ViewPort; truelight@0: typedef struct Town Town; truelight@0: typedef struct NewsItem NewsItem; truelight@0: typedef struct Industry Industry; truelight@0: typedef struct DrawPixelInfo DrawPixelInfo; truelight@0: typedef uint16 VehicleID; Darkvater@1786: typedef byte PlayerID; Darkvater@1786: typedef byte OrderID; Darkvater@1802: typedef byte CargoID; truelight@0: typedef uint16 StringID; celestar@2187: typedef uint32 SpriteID; truelight@0: typedef uint32 PalSpriteID; Darkvater@1914: typedef uint32 CursorID; tron@2153: typedef uint16 EngineID; //! All enginenumbers should be of this type tron@2153: typedef uint16 UnitID; //! All unitnumber stuff is of this type (or anyway, should be) truelight@0: truelight@0: typedef uint32 WindowNumber; truelight@0: typedef byte WindowClass; truelight@0: truelight@0: truelight@0: enum GameModes { truelight@0: GM_MENU, truelight@0: GM_NORMAL, truelight@0: GM_EDITOR truelight@0: }; truelight@0: truelight@0: enum SwitchModes { truelight@0: SM_NONE = 0, truelight@0: SM_NEWGAME = 1, truelight@0: SM_EDITOR = 2, truelight@0: SM_LOAD = 3, truelight@0: SM_MENU = 4, truelight@0: SM_SAVE = 5, truelight@0: SM_GENRANDLAND = 6, truelight@0: SM_LOAD_SCENARIO = 9, truelight@543: SM_START_SCENARIO = 10, truelight@0: }; truelight@0: truelight@159: typedef enum TransportTypes { truelight@159: /* These constants are for now linked to the representation of bridges truelight@159: * and tunnels, so they can be used by GetTileTrackStatus_TunnelBridge truelight@159: * to compare against the map5 array. In an ideal world, these truelight@159: * constants would be used everywhere when accessing tunnels and truelight@159: * bridges. For now, you should just not change the values for road truelight@159: * and rail. truelight@159: */ darkvater@241: TRANSPORT_RAIL = 0, truelight@159: TRANSPORT_ROAD = 1, darkvater@241: TRANSPORT_WATER, // = 2 matthijs@1967: TRANSPORT_END, matthijs@1967: INVALID_TRANSPORT = 0xff, truelight@159: } TransportType; truelight@159: truelight@0: typedef struct TileInfo { truelight@0: uint x; truelight@0: uint y; truelight@0: uint tileh; truelight@0: uint type; truelight@0: uint map5; tron@1977: TileIndex tile; truelight@0: uint z; truelight@0: } TileInfo; truelight@0: truelight@0: enum { truelight@0: NG_EDGE = 1, truelight@0: }; truelight@0: truelight@0: /* Display Options */ truelight@0: enum { hackykid@1932: DO_SHOW_TOWN_NAMES = 1 << 0, hackykid@1932: DO_SHOW_STATION_NAMES = 1 << 1, hackykid@1932: DO_SHOW_SIGNS = 1 << 2, hackykid@1932: DO_FULL_ANIMATION = 1 << 3, hackykid@1932: DO_TRANS_BUILDINGS = 1 << 4, hackykid@1932: DO_FULL_DETAIL = 1 << 5, hackykid@1932: DO_WAYPOINTS = 1 << 6, hackykid@1932: DO_TRANS_SIGNS = 1 << 7, truelight@0: }; truelight@0: truelight@0: /* Landscape types */ truelight@0: enum { truelight@0: LT_NORMAL = 0, truelight@0: LT_HILLY = 1, truelight@0: LT_DESERT = 2, truelight@0: LT_CANDY = 3, truelight@0: truelight@0: NUM_LANDSCAPE = 4, truelight@0: }; truelight@0: truelight@0: enum { truelight@0: NUM_PRICES = 49, truelight@0: }; truelight@0: truelight@0: typedef struct Prices { truelight@0: int32 station_value; truelight@0: int32 build_rail; truelight@0: int32 build_road; truelight@0: int32 build_signals; truelight@0: int32 build_bridge; truelight@0: int32 build_train_depot; truelight@0: int32 build_road_depot; truelight@0: int32 build_ship_depot; truelight@0: int32 build_tunnel; truelight@0: int32 train_station_track; truelight@0: int32 train_station_length; truelight@0: int32 build_airport; truelight@0: int32 build_bus_station; truelight@0: int32 build_truck_station; truelight@0: int32 build_dock; truelight@0: int32 build_railvehicle; truelight@0: int32 build_railwagon; truelight@0: int32 aircraft_base; truelight@0: int32 roadveh_base; truelight@0: int32 ship_base; truelight@0: int32 build_trees; truelight@0: int32 terraform; truelight@0: int32 clear_1; truelight@0: int32 purchase_land; truelight@0: int32 clear_2; truelight@0: int32 clear_3; truelight@0: int32 remove_trees; truelight@0: int32 remove_rail; truelight@0: int32 remove_signals; truelight@0: int32 clear_bridge; truelight@0: int32 remove_train_depot; truelight@0: int32 remove_road_depot; truelight@0: int32 remove_ship_depot; truelight@0: int32 clear_tunnel; truelight@0: int32 clear_water; truelight@0: int32 remove_rail_station; truelight@0: int32 remove_airport; truelight@0: int32 remove_bus_station; truelight@0: int32 remove_truck_station; truelight@0: int32 remove_dock; truelight@0: int32 remove_house; truelight@0: int32 remove_road; truelight@0: int32 running_rail[3]; truelight@0: int32 aircraft_running; truelight@0: int32 roadveh_running; truelight@0: int32 ship_running; truelight@193: int32 build_industry; truelight@0: } Prices; truelight@0: truelight@0: #define GAME_DIFFICULTY_NUM 18 truelight@0: truelight@0: typedef struct GameDifficulty { truelight@0: int max_no_competitors; truelight@0: int competitor_start_time; truelight@0: int number_towns; truelight@0: int number_industries; truelight@0: int max_loan; truelight@0: int initial_interest; truelight@0: int vehicle_costs; truelight@0: int competitor_speed; truelight@2395: int competitor_intelligence; // no longer in use truelight@0: int vehicle_breakdowns; truelight@0: int subsidy_multiplier; truelight@0: int construction_cost; truelight@0: int terrain_type; truelight@0: int quantity_sea_lakes; truelight@0: int economy; truelight@0: int line_reverse_mode; truelight@0: int disasters; truelight@0: int town_council_tolerance; // minimum required town ratings to be allowed to demolish stuff truelight@0: } GameDifficulty; truelight@0: tron@473: enum { tron@473: // Temperate tron@473: CT_PASSENGERS = 0, tron@473: CT_COAL = 1, tron@473: CT_MAIL = 2, tron@473: CT_OIL = 3, tron@473: CT_LIVESTOCK = 4, tron@473: CT_GOODS = 5, tron@473: CT_GRAIN = 6, tron@473: CT_WOOD = 7, tron@473: CT_IRON_ORE = 8, tron@473: CT_STEEL = 9, tron@473: CT_VALUABLES = 10, tron@473: CT_FOOD = 11, tron@473: tron@473: // Arctic celestar@924: CT_WHEAT = 6, tron@473: CT_HILLY_UNUSED = 8, tron@473: CT_PAPER = 9, celestar@924: CT_GOLD = 10, tron@473: tron@473: // Tropic tron@473: CT_RUBBER = 1, tron@473: CT_FRUIT = 4, celestar@924: CT_MAIZE = 6, tron@473: CT_COPPER_ORE = 8, tron@473: CT_WATER = 9, celestar@924: CT_DIAMONDS = 10, tron@473: tron@473: // Toyland tron@473: CT_SUGAR = 1, tron@473: CT_TOYS = 3, tron@473: CT_BATTERIES = 4, tron@473: CT_CANDY = 5, tron@473: CT_TOFFEE = 6, tron@473: CT_COLA = 7, tron@473: CT_COTTON_CANDY = 8, tron@473: CT_BUBBLES = 9, tron@473: CT_PLASTIC = 10, tron@473: CT_FIZZY_DRINKS = 11, tron@473: tron@473: NUM_CARGO = 12, miham@1004: miham@1004: CT_INVALID = 0xFF tron@473: }; tron@473: tron@473: typedef uint AcceptedCargo[NUM_CARGO]; truelight@0: truelight@0: typedef struct TileDesc { truelight@0: StringID str; truelight@0: byte owner; truelight@71: uint16 build_date; truelight@0: uint32 dparam[2]; truelight@0: } TileDesc; truelight@0: truelight@0: typedef struct { tron@849: int32 left; tron@849: int32 top; truelight@0: byte width_1, width_2; truelight@0: } ViewportSign; truelight@0: truelight@0: typedef int32 CommandProc(int x, int y, uint32 flags, uint32 p1, uint32 p2); truelight@0: truelight@0: typedef void DrawTileProc(TileInfo *ti); truelight@0: typedef uint GetSlopeZProc(TileInfo *ti); tron@1977: typedef int32 ClearTileProc(TileIndex tile, byte flags); tron@1977: typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res); tron@1977: typedef void GetTileDescProc(TileIndex tile, TileDesc *td); truelight@159: /* 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. truelight@159: */ tron@1977: typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode); tron@1977: typedef void GetProducedCargoProc(TileIndex tile, byte *b); tron@1977: typedef void ClickTileProc(TileIndex tile); tron@1977: typedef void AnimateTileProc(TileIndex tile); tron@1977: typedef void TileLoopProc(TileIndex tile); tron@1977: typedef void ChangeTileOwnerProc(TileIndex tile, byte old_player, byte new_player); darkvater@22: /* Return value has bit 0x2 set, when the vehicle enters a station. Then, darkvater@22: * result << 8 contains the id of the station entered. If the return value has darkvater@22: * bit 0x8 set, the vehicle could not and did not enter the tile. Are there darkvater@22: * other bits that can be set? */ tron@1977: typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y); tron@1977: typedef void VehicleLeaveTileProc(Vehicle *v, TileIndex tile, int x, int y); dominik@39: typedef uint GetSlopeTilehProc(TileInfo *ti); truelight@0: truelight@0: typedef struct { 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; truelight@0: VehicleLeaveTileProc *vehicle_leave_tile_proc; dominik@39: GetSlopeTilehProc *get_slope_tileh_proc; truelight@0: } TileTypeProcs; truelight@0: truelight@0: truelight@0: truelight@0: #define MP_SETTYPE(x) ((x+1) << 8) truelight@0: truelight@0: enum { truelight@0: MP_MAP2 = 1<<0, truelight@0: MP_MAP3LO = 1<<1, truelight@0: MP_MAP3HI = 1<<2, truelight@0: MP_MAP5 = 1<<3, truelight@0: MP_MAPOWNER_CURRENT = 1<<4, truelight@0: MP_MAPOWNER = 1<<5, truelight@193: truelight@0: MP_TYPE_MASK = 0xF << 8, truelight@0: truelight@0: MP_MAP2_CLEAR = 1 << 12, truelight@0: MP_MAP3LO_CLEAR = 1 << 13, truelight@0: MP_MAP3HI_CLEAR = 1 << 14, truelight@0: truelight@0: MP_NODIRTY = 1<<15, truelight@0: }; truelight@0: truelight@0: enum { truelight@0: WC_MAIN_WINDOW = 0x0, truelight@0: WC_MAIN_TOOLBAR = 0x1, truelight@0: WC_STATUS_BAR = 0x2, truelight@0: WC_BUILD_TOOLBAR = 0x3, truelight@0: WC_NEWS_WINDOW = 0x4, truelight@0: WC_TOWN_DIRECTORY = 0x5, truelight@0: WC_STATION_LIST = 0x6, truelight@0: WC_TOWN_VIEW = 0x7, truelight@0: WC_SMALLMAP = 0x8, truelight@0: WC_TRAINS_LIST = 0x9, truelight@0: WC_ROADVEH_LIST = 0xA, truelight@0: WC_SHIPS_LIST = 0xB, truelight@0: WC_AIRCRAFT_LIST = 0xC, truelight@0: WC_VEHICLE_VIEW = 0xD, truelight@0: WC_VEHICLE_DETAILS = 0xE, truelight@0: WC_VEHICLE_REFIT = 0xF, truelight@0: WC_VEHICLE_ORDERS = 0x10, truelight@0: WC_STATION_VIEW = 0x11, truelight@0: WC_VEHICLE_DEPOT = 0x12, truelight@0: WC_BUILD_VEHICLE = 0x13, truelight@0: WC_BUILD_BRIDGE = 0x14, truelight@0: WC_ERRMSG = 0x15, truelight@0: WC_ASK_ABANDON_GAME = 0x16, truelight@0: WC_QUIT_GAME = 0x17, truelight@0: WC_BUILD_STATION = 0x18, truelight@0: WC_BUS_STATION = 0x19, truelight@0: WC_TRUCK_STATION = 0x1A, truelight@0: WC_BUILD_DEPOT = 0x1B, truelight@0: WC_DEBUGGER = 0x1C, truelight@0: WC_COMPANY = 0x1D, truelight@0: WC_FINANCES = 0x1E, truelight@0: WC_PLAYER_COLOR = 0x1F, truelight@0: WC_QUERY_STRING = 0x20, truelight@0: WC_SAVELOAD = 0x21, truelight@0: WC_SELECT_GAME = 0x22, truelight@0: WC_TOOLBAR_MENU = 0x24, truelight@0: WC_INCOME_GRAPH = 0x25, truelight@0: WC_OPERATING_PROFIT = 0x26, truelight@0: WC_TOOLTIPS = 0x27, truelight@0: WC_INDUSTRY_VIEW = 0x28, truelight@0: WC_PLAYER_FACE = 0x29, truelight@0: WC_LAND_INFO = 0x2A, truelight@0: WC_TOWN_AUTHORITY = 0x2B, truelight@0: WC_SUBSIDIES_LIST = 0x2C, truelight@0: WC_GRAPH_LEGEND = 0x2D, truelight@0: WC_DELIVERED_CARGO = 0x2E, truelight@0: WC_PERFORMANCE_HISTORY = 0x2F, truelight@0: WC_COMPANY_VALUE = 0x30, truelight@0: WC_COMPANY_LEAGUE = 0x31, truelight@0: WC_BUY_COMPANY = 0x32, truelight@0: WC_PAYMENT_RATES = 0x33, truelight@0: WC_SELECT_TUTORIAL = 0x34, truelight@0: WC_ENGINE_PREVIEW = 0x35, truelight@0: WC_MUSIC_WINDOW = 0x36, truelight@0: WC_MUSIC_TRACK_SELECTION = 0x37, dominik@606: WC_SCEN_LAND_GEN = 0x38, // also used for landscaping toolbar truelight@0: WC_ASK_RESET_LANDSCAPE = 0x39, truelight@0: WC_SCEN_TOWN_GEN = 0x3A, truelight@0: WC_SCEN_INDUSTRY = 0x3B, truelight@0: WC_SCEN_BUILD_ROAD = 0x3C, dominik@606: WC_BUILD_TREES = 0x3D, truelight@0: WC_SEND_NETWORK_MSG = 0x3E, truelight@0: WC_DROPDOWN_MENU = 0x3F, truelight@0: WC_BUILD_INDUSTRY = 0x40, truelight@0: WC_GAME_OPTIONS = 0x41, truelight@0: WC_NETWORK_WINDOW = 0x42, truelight@0: WC_INDUSTRY_DIRECTORY = 0x43, truelight@0: WC_MESSAGE_HISTORY = 0x44, truelight@0: WC_CHEATS = 0x45, darkvater@152: WC_PERFORMANCE_DETAIL = 0x46, dominik@126: WC_CONSOLE = 0x47, darkvater@152: WC_EXTRA_VIEW_PORT = 0x48, truelight@543: WC_CLIENT_LIST = 0x49, truelight@543: WC_NETWORK_STATUS_WINDOW = 0x4A, dominik@759: WC_CUSTOM_CURRENCY = 0x4B, bjarni@842: WC_REPLACE_VEHICLE = 0x4C, Darkvater@1875: WC_HIGHSCORE = 0x4D, Darkvater@1875: WC_ENDSCREEN = 0x4E, Darkvater@1875: WC_SIGN_LIST = 0x4F, truelight@0: }; truelight@0: truelight@0: truelight@0: enum { truelight@0: EXPENSES_CONSTRUCTION = 0, truelight@0: EXPENSES_NEW_VEHICLES = 1, truelight@0: EXPENSES_TRAIN_RUN = 2, truelight@0: EXPENSES_ROADVEH_RUN = 3, truelight@0: EXPENSES_AIRCRAFT_RUN = 4, truelight@0: EXPENSES_SHIP_RUN = 5, truelight@0: EXPENSES_PROPERTY = 6, truelight@0: EXPENSES_TRAIN_INC = 7, truelight@0: EXPENSES_ROADVEH_INC = 8, truelight@0: EXPENSES_AIRCRAFT_INC = 9, truelight@0: EXPENSES_SHIP_INC = 10, truelight@0: EXPENSES_LOAN_INT = 11, truelight@0: EXPENSES_OTHER = 12, truelight@0: }; truelight@0: 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. truelight@0: SPECSTR_TOWNNAME_START = 0x20C0, truelight@0: 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, Darkvater@2431: SPECSTR_TOWNNAME_LAST = SPECSTR_TOWNNAME_DANISH, truelight@0: truelight@0: // special strings for player names on the form "TownName transport". truelight@0: 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, truelight@193: SPECSTR_PLAYERNAME_LAST = SPECSTR_PLAYERNAME_SILLY, truelight@0: truelight@0: SPECSTR_ANDCO_NAME = 0x70E6, truelight@0: SPECSTR_PRESIDENT_NAME = 0x70E7, truelight@0: SPECSTR_SONGNAME = 0x70E8, truelight@0: truelight@0: // reserve 32 strings for the *.lng files truelight@0: SPECSTR_LANGUAGE_START = 0x7100, truelight@0: SPECSTR_LANGUAGE_END = 0x711f, truelight@0: truelight@0: // reserve 32 strings for various screen resolutions truelight@0: SPECSTR_RESOLUTION_START = 0x7120, truelight@0: SPECSTR_RESOLUTION_END = 0x713f, truelight@0: truelight@0: // reserve 32 strings for screenshot formats truelight@0: SPECSTR_SCREENSHOT_START = 0x7140, truelight@0: SPECSTR_SCREENSHOT_END = 0x715F, truelight@0: ludde@2055: // Used to implement SetDParamStr ludde@2055: STR_SPEC_DYNSTRING = 0xF800, ludde@2055: STR_SPEC_USERSTRING = 0xF808, truelight@0: }; truelight@0: tron@1977: typedef void PlaceProc(TileIndex tile); truelight@0: truelight@0: VARDEF byte _savegame_sort_order; truelight@0: truelight@0: #define INVALID_UINT_TILE (uint)0xFFFFFFFF truelight@0: #define INVALID_STRING_ID 0xFFFF truelight@0: truelight@0: enum { truelight@0: 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 { Darkvater@1397: 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 */ Darkvater@2380: typedef enum ThreadMsgs { Darkvater@2380: MSG_OTTD_SAVETHREAD_START = 1, Darkvater@2380: MSG_OTTD_SAVETHREAD_DONE = 2, Darkvater@2380: MSG_OTTD_SAVETHREAD_ERROR = 3, Darkvater@2380: } ThreadMsg; Darkvater@2380: Darkvater@2380: void OTTD_SendThreadMessage(ThreadMsg msg); Darkvater@2380: Darkvater@2075: #endif /* OPENTTD_H */