Cache highest snowline value

This commit is contained in:
Jonathan G Rennison
2022-04-29 17:10:18 +01:00
parent 0ec6f659c2
commit ed30542acf
5 changed files with 26 additions and 16 deletions

View File

@@ -30,8 +30,7 @@ bool IsSnowLineSet();
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]);
byte GetSnowLineUncached();
void UpdateCachedSnowLine();
byte HighestSnowLine();
byte LowestSnowLine();
void UpdateCachedSnowLineBounds();
void ClearSnowLine();
inline byte GetSnowLine()
@@ -40,6 +39,18 @@ inline byte GetSnowLine()
return _cached_snowline;
}
inline byte HighestSnowLine()
{
extern byte _cached_highest_snowline;
return _cached_highest_snowline;
}
inline byte LowestSnowLine()
{
extern byte _cached_lowest_snowline;
return _cached_lowest_snowline;
}
int GetSlopeZInCorner(Slope tileh, Corner corner);
Slope GetFoundationSlope(TileIndex tile, int *z = nullptr);