1
0
Fork 0

(svn r23102) -Codechange: remove the remaining pointless multiplications by TILE_HEIGHT

release/1.2
rubidium 2011-11-04 10:31:46 +00:00
parent a8c4efcff4
commit 798f5a8608
7 changed files with 8 additions and 8 deletions

View File

@ -231,7 +231,7 @@ static void TileLoop_Clear(TileIndex tile)
/* If the tile is at any edge flood it to prevent maps without water. */ /* If the tile is at any edge flood it to prevent maps without water. */
if (_settings_game.construction.freeform_edges && DistanceFromEdge(tile) == 1) { if (_settings_game.construction.freeform_edges && DistanceFromEdge(tile) == 1) {
uint z; uint z;
Slope slope = GetTilePixelSlope(tile, &z); Slope slope = GetTileSlope(tile, &z);
if (z == 0 && slope == SLOPE_FLAT) { if (z == 0 && slope == SLOPE_FLAT) {
DoFloodTile(tile); DoFloodTile(tile);
MarkTileDirtyByTile(tile); MarkTileDirtyByTile(tile);

View File

@ -60,7 +60,7 @@ void CcBuildCanal(const CommandCost &result, TileIndex tile, uint32 p1, uint32 p
static TileIndex GetOtherAqueductEnd(TileIndex tile_from, TileIndex *tile_to = NULL) static TileIndex GetOtherAqueductEnd(TileIndex tile_from, TileIndex *tile_to = NULL)
{ {
uint z; 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 /* 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. * complains about the wrong slope instead of the ends not matching up.
@ -79,7 +79,7 @@ static TileIndex GetOtherAqueductEnd(TileIndex tile_from, TileIndex *tile_to = N
if (length > max_length) break; if (length > max_length) break;
if (GetTileMaxPixelZ(endtile) > z) { if (GetTileMaxZ(endtile) > z) {
if (tile_to != NULL) *tile_to = endtile; if (tile_to != NULL) *tile_to = endtile;
break; break;
} }

View File

@ -376,7 +376,7 @@ static void DrawCatenaryRailway(const TileInfo *ti)
foundation = GetBridgeFoundation(tileh[TS_NEIGHBOUR], DiagDirToAxis(GetTunnelBridgeDirection(neighbour))); 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. /* Half tile slopes coincide only with horizontal/vertical track.
* Faking a flat slope results in the correct sprites on positions. */ * Faking a flat slope results in the correct sprites on positions. */

View File

@ -1262,7 +1262,7 @@ static CommandCost CheckNewIndustry_Lumbermill(TileIndex tile)
*/ */
static CommandCost CheckNewIndustry_BubbleGen(TileIndex tile) 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_cmd_error(STR_ERROR_CAN_ONLY_BE_BUILT_IN_LOW_AREAS);
} }
return CommandCost(); return CommandCost();

View File

@ -221,7 +221,7 @@ public:
snprintf(tmp, lengthof(tmp), "0x%.4X", tile); snprintf(tmp, lengthof(tmp), "0x%.4X", tile);
SetDParam(0, TileX(tile)); SetDParam(0, TileX(tile));
SetDParam(1, TileY(tile)); SetDParam(1, TileY(tile));
SetDParam(2, GetTilePixelZ(tile) / TILE_HEIGHT); SetDParam(2, GetTileZ(tile));
SetDParamStr(3, tmp); SetDParamStr(3, tmp);
GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_LANDINFO_COORDS, lastof(this->landinfo_data[line_nr])); GetString(this->landinfo_data[line_nr], STR_LAND_AREA_INFORMATION_LANDINFO_COORDS, lastof(this->landinfo_data[line_nr]));
line_nr++; line_nr++;

View File

@ -48,7 +48,7 @@ static uint32 CanalGetVariable(const ResolverObject *object, byte variable, byte
switch (variable) { switch (variable) {
/* Height of tile */ /* Height of tile */
case 0x80: { case 0x80: {
uint z = GetTilePixelZ(tile) / TILE_HEIGHT; uint z = GetTileZ(tile);
/* Return consistent height within locks */ /* Return consistent height within locks */
if (IsTileType(tile, MP_WATER) && IsLock(tile) && GetLockPart(tile) == LOCK_PART_UPPER) z--; if (IsTileType(tile, MP_WATER) && IsLock(tile) && GetLockPart(tile) == LOCK_PART_UPPER) z--;
return z; return z;

View File

@ -676,7 +676,7 @@ bool FloodHalftile(TileIndex t)
} }
} else { } else {
/* Make shore on steep slopes and 'three-corners-raised'-slopes. */ /* 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)) { if (IsSteepSlope(tileh) || IsSlopeWithThreeCornersRaised(tileh)) {
flooded = true; flooded = true;
SetRailGroundType(t, RAIL_GROUND_WATER); SetRailGroundType(t, RAIL_GROUND_WATER);