Tile loop: Add snow line check fast path for tiles well above snow line

pull/393/head
Jonathan G Rennison 2 years ago
parent d71e38446e
commit 7207c9330c

@ -204,9 +204,13 @@ static void UpdateFences(TileIndex tile)
static void TileLoopClearAlps(TileIndex tile)
{
int k;
if ((int)TileHeight(tile) < GetSnowLine() - 1) {
int h = (int)TileHeight(tile);
if (h < GetSnowLine() - 1) {
/* Fast path to avoid needing to check all 4 corners */
k = -1;
} else if (h >= GetSnowLine() + 4) {
/* Fast path to avoid needing to check all 4 corners */
k = 3;
} else {
k = GetTileZ(tile) - GetSnowLine() + 1;
}

Loading…
Cancel
Save