(svn r27009) -Add: extra level of general map heightness (ChillCore)

This commit is contained in:
rubidium 2014-10-13 14:22:48 +00:00
parent fcdbdd6043
commit 8d90e86c2c
5 changed files with 17 additions and 6 deletions

View File

@ -296,7 +296,7 @@ static DropDownList *BuildMapsizeDropDown()
return list;
}
static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, INVALID_STRING_ID};
static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, INVALID_STRING_ID};
static const StringID _sea_lakes[] = {STR_SEA_LEVEL_VERY_LOW, STR_SEA_LEVEL_LOW, STR_SEA_LEVEL_MEDIUM, STR_SEA_LEVEL_HIGH, STR_SEA_LEVEL_CUSTOM, INVALID_STRING_ID};
static const StringID _rivers[] = {STR_RIVERS_NONE, STR_RIVERS_FEW, STR_RIVERS_MODERATE, STR_RIVERS_LOT, INVALID_STRING_ID};
static const StringID _smoothness[] = {STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_SMOOTH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_ROUGH, STR_CONFIG_SETTING_ROUGHNESS_OF_TERRAIN_VERY_ROUGH, INVALID_STRING_ID};
@ -650,7 +650,8 @@ struct GenerateLandscapeWindow : public Window {
break;
case WID_GL_TERRAIN_PULLDOWN: // Terrain type
ShowDropDownMenu(this, _elevations, _settings_newgame.difficulty.terrain_type, WID_GL_TERRAIN_PULLDOWN, 0, 0);
/* For the original map generation only the first four are valid. */
ShowDropDownMenu(this, _elevations, _settings_newgame.difficulty.terrain_type, WID_GL_TERRAIN_PULLDOWN, 0, _settings_newgame.game_creation.land_generator == LG_ORIGINAL ? ~0xF : 0);
break;
case WID_GL_WATER_PULLDOWN: { // Water quantity
@ -723,7 +724,14 @@ struct GenerateLandscapeWindow : public Window {
case WID_GL_RIVER_PULLDOWN: _settings_newgame.game_creation.amount_of_rivers = index; break;
case WID_GL_SMOOTHNESS_PULLDOWN: _settings_newgame.game_creation.tgen_smoothness = index; break;
case WID_GL_VARIETY_PULLDOWN: _settings_newgame.game_creation.variety = index; break;
case WID_GL_LANDSCAPE_PULLDOWN: _settings_newgame.game_creation.land_generator = index; break;
case WID_GL_LANDSCAPE_PULLDOWN: _settings_newgame.game_creation.land_generator = index;
/* If original landgenerator is selected and alpinist terrain_type was selected, revert to mountainous. */
if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL) {
_settings_newgame.difficulty.terrain_type = Clamp(_settings_newgame.difficulty.terrain_type, 0, 3);
}
break;
case WID_GL_HEIGHTMAP_ROTATION_PULLDOWN: _settings_newgame.game_creation.heightmap_rotation = index; break;
case WID_GL_TOWN_PULLDOWN:

View File

@ -1273,7 +1273,8 @@ void GenerateLandscape(byte mode)
assert(_settings_game.difficulty.quantity_sea_lakes != CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY);
uint i = ScaleByMapSize(GB(r, 0, 7) + (3 - _settings_game.difficulty.quantity_sea_lakes) * 256 + 100);
for (; i != 0; --i) {
GenerateTerrain(_settings_game.difficulty.terrain_type, 0);
/* Make sure we do not overflow. */
GenerateTerrain(Clamp(_settings_game.difficulty.terrain_type, 0, 3), 0);
}
break;
}

View File

@ -1084,6 +1084,7 @@ STR_TERRAIN_TYPE_VERY_FLAT :Very Flat
STR_TERRAIN_TYPE_FLAT :Flat
STR_TERRAIN_TYPE_HILLY :Hilly
STR_TERRAIN_TYPE_MOUNTAINOUS :Mountainous
STR_TERRAIN_TYPE_ALPINIST :Alpinist
STR_CITY_APPROVAL_PERMISSIVE :Permissive
STR_CITY_APPROVAL_TOLERANT :Tolerant

View File

@ -255,7 +255,7 @@ from = 97
guiflags = SGF_MULTISTRING | SGF_NEWGAME_ONLY
def = 1
min = 0
max = 3
max = 4
interval = 1
str = STR_CONFIG_SETTING_TERRAIN_TYPE
strhelp = STR_CONFIG_SETTING_TERRAIN_TYPE_HELPTEXT

View File

@ -227,12 +227,13 @@ static height_t TGPGetMaxHeight()
* raised land 24 times in the center of the map) will leave only a ring of about 10 tiles
* around the mountain to build on. On a 4096x4096 map, it won't cover any major part of the map.
*/
static const int max_height[4][MAX_MAP_SIZE_BITS - MIN_MAP_SIZE_BITS + 1] = {
static const int max_height[5][MAX_MAP_SIZE_BITS - MIN_MAP_SIZE_BITS + 1] = {
/* 64 128 256 512 1024 2048 4096 */
{ 3, 3, 5, 5, 5, 5, 5 }, ///< Very flat
{ 4, 4, 6, 10, 10, 10, 10 }, ///< Flat
{ 6, 9, 15, 25, 31, 31, 31 }, ///< Hilly
{ 7, 12, 23, 42, 78, 85, 85 }, ///< Mountainous
{ 12, 21, 36, 73, 146, 170, 170 } ///< Alpinist
};
int max_height_from_table = max_height[_settings_game.difficulty.terrain_type][min(MapLogX(), MapLogY()) - MIN_MAP_SIZE_BITS];