43 #include "table/strings.h" 104 Axis axis = Extract<Axis, 0, 1>(p1);
127 if (ret.
Failed())
return ret;
133 if (ret.
Failed())
return ret;
215 if (ret.
Failed())
return ret;
223 if (ret.
Failed())
return ret;
227 delete Depot::GetByTile(tile);
257 if (ret.
Failed())
return ret;
262 if (ret.
Failed())
return ret;
268 if (ret.
Failed())
return ret;
270 cost.
AddCost(_price[PR_BUILD_CANAL]);
280 if (ret.
Failed())
return ret;
282 cost.
AddCost(_price[PR_BUILD_CANAL]);
312 cost.
AddCost(_price[PR_BUILD_LOCK]);
327 if (ret.
Failed())
return ret;
336 if (ret.
Failed())
return ret;
351 MakeWaterKeepingClass(tile + delta,
GetTileOwner(tile + delta));
352 MakeWaterKeepingClass(tile - delta,
GetTileOwner(tile - delta));
396 WaterClass wc = Extract<WaterClass, 0, 2>(p2);
405 if (_game_mode != GM_EDITOR && ta.
w != 1 && ta.
h != 1)
return CMD_ERROR;
421 if (ret.
Failed())
return ret;
429 if (_game_mode == GM_EDITOR) {
454 cost.
AddCost(_price[PR_BUILD_CANAL]);
470 Money base_cost =
IsCanal(tile) ? _price[PR_CLEAR_CANAL] : _price[PR_CLEAR_WATER];
479 if (ret.
Failed())
return ret;
484 if (ret.
Failed())
return ret;
504 if (ret.
Failed())
return ret;
520 { { 0, 0}, {0, 0}, { 0, 0}, {0, 0} },
521 { {-1, 0}, {0, 1}, { 1, 0}, {0, -1} },
522 { { 1, 0}, {0, -1}, {-1, 0}, {0, 1} },
533 return RemoveShipDepot(tile, flags);
553 default: NOT_REACHED();
563 default:
return false;
575 default:
return false;
608 default:
return false;
621 if (base != SPR_FLAT_WATER_TILE) {
641 if (base == 0) base = SPR_CANAL_DIKES_BASE;
643 feature = CF_RIVER_EDGE;
645 if (base == 0)
return;
695 SpriteID image = SPR_FLAT_WATER_TILE;
699 if (image == 0) image = SPR_FLAT_WATER_TILE;
723 uint tile_offs = offset + dtss->image.
sprite;
726 ti->
x + dtss->
delta_x, ti->
y + dtss->delta_y,
727 dtss->size_x, dtss->size_y,
728 dtss->size_z, ti->
z + dtss->
delta_z,
743 if (water_base == 0) {
745 water_base = SPR_CANALS_BASE;
748 if (image == SPR_FLAT_WATER_TILE) {
755 if (image < 5) image += water_base;
764 base = SPR_LOCK_BASE;
766 zoffs = ti->
z > z_threshold ? 24 : 0;
775 DrawWaterClassGround(ti);
779 static void DrawRiverWater(
const TileInfo *ti)
781 SpriteID image = SPR_FLAT_WATER_TILE;
783 uint edges_offset = 0;
789 case SLOPE_NW: image = SPR_WATER_SLOPE_Y_DOWN;
break;
790 case SLOPE_SW: image = SPR_WATER_SLOPE_X_UP;
break;
791 case SLOPE_SE: image = SPR_WATER_SLOPE_Y_UP;
break;
792 case SLOPE_NE: image = SPR_WATER_SLOPE_X_DOWN;
break;
793 default: image = SPR_FLAT_WATER_TILE;
break;
800 case SLOPE_SE: edges_offset += 12;
break;
801 case SLOPE_NE: offset += 1; edges_offset += 24;
break;
802 case SLOPE_SW: offset += 2; edges_offset += 36;
break;
803 case SLOPE_NW: offset += 3; edges_offset += 48;
break;
804 default: offset = 0;
break;
817 void DrawShoreTile(
Slope tileh)
821 static const byte tileh_to_shoresprite[32] = {
822 0, 1, 2, 3, 4, 16, 6, 7, 8, 9, 17, 11, 12, 13, 14, 0,
823 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10, 15, 0,
834 void DrawWaterClassGround(
const TileInfo *ti)
840 default: NOT_REACHED();
844 static void DrawTile_Water(
TileInfo *ti)
848 DrawWaterClassGround(ti);
853 DrawShoreTile(ti->
tileh);
868 void DrawShipDepotSprite(
int x,
int y,
Axis axis,
DepotPart part)
877 static int GetSlopePixelZ_Water(
TileIndex tile, uint x, uint y)
898 default: NOT_REACHED();
break;
904 td->
str = STR_LAI_WATER_DESCRIPTION_SHIP_DEPOT;
907 default: NOT_REACHED();
break;
920 uint pass = v->
Crash(
true);
960 if (v->
z_pos > z)
break;
1045 bool flooded =
false;
1121 default: NOT_REACHED();
1123 SetRailGroundType(tile, new_ground);
1141 default: NOT_REACHED();
1170 if (z_dest > 0)
continue;
1196 void ConvertGroundTilesIntoWaterTiles()
1236 static const byte coast_tracks[] = {0, 32, 4, 0, 16, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0};
1249 if (
TileX(tile) == 0) {
1253 if (
TileY(tile) == 0) {
1260 static bool ClickTile_Water(
TileIndex tile)
1321 GetSlopePixelZ_Water,
1325 GetTileTrackStatus_Water,
1329 ChangeTileOwner_Water,
1332 GetFoundation_Water,
1333 TerraformTile_Water,
TileIndex GetOtherBridgeEnd(TileIndex tile)
Starting at one bridge end finds the other bridge end.
Functions related to OTTD's strings.
static TileType GetTileType(TileIndex tile)
Get the tiletype of a given tile.
don't allow building on structures
static bool IsHalftileSlope(Slope s)
Checks for non-continuous slope on halftile foundations.
Grass with a fence at the northern side.
the north corner of the tile is raised
uint32 PaletteID
The number of the palette.
static const SpriteID SPR_SHORE_BASE
shore tiles - action 05-0D
GameSettings _settings_game
Game settings of a running game or the scenario editor.
static void NewEvent(class ScriptEvent *event)
Queue a new event for a Game Script.
Definition of stuff that is very close to a company, like the company struct itself.
static Titem * GetIfValid(size_t index)
Returns Titem with given index.
The tile drys up if it is not constantly flooded from neighboured tiles.
static TropicZone GetTropicZone(TileIndex tile)
Get the tropic zone.
static TransportType GetTunnelBridgeTransportType(TileIndex t)
Tunnel: Get the transport type of the tunnel (road or rail) Bridge: Get the transport type of the bri...
Finite sTate mAchine (FTA) of an airport.
CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Build a piece of canal.
static void DrawOrigTileSeqInGUI(int x, int y, const DrawTileSprites *dts, PaletteID default_palette)
Draw TTD sprite sequence in GUI.
do not only remove the object on the tile, but also clear any water left on it
static byte GetLockPart(TileIndex t)
Get the part of a lock.
static void SetTileOwner(TileIndex tile, Owner owner)
Sets the owner of a tile.
Tile information, used while rendering the tile.
south and east corner are raised
the west corner of the tile is raised
static DiagDirection DirToDiagDir(Direction dir)
Convert a Direction to a DiagDirection.
static Axis GetShipDepotAxis(TileIndex t)
Get the axis of the ship depot.
company buildings - depots, stations, HQ, ...
static void DoDryUp(TileIndex tile)
Drys a tile up.
static bool IsAirportTile(TileIndex t)
Is this tile a station tile and an airport tile?
static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
Remove a lock.
uint GetPartialPixelZ(int x, int y, Slope corners)
Determines height at given coordinate of a slope.
CommandCost EnsureNoVehicleOnGround(TileIndex tile)
Ensure there is no vehicle at the ground at the given position.
Flag for an invalid DiagDirection.
int32 TileIndexDiff
An offset value between to tiles.
static Titem * Get(size_t index)
Returns Titem with given index.
static bool IsBridgeTile(TileIndex t)
checks if there is a bridge on this tile
Functions related to dates.
static bool IsInsideMM(const T x, const uint min, const uint max)
Checks if a value is in an interval.
static WaterClass GetWaterClass(TileIndex t)
Get the water class at a tile.
virtual uint Crash(bool flooded=false)
Crash the (whole) vehicle chain.
static void DrawWaterLock(const TileInfo *ti)
Draw a lock tile.
static TileIndex GetShipDepotNorthTile(TileIndex t)
Get the most northern tile of a ship depot.
const AirportFTAClass * GetFTA() const
Get the finite-state machine for this airport or the finite-state machine for the dummy airport in ca...
static void DrawWaterTileStruct(const TileInfo *ti, const DrawTileSeqStruct *dtss, SpriteID base, uint offset, PaletteID palette, CanalFeature feature)
Draw a build sprite sequence for water tiles.
static void MakeShore(TileIndex t)
Helper function to make a coast tile.
north and south corner are raised
static const CommandCost CMD_ERROR
Define a default return value for a failed command.
static TrackBits AxisToTrackBits(Axis a)
Maps an Axis to the corresponding TrackBits value.
Slope tileh
Slope of the tile.
bool FloodHalftile(TileIndex t)
Called from water_cmd if a non-flat rail-tile gets flooded and should be converted to shore...
static TileIndex GetOtherShipDepotTile(TileIndex t)
Get the other tile of the ship depot.
SpriteID GetCanalSprite(CanalFeature feature, TileIndex tile)
Lookup the base sprite to use for a canal.
CanalFeature
List of different canal 'features'.
Grass with a fence at the eastern side.
Functions related to vehicles.
static TrackBits DiagDirToDiagTrackBits(DiagDirection diagdir)
Maps a (4-way) direction to the diagonal track bits incidating with that diagdir. ...
static void SetTreeGroundDensity(TileIndex t, TreeGround g, uint d)
Set the density and ground type of a tile with trees.
static bool HasTileWaterGround(TileIndex t)
Checks whether the tile has water at the ground.
static uint TileX(TileIndex tile)
Get the X component of a tile.
Base for all depots (except hangars)
Tile description for the 'land area information' tool.
CommandCost CheckTileOwnership(TileIndex tile)
Check whether the current owner owns the stuff on the given tile.
Tindex index
Index of this pool item.
the east corner of the tile is raised
Helper functions to extract data from command parameters.
static SigSegState UpdateSignalsInBuffer(Owner owner)
Updates blocks in _globset buffer.
Map accessors for tree tiles.
Money GetCost() const
The costs as made up to this moment.
Contains objects such as transmitters and owned land.
static void MarkTileDirtyIfCanalOrRiver(TileIndex tile)
Marks tile dirty if it is a canal or river tile.
#define FOR_EACH_SET_BIT(bitpos_var, bitset_value)
Do an operation for each set set bit in a value.
Sprites to use and how to display them for water tiles (depots/locks).
south and west corner are raised
Common return value for all commands.
Accessors for industries.
static bool IsInclinedSlope(Slope s)
Tests if a specific slope is an inclined slope.
static void AmbientSoundEffect(TileIndex tile)
Play an ambient sound effect for an empty tile.
uint16 w
The width of the area.
bool IsTileFlat(TileIndex tile, int *h)
Check if a given tile is flat.
bool IsWateredTile(TileIndex tile, Direction from)
return true if a tile is a water tile wrt.
void AddCost(const Money &cost)
Adds the given cost to the cost of the command.
Owner owner[4]
Name of the owner(s)
Direction
Defines the 8 directions on the map.
const DrawTileSeqStruct * seq
Array of child sprites. Terminated with a terminator entry.
north and east corner are raised
static bool IsLock(TileIndex t)
Is there a lock on a given water tile?
Date build_date
Date of construction.
Class to backup a specific variable and restore it later.
CompanyByte _local_company
Company controlled by the human player at this client. Can also be COMPANY_SPECTATOR.
company bankrupts, skip money check, skip vehicle on tile check in some cases
Functions related to (drawing on) viewports.
Pseudo random number generator.
FloodingBehaviour
Describes the behaviour of a tile during flooding.
bool freeform_edges
allow terraforming the tiles at the map edges
Slope GetTileSlope(TileIndex tile, int *h)
Return the slope of a given tile inside the map.
static bool IsValidTile(TileIndex tile)
Checks if a tile is valid.
byte subtype
subtype (Filled with values from #EffectVehicles/#TrainSubTypes/#AircraftSubTypes) ...
static bool IsBridgeAbove(TileIndex t)
checks if a bridge is set above the ground of this tile
TrackBits
Bitfield corresponding to Track.
static bool IsTileOwner(TileIndex tile, Owner owner)
Checks if a tile belongs to the given owner.
indicates the slope is steep
CommandCost CmdBuildShipDepot(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Build a ship depot.
The tile does not flood neighboured tiles.
static void MakeSea(TileIndex t)
Make a sea tile.
uint x
X position of the tile in unit coordinates.
static TileIndexDiff TileOffsByDiagDir(DiagDirection dir)
Convert a DiagDirection to a TileIndexDiff.
Foundation
Enumeration for Foundations.
static void DrawCanalWater(TileIndex tile)
draw a canal styled water tile with dikes around
static bool IsBuoy(TileIndex t)
Is tile t a buoy tile?
static bool IsTileType(TileIndex tile, TileType type)
Checks if a tile is a give tiletype.
void MakeDefaultName(T *obj)
Set the default name for a depot/waypoint.
TileIndex tile
Tile index.
static void FloodVehicles(TileIndex tile)
Finds a vehicle to flood.
bool IsTerminator() const
Check whether this is a sequence terminator.
CommandCost DoCommand(const CommandContainer *container, DoCommandFlag flags)
Shorthand for calling the long DoCommand with a container.
static bool IsCoast(TileIndex t)
Is it a coast tile?
SoundSettings sound
sound effect settings
Ground palette sprite of a tile, together with its sprite layout.
void DirtyCompanyInfrastructureWindows(CompanyID company)
Redraw all windows with company infrastructure counts.
WaterClass
classes of water (for WATER_TILE_CLEAR water tile type).
static Owner GetTileOwner(TileIndex tile)
Returns the owner of a tile.
static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag flags)
Builds a lock.
static DiagDirection ReverseDiagDir(DiagDirection d)
Returns the reverse direction of the given DiagDirection.
DoCommandFlag
List of flags for a command.
ClientSettings _settings_client
The current settings for this game.
bool Succeeded() const
Did this command succeed?
#define TILE_AREA_LOOP(var, ta)
A loop which iterates over the tiles of a TileArea.
Definition of base types and functions in a cross-platform compatible way.
#define TILE_ADDXY(tile, x, y)
Adds a given offset to a tile.
A number of safeguards to prevent using unsafe methods.
bool CircularTileSearch(TileIndex *tile, uint size, TestTileOnSearchProc proc, void *user_data)
Function performing a search around a center tile and going outward, thus in circle.
uint y
Y position of the tile in unit coordinates.
void ShowDepotWindow(TileIndex tile, VehicleType type)
Opens a depot window.
static Slope GetTilePixelSlope(TileIndex tile, int *h)
Return the slope of a given tile.
static bool IsSlopeWithOneCornerRaised(Slope s)
Tests if a specific slope has exactly one corner raised.
Represents the covered area of e.g.
GUI Functions related to companies.
static const uint8 _flood_from_dirs[]
Describes from which directions a specific slope can be flooded (if the tile is floodable at all)...
static void DrawWaterDepot(const TileInfo *ti)
Draw a ship depot tile.
The tile does not actively flood neighboured tiles, but it prevents them from drying up...
static WaterTileType GetWaterTileType(TileIndex t)
Get the water tile type at a tile.
don't allow building on water
void FindVehicleOnPos(TileIndex tile, void *data, VehicleFromPosProc *proc)
Find a vehicle from a specific location.
TileIndex tile
Current tile index.
Grass with a fence and shore or water on the free halftile.
The tile has no ownership.
static Vehicle * FloodVehicleProc(Vehicle *v, void *data)
Flood a vehicle if we are allowed to flood it, i.e.
DiagDirection
Enumeration for diagonal directions.
static bool IsWaterTile(TileIndex t)
Is it a water tile with plain water?
static void MakeRiver(TileIndex t, uint8 random_bits)
Make a river tile.
static DiagDirection GetInclinedSlopeDirection(Slope s)
Returns the direction of an inclined slope.
Functions related to sound.
static void MakeShipDepot(TileIndex t, Owner o, DepotID did, DepotPart part, Axis a, WaterClass original_water_class)
Make a ship depot section.
void TileLoop_Water(TileIndex tile)
Let a water tile floods its diagonal adjoining tiles called from tunnelbridge_cmd, and by TileLoop_Industry() and TileLoop_Track()
static DiagDirection GetTunnelBridgeDirection(TileIndex t)
Get the direction pointing to the other end.
Vehicle * First() const
Get the first vehicle of this vehicle chain.
static TrackStatus CombineTrackStatus(TrackdirBits trackdirbits, TrackdirBits red_signals)
Builds a TrackStatus.
bool Failed() const
Did this command fail?
EffectVehicle * CreateEffectVehicleRel(const Vehicle *v, int x, int y, int z, EffectVehicleType type)
Create an effect vehicle above a particular vehicle.
bool RiverModifyDesertZone(TileIndex tile, void *)
Callback to create non-desert around a river tile.
east and west corner are raised
void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent, int bb_offset_x, int bb_offset_y, int bb_offset_z, const SubSprite *sub)
Draw a (transparent) sprite at given coordinates with a given bounding box.
WaterFeature _water_feature[CF_END]
Table of canal 'feature' sprite groups.
#define return_cmd_error(errcode)
Returns from a function with a specific StringID as error.
static void NewEvent(CompanyID company, ScriptEvent *event)
Queue a new event for an AI.
void MarkTileDirtyByTile(TileIndex tile, int bridge_level_offset)
Mark a tile given by its index dirty for repaint.
static TrackBits GetTrackBits(TileIndex tile)
Gets the track bits of the given tile.
A pair-construct of a TileIndexDiff.
CompanyInfrastructure infrastructure
NOSAVE: Counts of company owned infrastructure.
static Axis DiagDirToAxis(DiagDirection d)
Convert a DiagDirection to the axis.
static TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc)
Return the offset between to tiles from a TileIndexDiffC struct.
Handling of NewGRF canals.
execute the given command
Northern part of a depot.
Slope GetFoundationSlope(TileIndex tile, int *z)
Get slope of a tile on top of a (possible) foundation If a tile does not have a foundation, the function returns the same as GetTileSlope.
Functions related to companies.
PalSpriteID ground
Palette and sprite for the ground.
static uint MapSize()
Get the size of the map.
Functions related to generic callbacks.
Tunnel entry/exit and bridge heads.
Invisible tiles at the SW and SE border.
Additional flat ground sprite in the beginning.
static DiagDirection GetLockDirection(TileIndex t)
Get the direction of the water lock.
uint32 SpriteID
The number of a sprite, without mapping bits and colourtables.
int GetTileMaxZ(TileIndex t)
Get top height of the tile inside the map.
CompanyByte _current_company
Company currently doing an action.
Set of callback functions for performing tile operations of a given tile type.
static bool IsShipDepot(TileIndex t)
Is it a water tile with a ship depot on it?
uint32 TileIndex
The index/ID of a Tile.
Map accessors for 'clear' tiles.
CommandCost CmdBuildLock(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
Builds a lock.
Functions related to depots.
DepotPart
Sections of the water depot.
static TreeGround GetTreeGround(TileIndex t)
Returns the groundtype for tree tiles.
static void MakeLock(TileIndex t, Owner o, DiagDirection d, WaterClass wc_lower, WaterClass wc_upper, WaterClass wc_middle)
Make a water lock.
static const uint LOCK_DEPOT_TILE_FACTOR
Multiplier for how many regular tiles a lock counts.
static int GetBridgePixelHeight(TileIndex tile)
Get the height ('z') of a bridge in pixels.
north and west corner are raised
static IndustryID GetIndustryIndex(TileIndex t)
Get the industry ID of the given tile.
void DoFloodTile(TileIndex target)
Floods a tile.
static uint TileY(TileIndex tile)
Get the Y component of a tile.
Bit sets of the above specified bits.
static void MakeClear(TileIndex t, ClearGround g, uint density)
Make a clear tile.
OwnerByte owner
Which company owns the vehicle?
int8 delta_z
0x80 identifies child sprites
static void DrawWaterSprite(SpriteID base, uint offset, CanalFeature feature, TileIndex tile)
Draw a water sprite, potentially with a NewGRF-modified sprite offset.
The tile has no foundation, the slope remains unchanged.
TransportType
Available types of transport.
The tile floods neighboured tiles.
static bool IsCanal(TileIndex t)
Is it a canal tile?
static bool IsOilRig(TileIndex t)
Is tile t part of an oilrig?
Slope
Enumeration for the slope-type.
Southern part of a depot.
static bool IsRiver(TileIndex t)
Is it a river water tile?
uint GetCanalSpriteOffset(CanalFeature feature, TileIndex tile, uint cur_offset)
Get the new sprite offset for a water tile.
static uint MapMaxY()
Gets the maximum Y coordinate within the map, including MP_VOID.
static Station * GetByTile(TileIndex tile)
Get the station belonging to a specific tile.
static void MakeCanal(TileIndex t, Owner o, uint8 random_bits)
Make a canal tile.
bool disaster
Play disaster and accident sounds.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function() ...
Functions related to OTTD's landscape.
FloodingBehaviour GetFloodingBehaviour(TileIndex tile)
Returns the behaviour of a tile during flooding.
static TileIndexDiff TileOffsByDir(Direction dir)
Convert a Direction to a TileIndexDiff.
Base functions for all Games.
Functions related to commands.
An accident or disaster has occurred.
void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub, int extra_offs_x, int extra_offs_y)
Draws a ground sprite for the current tile.
static bool IsValidID(size_t index)
Tests whether given index can be used to get valid (non-NULL) Titem.
Date build_date
Date of construction of tile contents.
static uint TileHeight(TileIndex tile)
Returns the height of a tile.
RailGroundType
The ground 'under' the rail.
ConstructionSettings construction
construction of things in-game
Functions that have tunnels and bridges in common.
static TileIndexDiff TileDiffXY(int x, int y)
Calculates an offset for the given coordinate(-offset).
Airport airport
Tile area the airport covers.
static void MarkCanalsAndRiversAroundDirty(TileIndex tile)
Marks the tiles around a tile as dirty, if they are canals or rivers.
StringID str
Description of the tile.
static bool HasBit(const T x, const uint8 y)
Checks if a bit in a value is set.
void Restore()
Restore the variable.
Base functions for all AIs.
static TrackdirBits TrackBitsToTrackdirBits(TrackBits bits)
Converts TrackBits to TrackdirBits while allowing both directions.
static bool IsPlainRail(TileIndex t)
Returns whether this is plain rails, with or without signals.
A tile without any structures, i.e. grass, rocks, farm fields etc.
static uint MapMaxX()
Gets the maximum X coordinate within the map, including MP_VOID.
static void FloodVehicle(Vehicle *v)
Handle the flooding of a vehicle.
static bool IsInvisibilitySet(TransparencyOption to)
Check if the invisibility option bit is set and if we aren't in the game menu (there's never transpar...
int8 delta_x
0x80 is sequence terminator
Owner
Enum for all companies/owners.
Functions related to water (management)
static bool IsTileOnWater(TileIndex t)
Tests if the tile was built on water.
VehicleEnterTileStatus
The returned bits of VehicleEnterTile.
Grass with a fence at the southern side.
static void DrawWaterEdges(bool canal, uint offset, TileIndex tile)
Draw canal or river edges.
#define TILE_ADD(x, y)
Adds to tiles together.
SpriteID sprite
The 'real' sprite.
static void DrawSeaWater(TileIndex tile)
Draw a plain sea water tile with no edges.
three bits used for halftile slopes
Functions related to news.
Base classes/functions for stations.
static bool IsDock(TileIndex t)
Is tile t a dock tile?
Date _date
Current date in days (day counter)
A tile child sprite and palette to draw for stations etc, with 3D bounding box.
uint16 h
The height of the area.
static Direction ReverseDir(Direction d)
Return the reverse of a direction.
the south corner of the tile is raised
The tile/execution is done by "water".
VehicleTypeByte type
Type of vehicle.
void DrawBridgeMiddle(const TileInfo *ti)
Draw the middle bits of a bridge.
Class for backupping variables and making sure they are restored later.
Functions related to effect vehicles.
static bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
Axis
Allow incrementing of DiagDirDiff variables.
Used for industry tiles on land (also for oilrig if newgrf says so).
void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, ZoomLevel zoom)
Draw a sprite, not in a viewport.
byte delta_z
Z adjustment for helicopter pads.
Grass with a fence at the western side.
static void SetTropicZone(TileIndex tile, TropicZone type)
Set the tropic zone.
static DepotPart GetShipDepotPart(TileIndex t)
Get the part of a ship depot.
static void SetDParam(uint n, uint64 v)
Set a string parameter v at index n in the global string parameter array.
PaletteID pal
The palette (use PAL_NONE) if not needed)
uint32 water
Count of company owned track bits for canals.
static void AddVehicleNewsItem(StringID string, NewsType type, VehicleID vehicle, StationID station=INVALID_STATION)
Adds a newsitem referencing a vehicle.