Mercurial > hg > openttd
changeset 7370:fba35a9abf79 draft
(svn r10733) -Codechange: change MP_STREET into MP_ROAD as we use the word "road" everywhere except in the tile type.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 29 Jul 2007 23:42:59 +0000 |
parents | 92f1c57f783c |
children | e03ba4271be4 |
files | src/ai/default/default.cpp src/ai/trolly/build.cpp src/ai/trolly/pathfinder.cpp src/ai/trolly/trolly.cpp src/bridge_map.h src/depot.h src/elrail.cpp src/npf.cpp src/openttd.cpp src/order_gui.cpp src/rail.cpp src/rail_cmd.cpp src/road_cmd.cpp src/road_gui.cpp src/road_map.cpp src/road_map.h src/roadveh_cmd.cpp src/smallmap_gui.cpp src/station_cmd.cpp src/tile.h src/town_cmd.cpp src/town_map.h src/tunnelbridge_cmd.cpp src/yapf/yapf_costrail.hpp src/yapf/yapf_road.cpp |
diffstat | 25 files changed, 75 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ai/default/default.cpp +++ b/src/ai/default/default.cpp @@ -1691,7 +1691,7 @@ /* signals too? */ if (j & 3) { // Can't build signals on a road. - if (IsTileType(c, MP_STREET)) return CMD_ERROR; + if (IsTileType(c, MP_ROAD)) return CMD_ERROR; if (flag & DC_EXEC) { j = 4 - j; @@ -2044,7 +2044,7 @@ if (!flag) return; break; } - if (type != MP_WATER && type != MP_RAILWAY && type != MP_STREET) return; + if (type != MP_WATER && type != MP_RAILWAY && type != MP_ROAD) return; flag = true; } @@ -2639,7 +2639,7 @@ _cleared_town = NULL; if (p->mode == 2) { - if (IsTileType(c, MP_STREET) && + if (IsTileType(c, MP_ROAD) && GetRoadTileType(c) == ROAD_TILE_NORMAL && (GetRoadBits(c, ROADTYPE_ROAD) & p->attr) != 0) { roadflag |= 2; @@ -2682,7 +2682,7 @@ if (GetTileSlope(c, NULL) != SLOPE_FLAT) return CMD_ERROR; - if (!IsTileType(c, MP_STREET) || GetRoadTileType(c) != ROAD_TILE_NORMAL) { + if (!IsTileType(c, MP_ROAD) || GetRoadTileType(c) != ROAD_TILE_NORMAL) { ret = DoCommand(c, 0, 0, flag | DC_AUTO | DC_NO_WATER | DC_AI_BUILDING, CMD_LANDSCAPE_CLEAR); if (CmdFailed(ret)) return CMD_ERROR; } @@ -2857,7 +2857,7 @@ if (dist <= a->best_dist) { TileIndex tile2 = TILE_MASK(tile + TileOffsByDiagDir(_dir_by_track[track])); - if (IsTileType(tile2, MP_STREET) && GetRoadTileType(tile2) == ROAD_TILE_NORMAL) { + if (IsTileType(tile2, MP_ROAD) && GetRoadTileType(tile2) == ROAD_TILE_NORMAL) { a->best_dist = dist; a->best_tile = tile; a->best_track = track; @@ -2945,7 +2945,7 @@ if (!flag) return; break; } - if (type != MP_WATER && type != MP_RAILWAY && type != MP_STREET) return; + if (type != MP_WATER && type != MP_RAILWAY && type != MP_ROAD) return; flag = true; } @@ -3726,7 +3726,7 @@ DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); } - } else if (IsTileType(tile, MP_STREET)) { + } else if (IsTileType(tile, MP_ROAD)) { if (!IsTileOwner(tile, _current_player)) return; if (IsLevelCrossing(tile)) goto is_rail_crossing;
--- a/src/ai/trolly/build.cpp +++ b/src/ai/trolly/build.cpp @@ -199,7 +199,7 @@ // Build the tile res = AI_DoCommand(route[part], dir, 0, flag | DC_NO_WATER, CMD_BUILD_ROAD); // Currently, we ignore CMD_ERRORs! - if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_STREET) && !EnsureNoVehicle(route[part])) { + if (CmdFailed(res) && flag == DC_EXEC && !IsTileType(route[part], MP_ROAD) && !EnsureNoVehicle(route[part])) { // Problem.. let's just abort it all! DEBUG(ai, 0, "[BuidPath] route building failed at tile 0x%X, aborting", route[part]); p->ainew.state = AI_STATE_NOTHING;
--- a/src/ai/trolly/pathfinder.cpp +++ b/src/ai/trolly/pathfinder.cpp @@ -41,8 +41,8 @@ static bool IsRoad(TileIndex tile) { return - // MP_STREET, but not a road depot? - (IsTileType(tile, MP_STREET) && !IsTileDepotType(tile, TRANSPORT_ROAD)) || + // MP_ROAD, but not a road depot? + (IsTileType(tile, MP_ROAD) && !IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_TUNNELBRIDGE) && ( (IsTunnel(tile) && GetTunnelTransportType(tile) == TRANSPORT_ROAD) || (IsBridge(tile) && GetBridgeTransportType(tile) == TRANSPORT_ROAD) @@ -319,7 +319,7 @@ // Bridges can only be build on land that is not flat // And if there is a road or rail blocking if (tileh != SLOPE_FLAT || - (PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_STREET)) || + (PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_ROAD)) || (!PathFinderInfo->rail_or_road && IsTileType(tile + TileOffsByDiagDir(dir), MP_RAILWAY))) { for (;;) { new_tile += TileOffsByDiagDir(dir);
--- a/src/ai/trolly/trolly.cpp +++ b/src/ai/trolly/trolly.cpp @@ -800,7 +800,7 @@ for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) { TileIndex t = tile + TileOffsByDiagDir(j); - if (IsTileType(t, MP_STREET) && + if (IsTileType(t, MP_ROAD) && GetRoadTileType(t) == ROAD_TILE_DEPOT && IsTileOwner(t, _current_player) && GetRoadDepotDirection(t) == ReverseDiagDir(j)) { @@ -1101,7 +1101,7 @@ CommandCost res; assert(p->ainew.state == AI_STATE_BUILD_DEPOT); - if (IsTileType(p->ainew.depot_tile, MP_STREET) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) { + if (IsTileType(p->ainew.depot_tile, MP_ROAD) && GetRoadTileType(p->ainew.depot_tile) == ROAD_TILE_DEPOT) { if (IsTileOwner(p->ainew.depot_tile, _current_player)) { // The depot is already built p->ainew.state = AI_STATE_BUILD_VEHICLE;
--- a/src/bridge_map.h +++ b/src/bridge_map.h @@ -46,7 +46,7 @@ return IsTileType(t, MP_CLEAR) || IsTileType(t, MP_RAILWAY) || - IsTileType(t, MP_STREET) || + IsTileType(t, MP_ROAD) || IsTileType(t, MP_WATER) || IsTileType(t, MP_TUNNELBRIDGE) || IsTileType(t, MP_UNMOVABLE);
--- a/src/depot.h +++ b/src/depot.h @@ -74,7 +74,7 @@ return IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TILE_DEPOT; case TRANSPORT_ROAD: - return IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT; + return IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT; case TRANSPORT_WATER: return IsTileType(tile, MP_WATER) && GetWaterTileType(tile) == WATER_TILE_DEPOT;
--- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -102,7 +102,7 @@ return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(t))); } - case MP_STREET: + case MP_ROAD: if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return TRACK_BIT_NONE; if (GetRailType(t) != RAILTYPE_ELECTRIC) return TRACK_BIT_NONE; return GetCrossingRailBits(t); @@ -393,7 +393,7 @@ break; case MP_TUNNELBRIDGE: - case MP_STREET: + case MP_ROAD: case MP_STATION: break;
--- a/src/npf.cpp +++ b/src/npf.cpp @@ -232,7 +232,7 @@ } break; - case MP_STREET: + case MP_ROAD: if (!IsTileDepotType(tile, TRANSPORT_ROAD)) { SetRoadside(tile, ROADSIDE_BARREN); MarkTileDirtyByTile(tile); @@ -276,7 +276,7 @@ cost = IsTunnel(tile) ? NPFTunnelCost(current) : NPFBridgeCost(current); break; - case MP_STREET: + case MP_ROAD: cost = NPF_TILE_LENGTH; /* Increase the cost for level crossings */ if (IsLevelCrossing(tile)) cost += _patches.npf_crossing_penalty; @@ -327,7 +327,7 @@ cost = _trackdir_length[trackdir]; /* Should be different for diagonal tracks */ break; - case MP_STREET: /* Railway crossing */ + case MP_ROAD: /* Railway crossing */ cost = NPF_TILE_LENGTH; break; @@ -468,7 +468,7 @@ } switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: /* rail-road crossing : are we looking at the railway part? */ if (IsLevelCrossing(tile) && DiagDirToAxis(enterdir) != GetCrossingRoadAxis(tile)) {
--- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1153,7 +1153,7 @@ for (tile = 0; tile != MapSize(); tile++) { switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: if (GB(_m[tile].m5, 4, 2) == ROAD_TILE_CROSSING && HASBIT(_m[tile].m4, 7)) { _m[tile].m4 = OWNER_TOWN; } @@ -1473,7 +1473,7 @@ SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index); break; - case MP_STREET: + case MP_ROAD: _m[t].m4 |= (_m[t].m2 << 4); if (IsTileOwner(t, OWNER_TOWN)) { SetTownIndex(t, CalcClosestTownFromTile(t, (uint)-1)->index); @@ -1535,7 +1535,7 @@ } break; - case MP_STREET: + case MP_ROAD: /* Swap m3 and m4, so the track type for rail crossings is the * same as for normal rail. */ Swap(_m[t].m3, _m[t].m4); @@ -1551,7 +1551,7 @@ bool old_bridge = CheckSavegameVersion(42); for (TileIndex t = 0; t < map_size; t++) { switch(GetTileType(t)) { - case MP_STREET: + case MP_ROAD: SB(_m[t].m5, 6, 2, GB(_m[t].m5, 4, 2)); switch (GetRoadTileType(t)) { default: NOT_REACHED(); @@ -1679,7 +1679,7 @@ SetRailType(t, UpdateRailType(GetRailType(t), min_rail)); break; - case MP_STREET: + case MP_ROAD: if (IsLevelCrossing(t)) { SetRailType(t, UpdateRailType(GetRailType(t), min_rail)); } @@ -1781,7 +1781,7 @@ } break; - case MP_STREET: /* Clear PBS reservation on crossing */ + case MP_ROAD: /* Clear PBS reservation on crossing */ if (IsLevelCrossing(t)) CLRBIT(_m[t].m5, 0); break;
--- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -278,7 +278,7 @@ } break; - case MP_STREET: + case MP_ROAD: if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) { order.type = OT_GOTO_DEPOT; order.flags = OF_PART_OF_ORDERS;
--- a/src/rail.cpp +++ b/src/rail.cpp @@ -110,7 +110,7 @@ case MP_RAILWAY: return GetRailType(tile); - case MP_STREET: + case MP_ROAD: /* rail/road crossing */ if (IsLevelCrossing(tile)) return GetRailType(tile); break;
--- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -265,7 +265,7 @@ } break; - case MP_STREET: + case MP_ROAD: #define M(x) (1 << (x)) /* Level crossings may only be built on these slopes */ if (!HASBIT(M(SLOPE_SEN) | M(SLOPE_ENW) | M(SLOPE_NWS) | M(SLOPE_NS) | M(SLOPE_WSE) | M(SLOPE_EW) | M(SLOPE_FLAT), tileh)) { @@ -354,7 +354,7 @@ SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); switch (GetTileType(tile)) { - case MP_STREET: { + case MP_ROAD: { if (!IsLevelCrossing(tile) || GetCrossingRailBits(tile) != trackbit || (_current_player != OWNER_WATER && !CheckTileOwnership(tile)) || @@ -757,7 +757,7 @@ } return true; - case MP_STREET: + case MP_ROAD: if (!IsLevelCrossing(tile)) return false; signal_ctr += 2; return true; @@ -1076,7 +1076,7 @@ switch (GetTileType(tile)) { case MP_RAILWAY: proc = DoConvertRail; break; case MP_STATION: proc = DoConvertStationRail; break; - case MP_STREET: proc = DoConvertStreetRail; break; + case MP_ROAD: proc = DoConvertStreetRail; break; case MP_TUNNELBRIDGE: proc = DoConvertTunnelBridgeRail; break; default: continue; }
--- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -124,7 +124,7 @@ Town *t = NULL; switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: if (_game_mode != GM_EDITOR && GetRoadOwner(tile, rt) == OWNER_TOWN) t = GetTownByTile(tile); break; @@ -154,7 +154,7 @@ * removal allowance depends on difficulty setting */ if (!CheckforTownRating(flags, t, ROAD_REMOVE)) return CMD_ERROR; - if (!IsTileType(tile, MP_STREET)) { + if (!IsTileType(tile, MP_ROAD)) { /* If it's the last roadtype, just clear the whole tile */ if (rts == RoadTypeToRoadTypes(rt)) return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); @@ -364,7 +364,7 @@ tileh = GetTileSlope(tile, NULL); switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: switch (GetRoadTileType(tile)) { case ROAD_TILE_NORMAL: { if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS); @@ -481,7 +481,7 @@ cost.AddCost(ret); } - if (IsTileType(tile, MP_STREET)) { + if (IsTileType(tile, MP_ROAD)) { /* Don't put the pieces that already exist */ pieces &= ComplementRoadBits(existing); } @@ -494,7 +494,7 @@ if (flags & DC_EXEC) { switch (GetTileType(tile)) { - case MP_STREET: { + case MP_ROAD: { RoadTileType rtt = GetRoadTileType(tile); if (existing == ROAD_NONE || rtt == ROAD_TILE_CROSSING) { SetRoadTypes(tile, GetRoadTypes(tile) | RoadTypeToRoadTypes(rt)); @@ -529,7 +529,7 @@ break; } - if (rt != ROADTYPE_TRAM && IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) { + if (rt != ROADTYPE_TRAM && IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) { existing |= pieces; SetDisallowedRoadDirections(tile, (existing == ROAD_X || existing == ROAD_Y) ? GetDisallowedRoadDirections(tile) ^ toggle_drd : DRD_NONE);
--- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -122,7 +122,7 @@ { tile += TileOffsByDiagDir(direction); // if there is a roadpiece just outside of the station entrance, build a connecting route - if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) { + if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL) { if (GetRoadBits(tile, _cur_roadtype) != ROAD_NONE) { DoCommandP(tile, _cur_roadtype << 4 | DiagDirToRoadBits(ReverseDiagDir(direction)), 0, NULL, CMD_BUILD_ROAD); }
--- a/src/road_map.cpp +++ b/src/road_map.cpp @@ -19,7 +19,7 @@ if (!HASBIT(GetRoadTypes(tile), rt)) return ROAD_NONE; switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: switch (GetRoadTileType(tile)) { default: case ROAD_TILE_NORMAL: return GetRoadBits(tile, rt); @@ -51,7 +51,7 @@ uint32 r; /* Don't allow local authorities to build roads through road depots or road stops. */ - if ((IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_STATION) && !IsDriveThroughStopTile(tile)) || !HASBIT(GetRoadTypes(tile), rt)) { + if ((IsTileType(tile, MP_ROAD) && IsTileDepotType(tile, TRANSPORT_ROAD)) || (IsTileType(tile, MP_STATION) && !IsDriveThroughStopTile(tile)) || !HASBIT(GetRoadTypes(tile), rt)) { return TRACK_BIT_NONE; }
--- a/src/road_map.h +++ b/src/road_map.h @@ -19,7 +19,7 @@ static inline RoadTileType GetRoadTileType(TileIndex t) { - assert(IsTileType(t, MP_STREET)); + assert(IsTileType(t, MP_ROAD)); return (RoadTileType)GB(_m[t].m5, 6, 2); } @@ -30,7 +30,7 @@ static inline bool IsLevelCrossingTile(TileIndex t) { - return IsTileType(t, MP_STREET) && IsLevelCrossing(t); + return IsTileType(t, MP_ROAD) && IsLevelCrossing(t); } static inline RoadBits GetRoadBits(TileIndex t, RoadType rt) @@ -62,7 +62,7 @@ static inline RoadTypes GetRoadTypes(TileIndex t) { - if (IsTileType(t, MP_STREET)) { + if (IsTileType(t, MP_ROAD)) { return (RoadTypes)GB(_me[t].m7, 5, 3); } else { return (RoadTypes)GB(_m[t].m3, 0, 3); @@ -71,7 +71,7 @@ static inline void SetRoadTypes(TileIndex t, RoadTypes rt) { - if (IsTileType(t, MP_STREET)) { + if (IsTileType(t, MP_ROAD)) { SB(_me[t].m7, 5, 3, rt); } else { assert(IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE)); @@ -81,7 +81,7 @@ static inline Owner GetRoadOwner(TileIndex t, RoadType rt) { - if (!IsTileType(t, MP_STREET)) return GetTileOwner(t); + if (!IsTileType(t, MP_ROAD)) return GetTileOwner(t); switch (GetRoadTileType(t)) { default: NOT_REACHED(); @@ -115,7 +115,7 @@ static inline void SetRoadOwner(TileIndex t, RoadType rt, Owner o) { - if (!IsTileType(t, MP_STREET)) return SetTileOwner(t, o); + if (!IsTileType(t, MP_ROAD)) return SetTileOwner(t, o); switch (GetRoadTileType(t)) { default: NOT_REACHED(); @@ -307,7 +307,7 @@ static inline void MakeRoadNormal(TileIndex t, RoadBits bits, RoadTypes rot, TownID town, Owner road, Owner tram, Owner hway) { - SetTileType(t, MP_STREET); + SetTileType(t, MP_ROAD); SetTileOwner(t, road); _m[t].m2 = town; _m[t].m3 = 0; @@ -321,7 +321,7 @@ static inline void MakeRoadCrossing(TileIndex t, Owner road, Owner tram, Owner hway, Owner rail, Axis roaddir, RailType rat, RoadTypes rot, uint town) { - SetTileType(t, MP_STREET); + SetTileType(t, MP_ROAD); SetTileOwner(t, rail); _m[t].m2 = town; _m[t].m3 = rat; @@ -335,7 +335,7 @@ static inline void MakeRoadDepot(TileIndex t, Owner owner, DiagDirection dir, RoadType rt) { - SetTileType(t, MP_STREET); + SetTileType(t, MP_ROAD); SetTileOwner(t, owner); _m[t].m2 = 0; _m[t].m3 = 0;
--- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -395,7 +395,7 @@ tile += TileOffsByDiagDir(_road_pf_directions[trackdir]); - if (IsTileType(tile, MP_STREET) && + if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT && IsTileOwner(tile, rfdd->owner) && length < rfdd->best_length) { @@ -543,7 +543,7 @@ return CMD_ERROR; } - if (IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) return CMD_ERROR; + if (IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) return CMD_ERROR; if (IsTunnelTile(v->tile) && DirToDiagDir(v->direction) == GetTunnelDirection(v->tile)) return CMD_ERROR; if (IsBridgeTile(v->tile) && DirToDiagDir(v->direction) == GetBridgeRampDirection(v->tile)) return CMD_ERROR; @@ -1145,7 +1145,7 @@ TrackdirBits signal = (TrackdirBits)GB(r, 16, 16); TrackdirBits trackdirs = (TrackdirBits)GB(r, 0, 16); - if (IsTileType(tile, MP_STREET)) { + if (IsTileType(tile, MP_ROAD)) { if (GetRoadTileType(tile) == ROAD_TILE_DEPOT && (!IsTileOwner(tile, v->owner) || GetRoadDepotDirection(tile) == enterdir || (GetRoadTypes(tile) & v->u.road.compatible_roadtypes) == 0)) { /* Road depot owned by another player or with the wrong orientation */ trackdirs = TRACKDIR_BIT_NONE; @@ -1232,7 +1232,7 @@ } else { DiagDirection dir; - if (IsTileType(desttile, MP_STREET)) { + if (IsTileType(desttile, MP_ROAD)) { if (GetRoadTileType(desttile) == ROAD_TILE_DEPOT) { dir = GetRoadDepotDirection(desttile); goto do_it; @@ -1394,7 +1394,7 @@ diag_dir = GetTunnelDirection(tile); } else if (IsBridgeTile(tile)) { diag_dir = GetBridgeRampDirection(tile); - } else if (IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT) { + } else if (IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_DEPOT) { diag_dir = ReverseDiagDir(GetRoadDepotDirection(tile)); } @@ -1512,12 +1512,12 @@ case TRACKDIR_RVREV_SW: needed = ROAD_NE; break; case TRACKDIR_RVREV_NW: needed = ROAD_SE; break; } - if (!IsTileType(tile, MP_STREET) || GetRoadTileType(tile) != ROAD_TILE_NORMAL || HasRoadWorks(tile) || (needed & GetRoadBits(tile, ROADTYPE_TRAM)) == ROAD_NONE) { + if (!IsTileType(tile, MP_ROAD) || GetRoadTileType(tile) != ROAD_TILE_NORMAL || HasRoadWorks(tile) || (needed & GetRoadBits(tile, ROADTYPE_TRAM)) == ROAD_NONE) { /* The tram cannot turn here */ v->cur_speed = 0; return false; } - } else if (IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) { + } else if (IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_NORMAL && GetDisallowedRoadDirections(v->tile) != DRD_NONE) { v->cur_speed = 0; return false; } else { @@ -1625,7 +1625,7 @@ * it's on a depot tile, check if it's time to activate the next vehicle in * the chain yet. */ if (v->next != NULL && - IsTileType(v->tile, MP_STREET) && GetRoadTileType(v->tile) == ROAD_TILE_DEPOT) { + IsTileType(v->tile, MP_ROAD) && GetRoadTileType(v->tile) == ROAD_TILE_DEPOT) { if (v->u.road.frame == v->u.road.cached_veh_length + RVC_DEPOT_START_FRAME) { RoadVehLeaveDepot(v->next, false);
--- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -318,7 +318,7 @@ } switch (tt) { case TRANSPORT_RAIL: t = MP_RAILWAY; break; - case TRANSPORT_ROAD: t = MP_STREET; break; + case TRANSPORT_ROAD: t = MP_ROAD; break; default: t = MP_WATER; break; } }
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -1312,7 +1312,7 @@ { bool type = HASBIT(p2, 0); bool is_drive_through = HASBIT(p2, 1); - bool build_over_road = is_drive_through && IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_NORMAL; + bool build_over_road = is_drive_through && IsTileType(tile, MP_ROAD) && GetRoadTileType(tile) == ROAD_TILE_NORMAL; bool town_owned_road = build_over_road && IsTileOwner(tile, OWNER_TOWN); RoadTypes rts = (RoadTypes)GB(p2, 2, 3);
--- a/src/tile.h +++ b/src/tile.h @@ -26,7 +26,7 @@ enum TileType { MP_CLEAR, ///< A tile without any structures, i.e. grass, rocks, farm fields etc. MP_RAILWAY, ///< A railway - MP_STREET, ///< A street + MP_ROAD, ///< A tile with road (or tram tracks) MP_HOUSE, ///< A house by a town MP_TREES, ///< Tile got trees MP_STATION, ///< A tile of a station @@ -46,7 +46,7 @@ enum TropicZone { TROPICZONE_INVALID = 0, ///< Invalid tropiczone-type TROPICZONE_DESERT = 1, ///< Tile is desert - TROPICZONE_RAINFOREST = 2, ///< Normal grass tile + TROPICZONE_RAINFOREST = 2, ///< Rainforest tile }; Slope GetTileSlope(TileIndex tile, uint *h);
--- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -82,7 +82,7 @@ if (GetTownByTile(tile) == t) DoCommand(tile, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR); break; - case MP_STREET: + case MP_ROAD: case MP_TUNNELBRIDGE: if (IsTileOwner(tile, OWNER_TOWN) && ClosestTownFromTile(tile, (uint)-1) == t) @@ -1151,7 +1151,7 @@ do block = Random() & 3; while (!HASBIT(mask, block)); tile += ToTileIndexDiff(_roadblock_tileadd[block]); - if (IsTileType(tile, MP_STREET)) { + if (IsTileType(tile, MP_ROAD)) { /* Don't allow building over roads of other cities */ if (IsTileOwner(tile, OWNER_TOWN) && GetTownByTile(tile) != t) { _grow_town_result = -1; @@ -2233,7 +2233,7 @@ Town *ClosestTownFromTile(TileIndex tile, uint threshold) { if (IsTileType(tile, MP_HOUSE) || ( - IsTileType(tile, MP_STREET) && + IsTileType(tile, MP_ROAD) && GetRoadOwner(tile, ROADTYPE_ROAD) == OWNER_TOWN )) { return GetTownByTile(tile);
--- a/src/town_map.h +++ b/src/town_map.h @@ -11,25 +11,25 @@ /** * Get the index of which town this house/street is attached to. * @param t the tile - * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_STREET) + * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD) * @return TownID */ static inline TownID GetTownIndex(TileIndex t) { - assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET)); // XXX incomplete + assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_ROAD)); // XXX incomplete return _m[t].m2; } /** * Set the town index for a road or house tile. * @param t the tile - * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_STREET) + * @pre IsTileType(t, MP_HOUSE) or IsTileType(t, MP_ROAD) * @param index the index of the town - * @pre IsTileType(t, MP_STREET) || IsTileType(t, MP_HOUSE) + * @pre IsTileType(t, MP_ROAD) || IsTileType(t, MP_HOUSE) */ static inline void SetTownIndex(TileIndex t, TownID index) { - assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_STREET)); + assert(IsTileType(t, MP_HOUSE) || IsTileType(t, MP_ROAD)); _m[t].m2 = index; }
--- a/src/tunnelbridge_cmd.cpp +++ b/src/tunnelbridge_cmd.cpp @@ -389,7 +389,7 @@ if (!IsPlainRailTile(tile)) goto not_valid_below; break; - case MP_STREET: + case MP_ROAD: if (GetRoadTileType(tile) == ROAD_TILE_DEPOT) goto not_valid_below; break;
--- a/src/yapf/yapf_costrail.hpp +++ b/src/yapf/yapf_costrail.hpp @@ -112,7 +112,7 @@ if (IsDiagonalTrackdir(trackdir)) { cost += YAPF_TILE_LENGTH; switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: /* Increase the cost for level crossings */ if (IsLevelCrossing(tile)) cost += Yapf().PfGetSettings().rail_crossing_penalty;
--- a/src/yapf/yapf_road.cpp +++ b/src/yapf/yapf_road.cpp @@ -48,7 +48,7 @@ if (IsDiagonalTrackdir(trackdir)) { cost += YAPF_TILE_LENGTH; switch (GetTileType(tile)) { - case MP_STREET: + case MP_ROAD: /* Increase the cost for level crossings */ if (IsLevelCrossing(tile)) cost += Yapf().PfGetSettings().road_crossing_penalty; @@ -442,7 +442,7 @@ return NULL; // handle the case when our vehicle is already in the depot tile - if (IsTileType(tile, MP_STREET) && IsTileDepotType(tile, TRANSPORT_ROAD)) { + if (IsTileType(tile, MP_ROAD) && IsTileDepotType(tile, TRANSPORT_ROAD)) { // only what we need to return is the Depot* return GetDepotByTile(tile); }