Tile loop: Add snow line check fast path for tiles well above snow line
This commit is contained in:
@@ -204,9 +204,13 @@ static void UpdateFences(TileIndex tile)
|
|||||||
static void TileLoopClearAlps(TileIndex tile)
|
static void TileLoopClearAlps(TileIndex tile)
|
||||||
{
|
{
|
||||||
int k;
|
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 */
|
/* Fast path to avoid needing to check all 4 corners */
|
||||||
k = -1;
|
k = -1;
|
||||||
|
} else if (h >= GetSnowLine() + 4) {
|
||||||
|
/* Fast path to avoid needing to check all 4 corners */
|
||||||
|
k = 3;
|
||||||
} else {
|
} else {
|
||||||
k = GetTileZ(tile) - GetSnowLine() + 1;
|
k = GetTileZ(tile) - GetSnowLine() + 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user