summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-04 10:29:26 +0000
committerrubidium <rubidium@openttd.org>2011-11-04 10:29:26 +0000
commit0b6dbaf6645644be09d101b15806a13479610fda (patch)
treeeca1ddbfbeed9bc2832cb41cbad553832217b7b7 /src/landscape.cpp
parentf0f17a77bad81ae15de70b4a5bca131561affe05 (diff)
downloadopenttd-0b6dbaf6645644be09d101b15806a13479610fda.tar.xz
(svn r23099) -Codechange: remove pointless multiplications by TILE_HEIGHT for the water/river code
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index f310f39d4..d0562e3aa 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -927,7 +927,7 @@ static void CreateDesertOrRainForest()
static bool FindSpring(TileIndex tile, void *user_data)
{
uint referenceHeight;
- Slope s = GetTilePixelSlope(tile, &referenceHeight);
+ Slope s = GetTileSlope(tile, &referenceHeight);
if (s != SLOPE_FLAT || IsWaterTile(tile)) return false;
/* In the tropics rivers start in the rainforest. */
@@ -938,7 +938,7 @@ static bool FindSpring(TileIndex tile, void *user_data)
for (int dx = -1; dx <= 1; dx++) {
for (int dy = -1; dy <= 1; dy++) {
TileIndex t = TileAddWrap(tile, dx, dy);
- if (t != INVALID_TILE && GetTileMaxPixelZ(t) > referenceHeight) num++;
+ if (t != INVALID_TILE && GetTileMaxZ(t) > referenceHeight) num++;
}
}
@@ -948,7 +948,7 @@ static bool FindSpring(TileIndex tile, void *user_data)
for (int dx = -16; dx <= 16; dx++) {
for (int dy = -16; dy <= 16; dy++) {
TileIndex t = TileAddWrap(tile, dx, dy);
- if (t != INVALID_TILE && GetTileMaxPixelZ(t) > referenceHeight + 2 * TILE_HEIGHT) return false;
+ if (t != INVALID_TILE && GetTileMaxZ(t) > referenceHeight + 2) return false;
}
}
@@ -990,8 +990,8 @@ static bool FlowsDown(TileIndex begin, TileIndex end)
uint heightBegin;
uint heightEnd;
- Slope slopeBegin = GetTilePixelSlope(begin, &heightBegin);
- Slope slopeEnd = GetTilePixelSlope(end, &heightEnd);
+ Slope slopeBegin = GetTileSlope(begin, &heightBegin);
+ Slope slopeEnd = GetTileSlope(end, &heightEnd);
return heightEnd <= heightBegin &&
/* Slope either is inclined or flat; rivers don't support other slopes. */