openttd.h
changeset 1977 4392ae3d8e31
parent 1967 c57192f4c121
child 2055 9361b56db8ba
equal deleted inserted replaced
1976:41c542bd18c4 1977:4392ae3d8e31
   114 	uint x;
   114 	uint x;
   115 	uint y;
   115 	uint y;
   116 	uint tileh;
   116 	uint tileh;
   117 	uint type;
   117 	uint type;
   118 	uint map5;
   118 	uint map5;
   119 	uint tile;
   119 	TileIndex tile;
   120 	uint z;
   120 	uint z;
   121 } TileInfo;
   121 } TileInfo;
   122 
   122 
   123 enum {
   123 enum {
   124 	NG_EDGE = 1,
   124 	NG_EDGE = 1,
   286 
   286 
   287 typedef int32 CommandProc(int x, int y, uint32 flags, uint32 p1, uint32 p2);
   287 typedef int32 CommandProc(int x, int y, uint32 flags, uint32 p1, uint32 p2);
   288 
   288 
   289 typedef void DrawTileProc(TileInfo *ti);
   289 typedef void DrawTileProc(TileInfo *ti);
   290 typedef uint GetSlopeZProc(TileInfo *ti);
   290 typedef uint GetSlopeZProc(TileInfo *ti);
   291 typedef int32 ClearTileProc(uint tile, byte flags);
   291 typedef int32 ClearTileProc(TileIndex tile, byte flags);
   292 typedef void GetAcceptedCargoProc(uint tile, AcceptedCargo res);
   292 typedef void GetAcceptedCargoProc(TileIndex tile, AcceptedCargo res);
   293 typedef void GetTileDescProc(uint tile, TileDesc *td);
   293 typedef void GetTileDescProc(TileIndex tile, TileDesc *td);
   294 /* GetTileTrackStatusProcs return a value that contains the possible tracks
   294 /* GetTileTrackStatusProcs return a value that contains the possible tracks
   295  * that can be taken on a given tile by a given transport. The return value is
   295  * that can be taken on a given tile by a given transport. The return value is
   296  * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
   296  * composed as follows: 0xaabbccdd. ccdd and aabb are bitmasks of trackdirs,
   297  * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
   297  * where bit n corresponds to trackdir n. ccdd are the trackdirs that are
   298  * present in the tile (1==present, 0==not present), aabb is the signal
   298  * present in the tile (1==present, 0==not present), aabb is the signal
   308  * A trackdir is combination of a track and a dir, where the lower three bits
   308  * A trackdir is combination of a track and a dir, where the lower three bits
   309  * are a track, the fourth bit is the direction. these give 12 (or 14)
   309  * are a track, the fourth bit is the direction. these give 12 (or 14)
   310  * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
   310  * possible options: 0-5 and 8-13, so we need 14 bits for a trackdir bitmask
   311  * above.
   311  * above.
   312  */
   312  */
   313 typedef uint32 GetTileTrackStatusProc(uint tile, TransportType mode);
   313 typedef uint32 GetTileTrackStatusProc(TileIndex tile, TransportType mode);
   314 typedef void GetProducedCargoProc(uint tile, byte *b);
   314 typedef void GetProducedCargoProc(TileIndex tile, byte *b);
   315 typedef void ClickTileProc(uint tile);
   315 typedef void ClickTileProc(TileIndex tile);
   316 typedef void AnimateTileProc(uint tile);
   316 typedef void AnimateTileProc(TileIndex tile);
   317 typedef void TileLoopProc(uint tile);
   317 typedef void TileLoopProc(TileIndex tile);
   318 typedef void ChangeTileOwnerProc(uint tile, byte old_player, byte new_player);
   318 typedef void ChangeTileOwnerProc(TileIndex tile, byte old_player, byte new_player);
   319 /* Return value has bit 0x2 set, when the vehicle enters a station. Then,
   319 /* Return value has bit 0x2 set, when the vehicle enters a station. Then,
   320  * result << 8 contains the id of the station entered. If the return value has
   320  * result << 8 contains the id of the station entered. If the return value has
   321  * bit 0x8 set, the vehicle could not and did not enter the tile. Are there
   321  * bit 0x8 set, the vehicle could not and did not enter the tile. Are there
   322  * other bits that can be set? */
   322  * other bits that can be set? */
   323 typedef uint32 VehicleEnterTileProc(Vehicle *v, uint tile, int x, int y);
   323 typedef uint32 VehicleEnterTileProc(Vehicle *v, TileIndex tile, int x, int y);
   324 typedef void VehicleLeaveTileProc(Vehicle *v, uint tile, int x, int y);
   324 typedef void VehicleLeaveTileProc(Vehicle *v, TileIndex tile, int x, int y);
   325 typedef uint GetSlopeTilehProc(TileInfo *ti);
   325 typedef uint GetSlopeTilehProc(TileInfo *ti);
   326 
   326 
   327 typedef struct {
   327 typedef struct {
   328 	DrawTileProc *draw_tile_proc;
   328 	DrawTileProc *draw_tile_proc;
   329 	GetSlopeZProc *get_slope_z_proc;
   329 	GetSlopeZProc *get_slope_z_proc;
   519 
   519 
   520 	STR_SPEC_SCREENSHOT_NAME = 0xF800,
   520 	STR_SPEC_SCREENSHOT_NAME = 0xF800,
   521 	STR_SPEC_USERSTRING = 0xF801,
   521 	STR_SPEC_USERSTRING = 0xF801,
   522 };
   522 };
   523 
   523 
   524 typedef void PlaceProc(uint tile);
   524 typedef void PlaceProc(TileIndex tile);
   525 
   525 
   526 VARDEF byte _savegame_sort_order;
   526 VARDEF byte _savegame_sort_order;
   527 
   527 
   528 #define INVALID_UINT_TILE (uint)0xFFFFFFFF
   528 #define INVALID_UINT_TILE (uint)0xFFFFFFFF
   529 #define INVALID_STRING_ID 0xFFFF
   529 #define INVALID_STRING_ID 0xFFFF