(svn r15559) -Feature: Show required/already-delivered cargo needed for town-growth in town-view-window. (and only if it is really needed)

This commit is contained in:
frosch
2009-02-23 20:03:38 +00:00
parent 301dcb6dc4
commit b95fa2b7a3
4 changed files with 108 additions and 19 deletions

View File

@@ -539,11 +539,13 @@ bool IsSnowLineSet(void)
void SetSnowLine(byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS])
{
_snow_line = CallocT<SnowLine>(1);
_snow_line->lowest_value = 0xFF;
memcpy(_snow_line->table, table, sizeof(_snow_line->table));
for (uint i = 0; i < SNOW_LINE_MONTHS; i++) {
for (uint j = 0; j < SNOW_LINE_DAYS; j++) {
_snow_line->highest_value = max(_snow_line->highest_value, table[i][j]);
_snow_line->lowest_value = min(_snow_line->lowest_value, table[i][j]);
}
}
}
@@ -572,6 +574,16 @@ byte HighestSnowLine(void)
return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->highest_value;
}
/**
* Get the lowest possible snow line height, either variable or static.
* @return the lowest snow line height.
* @ingroup SnowLineGroup
*/
byte LowestSnowLine(void)
{
return _snow_line == NULL ? _settings_game.game_creation.snow_line : _snow_line->lowest_value;
}
/**
* Clear the variable snow line table and free the memory.
* @ingroup SnowLineGroup