(svn r20420) -Codechange: Add TileContext enum instead of using a bool.

This commit is contained in:
frosch
2010-08-09 07:10:42 +00:00
parent 811c7f6c25
commit b2ea8b196a
7 changed files with 28 additions and 20 deletions

View File

@@ -297,7 +297,7 @@ void IndustryTileOverrideManager::SetEntitySpec(const IndustryTileSpec *its)
* @return value corresponding to the grf expected format:
* Terrain type: 0 normal, 1 desert, 2 rainforest, 4 on or above snowline
*/
uint32 GetTerrainType(TileIndex tile, bool upper_halftile)
uint32 GetTerrainType(TileIndex tile, TileContext context)
{
switch (_settings_game.game_creation.landscape) {
case LT_TROPIC: return GetTropicZone(tile);
@@ -314,7 +314,7 @@ uint32 GetTerrainType(TileIndex tile, bool upper_halftile)
/* During map generation the snowstate may not be valid yet, as the tileloop may not have run yet. */
if (_generating_world) goto genworld; // we do not care about foundations here
RailGroundType ground = GetRailGroundType(tile);
has_snow = (ground == RAIL_GROUND_ICE_DESERT || (upper_halftile && ground == RAIL_GROUND_HALF_SNOW));
has_snow = (ground == RAIL_GROUND_ICE_DESERT || (context == TC_UPPER_HALFTILE && ground == RAIL_GROUND_HALF_SNOW));
break;
}