Snowline functions and data structures


Data Structures

struct  SnowLine
 Structure describing the height of the snow line each day of the year. More...

Functions

bool IsSnowLineSet (void)
 Has a snow line table already been loaded.
void SetSnowLine (byte table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS])
 Set a variable snow line, as loaded from a newgrf file.
byte GetSnowLine (void)
 Get the current snow line, either variable or static.
byte HighestSnowLine (void)
 Get the highest possible snow line height, either variable or static.
byte LowestSnowLine (void)
 Get the lowest possible snow line height, either variable or static.
void ClearSnowLine (void)
 Clear the variable snow line table and free the memory.

Variables

SnowLine_snow_line = NULL
 Description of the snow line throughout the year.

Function Documentation

byte GetSnowLine ( void   ) 

Get the current snow line, either variable or static.

Returns:
the snow line height.

Definition at line 558 of file landscape.cpp.

References _date, _settings_game, ConvertDateToYMD(), YearMonthDay::day, GameSettings::game_creation, YearMonthDay::month, GameCreationSettings::snow_line, and SnowLine::table.

Referenced by GetGlobalVariable(), GetTerrainType(), PlaceTreesRandomly(), and UpdateTownGrowRate().

byte HighestSnowLine ( void   ) 

Get the highest possible snow line height, either variable or static.

Returns:
the highest snow line height.

Definition at line 572 of file landscape.cpp.

References _settings_game, GameSettings::game_creation, SnowLine::highest_value, and GameCreationSettings::snow_line.

bool IsSnowLineSet ( void   ) 

Has a snow line table already been loaded.

Returns:
true if the table has been loaded already.

Definition at line 529 of file landscape.cpp.

byte LowestSnowLine ( void   ) 

Get the lowest possible snow line height, either variable or static.

Returns:
the lowest snow line height.

Definition at line 582 of file landscape.cpp.

References _settings_game, GameSettings::game_creation, SnowLine::lowest_value, and GameCreationSettings::snow_line.

void SetSnowLine ( byte  table[SNOW_LINE_MONTHS][SNOW_LINE_DAYS]  ) 

Set a variable snow line, as loaded from a newgrf file.

Parameters:
table the 12 * 32 byte table containing the snowline for each day

Definition at line 539 of file landscape.cpp.

References SnowLine::highest_value, SnowLine::lowest_value, max(), min(), SNOW_LINE_MONTHS, and SnowLine::table.


Variable Documentation

Description of the snow line throughout the year.

If it is NULL, a static snowline height is used, as set by _settings_game.game_creation.snow_line. Otherwise it points to a table loaded from a newGRF file, that describes the variable snowline

See also:
GetSnowLine() GameCreationSettings

Definition at line 71 of file landscape.cpp.


Generated on Mon May 11 15:48:23 2009 for OpenTTD by  doxygen 1.5.6