src/openttd.h
branchNewGRF_ports
changeset 6719 4cc327ad39d5
parent 6683 7ec558346172
child 6720 35756db7e577
equal deleted inserted replaced
6718:5a8b295aa345 6719:4cc327ad39d5
    38 struct ViewPort;
    38 struct ViewPort;
    39 struct Town;
    39 struct Town;
    40 struct NewsItem;
    40 struct NewsItem;
    41 struct Industry;
    41 struct Industry;
    42 struct DrawPixelInfo;
    42 struct DrawPixelInfo;
       
    43 struct Group;
    43 typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
    44 typedef byte VehicleOrderID;  ///< The index of an order within its current vehicle (not pool related)
    44 typedef byte CargoID;
    45 typedef byte CargoID;
    45 typedef byte LandscapeID;
    46 typedef byte LandscapeID;
    46 typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
    47 typedef uint32 SpriteID;      ///< The number of a sprite, without mapping bits and colortables
    47 struct PalSpriteID {
    48 struct PalSpriteID {
    61 typedef uint16 IndustryID;
    62 typedef uint16 IndustryID;
    62 typedef uint16 DepotID;
    63 typedef uint16 DepotID;
    63 typedef uint16 WaypointID;
    64 typedef uint16 WaypointID;
    64 typedef uint16 OrderID;
    65 typedef uint16 OrderID;
    65 typedef uint16 SignID;
    66 typedef uint16 SignID;
       
    67 typedef uint16 GroupID;
    66 typedef uint16 EngineRenewID;
    68 typedef uint16 EngineRenewID;
    67 typedef uint16 DestinationID;
    69 typedef uint16 DestinationID;
    68 
    70 
    69 /* DestinationID must be at least as large as every these below, because it can
    71 /* DestinationID must be at least as large as every these below, because it can
    70  * be any of them
    72  * be any of them
   169 };
   171 };
   170 
   172 
   171 
   173 
   172 /* Display Options */
   174 /* Display Options */
   173 enum {
   175 enum {
   174 	DO_SHOW_TOWN_NAMES    = 1 << 0,
   176 	DO_SHOW_TOWN_NAMES    = 0,
   175 	DO_SHOW_STATION_NAMES = 1 << 1,
   177 	DO_SHOW_STATION_NAMES = 1,
   176 	DO_SHOW_SIGNS         = 1 << 2,
   178 	DO_SHOW_SIGNS         = 2,
   177 	DO_FULL_ANIMATION     = 1 << 3,
   179 	DO_FULL_ANIMATION     = 3,
   178 	DO_TRANS_BUILDINGS    = 1 << 4,
   180 	DO_FULL_DETAIL        = 5,
   179 	DO_FULL_DETAIL        = 1 << 5,
   181 	DO_WAYPOINTS          = 6,
   180 	DO_WAYPOINTS          = 1 << 6,
   182 };
   181 	DO_TRANS_SIGNS        = 1 << 7,
   183 
       
   184 enum {
       
   185 	TO_SIGNS,
       
   186 	TO_TREES,
       
   187 	TO_HOUSES,
       
   188 	TO_INDUSTRIES,
       
   189 	TO_BUILDINGS,
       
   190 	TO_BRIDGES,
       
   191 	TO_STRUCTURES,
   182 };
   192 };
   183 
   193 
   184 /* Landscape types */
   194 /* Landscape types */
   185 enum {
   195 enum {
   186 	LT_TEMPERATE  = 0,
   196 	LT_TEMPERATE  = 0,
   188 	LT_TROPIC     = 2,
   198 	LT_TROPIC     = 2,
   189 	LT_TOYLAND    = 3,
   199 	LT_TOYLAND    = 3,
   190 
   200 
   191 	NUM_LANDSCAPE = 4,
   201 	NUM_LANDSCAPE = 4,
   192 };
   202 };
       
   203 
       
   204 /**
       
   205  * Town Layouts
       
   206  */
       
   207 enum TownLayout {
       
   208 	TL_NO_ROADS     = 0, ///< Build no more roads, but still build houses
       
   209 	TL_ORIGINAL,         ///< Original algorithm (min. 1 distance between roads)
       
   210 	TL_BETTER_ROADS,     ///< Extended original algorithm (min. 2 distance between roads)
       
   211 	TL_2X2_GRID,         ///< Geometric 2x2 grid algorithm
       
   212 	TL_3X3_GRID,         ///< Geometric 3x3 grid algorithm
       
   213 
       
   214 	NUM_TLS,             ///< Number of town layouts
       
   215 };
       
   216 
       
   217 /* It needs to be 8bits, because we save and load it as such */
       
   218 /** Define basic enum properties */
       
   219 template <> struct EnumPropsT<TownLayout> : MakeEnumPropsT<TownLayout, byte, TL_NO_ROADS, NUM_TLS, NUM_TLS> {};
       
   220 typedef TinyEnumT<TownLayout> TownLayoutByte; //typedefing-enumification of TownLayout
   193 
   221 
   194 enum {
   222 enum {
   195 	NUM_PRICES = 49,
   223 	NUM_PRICES = 49,
   196 };
   224 };
   197 
   225 
   279 	CT_GRAIN        =  6,
   307 	CT_GRAIN        =  6,
   280 	CT_WOOD         =  7,
   308 	CT_WOOD         =  7,
   281 	CT_IRON_ORE     =  8,
   309 	CT_IRON_ORE     =  8,
   282 	CT_STEEL        =  9,
   310 	CT_STEEL        =  9,
   283 	CT_VALUABLES    = 10,
   311 	CT_VALUABLES    = 10,
   284 	CT_FOOD         = 11,
       
   285 
   312 
   286 	// Arctic
   313 	// Arctic
   287 	CT_WHEAT        =  6,
   314 	CT_WHEAT        =  6,
   288 	CT_HILLY_UNUSED =  8,
   315 	CT_HILLY_UNUSED =  8,
   289 	CT_PAPER        =  9,
   316 	CT_PAPER        =  9,
   290 	CT_GOLD         = 10,
   317 	CT_GOLD         = 10,
       
   318 	CT_FOOD         = 11,
   291 
   319 
   292 	// Tropic
   320 	// Tropic
   293 	CT_RUBBER       =  1,
   321 	CT_RUBBER       =  1,
   294 	CT_FRUIT        =  4,
   322 	CT_FRUIT        =  4,
   295 	CT_MAIZE        =  6,
   323 	CT_MAIZE        =  6,
   307 	CT_COTTON_CANDY =  8,
   335 	CT_COTTON_CANDY =  8,
   308 	CT_BUBBLES      =  9,
   336 	CT_BUBBLES      =  9,
   309 	CT_PLASTIC      = 10,
   337 	CT_PLASTIC      = 10,
   310 	CT_FIZZY_DRINKS = 11,
   338 	CT_FIZZY_DRINKS = 11,
   311 
   339 
   312 	NUM_CARGO       = 12,
   340 	NUM_CARGO       = 32,
   313 
   341 
   314 	CT_NO_REFIT     = 0xFE,
   342 	CT_NO_REFIT     = 0xFE,
   315 	CT_INVALID      = 0xFF
   343 	CT_INVALID      = 0xFF
   316 };
   344 };
   317 
   345 
   334 typedef void DrawTileProc(TileInfo *ti);
   362 typedef void DrawTileProc(TileInfo *ti);
   335 typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y);
   363 typedef uint GetSlopeZProc(TileIndex tile, uint x, uint y);
   336 typedef int32 ClearTileProc(TileIndex tile, byte flags);
   364 typedef int32 ClearTileProc(TileIndex tile, byte flags);
   337 typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
   365 typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
   338 typedef void GetTileDescProc(TileIndex tile, TileDesc *td);
   366 typedef void GetTileDescProc(TileIndex tile, TileDesc *td);
   339 /* GetTileTrackStatusProcs return a value that contains the possible tracks
   367 /**
       
   368  * GetTileTrackStatusProcs return a value that contains the possible tracks
   340  * that can be taken on a given tile by a given transport. The return value is
   369  * that can be taken on a given tile by a given transport. The return value is
   341  * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
   370  * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
   342  * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
   371  * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
   343  * present in the tile (1==present, 0==not present), aabb is the signal
   372  * present in the tile (1==present, 0==not present), aabb is the signal
   344  * status, if applicable (0==green/no signal, 1==red, note that this is
   373  * status, if applicable (0==green/no signal, 1==red, note that this is
   352  *
   381  *
   353  * A trackdir is combination of a track and a dir, where the lower three bits
   382  * A trackdir is combination of a track and a dir, where the lower three bits
   354  * are a track, the fourth bit is the direction. these give 12 (or 14)
   383  * are a track, the fourth bit is the direction. these give 12 (or 14)
   355  * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
   384  * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
   356  * above.
   385  * above.
       
   386  * @param tile     the tile to get the track status from
       
   387  * @param mode     the mode of transportation
       
   388  * @param sub_mode used to differentiate between different kinds within the mode
       
   389  * @return the above mentions track status information
   357  */
   390  */
   358 typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode);
   391 typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode, uint sub_mode);
   359 typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
   392 typedef void GetProducedCargoProc(TileIndex tile, CargoID *b);
   360 typedef void ClickTileProc(TileIndex tile);
   393 typedef void ClickTileProc(TileIndex tile);
   361 typedef void AnimateTileProc(TileIndex tile);
   394 typedef void AnimateTileProc(TileIndex tile);
   362 typedef void TileLoopProc(TileIndex tile);
   395 typedef void TileLoopProc(TileIndex tile);
   363 typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player);
   396 typedef void ChangeTileOwnerProc(TileIndex tile, PlayerID old_player, PlayerID new_player);
   459 	WC_ENDSCREEN,
   492 	WC_ENDSCREEN,
   460 	WC_SIGN_LIST,
   493 	WC_SIGN_LIST,
   461 	WC_GENERATE_LANDSCAPE,
   494 	WC_GENERATE_LANDSCAPE,
   462 	WC_GENERATE_PROGRESS_WINDOW,
   495 	WC_GENERATE_PROGRESS_WINDOW,
   463 	WC_CONFIRM_POPUP_QUERY,
   496 	WC_CONFIRM_POPUP_QUERY,
   464 };
   497 	WC_TRANSPARENCY_TOOLBAR,
   465 
   498 };
   466 
   499 
   467 enum {
   500 
       
   501 enum ExpensesType {
   468 	EXPENSES_CONSTRUCTION =  0,
   502 	EXPENSES_CONSTRUCTION =  0,
   469 	EXPENSES_NEW_VEHICLES =  1,
   503 	EXPENSES_NEW_VEHICLES =  1,
   470 	EXPENSES_TRAIN_RUN    =  2,
   504 	EXPENSES_TRAIN_RUN    =  2,
   471 	EXPENSES_ROADVEH_RUN  =  3,
   505 	EXPENSES_ROADVEH_RUN  =  3,
   472 	EXPENSES_AIRCRAFT_RUN =  4,
   506 	EXPENSES_AIRCRAFT_RUN =  4,