Cache current value of snow line height

This commit is contained in:
Jonathan G Rennison
2021-02-21 22:02:58 +00:00
parent f595696e97
commit 2e20da40ed
6 changed files with 29 additions and 2 deletions

View File

@@ -28,11 +28,18 @@ struct SnowLine {
bool IsSnowLineSet();
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]);
byte GetSnowLine();
byte GetSnowLineUncached();
void UpdateCachedSnowLine();
byte HighestSnowLine();
byte LowestSnowLine();
void ClearSnowLine();
inline byte GetSnowLine()
{
extern byte _cached_snowline;
return _cached_snowline;
}
int GetSlopeZInCorner(Slope tileh, Corner corner);
Slope GetFoundationSlope(TileIndex tile, int *z = nullptr);