Mercurial > hg > openttd
changeset 18266:4fb3f7ce4ea9 draft
(svn r23102) -Codechange: remove the remaining pointless multiplications by TILE_HEIGHT
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 04 Nov 2011 10:31:46 +0000 |
parents | c45ee8c2b36b |
children | bd462bea68f1 |
files | src/clear_cmd.cpp src/dock_gui.cpp src/elrail.cpp src/industry_cmd.cpp src/misc_gui.cpp src/newgrf_canal.cpp src/rail_cmd.cpp |
diffstat | 7 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/clear_cmd.cpp +++ b/src/clear_cmd.cpp @@ -231,7 +231,7 @@ /* If the tile is at any edge flood it to prevent maps without water. */ if (_settings_game.construction.freeform_edges && DistanceFromEdge(tile) == 1) { uint z; - Slope slope = GetTilePixelSlope(tile, &z); + Slope slope = GetTileSlope(tile, &z); if (z == 0 && slope == SLOPE_FLAT) { DoFloodTile(tile); MarkTileDirtyByTile(tile);
--- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -60,7 +60,7 @@ static TileIndex GetOtherAqueductEnd(TileIndex tile_from, TileIndex *tile_to = NULL) { uint z; - DiagDirection dir = GetInclinedSlopeDirection(GetTilePixelSlope(tile_from, &z)); + DiagDirection dir = GetInclinedSlopeDirection(GetTileSlope(tile_from, &z)); /* If the direction isn't right, just return the next tile so the command * complains about the wrong slope instead of the ends not matching up. @@ -79,7 +79,7 @@ if (length > max_length) break; - if (GetTileMaxPixelZ(endtile) > z) { + if (GetTileMaxZ(endtile) > z) { if (tile_to != NULL) *tile_to = endtile; break; }
--- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -376,7 +376,7 @@ foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour))); } - ApplyPixelFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]); + ApplyFoundationToSlope(foundation, &tileh[TS_NEIGHBOUR]); /* Half tile slopes coincide only with horizontal/vertical track. * Faking a flat slope results in the correct sprites on positions. */
--- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -1262,7 +1262,7 @@ */ static CommandCost CheckNewIndustry_BubbleGen(TileIndex tile) { - if (GetTilePixelZ(tile) > TILE_HEIGHT * 4) { + if (GetTileZ(tile) > 4) { return_cmd_error(STR_ERROR_CAN_ONLY_BE_BUILT_IN_LOW_AREAS); } return CommandCost();
--- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -221,7 +221,7 @@ snprintf(tmp, lengthof(tmp), "0x%.4X", tile); SetDParam(0, TileX(tile)); SetDParam(1, TileY(tile)); - SetDParam(2, GetTilePixelZ(tile) / TILE_HEIGHT); + SetDParam(2, GetTileZ(tile)); SetDParamStr(3, tmp); GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_LANDINFO_COORDS, lastof(this->landinfo_data[line_nr])); line_nr++;
--- a/src/newgrf_canal.cpp +++ b/src/newgrf_canal.cpp @@ -48,7 +48,7 @@ switch (variable) { /* Height of tile */ case 0x80: { - uint z = GetTilePixelZ(tile) / TILE_HEIGHT; + uint z = GetTileZ(tile); /* Return consistent height within locks */ if (IsTileType(tile, MP_WATER) && IsLock(tile) && GetLockPart(tile) == LOCK_PART_UPPER) z--; return z;
--- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -676,7 +676,7 @@ } } else { /* Make shore on steep slopes and 'three-corners-raised'-slopes. */ - if (ApplyPixelFoundationToSlope(GetRailFoundation(tileh, rail_bits), &tileh) == 0) { + if (ApplyFoundationToSlope(GetRailFoundation(tileh, rail_bits), &tileh) == 0) { if (IsSteepSlope(tileh) || IsSlopeWithThreeCornersRaised(tileh)) { flooded = true; SetRailGroundType(t, RAIL_GROUND_WATER);