|
OpenTTD Source 20260311-master-g511d3794ce
|
Commands related to road tiles. More...
#include "stdafx.h"#include "road.h"#include "road_internal.h"#include "viewport_func.h"#include "command_func.h"#include "company_func.h"#include "pathfinder/yapf/yapf_cache.h"#include "depot_base.h"#include "newgrf.h"#include "autoslope.h"#include "tunnelbridge_map.h"#include "strings_func.h"#include "vehicle_func.h"#include "sound_func.h"#include "tunnelbridge.h"#include "cheat_type.h"#include "effectvehicle_func.h"#include "effectvehicle_base.h"#include "elrail_func.h"#include "roadveh.h"#include "train.h"#include "town.h"#include "company_base.h"#include "core/random_func.hpp"#include "core/container_func.hpp"#include "newgrf_debug.h"#include "newgrf_railtype.h"#include "newgrf_roadtype.h"#include "timer/timer_game_calendar.h"#include "genworld.h"#include "company_gui.h"#include "road_func.h"#include "road_cmd.h"#include "landscape_cmd.h"#include "rail_cmd.h"#include "table/strings.h"#include "table/roadtypes.h"#include "safeguards.h"#include "table/road_land.h"Go to the source code of this file.
Data Structures | |
| struct | DrawRoadTileStruct |
Typedefs | |
| typedef std::vector< RoadVehicle * > | RoadVehicleList |
| Helper type for lists/vectors of road vehicles. | |
Functions | |
| void | ResetRoadTypes () |
| Reset all road type information to its default values. | |
| void | ResolveRoadTypeGUISprites (RoadTypeInfo *rti) |
| static bool | CompareRoadTypes (const RoadType &first, const RoadType &second) |
| Compare roadtypes based on their sorting order. | |
| void | InitRoadTypes () |
| Resolve sprites of custom road types. | |
| RoadType | AllocateRoadType (RoadTypeLabel label, RoadTramType rtt) |
| Allocate a new road type label. | |
| bool | RoadVehiclesAreBuilt () |
| Verify whether a road vehicle is available. | |
| void | UpdateCompanyRoadInfrastructure (RoadType rt, Owner o, int count) |
| Update road infrastructure counts for a company. | |
| static Foundation | GetRoadFoundation (Slope tileh, RoadBits bits) |
| Get the foundationtype of a RoadBits Slope combination. | |
| CommandCost | CheckAllowRemoveRoad (TileIndex tile, RoadBits remove, Owner owner, RoadTramType rtt, DoCommandFlags flags, bool town_check) |
| Is it allowed to remove the given road bits from the given tile? | |
| static CommandCost | RemoveRoad (TileIndex tile, DoCommandFlags flags, RoadBits pieces, RoadTramType rtt, bool town_check) |
| Delete a piece of road. | |
| static CommandCost | CheckRoadSlope (Slope tileh, RoadBits *pieces, RoadBits existing, RoadBits other) |
| Calculate the costs for roads on slopes Aside modify the RoadBits to fit on the slopes. | |
| CommandCost | CmdBuildRoad (DoCommandFlags flags, TileIndex tile, RoadBits pieces, RoadType rt, DisallowedRoadDirections toggle_drd, TownID town_id) |
| Build a piece of road. | |
| static bool | CanConnectToRoad (TileIndex tile, RoadType rt, DiagDirection dir) |
| Checks whether a road or tram connection can be found when building a new road or tram. | |
| CommandCost | CmdBuildLongRoad (DoCommandFlags flags, TileIndex end_tile, TileIndex start_tile, RoadType rt, Axis axis, DisallowedRoadDirections drd, bool start_half, bool end_half, bool is_ai) |
| Build a long piece of road. | |
| std::tuple< CommandCost, Money > | CmdRemoveLongRoad (DoCommandFlags flags, TileIndex end_tile, TileIndex start_tile, RoadType rt, Axis axis, bool start_half, bool end_half) |
| Remove a long piece of road. | |
| CommandCost | CmdBuildRoadDepot (DoCommandFlags flags, TileIndex tile, RoadType rt, DiagDirection dir) |
| Build a road depot. | |
| static CommandCost | RemoveRoadDepot (TileIndex tile, DoCommandFlags flags) |
| static CommandCost | ClearTile_Road (TileIndex tile, DoCommandFlags flags) |
| Tile callback function signature for clearing a tile. | |
| static uint | GetRoadSpriteOffset (Slope slope, RoadBits bits) |
| Get the sprite offset within a spritegroup. | |
| static bool | DrawRoadAsSnowOrDesert (bool snow_or_desert, Roadside roadside) |
| Should the road be drawn as a unpaved snow/desert road? | |
| void | DrawRoadTypeCatenary (const TileInfo *ti, RoadType rt, RoadBits rb) |
| Draws the catenary for the RoadType of the given tile. | |
| void | DrawRoadCatenary (const TileInfo *ti) |
| Draws the catenary for the given tile. | |
| static void | DrawRoadDetail (SpriteID img, const TileInfo *ti, int8_t dx, int8_t dy, uint8_t h, bool transparent) |
| Draws details on/around the road. | |
| void | DrawRoadOverlays (const TileInfo *ti, PaletteID pal, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rti, uint road_offset, uint tram_offset, bool draw_underlay) |
| Draw road underlay and overlay sprites. | |
| static SpriteID | GetRoadGroundSprite (const TileInfo *ti, Roadside roadside, const RoadTypeInfo *rti, uint offset, bool snow_or_desert, PaletteID *pal) |
| Get ground sprite to draw for a road tile. | |
| void | DrawRoadGroundSprites (const TileInfo *ti, RoadBits road, RoadBits tram, const RoadTypeInfo *road_rti, const RoadTypeInfo *tram_rti, Roadside roadside, bool snow_or_desert) |
| Draw road ground sprites. | |
| static void | DrawRoadBits (TileInfo *ti) |
| Draw ground sprite and road pieces. | |
| static void | DrawTile_Road (TileInfo *ti) |
| Tile callback function signature for drawing a tile and its contents to the screen. | |
| void | DrawRoadDepotSprite (int x, int y, DiagDirection dir, RoadType rt) |
| Draw the road depot sprite. | |
| void | UpdateNearestTownForRoadTiles (bool invalidate) |
| Updates cached nearest town for all road tiles. | |
| static int | GetSlopePixelZ_Road (TileIndex tile, uint x, uint y, bool ground_vehicle) |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile. | |
| static Foundation | GetFoundation_Road (TileIndex tile, Slope tileh) |
| Tile callback function signature for getting the foundation of a tile. | |
| static void | TileLoop_Road (TileIndex tile) |
| Tile callback function signature for running periodic tile updates. | |
| static bool | ClickTile_Road (TileIndex tile) |
| Tile callback function signature for clicking a tile. | |
| static TrackStatus | GetTileTrackStatus_Road (TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side) |
| Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport. | |
| static void | GetTileDesc_Road (TileIndex tile, TileDesc &td) |
| Tile callback function signature for obtaining a tile description. | |
| static VehicleEnterTileStates | VehicleEnterTile_Road (Vehicle *v, TileIndex tile, int x, int y) |
| Tile callback function for a vehicle entering a tile. | |
| static void | ChangeTileOwner_Road (TileIndex tile, Owner old_owner, Owner new_owner) |
| Tile callback function signature for changing the owner of a tile. | |
| static CommandCost | TerraformTile_Road (TileIndex tile, DoCommandFlags flags, int z_new, Slope tileh_new) |
| Tile callback function signature of the terraforming callback. | |
| static bool | CanConvertUnownedRoadType (Owner owner, RoadTramType rtt) |
| Checks the tile and returns whether the current player is allowed to convert the roadtype to another roadtype without taking ownership. | |
| static void | ConvertRoadTypeOwner (TileIndex tile, uint num_pieces, Owner owner, RoadType from_type, RoadType to_type) |
| Convert the ownership of the RoadType of the tile if applicable. | |
| CommandCost | CmdConvertRoad (DoCommandFlags flags, TileIndex tile, TileIndex area_start, RoadType to_type, bool diagonal) |
| Convert one road subtype to another. | |
| static CommandCost | CheckBuildAbove_Road (TileIndex tile, DoCommandFlags flags, Axis axis, int height) |
| Tile callback function signature to test if a bridge can be built above a tile. | |
Variables | |
| RoadTypeInfo | _roadtypes [ROADTYPE_END] |
| std::vector< RoadType > | _sorted_roadtypes |
| Sorted list of road types. | |
| RoadTypes | _roadtypes_hidden_mask |
| Bitset of hidden roadtypes. | |
| RoadTypes | _roadtypes_road |
| Bitset of road roadtypes. | |
| RoadTypes | _roadtypes_tram |
| Bitset of tram roadtypes. | |
| static const RoadBits | _invalid_tileh_slopes_road [2][15] |
| Invalid RoadBits on slopes. | |
| const uint8_t | _road_sloped_sprites [14] |
| static const Roadside | _town_road_types [][2] |
| static const Roadside | _town_road_types_2 [][2] |
| static const TrackBits | _road_trackbits [16] |
| Converts RoadBits to TrackBits. | |
| static const StringID | _road_tile_strings [] |
| static const uint8_t | _roadveh_enter_depot_dir [4] |
| Given the direction the road depot is pointing, this is the direction the vehicle should be travelling in in order to enter the depot. | |
| const TileTypeProcs | _tile_type_road_procs |
| TileTypeProcs definitions for TileType::Road tiles. | |
Commands related to road tiles.
Definition in file road_cmd.cpp.
| typedef std::vector<RoadVehicle *> RoadVehicleList |
Helper type for lists/vectors of road vehicles.
Definition at line 52 of file road_cmd.cpp.
| RoadType AllocateRoadType | ( | RoadTypeLabel | label, |
| RoadTramType | rtt ) |
Allocate a new road type label.
| label | The label of the road type. |
| rtt | Whether it's a road or tram type. |
INVALID_ROADTYPE upon failures. Definition at line 132 of file road_cmd.cpp.
References _original_roadtypes, _roadtypes_road, _roadtypes_tram, RoadTypeInfo::alternate_labels, RoadTypeInfo::flags, RoadTypeInfo::Index(), RoadTypeInfo::introduces_roadtypes, RoadTypeInfo::introduction_date, TimerGameConst< struct Calendar >::INVALID_DATE, INVALID_ROADTYPE, RoadTypeInfo::label, RoadTypeInfo::powered_roadtypes, ROADTYPE_ROAD, ROADTYPE_TRAM, RTT_ROAD, RTT_TRAM, and RoadTypeInfo::sorting_order.
|
static |
Checks whether a road or tram connection can be found when building a new road or tram.
| tile | Tile at which the road being built will end. |
| rt | Roadtype of the road being built. |
| dir | Direction that the road is following. |
Definition at line 941 of file road_cmd.cpp.
References DiagDirToRoadBits(), GetAnyRoadBits(), GetRoadType(), HasPowerOnRoad(), INVALID_ROADTYPE, IsValidTile(), MayHaveRoad(), ReverseDiagDir(), and TileOffsByDiagDir().
Referenced by CmdBuildLongRoad().
|
static |
Checks the tile and returns whether the current player is allowed to convert the roadtype to another roadtype without taking ownership.
| owner | the tile owner. |
| rtt | Road/tram type. |
Definition at line 2424 of file road_cmd.cpp.
References OWNER_NONE, OWNER_TOWN, and RTT_ROAD.
Referenced by CmdConvertRoad().
|
static |
Tile callback function signature for changing the owner of a tile.
| tile | The tile to process. |
| old_owner | The owner to replace. |
| new_owner | The owner to replace with. |
Definition at line 2324 of file road_cmd.cpp.
References Bankrupt, CountBits(), Execute, GetCrossingRailTrack(), GetRailType(), GetRoadBits(), GetRoadOwner(), GetRoadType(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTileOwner(), INVALID_OWNER, INVALID_ROADTYPE, IsLevelCrossing(), IsRoadDepot(), LEVELCROSSING_TRACKBIT_FACTOR, OWNER_NONE, SetRoadOwner(), and SetTileOwner().
| CommandCost CheckAllowRemoveRoad | ( | TileIndex | tile, |
| RoadBits | remove, | ||
| Owner | owner, | ||
| RoadTramType | rtt, | ||
| DoCommandFlags | flags, | ||
| bool | town_check ) |
Is it allowed to remove the given road bits from the given tile?
| tile | the tile to remove the road from |
| remove | the roadbits that are going to be removed |
| owner | the actual owner of the roadbits of the tile |
| rtt | The road type to remove the bits from. |
| flags | command flags |
| town_check | Shall the town rating checked/affected |
Definition at line 255 of file road_cmd.cpp.
References _cheats, _current_company, _settings_game, ChangeTownRating(), CheckforTownRating(), CheckOwnership(), ClosestTownFromTile(), CommandCostWithParam(), CommandCost::Failed(), GetAnyRoadBits(), KillFirstBit(), OWNER_NONE, OWNER_TOWN, OWNER_WATER, RATING_ROAD_DOWN_STEP_EDGE, RATING_ROAD_DOWN_STEP_INNER, RATING_ROAD_MINIMUM, ROAD_NE, ROAD_NONE, ROAD_NW, ROAD_SE, ROAD_SW, RoadRemove, RTT_ROAD, and TileAddXY().
Referenced by CanRemoveRoadWithStop(), and RemoveRoad().
|
static |
Tile callback function signature to test if a bridge can be built above a tile.
| tile | The involved tile. |
| flags | Command flags passed to the build command. |
| axis | Axis of bridge being built. |
| height | Absolute height of bridge platform. |
Definition at line 2663 of file road_cmd.cpp.
References IsRoadDepot().
|
static |
Calculate the costs for roads on slopes Aside modify the RoadBits to fit on the slopes.
| tileh | The current slope |
| pieces | The RoadBits we want to add |
| existing | The existent RoadBits of the current type |
| other | The other existent RoadBits |
Definition at line 538 of file road_cmd.cpp.
References _invalid_tileh_slopes_road, _price, _settings_game, BuildFoundation, CMD_ERROR, EXPENSES_CONSTRUCTION, FOUNDATION_NONE, GetHighestSlopeCorner(), GetRoadFoundation(), HasExactlyOneBit(), IsSlopeWithOneCornerRaised(), IsSteepSlope(), IsStraightRoad(), MirrorRoadBits(), ROAD_NONE, SLOPE_FLAT, and SlopeWithOneCornerRaised().
Referenced by CmdBuildRoad(), and TerraformTile_Road().
|
static |
Tile callback function signature for clearing a tile.
| tile | The tile to clear. |
| flags | The command flags. |
Definition at line 1222 of file road_cmd.cpp.
References CommandCost::AddCost(), Auto, Crossing, Depot, Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetAllRoadBits(), CommandCost::GetCost(), GetCrossingRoadBits(), GetRoadBits(), GetRoadTileType(), GetRoadType(), HasExactlyOneBit(), INVALID_ROADTYPE, MayHaveRoad(), Normal, RemoveRoad(), ROAD_NONE, RTT_ROAD, RTT_TRAM, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
|
static |
Tile callback function signature for clicking a tile.
| tile | The tile that was clicked. |
Definition at line 2116 of file road_cmd.cpp.
References IsRoadDepot(), ShowDepotWindow(), and VEH_ROAD.
| CommandCost CmdBuildLongRoad | ( | DoCommandFlags | flags, |
| TileIndex | end_tile, | ||
| TileIndex | start_tile, | ||
| RoadType | rt, | ||
| Axis | axis, | ||
| DisallowedRoadDirections | drd, | ||
| bool | start_half, | ||
| bool | end_half, | ||
| bool | is_ai ) |
Build a long piece of road.
| flags | operation to perform |
| end_tile | end tile of drag |
| start_tile | start tile of drag |
| rt | road type |
| axis | direction |
| drd | set road direction |
| start_half | start tile starts in the 2nd half of tile (p2 & 1). Only used if is_ai is set or if we are building a single tile |
| end_half | end tile starts in the 2nd half of tile (p2 & 2). Only used if is_ai is set or if we are building a single tile |
| is_ai | defines two different behaviors for this command:
|
Definition at line 970 of file road_cmd.cpp.
References CommandCost::AddCost(), AXIS_X, AXIS_Y, AxisToDiagDir(), AxisToRoadBits(), CanConnectToRoad(), CMD_ERROR, DiagDirToRoadBits(), DRD_BOTH, DRD_NORTHBOUND, DRD_SOUTHBOUND, EXPENSES_CONSTRUCTION, CommandCost::Failed(), CommandCost::GetCost(), CommandCost::GetErrorMessage(), GetTunnelBridgeDirection(), IsBridge(), IsTileType(), IsValidAxis(), IsValidDisallowedRoadDirections(), ReverseDiagDir(), Map::Size(), TileOffsByDiagDir(), TileX(), TileY(), TunnelBridge, and ValParamRoadType().
| CommandCost CmdBuildRoad | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| RoadBits | pieces, | ||
| RoadType | rt, | ||
| DisallowedRoadDirections | toggle_drd, | ||
| TownID | town_id ) |
Build a piece of road.
| flags | operation to perform |
| tile | tile where to build road |
| pieces | road pieces to build (RoadBits) |
| rt | road type |
| toggle_drd | disallowed directions to toggle |
| town_id | the town that is building the road (TownID::Invalid() if not applicable) |
Definition at line 603 of file road_cmd.cpp.
References _current_company, _settings_game, CommandCost::AddCost(), AXIS_X, AXIS_Y, AxisToRoadBits(), AxisToTrack(), Town::cache, CalcClosestTownFromTile(), CheckOwnership(), CheckRoadSlope(), CheckTileOwnership(), CMD_ERROR, ComplementRoadBits(), CountBits(), Crossing, Depot, DiagDirToRoadBits(), DirtyCompanyInfrastructureWindows(), DistanceSquare(), DRD_NONE, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetAnyRoadBits(), CommandCost::GetCost(), GetCrossingRoadAxis(), GetCrossingRoadBits(), GetDisallowedRoadDirections(), GetDriveThroughStopAxis(), GetOtherTunnelBridgeEnd(), GetRailReservationTrackBits(), GetRailTileType(), GetRailType(), GetRoadBits(), GetRoadFoundation(), GetRoadOwner(), GetRoadTileType(), GetRoadType(), GetTileOwner(), GetTileSlope(), GetTileType(), GetTrackBits(), GetTunnelBridgeDirection(), GetTunnelBridgeLength(), GetTunnelBridgeTransportType(), HasBit(), HasExactlyOneBit(), HasPowerOnRoad(), HasRoadWorks(), HasTileRoadType(), Company::infrastructure, INVALID_ROADTYPE, IsBridge(), IsDriveThroughStopTile(), IsNormalRoad(), IsNormalRoadTile(), IsSteepSlope(), IsStraightRoad(), IsTileType(), IsValidDisallowedRoadDirections(), IsValidRoadBits(), LEVELCROSSING_TRACKBIT_FACTOR, MakeRoadCrossing(), MakeRoadNormal(), MarkBridgeDirty(), MarkDirtyAdjacentLevelCrossingTiles(), MarkTileDirtyByTile(), MirrorRoadBits(), Normal, OtherAxis(), OWNER_DEITY, OWNER_NONE, OWNER_TOWN, CompanyInfrastructure::rail, RailNoLevelCrossings(), Railway, Road, ROAD_NONE, ROAD_X, ROAD_Y, RoadBuildCost(), RoadNoLevelCrossing(), RTT_ROAD, RTT_TRAM, SetCrossingReservation(), SetDisallowedRoadDirections(), SetRoadBits(), SetRoadOwner(), SetRoadType(), SetTownIndex(), TownCache::squared_town_zone_radius, Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), to_underlying(), TownEdge, TRACK_BIT_X, TRACK_BIT_Y, TRANSPORT_ROAD, TunnelBridge, TUNNELBRIDGE_TRACKBIT_FACTOR, TunnelBridgeIsFree(), UpdateCompanyRoadInfrastructure(), UpdateLevelCrossing(), VALID_LEVEL_CROSSING_SLOPES, ValParamRoadType(), Town::xy, and YapfNotifyTrackLayoutChange().
| CommandCost CmdBuildRoadDepot | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| RoadType | rt, | ||
| DiagDirection | dir ) |
Build a road depot.
| tile | tile where to build the depot |
| flags | operation to perform |
| rt | road type |
| dir | entrance direction |
Definition at line 1138 of file road_cmd.cpp.
References _current_company, _price, _settings_game, CommandCost::AddCost(), BuildDepotRoad, BuildFoundation, CanBuildDepotByTileh(), CheckTileOwnership(), CMD_ERROR, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), GetRoadDepotDirection(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTileSlope(), HasRoadTypeTram(), IsBridgeAbove(), IsRoadDepotTile(), IsValidDiagDirection(), MakeDefaultName(), MakeRoadDepot(), MarkTileDirtyByTile(), ROAD_DEPOT_TRACKBIT_FACTOR, SetRoadDepotExitDirection(), SLOPE_FLAT, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), UpdateCompanyRoadInfrastructure(), and ValParamRoadType().
| CommandCost CmdConvertRoad | ( | DoCommandFlags | flags, |
| TileIndex | tile, | ||
| TileIndex | area_start, | ||
| RoadType | to_type, | ||
| bool | diagonal ) |
Convert one road subtype to another.
Not meant to convert from road to tram.
| flags | operation to perform |
| tile | end tile of road conversion drag |
| area_start | start tile of drag |
| to_type | new roadtype to convert to. |
| diagonal | Whether a diagonal or orthogonal area is to be converted. |
Definition at line 2473 of file road_cmd.cpp.
References _current_company, _settings_game, CommandCost::AddCost(), CanConvertUnownedRoadType(), CheckforTownRating(), CheckOwnership(), ClosestTownFromTile(), CMD_ERROR, ConvertRoadTypeOwner(), CountBits(), TileIterator::Create(), EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), SpecializedVehicle< RoadVehicle, Type >::From(), GetAnyRoadBits(), GetEncodedStringWithArgs(), GetOtherTunnelBridgeEnd(), GetParamsForOwnedBy(), GetRoadOwner(), GetRoadType(), GetTileType(), GetTunnelBridgeLength(), GetTunnelBridgeTransportType(), HasPowerOnRoad(), include(), INVALID_ROADTYPE, INVALID_TILE, InvalidateWindowData(), IsAnyRoadStop(), IsBayRoadStopTile(), IsBridge(), IsLevelCrossing(), IsLocalCompany(), IsRoadDepot(), IsRoadDepotTile(), CommandCost::MakeError(), MarkBridgeDirty(), MarkTileDirtyByTile(), MayHaveRoad(), OWNER_TOWN, Road, ROAD_DEPOT_TRACKBIT_FACTOR, ROAD_STOP_TRACKBIT_FACTOR, RoadConvertCost(), RoadNoLevelCrossing(), RoadRemove, RTT_ROAD, RTT_TRAM, CommandCost::SetEncodedMessage(), SetRoadType(), SetTunnelBridgeOwner(), Map::Size(), Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TRANSPORT_ROAD, TunnelBridge, TUNNELBRIDGE_TRACKBIT_FACTOR, TunnelBridgeIsFree(), TunnelBridgeRemove, ValParamRoadType(), VEH_ROAD, WC_BUILD_VEHICLE, and WC_VEHICLE_DEPOT.
| std::tuple< CommandCost, Money > CmdRemoveLongRoad | ( | DoCommandFlags | flags, |
| TileIndex | end_tile, | ||
| TileIndex | start_tile, | ||
| RoadType | rt, | ||
| Axis | axis, | ||
| bool | start_half, | ||
| bool | end_half ) |
Remove a long piece of road.
| flags | operation to perform |
| end_tile | end tile of drag |
| start_tile | start tile of drag |
| rt | road type |
| axis | direction |
| start_half | start tile starts in the 2nd half of tile |
| end_half | end tile starts in the 2nd half of tile (p2 & 2) |
Definition at line 1067 of file road_cmd.cpp.
References CommandCost::AddCost(), AXIS_X, AXIS_Y, AxisToRoadBits(), CMD_ERROR, Execute, EXPENSES_CONSTRUCTION, GetAvailableMoneyForCommand(), CommandCost::GetCost(), CommandCost::GetErrorMessage(), IsValidAxis(), RemoveRoad(), ROAD_NE, ROAD_NW, ROAD_SE, ROAD_SW, Map::Size(), CommandCost::Succeeded(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileOffsByAxis(), TileX(), TileY(), and ValParamRoadType().
Compare roadtypes based on their sorting order.
| first | The roadtype to compare to. |
| second | The roadtype to compare. |
Definition at line 100 of file road_cmd.cpp.
References GetRoadTypeInfo(), and RoadTypeInfo::sorting_order.
Referenced by InitRoadTypes().
|
static |
Convert the ownership of the RoadType of the tile if applicable.
| tile | the tile of which convert ownership |
| num_pieces | the count of the roadbits to assign to the new owner |
| owner | the current owner of the RoadType |
| from_type | the old road type |
| to_type | the new road type |
Definition at line 2437 of file road_cmd.cpp.
References _current_company, DirtyCompanyInfrastructureWindows(), Company::infrastructure, OWNER_NONE, CompanyInfrastructure::road, SetRoadOwner(), and UpdateCompanyRoadInfrastructure().
Referenced by CmdConvertRoad().
|
static |
Should the road be drawn as a unpaved snow/desert road?
By default, roads are always drawn as unpaved if they are on desert or above the snow line, but NewGRFs can override this for desert.
| snow_or_desert | Is snowy or desert tile |
| roadside | What sort of road this is |
Definition at line 1354 of file road_cmd.cpp.
References _settings_game, Barren, DesertPavedRoads, Grass, GrassRoadWorks, HasGrfMiscBit(), and Tropic.
Referenced by DrawTile_Road(), and GetRoadGroundSprite().
|
static |
Draw ground sprite and road pieces.
| ti | TileInfo |
Definition at line 1628 of file road_cmd.cpp.
References _display_opt, Detail, DO_FULL_DETAIL, DrawFoundation(), DrawGroundSprite(), DrawGroundSpriteAt(), DrawRoadCatenary(), DrawRoadDetail(), DrawRoadGroundSprites(), DRD_NONE, GetBridgeHeight(), GetCustomRoadSprite(), GetDisallowedRoadDirections(), GetNorthernBridgeEnd(), GetPartialPixelZ(), GetRoadBits(), GetRoadFoundation(), GetRoadside(), GetRoadTypeInfo(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTileMaxZ(), HasAtMostOneBit(), HasBit(), HasRoadWorks(), INVALID_ROADTYPE, IsBridgeAbove(), IsInvisibilitySet(), IsOnSnowOrDesert(), IsTransparencySet(), ROAD_X, ROTSG_ONEWAY, RTT_ROAD, RTT_TRAM, SLOPE_FLAT, SLOPE_NE, SLOPE_NW, SLOPE_SE, SLOPE_SW, SPR_ONEWAY_BASE, StreetLights, TileInfo::tile, TileInfo::tileh, TO_HOUSES, TO_TREES, to_underlying(), and Trees.
Referenced by DrawTile_Road().
| void DrawRoadCatenary | ( | const TileInfo * | ti | ) |
Draws the catenary for the given tile.
| ti | information about the tile (slopes, height etc) |
Definition at line 1442 of file road_cmd.cpp.
References AXIS_X, AXIS_Y, DiagDirToRoadBits(), DrawRoadTypeCatenary(), GetBayRoadStopDir(), GetCrossingRailAxis(), GetDriveThroughStopAxis(), GetRoadBits(), GetRoadTypeRoad(), GetRoadTypeTram(), HasRoadCatenaryDrawn(), INVALID_ROADTYPE, IsAnyRoadStop(), IsDriveThroughStopTile(), IsLevelCrossing(), IsNormalRoad(), IsTileType(), Road, ROAD_NONE, ROAD_X, ROAD_Y, RTT_ROAD, RTT_TRAM, Station, and TileInfo::tile.
Referenced by DrawRoadBits(), DrawTile_Road(), and DrawTile_Station().
| void DrawRoadDepotSprite | ( | int | x, |
| int | y, | ||
| DiagDirection | dir, | ||
| RoadType | rt ) |
Draw the road depot sprite.
| x | The x offset to draw at. |
| y | The y offset to draw at. |
| dir | The direction the depot must be facing. |
| rt | The road type of the depot to draw. |
Definition at line 1904 of file road_cmd.cpp.
References _loaded_newgrf_features, _local_company, Catenary, DiagDirToRoadBits(), DrawRailTileSeqInGUI(), DrawSprite(), RoadTypeInfo::flags, GetCompanyPalette(), GetCustomRoadSprite(), GetRoadSpriteOffset(), GetRoadTypeInfo(), DrawTileSprites::ground, INVALID_TILE, ROTSG_DEPOT, ROTSG_OVERLAY, SLOPE_FLAT, PalSpriteID::sprite, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), and TRAMWAY_REPLACE_DEPOT_WITH_TRACK.
Referenced by BuildRoadDepotWindow::DrawWidget().
|
static |
Draws details on/around the road.
| img | the sprite to draw |
| ti | the tile to draw on |
| dx | the offset from the top of the BB of the tile |
| dy | the offset from the top of the BB of the tile |
| h | the height of the sprite to draw |
| transparent | whether the sprite should be transparent (used for roadside trees) |
Definition at line 1488 of file road_cmd.cpp.
References AddSortableSpriteToDraw(), GetSlopePixelZ(), SLOPE_FLAT, TileInfo::tileh, Coord3D< T >::x, Coord3D< T >::y, and Coord3D< T >::z.
Referenced by DrawRoadBits().
| void DrawRoadGroundSprites | ( | const TileInfo * | ti, |
| RoadBits | road, | ||
| RoadBits | tram, | ||
| const RoadTypeInfo * | road_rti, | ||
| const RoadTypeInfo * | tram_rti, | ||
| Roadside | roadside, | ||
| bool | snow_or_desert ) |
Draw road ground sprites.
| ti | TileInfo |
| road | Road bits |
| tram | Tram bits |
| road_rti | Road road type information |
| tram_rti | Tram road type information |
| roadside | Roadside type |
| snow_or_desert | Whether to draw snow/desert ground sprites |
Definition at line 1610 of file road_cmd.cpp.
References DrawGroundSprite(), DrawRoadOverlays(), GetRoadGroundSprite(), GetRoadSpriteOffset(), ROAD_NONE, and TileInfo::tileh.
Referenced by DrawRoadBits(), and DrawTile_Station().
| void DrawRoadOverlays | ( | const TileInfo * | ti, |
| PaletteID | pal, | ||
| const RoadTypeInfo * | road_rti, | ||
| const RoadTypeInfo * | tram_rti, | ||
| uint | road_offset, | ||
| uint | tram_offset, | ||
| bool | draw_underlay ) |
Draw road underlay and overlay sprites.
| ti | TileInfo |
| pal | The palette to apply to the overlays. |
| road_rti | Road road type information |
| tram_rti | Tram road type information |
| road_offset | Road sprite offset (based on road bits) |
| tram_offset | Tram sprite offset (based on road bits) |
| draw_underlay | Whether to draw underlays |
Definition at line 1507 of file road_cmd.cpp.
References DrawGroundSprite(), GetCustomRoadSprite(), ROTSG_GROUND, ROTSG_OVERLAY, and TileInfo::tile.
Referenced by DrawRoadGroundSprites(), DrawTile_Road(), DrawTile_Station(), and DrawTile_TunnelBridge().
Draws the catenary for the RoadType of the given tile.
| ti | information about the tile (slopes, height etc) |
| rt | road type to draw catenary for |
| rb | the roadbits for the tram |
< big number compared to sprite size
Definition at line 1367 of file road_cmd.cpp.
References AddSortableSpriteToDraw(), BB_HEIGHT_UNDER_BRIDGE, CountBits(), DIAGDIR_BEGIN, DIAGDIR_END, DiagDirToRoadBits(), GetBridgeHeight(), GetColourPalette(), GetCompanyPalette(), GetCustomRoadSprite(), GetNorthernBridgeEnd(), GetRoadOwner(), GetRoadSpriteOffset(), GetRoadTypeInfo(), GetRoadTypeRoad(), GetRoadTypeTram(), GetSlopePixelZInCorner(), GetTileMaxZ(), HasRoadCatenary(), INF, INVALID_ROADTYPE, IsBridgeAbove(), IsTransparencySet(), MayHaveRoad(), OWNER_NONE, OWNER_TOWN, ROAD_NONE, ROTSG_CATENARY_BACK, ROTSG_CATENARY_FRONT, SLOPE_FLAT, SPR_TRAMWAY_BASE, TileInfo::tile, TILE_HEIGHT, TILE_SIZE, TileAddByDiagDir(), TileInfo::tileh, and TO_CATENARY.
Referenced by DrawRoadCatenary().
|
static |
Tile callback function signature for drawing a tile and its contents to the screen.
| ti | Information about the tile to draw |
Definition at line 1709 of file road_cmd.cpp.
References _loaded_newgrf_features, _settings_client, AXIS_Y, AxisToDiagDir(), Barren, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::base(), RailTypeInfo::base_sprites, Catenary, Crossing, RailTypeInfo::crossing, Depot, DIAGDIR_NE, DIAGDIR_NW, DIAGDIR_SE, DIAGDIR_SW, DiagDirToRoadBits(), DrawBridgeMiddle(), DrawFoundation(), DrawGroundSprite(), DrawRailCatenary(), DrawRailTileSeq(), DrawRoadAsSnowOrDesert(), DrawRoadBits(), DrawRoadCatenary(), DrawRoadOverlays(), EdgeNE, EdgeNW, EdgeSE, EdgeSW, RoadTypeInfo::flags, FOUNDATION_LEVELED, GetAllRoadBits(), GetCompanyPalette(), GetCrossingRailAxis(), GetCrossingRoadAxis(), GetCustomRailSprite(), GetCustomRoadSprite(), GetRailType(), GetRailTypeInfo(), GetRoadDepotDirection(), GetRoadside(), GetRoadSpriteOffset(), GetRoadTileType(), GetRoadTypeInfo(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTileOwner(), Grass, DrawTileSprites::ground, HasCrossingReservation(), HasRailCatenaryDrawn(), INVALID_ROADTYPE, IsBridgeAbove(), IsCrossingBarred(), IsLevelCrossingTile(), IsOnSnowOrDesert(), Normal, PALETTE_CRASH, PALETTE_TO_BARE_LAND, ReverseDiagDir(), ROAD_NE, ROAD_NW, ROAD_SE, ROAD_SW, ROTSG_DEPOT, ROTSG_OVERLAY, RTSG_CROSSING, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), RailTypeInfo::single_x, RailTypeInfo::single_y, Map::Size(), SLOPE_FLAT, PalSpriteID::sprite, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileInfo::tile, TileAddByDiagDir(), TileInfo::tileh, TO_BUILDINGS, TO_CATENARY, and TRAMWAY_REPLACE_DEPOT_WITH_TRACK.
|
static |
Tile callback function signature for getting the foundation of a tile.
| tile | The tile to check. |
| tileh | The current slope. |
Definition at line 1980 of file road_cmd.cpp.
References FlatteningFoundation(), GetAllRoadBits(), GetRoadFoundation(), and IsNormalRoad().
|
static |
Get the foundationtype of a RoadBits Slope combination.
Definition at line 1289 of file road_cmd.cpp.
References _invalid_tileh_slopes_road, FOUNDATION_INCLINED_X, FOUNDATION_INCLINED_Y, FOUNDATION_LEVELED, FOUNDATION_NONE, GetHighestSlopeCorner(), IsSlopeWithOneCornerRaised(), IsSteepSlope(), ROAD_NONE, ROAD_X, SLOPE_FLAT, and SlopeWithOneCornerRaised().
Referenced by CheckRoadSlope(), CmdBuildRoad(), DrawRoadBits(), GetFoundation_Road(), GetSlopePixelZ_Road(), RemoveRoad(), and TerraformTile_Road().
|
static |
Get ground sprite to draw for a road tile.
| ti | TileInof | |
| roadside | Road side type | |
| rti | Road type info | |
| offset | Road sprite offset | |
| snow_or_desert | Whether to get snow/desert ground sprite | |
| [out] | pal | Palette to draw. |
Definition at line 1555 of file road_cmd.cpp.
References Barren, DrawRoadAsSnowOrDesert(), Grass, GrassRoadWorks, PALETTE_TO_BARE_LAND, SlopeToSpriteOffset(), and TileInfo::tileh.
Referenced by DrawRoadGroundSprites().
Get the sprite offset within a spritegroup.
| slope | Slope |
| bits | Roadbits |
Definition at line 1324 of file road_cmd.cpp.
References SLOPE_FLAT, SLOPE_NE, SLOPE_NW, SLOPE_SE, and SLOPE_SW.
Referenced by DrawRoadDepotSprite(), DrawRoadGroundSprites(), DrawRoadTypeCatenary(), and DrawTile_Road().
|
static |
Tile callback function signature for obtaining the world Z coordinate of a given point of a tile.
| tile | The queries tile for the Z coordinate. |
| x | World X coordinate in tile "units". |
| y | World Y coordinate in tile "units". |
| ground_vehicle | Whether to get the Z coordinate of the ground vehicle, or the ground. |
Definition at line 1964 of file road_cmd.cpp.
References ApplyPixelFoundationToSlope(), GetAllRoadBits(), GetPartialPixelZ(), GetRoadFoundation(), GetTileMaxPixelZ(), GetTilePixelSlope(), IsNormalRoad(), and SLOPE_FLAT.
Tile callback function signature for obtaining a tile description.
| tile | Tile being queried |
| td | Storage pointer for returned tile description |
Definition at line 2221 of file road_cmd.cpp.
References TileDesc::build_date, Crossing, Depot, GetRailType(), GetRailTypeInfo(), GetRoadOwner(), GetRoadside(), GetRoadTileType(), GetRoadTypeInfo(), GetRoadTypeRoad(), GetRoadTypeTram(), GetTileOwner(), INVALID_OWNER, INVALID_ROADTYPE, RailTypeInfo::max_speed, RoadTypeInfo::max_speed, RailTypeInfo::name, RoadTypeInfo::name, TileDesc::owner, TileDesc::owner_type, TileDesc::rail_speed, TileDesc::railtype, TileDesc::road_speed, TileDesc::roadtype, RTT_ROAD, RTT_TRAM, TileDesc::str, RailTypeInfo::strings, RoadTypeInfo::strings, to_underlying(), TileDesc::tram_speed, and TileDesc::tramtype.
|
static |
Tile callback function signature for getting the possible tracks that can be taken on a given tile by a given transport.
The return value contains the existing trackdirs and signal states.
see track_func.h for usage of TrackStatus.
| tile | the tile to get the track status from |
| mode | the mode of transportation |
| sub_mode | used to differentiate between different kinds within the mode |
| side | The side where the tile is entered. |
Definition at line 2145 of file road_cmd.cpp.
References _road_trackbits, AxisToDiagDir(), AxisToTrackBits(), CombineTrackStatus(), Crossing, Depot, DiagDirToAxis(), DiagDirToDiagTrackBits(), DiagDirToRoadBits(), DRD_END, DRD_NONE, GetCrossingRailBits(), GetCrossingRoadAxis(), GetDisallowedRoadDirections(), GetRoadBits(), GetRoadDepotDirection(), GetRoadTileType(), HasRoadWorks(), HasTileRoadType(), INVALID_DIAGDIR, IsCrossingBarred(), IsLevelCrossing(), IsLevelCrossingTile(), Normal, ReverseDiagDir(), RTT_TRAM, TileAddByDiagDir(), TrackBitsToTrackdirBits(), TRACKDIR_BIT_NONE, TRACKDIR_BIT_X_NE, TRACKDIR_BIT_X_SW, TRACKDIR_BIT_Y_NW, TRACKDIR_BIT_Y_SE, TrainOnCrossing(), TRANSPORT_RAIL, and TRANSPORT_ROAD.
| void InitRoadTypes | ( | ) |
Resolve sprites of custom road types.
Definition at line 111 of file road_cmd.cpp.
References _roadtypes_hidden_mask, _sorted_roadtypes, CompareRoadTypes(), RoadTypeInfo::flags, Hidden, RoadTypeInfo::Index(), RoadTypeInfo::label, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
Referenced by AfterLoadGRFs().
|
static |
Delete a piece of road.
| tile | tile where to remove road from |
| flags | operation to perform |
| pieces | roadbits to remove |
| rtt | Road type to remove. |
| town_check | should we check if the town allows removal? |
Definition at line 318 of file road_cmd.cpp.
References _current_company, _invalid_tileh_slopes_road, _price, _settings_game, CommandCost::AddCost(), AxisToRoadBits(), BuildFoundation, CalcClosestTownFromTile(), CheckAllowRemoveRoad(), CMD_ERROR, ComplementRoadBits(), CountBits(), Crossing, Depot, DiagDirToAxis(), DirtyCompanyInfrastructureWindows(), DRD_NONE, EnsureNoVehicleOnGround(), Execute, EXPENSES_CONSTRUCTION, CommandCost::Failed(), FOUNDATION_NONE, GetCrossingRailBits(), GetCrossingRailTrack(), GetCrossingRoadAxis(), GetCrossingRoadBits(), GetHighestSlopeCorner(), GetOtherTunnelBridgeEnd(), GetRailType(), GetRoadBits(), GetRoadFoundation(), GetRoadOwner(), GetRoadTileType(), GetRoadType(), GetTileOwner(), GetTileSlope(), GetTileType(), GetTunnelBridgeDirection(), GetTunnelBridgeLength(), GetTunnelBridgeTransportType(), HasCrossingReservation(), HasRoadWorks(), Company::infrastructure, INVALID_ROADTYPE, IsBridge(), IsDriveThroughStopTile(), IsRoadOwner(), IsSteepSlope(), IsStraightRoad(), IsTileOwner(), IsTileType(), LEVELCROSSING_TRACKBIT_FACTOR, MakeRailNormal(), MarkBridgeDirty(), MarkTileDirtyByTile(), MayHaveRoad(), MirrorRoadBits(), Normal, OWNER_TOWN, OWNER_WATER, CompanyInfrastructure::rail, Road, ROAD_NONE, RoadClearCost(), RTT_ROAD, RTT_TRAM, SetDisallowedRoadDirections(), SetRoadBits(), SetRoadType(), SetTileOwner(), SetTownIndex(), SetTrackReservation(), SLOPE_ELEVATED, SLOPE_FLAT, SlopeWithOneCornerRaised(), Station, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), TileVirtXY(), TRANSPORT_ROAD, TunnelBridge, TUNNELBRIDGE_TRACKBIT_FACTOR, TunnelBridgeIsFree(), UpdateAdjacentLevelCrossingTilesOnLevelCrossingRemoval(), UpdateCompanyRoadInfrastructure(), and YapfNotifyTrackLayoutChange().
Referenced by ClearTile_Road(), CmdRemoveLongRoad(), and TileLoop_Road().
|
static |
Definition at line 1194 of file road_cmd.cpp.
| void ResetRoadTypes | ( | ) |
Reset all road type information to its default values.
Definition at line 63 of file road_cmd.cpp.
References _original_roadtypes, _roadtypes_hidden_mask, _roadtypes_road, _roadtypes_tram, ROADTYPE_ROAD, and ROADTYPE_TRAM.
Referenced by ResetNewGRFData().
| void ResolveRoadTypeGUISprites | ( | RoadTypeInfo * | rti | ) |
Definition at line 75 of file road_cmd.cpp.
| bool RoadVehiclesAreBuilt | ( | ) |
Verify whether a road vehicle is available.
true if at least one road vehicle is available, false if not Definition at line 172 of file road_cmd.cpp.
Referenced by CheckRoadSide().
|
static |
Tile callback function signature of the terraforming callback.
The function is called when a tile is affected by a terraforming operation. It has to check if terraforming of the tile is allowed and return extra terraform-cost that depend on the tiletype. With DoCommandFlag::Execute in flags it has to perform tiletype-specific actions (like clearing land etc., but not the terraforming itself).
| tile | The involved tile. |
| flags | Command flags passed to the terraform command (DoCommandFlag::Execute, DoCommandFlag::QueryCost, etc.). |
| z_new | TileZ after terraforming. |
| tileh_new | Slope after terraforming. |
Definition at line 2379 of file road_cmd.cpp.
References _price, _settings_game, ApplyFoundationToSlope(), AutoslopeCheckForEntranceEdge(), AutoslopeEnabled(), BuildFoundation, CheckRoadSlope(), Crossing, Depot, EXPENSES_CONSTRUCTION, GetAllRoadBits(), GetRoadDepotDirection(), GetRoadFoundation(), GetRoadTileType(), GetSlopeMaxZ(), GetTileMaxZ(), GetTileSlopeZ(), HasBit(), IsSteepSlope(), Normal, ROAD_NONE, and VALID_LEVEL_CROSSING_SLOPES.
|
static |
Tile callback function signature for running periodic tile updates.
| tile | The tile to update. |
Definition at line 2011 of file road_cmd.cpp.
References _settings_client, _settings_game, Arctic, Auto, Barren, Chance16(), CleanUpRoadBits(), ClosestTownFromTile(), CreateEffectVehicleAbove(), DistanceManhattan(), EnsureNoVehicleOnGround(), EV_BULLDOZER, Execute, GetAllRoadBits(), GetAnyRoadBits(), GetFoundationSlope(), GetRoadOwner(), GetRoadside(), GetRoadTypeRoad(), GetSnowLine(), GetTileMaxZ(), GetTownRadiusGroup(), GetTownRoadType(), GetTropicZone(), HasAtMostOneBit(), HasRoadWorks(), IncreaseRoadWorksCounter(), IsNormalRoad(), IsOnSnowOrDesert(), IsRoadDepot(), MarkTileDirtyByTile(), NoWater, OWNER_TOWN, RemoveRoad(), Town::road_build_months, RTT_ROAD, SetRoadside(), SetRoadType(), SLOPE_FLAT, SND_21_ROAD_WORKS, StartRoadWorks(), TerminateRoadWorks(), TILE_SIZE, TileX(), TileY(), to_underlying(), ToggleSnowOrDesert(), TownEdge, Toyland, Tropic, TROPICZONE_DESERT, and Town::xy.
| void UpdateCompanyRoadInfrastructure | ( | RoadType | rt, |
| Owner | o, | ||
| int | count ) |
Update road infrastructure counts for a company.
| rt | Road type to update count of. |
| o | Owner of road piece. |
| count | Number of road pieces to adjust. |
Definition at line 183 of file road_cmd.cpp.
References DirtyCompanyInfrastructureWindows(), Company::infrastructure, INVALID_ROADTYPE, and CompanyInfrastructure::road.
Referenced by CmdBuildRoad(), CmdBuildRoadDepot(), CmdBuildRoadStop(), CmdBuildRoadWaypoint(), ConvertRoadTypeOwner(), DoClearBridge(), DoClearTunnel(), RemoveGenericRoadStop(), RemoveRoad(), RemoveRoadStop(), and RemoveRoadWaypointStop().
| void UpdateNearestTownForRoadTiles | ( | bool | invalidate | ) |
Updates cached nearest town for all road tiles.
| invalidate | are we just invalidating cached data? |
Definition at line 1947 of file road_cmd.cpp.
References _generating_world, CalcClosestTownFromTile(), HasTownOwnedRoad(), IsRoadDepot(), IsTileType(), Map::Iterate(), Road, and SetTownIndex().
Referenced by AfterLoadGame(), CmdFoundTown(), FoundTownWindow::OnQueryTextFinished(), and Town::PostDestructor().
Tile callback function for a vehicle entering a tile.
| v | Vehicle entering the tile. |
| tile | Tile entered. |
| x | X position in world coordinates. |
| y | Y position in world coordinates. |
Definition at line 2296 of file road_cmd.cpp.
References _roadveh_enter_depot_dir, Depot, Vehicle::direction, EnteredWormhole, SpecializedVehicle< T, Type >::First(), SpecializedVehicle< RoadVehicle, Type >::From(), GetRoadDepotDirection(), GetRoadTileType(), Hidden, InvalidateWindowData(), SpecializedVehicle< T, Type >::Next(), ReverseDir(), RVSB_IN_DEPOT, BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), RoadVehicle::state, Vehicle::tile, BaseVehicle::type, VEH_ROAD, VehicleEnterDepot(), Vehicle::vehstatus, and WC_VEHICLE_DEPOT.
|
static |
Invalid RoadBits on slopes.
Definition at line 195 of file road_cmd.cpp.
Referenced by CheckRoadSlope(), GetRoadFoundation(), and RemoveRoad().
| const uint8_t _road_sloped_sprites[14] |
Definition at line 1311 of file road_cmd.cpp.
|
static |
Definition at line 2209 of file road_cmd.cpp.
|
static |
Converts RoadBits to TrackBits.
Definition at line 2125 of file road_cmd.cpp.
Referenced by GetTileTrackStatus_Road().
| RoadTypeInfo _roadtypes[ROADTYPE_END] |
Definition at line 54 of file road_cmd.cpp.
| RoadTypes _roadtypes_hidden_mask |
Bitset of hidden roadtypes.
Definition at line 56 of file road_cmd.cpp.
Referenced by HasAnyRoadTypesAvail(), HasRoadTypeAvail(), InitRoadTypes(), and ResetRoadTypes().
| RoadTypes _roadtypes_road |
Bitset of road roadtypes.
Definition at line 57 of file road_cmd.cpp.
Referenced by AllocateRoadType(), GetMaskForRoadTramType(), and ResetRoadTypes().
| RoadTypes _roadtypes_tram |
Bitset of tram roadtypes.
Definition at line 58 of file road_cmd.cpp.
Referenced by AllocateRoadType(), GetMaskForRoadTramType(), and ResetRoadTypes().
|
static |
Given the direction the road depot is pointing, this is the direction the vehicle should be travelling in in order to enter the depot.
Definition at line 2291 of file road_cmd.cpp.
Referenced by VehicleEnterTile_Road().
| std::vector<RoadType> _sorted_roadtypes |
Sorted list of road types.
Definition at line 55 of file road_cmd.cpp.
Referenced by BuildRoadToolbarWindow::ChangeRoadTypeOnHotkey(), InitRoadTypes(), CompanyInfrastructureWindow::UpdateWidgetSize(), and ReplaceVehicleWindow::UpdateWidgetSize().
|
extern |
TileTypeProcs definitions for TileType::Road tiles.
Definition at line 54 of file landscape.cpp.
|
static |
Definition at line 1989 of file road_cmd.cpp.
|
static |
Definition at line 1999 of file road_cmd.cpp.