diff options
author | truelight <truelight@openttd.org> | 2007-11-04 22:47:34 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-11-04 22:47:34 +0000 |
commit | 69b1d97c0348229bf1ff14a672d7e50aa3d9eb3f (patch) | |
tree | 3f3cf6fdd8b19411c70fc99e7dc1456cbc7f798e /src/road_cmd.cpp | |
parent | 3517ee6d54157541ad8c451a075b675c0b429506 (diff) | |
download | openttd-69b1d97c0348229bf1ff14a672d7e50aa3d9eb3f.tar.xz |
(svn r11382) -Codechange: renamed COUNTBITS to CountBits, as it is no longer a macro (skidd13)
Diffstat (limited to 'src/road_cmd.cpp')
-rw-r--r-- | src/road_cmd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index bc2c86444..886593b33 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -220,7 +220,7 @@ CommandCost CmdRemoveRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) MarkTileDirtyByTile(tile); } } - return CommandCost(COUNTBITS(c) * _price.remove_road); + return CommandCost(CountBits(c) * _price.remove_road); } case ROAD_TILE_CROSSING: { @@ -352,7 +352,7 @@ static CommandCost CheckRoadSlope(Slope tileh, RoadBits* pieces, RoadBits existi /* Single bits on slopes. * We check for the roads that need at least 2 bits */ if (_patches.build_on_slopes && !_is_old_ai_player && - existing == ROAD_NONE && COUNTBITS(*pieces) == 1 && + existing == ROAD_NONE && CountBits(*pieces) == 1 && (_valid_tileh_slopes_road[2][tileh] & *pieces) == ROAD_NONE) { return CommandCost(_price.terraform); } @@ -531,7 +531,7 @@ do_clear:; pieces &= ComplementRoadBits(existing); } - cost.AddCost(COUNTBITS(pieces) * _price.build_road); + cost.AddCost(CountBits(pieces) * _price.build_road); if (IsTileType(tile, MP_TUNNELBRIDGE)) { /* Pay for *every* tile of the bridge or tunnel */ cost.MultiplyCost(DistanceManhattan(IsTunnel(tile) ? GetOtherTunnelEnd(tile) : GetOtherBridgeEnd(tile), tile)); @@ -838,7 +838,7 @@ static CommandCost ClearTile_Road(TileIndex tile, byte flags) /* Clear the road if only one piece is on the tile OR the AI tries * to clear town road OR we are not using the DC_AUTO flag */ - if ((COUNTBITS(b) == 1 && GetRoadBits(tile, ROADTYPE_TRAM) == ROAD_NONE) || + if ((CountBits(b) == 1 && GetRoadBits(tile, ROADTYPE_TRAM) == ROAD_NONE) || ((flags & DC_AI_BUILDING) && IsTileOwner(tile, OWNER_TOWN)) || !(flags & DC_AUTO) ) { @@ -906,7 +906,7 @@ Foundation GetRoadFoundation(Slope tileh, RoadBits bits) * created directly, but the state itself is still perfectly drawable. * However, as we do not want this to be build directly, we need to check * for that situation in here. */ - return (tileh != 0 && COUNTBITS(bits) == 1) ? FOUNDATION_LEVELED : FOUNDATION_NONE; + return (tileh != 0 && CountBits(bits) == 1) ? FOUNDATION_LEVELED : FOUNDATION_NONE; } if ((~_valid_tileh_slopes_road[1][tileh] & bits) == 0) return FOUNDATION_LEVELED; } @@ -1241,7 +1241,7 @@ static void TileLoop_Road(TileIndex tile) /* Show an animation to indicate road work */ if (t->road_build_months != 0 && (DistanceManhattan(t->xy, tile) < 8 || grp != 0) && - GetRoadTileType(tile) == ROAD_TILE_NORMAL && COUNTBITS(GetAllRoadBits(tile)) > 1 ) { + GetRoadTileType(tile) == ROAD_TILE_NORMAL && CountBits(GetAllRoadBits(tile)) > 1 ) { if (GetTileSlope(tile, NULL) == SLOPE_FLAT && EnsureNoVehicleOnGround(tile) && CHANCE16(1, 40)) { StartRoadWorks(tile); |