OpenTTD
|
Generic road related functions. More...
#include "stdafx.h"
#include "rail_map.h"
#include "road_map.h"
#include "water_map.h"
#include "genworld.h"
#include "company_func.h"
#include "company_base.h"
#include "engine_base.h"
#include "date_func.h"
#include "landscape.h"
#include "safeguards.h"
Go to the source code of this file.
Functions | |
static bool | IsPossibleCrossing (const TileIndex tile, Axis ax) |
Return if the tile is a valid tile for a crossing. | |
RoadBits | CleanUpRoadBits (const TileIndex tile, RoadBits org_rb) |
Clean up unnecessary RoadBits of a planed tile. | |
bool | HasRoadTypesAvail (const CompanyID company, const RoadTypes rts) |
Finds out, whether given company has all given RoadTypes available. | |
bool | ValParamRoadType (const RoadType rt) |
Validate functions for rail building. | |
RoadTypes | GetCompanyRoadtypes (CompanyID company) |
Get the road types the given company can build. |
Generic road related functions.
Definition in file road.cpp.
Clean up unnecessary RoadBits of a planed tile.
tile | current tile |
org_rb | planed RoadBits |
Definition at line 46 of file road.cpp.
References DIAGDIR_BEGIN, DIAGDIR_END, DiagDirToAxis(), DiagDirToRoadBits(), GetAnyRoadBits(), GetTileType(), IsNormalRoadTile(), IsPossibleCrossing(), IsValidTile(), IsWater(), MirrorRoadBits(), MP_CLEAR, MP_RAILWAY, MP_ROAD, MP_STATION, MP_TREES, MP_TUNNELBRIDGE, MP_WATER, ROAD_NONE, ROADTYPE_ROAD, ROADTYPE_TRAM, and TileAddByDiagDir().
Referenced by GrowTownInTile().
Get the road types the given company can build.
company | the company to get the roadtypes for. |
Definition at line 139 of file road.cpp.
References _date, _settings_game, EngineInfo::climates, Engine::company_avail, DAYS_IN_YEAR, EF_ROAD_TRAM, GameSettings::game_creation, HasBit(), Engine::intro_date, GameCreationSettings::landscape, EngineInfo::misc_flags, ROADTYPE_ROAD, ROADTYPE_TRAM, ROADTYPES_NONE, SetBit(), and VEH_ROAD.
Referenced by AfterLoadGame(), DoStartupNewCompany(), and StartupEngines().
Finds out, whether given company has all given RoadTypes available.
company | ID of company |
rts | RoadTypes to test |
Definition at line 110 of file road.cpp.
References _generating_world, Company::avail_roadtypes, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::GetIfValid(), OWNER_DEITY, OWNER_TOWN, and ROADTYPES_ROAD.
Referenced by CmdBuildBridge(), CmdBuildRoadStop(), CmdBuildTunnel(), and ValParamRoadType().
Return if the tile is a valid tile for a crossing.
tile | the current tile |
ax | the axis of the road over the rail |
Definition at line 32 of file road.cpp.
References AXIS_X, GetFoundationSlope(), GetRailTileType(), GetTrackBits(), IsTileType(), MP_RAILWAY, RAIL_TILE_NORMAL, SLOPE_FLAT, TRACK_BIT_X, and TRACK_BIT_Y.
Referenced by CleanUpRoadBits().
bool ValParamRoadType | ( | const RoadType | rt | ) |
Validate functions for rail building.
rt | road type to check. |
Definition at line 129 of file road.cpp.
References _current_company, HasRoadTypesAvail(), and RoadTypeToRoadTypes().
Referenced by CmdBuildLongRoad(), CmdBuildRoad(), and CmdBuildRoadDepot().