Changeset - r25081:abb147cb8bdd
[Not reviewed]
master
0 8 0
Patric Stout - 4 years ago 2021-03-24 19:51:41
truebrain@openttd.org
Add: allow setting the highest mountain for heightmaps

It will add some slack to the map height limit if that was set
to auto.
8 files changed with 75 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/genworld.cpp
Show inline comments
 
@@ -282,24 +282,26 @@ void GenerateWorld(GenWorldMode mode, ui
 

	
 
	/* This disables some commands and stuff */
 
	SetLocalCompany(COMPANY_SPECTATOR);
 

	
 
	InitializeGame(_gw.size_x, _gw.size_y, true, reset_settings);
 
	PrepareGenerateWorldProgress();
 

	
 
	if (_settings_game.construction.map_height_limit == 0) {
 
		uint estimated_height = 0;
 

	
 
		if (_gw.mode == GWM_EMPTY && _game_mode != GM_MENU) {
 
			estimated_height = _settings_game.game_creation.se_flat_world_height;
 
		} else if (_gw.mode == GWM_HEIGHTMAP) {
 
			estimated_height = _settings_game.game_creation.heightmap_height;
 
		} else if (_settings_game.game_creation.land_generator == LG_TERRAGENESIS) {
 
			estimated_height = GetEstimationTGPMapHeight();
 
		} else {
 
			estimated_height = 0;
 
		}
 

	
 
		_settings_game.construction.map_height_limit = std::max(MAP_HEIGHT_LIMIT_AUTO_MINIMUM, std::min(MAX_MAP_HEIGHT_LIMIT, estimated_height + MAP_HEIGHT_LIMIT_AUTO_CEILING_ROOM));
 
	}
 

	
 
	/* Load the right landscape stuff, and the NewGRFs! */
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
src/genworld_gui.cpp
Show inline comments
 
@@ -231,32 +231,38 @@ static const NWidgetPart _nested_heightm
 
							NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_MAPSIZE_X_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetFill(1, 0),
 
							NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_BY, STR_NULL), SetPadding(1, 0, 0, 0), SetFill(1, 1),
 
							NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_MAPSIZE_Y_PULLDOWN), SetDataTip(STR_JUST_INT, STR_NULL), SetFill(1, 0),
 
						EndContainer(),
 
						NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
 
						NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_TOWN_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
 
						NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_INDUSTRY_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
 
						NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_RIVER_PULLDOWN), SetDataTip(STR_JUST_STRING, STR_NULL), SetFill(1, 0),
 
					EndContainer(),
 
					NWidget(NWID_VERTICAL), SetPIP(0, 4, 0),
 
						NWidget(NWID_HORIZONTAL), SetPIP(0, 3, 0),
 
							NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(0, 4, 0),
 
								NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_HEIGHTMAP_HEIGHT, STR_NULL), SetFill(1, 1),
 
								NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_LABEL),
 
									NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_SNOW_COVERAGE, STR_NULL), SetFill(1, 1),
 
									NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_DESERT_COVERAGE, STR_NULL), SetFill(1, 1),
 
								EndContainer(),
 
								NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_MAPGEN_DATE, STR_NULL), SetFill(1, 1),
 
								NWidget(WWT_TEXT, COLOUR_ORANGE), SetDataTip(STR_GAME_OPTIONS_TOWN_NAMES_FRAME, STR_NULL), SetFill(1, 1),
 
							EndContainer(),
 
							NWidget(NWID_VERTICAL, NC_EQUALSIZE), SetPIP(0, 4, 0),
 
								NWidget(NWID_HORIZONTAL),
 
									NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_HEIGHT_DOWN), SetDataTip(SPR_ARROW_DOWN, STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN), SetFill(0, 1),
 
									NWidget(WWT_TEXTBTN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_HEIGHT_TEXT), SetDataTip(STR_BLACK_INT, STR_NULL), SetFill(1, 0),
 
									NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_HEIGHTMAP_HEIGHT_UP), SetDataTip(SPR_ARROW_UP, STR_MAPGEN_HEIGHTMAP_HEIGHT_UP), SetFill(0, 1),
 
								EndContainer(),
 
								NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_SELECTOR),
 
									NWidget(NWID_HORIZONTAL),
 
										NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_DOWN), SetDataTip(SPR_ARROW_DOWN, STR_MAPGEN_SNOW_COVERAGE_DOWN), SetFill(0, 1),
 
										NWidget(WWT_TEXTBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_TEXT), SetDataTip(STR_MAPGEN_SNOW_COVERAGE_TEXT, STR_NULL), SetFill(1, 0),
 
										NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_UP), SetDataTip(SPR_ARROW_UP, STR_MAPGEN_SNOW_COVERAGE_UP), SetFill(0, 1),
 
									EndContainer(),
 
									NWidget(NWID_HORIZONTAL),
 
										NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_DESERT_COVERAGE_DOWN), SetDataTip(SPR_ARROW_DOWN, STR_MAPGEN_DESERT_COVERAGE_DOWN), SetFill(0, 1),
 
										NWidget(WWT_TEXTBTN, COLOUR_ORANGE, WID_GL_DESERT_COVERAGE_TEXT), SetDataTip(STR_MAPGEN_DESERT_COVERAGE_TEXT, STR_NULL), SetFill(1, 0),
 
										NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_DESERT_COVERAGE_UP), SetDataTip(SPR_ARROW_UP, STR_MAPGEN_DESERT_COVERAGE_UP), SetFill(0, 1),
 
									EndContainer(),
 
								EndContainer(),
 
@@ -363,34 +369,38 @@ struct GenerateLandscapeWindow : public 
 
	GenerateLandscapeWindow(WindowDesc *desc, WindowNumber number = 0) : Window(desc)
 
	{
 
		this->InitNested(number);
 

	
 
		this->LowerWidget(_settings_newgame.game_creation.landscape + WID_GL_TEMPERATE);
 

	
 
		this->mode = (GenerateLandscapeWindowMode)this->window_number;
 

	
 
		/* Disable town and industry in SE */
 
		this->SetWidgetDisabledState(WID_GL_TOWN_PULLDOWN,     _game_mode == GM_EDITOR);
 
		this->SetWidgetDisabledState(WID_GL_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR);
 

	
 
		/* In case the map_height_limit is changed, clamp heightmap_height. */
 
		_settings_newgame.game_creation.heightmap_height = Clamp(_settings_newgame.game_creation.heightmap_height, MIN_HEIGHTMAP_HEIGHT, GetMapHeightLimit());
 

	
 
		this->OnInvalidateData();
 
	}
 

	
 

	
 
	void SetStringParameters(int widget) const override
 
	{
 
		switch (widget) {
 
			case WID_GL_START_DATE_TEXT:      SetDParam(0, ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); break;
 
			case WID_GL_MAPSIZE_X_PULLDOWN:   SetDParam(0, 1LL << _settings_newgame.game_creation.map_x); break;
 
			case WID_GL_MAPSIZE_Y_PULLDOWN:   SetDParam(0, 1LL << _settings_newgame.game_creation.map_y); break;
 
			case WID_GL_HEIGHTMAP_HEIGHT_TEXT: SetDParam(0, _settings_newgame.game_creation.heightmap_height); break;
 
			case WID_GL_SNOW_COVERAGE_TEXT:   SetDParam(0, _settings_newgame.game_creation.snow_coverage); break;
 
			case WID_GL_DESERT_COVERAGE_TEXT: SetDParam(0, _settings_newgame.game_creation.desert_coverage); break;
 

	
 
			case WID_GL_TOWN_PULLDOWN:
 
				if (_game_mode == GM_EDITOR) {
 
					SetDParam(0, STR_CONFIG_SETTING_OFF);
 
				} else if (_settings_newgame.difficulty.number_towns == CUSTOM_TOWN_NUMBER_DIFFICULTY) {
 
					SetDParam(0, STR_NUM_CUSTOM_NUMBER);
 
					SetDParam(1, _settings_newgame.game_creation.custom_town_number);
 
				} else {
 
					SetDParam(0, _num_towns[_settings_newgame.difficulty.number_towns]);
 
				}
 
@@ -481,43 +491,52 @@ struct GenerateLandscapeWindow : public 
 
		/* Set snow/rainforest selections */
 
		int climate_plane = 0;
 
		switch (_settings_newgame.game_creation.landscape) {
 
			case LT_TEMPERATE: climate_plane = SZSP_VERTICAL; break;
 
			case LT_ARCTIC:    climate_plane = 0;             break;
 
			case LT_TROPIC:    climate_plane = 1;             break;
 
			case LT_TOYLAND:   climate_plane = SZSP_VERTICAL; break;
 
		}
 
		this->GetWidget<NWidgetStacked>(WID_GL_CLIMATE_SEL_LABEL)->SetDisplayedPlane(climate_plane);
 
		this->GetWidget<NWidgetStacked>(WID_GL_CLIMATE_SEL_SELECTOR)->SetDisplayedPlane(climate_plane);
 

	
 
		/* Update availability of decreasing / increasing start date and snow level */
 
		if (mode == GLWM_HEIGHTMAP) {
 
			this->SetWidgetDisabledState(WID_GL_HEIGHTMAP_HEIGHT_DOWN, _settings_newgame.game_creation.heightmap_height <= MIN_HEIGHTMAP_HEIGHT);
 
			this->SetWidgetDisabledState(WID_GL_HEIGHTMAP_HEIGHT_UP, _settings_newgame.game_creation.heightmap_height >= GetMapHeightLimit());
 
		}
 
		this->SetWidgetDisabledState(WID_GL_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR);
 
		this->SetWidgetDisabledState(WID_GL_START_DATE_UP,   _settings_newgame.game_creation.starting_year >= MAX_YEAR);
 
		this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_DOWN, _settings_newgame.game_creation.snow_coverage <= 0 || _settings_newgame.game_creation.landscape != LT_ARCTIC);
 
		this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_UP,   _settings_newgame.game_creation.snow_coverage >= 100 || _settings_newgame.game_creation.landscape != LT_ARCTIC);
 
		this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_DOWN, _settings_newgame.game_creation.desert_coverage <= 0 || _settings_newgame.game_creation.landscape != LT_TROPIC);
 
		this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_UP,   _settings_newgame.game_creation.desert_coverage >= 100 || _settings_newgame.game_creation.landscape != LT_TROPIC);
 

	
 
		/* Do not allow a custom sea level with the original land generator. */
 
		if (_settings_newgame.game_creation.land_generator == LG_ORIGINAL &&
 
				_settings_newgame.difficulty.quantity_sea_lakes == CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY) {
 
			_settings_newgame.difficulty.quantity_sea_lakes = CUSTOM_SEA_LEVEL_MIN_PERCENTAGE;
 
		}
 

	
 
	}
 

	
 
	void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override
 
	{
 
		const StringID *strs = nullptr;
 
		switch (widget) {
 
			case WID_GL_HEIGHTMAP_HEIGHT_TEXT:
 
				SetDParam(0, MAX_TILE_HEIGHT);
 
				*size = GetStringBoundingBox(STR_JUST_INT);
 
				break;
 

	
 
			case WID_GL_START_DATE_TEXT:
 
				SetDParam(0, ConvertYMDToDate(MAX_YEAR, 0, 1));
 
				*size = maxdim(*size, GetStringBoundingBox(STR_BLACK_DATE_LONG));
 
				break;
 

	
 
			case WID_GL_MAPSIZE_X_PULLDOWN:
 
			case WID_GL_MAPSIZE_Y_PULLDOWN:
 
				SetDParamMaxValue(0, MAX_MAP_SIZE);
 
				*size = maxdim(*size, GetStringBoundingBox(STR_JUST_INT));
 
				break;
 

	
 
			case WID_GL_SNOW_COVERAGE_TEXT:
 
@@ -640,24 +659,43 @@ struct GenerateLandscapeWindow : public 
 
						map_y / 2 > (1U << _settings_newgame.game_creation.map_y))) {
 
					ShowQuery(
 
						STR_WARNING_HEIGHTMAP_SCALE_CAPTION,
 
						STR_WARNING_HEIGHTMAP_SCALE_MESSAGE,
 
						this,
 
						LandscapeGenerationCallback);
 
				} else {
 
					StartGeneratingLandscape(mode);
 
				}
 
				break;
 
			}
 

	
 
			case WID_GL_HEIGHTMAP_HEIGHT_DOWN:
 
			case WID_GL_HEIGHTMAP_HEIGHT_UP: // Height level buttons
 
				/* Don't allow too fast scrolling */
 
				if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
 
					this->HandleButtonClick(widget);
 

	
 
					_settings_newgame.game_creation.heightmap_height = Clamp(_settings_newgame.game_creation.heightmap_height + widget - WID_GL_HEIGHTMAP_HEIGHT_TEXT, MIN_HEIGHTMAP_HEIGHT, GetMapHeightLimit());
 
					this->InvalidateData();
 
				}
 
				_left_button_clicked = false;
 
				break;
 

	
 
			case WID_GL_HEIGHTMAP_HEIGHT_TEXT: // Height level text
 
				this->widget_id = WID_GL_HEIGHTMAP_HEIGHT_TEXT;
 
				SetDParam(0, _settings_newgame.game_creation.heightmap_height);
 
				ShowQueryString(STR_JUST_INT, STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT, 4, this, CS_NUMERAL, QSF_ENABLE_DEFAULT);
 
				break;
 

	
 

	
 
			case WID_GL_START_DATE_DOWN:
 
			case WID_GL_START_DATE_UP: // Year buttons
 
				/* Don't allow too fast scrolling */
 
				if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
 
					this->HandleButtonClick(widget);
 

	
 
					_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - WID_GL_START_DATE_TEXT, MIN_YEAR, MAX_YEAR);
 
					this->InvalidateData();
 
				}
 
				_left_button_clicked = false;
 
				break;
 

	
 
@@ -759,26 +797,30 @@ struct GenerateLandscapeWindow : public 
 
				this->InvalidateData();
 
				break;
 

	
 
			case WID_GL_BORDERS_RANDOM:
 
				_settings_newgame.game_creation.water_borders = (_settings_newgame.game_creation.water_borders == BORDERS_RANDOM) ? 0 : BORDERS_RANDOM;
 
				this->InvalidateData();
 
				break;
 
		}
 
	}
 

	
 
	void OnTimeout() override
 
	{
 
		static const int raise_widgets[] = {WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_SNOW_COVERAGE_UP, WID_GL_SNOW_COVERAGE_DOWN, WID_GL_DESERT_COVERAGE_UP, WID_GL_DESERT_COVERAGE_DOWN, WIDGET_LIST_END};
 
		for (const int *widget = raise_widgets; *widget != WIDGET_LIST_END; widget++) {
 
		static const int newgame_raise_widgets[] = {WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_SNOW_COVERAGE_UP, WID_GL_SNOW_COVERAGE_DOWN, WID_GL_DESERT_COVERAGE_UP, WID_GL_DESERT_COVERAGE_DOWN, WIDGET_LIST_END};
 
		static const int heightmap_raise_widgets[] = {WID_GL_HEIGHTMAP_HEIGHT_DOWN, WID_GL_HEIGHTMAP_HEIGHT_UP, WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_SNOW_COVERAGE_UP, WID_GL_SNOW_COVERAGE_DOWN, WID_GL_DESERT_COVERAGE_UP, WID_GL_DESERT_COVERAGE_DOWN, WIDGET_LIST_END};
 

	
 
		const int *widget = (mode == GLWM_HEIGHTMAP) ? heightmap_raise_widgets : newgame_raise_widgets;
 

	
 
		for (; *widget != WIDGET_LIST_END; widget++) {
 
			if (this->IsWidgetLowered(*widget)) {
 
				this->RaiseWidget(*widget);
 
				this->SetWidgetDirty(*widget);
 
			}
 
		}
 
	}
 

	
 
	void OnDropdownSelect(int widget, int index) override
 
	{
 
		switch (widget) {
 
			case WID_GL_MAPSIZE_X_PULLDOWN:     _settings_newgame.game_creation.map_x = index; break;
 
			case WID_GL_MAPSIZE_Y_PULLDOWN:     _settings_newgame.game_creation.map_y = index; break;
 
@@ -829,34 +871,40 @@ struct GenerateLandscapeWindow : public 
 

	
 
	void OnQueryTextFinished(char *str) override
 
	{
 
		/* Was 'cancel' pressed? */
 
		if (str == nullptr) return;
 

	
 
		int32 value;
 
		if (!StrEmpty(str)) {
 
			value = atoi(str);
 
		} else {
 
			/* An empty string means revert to the default */
 
			switch (this->widget_id) {
 
				case WID_GL_HEIGHTMAP_HEIGHT_TEXT: value = MAP_HEIGHT_LIMIT_AUTO_MINIMUM; break;
 
				case WID_GL_START_DATE_TEXT: value = DEF_START_YEAR; break;
 
				case WID_GL_SNOW_COVERAGE_TEXT: value = DEF_SNOW_COVERAGE; break;
 
				case WID_GL_DESERT_COVERAGE_TEXT: value = DEF_DESERT_COVERAGE; break;
 
				case WID_GL_TOWN_PULLDOWN: value = 1; break;
 
				case WID_GL_WATER_PULLDOWN: value = CUSTOM_SEA_LEVEL_MIN_PERCENTAGE; break;
 
				default: NOT_REACHED();
 
			}
 
		}
 

	
 
		switch (this->widget_id) {
 
			case WID_GL_HEIGHTMAP_HEIGHT_TEXT:
 
				this->SetWidgetDirty(WID_GL_HEIGHTMAP_HEIGHT_TEXT);
 
				_settings_newgame.game_creation.heightmap_height = Clamp(value, MIN_HEIGHTMAP_HEIGHT, GetMapHeightLimit());
 
				break;
 

	
 
			case WID_GL_START_DATE_TEXT:
 
				this->SetWidgetDirty(WID_GL_START_DATE_TEXT);
 
				_settings_newgame.game_creation.starting_year = Clamp(value, MIN_YEAR, MAX_YEAR);
 
				break;
 

	
 
			case WID_GL_SNOW_COVERAGE_TEXT:
 
				this->SetWidgetDirty(WID_GL_SNOW_COVERAGE_TEXT);
 
				_settings_newgame.game_creation.snow_coverage = Clamp(value, 0, 100);
 
				break;
 

	
 
			case WID_GL_DESERT_COVERAGE_TEXT:
 
				this->SetWidgetDirty(WID_GL_DESERT_COVERAGE_TEXT);
src/heightmap.cpp
Show inline comments
 
@@ -359,25 +359,25 @@ static void GrayscaleToMapHeights(uint i
 
						break;
 
				}
 

	
 
				assert(img_row < img_height);
 
				assert(img_col < img_width);
 

	
 
				uint heightmap_height = map[img_row * img_width + img_col];
 

	
 
				if (heightmap_height > 0) {
 
					/* 0 is sea level.
 
					 * Other grey scales are scaled evenly to the available height levels > 0.
 
					 * (The coastline is independent from the number of height levels) */
 
					heightmap_height = 1 + (heightmap_height - 1) * _settings_game.construction.map_height_limit / 255;
 
					heightmap_height = 1 + (heightmap_height - 1) * _settings_game.game_creation.heightmap_height / 255;
 
				}
 

	
 
				SetTileHeight(tile, heightmap_height);
 
			}
 
			/* Only clear the tiles within the map area. */
 
			if (IsInnerTile(tile)) {
 
				MakeClear(tile, CLEAR_GRASS, 3);
 
			}
 
		}
 
	}
 
}
 

	
src/lang/english.txt
Show inline comments
 
@@ -2891,24 +2891,27 @@ STR_SAVELOAD_DIRECTORY                  
 
STR_SAVELOAD_PARENT_DIRECTORY                                   :{RAW_STRING} (Parent directory)
 

	
 
STR_SAVELOAD_OSKTITLE                                           :{BLACK}Enter a name for the savegame
 

	
 
# World generation
 
STR_MAPGEN_WORLD_GENERATION_CAPTION                             :{WHITE}World Generation
 
STR_MAPGEN_MAPSIZE                                              :{BLACK}Map size:
 
STR_MAPGEN_MAPSIZE_TOOLTIP                                      :{BLACK}Select the size of the map in tiles. The number of available tiles will be slightly smaller
 
STR_MAPGEN_BY                                                   :{BLACK}*
 
STR_MAPGEN_NUMBER_OF_TOWNS                                      :{BLACK}No. of towns:
 
STR_MAPGEN_DATE                                                 :{BLACK}Date:
 
STR_MAPGEN_NUMBER_OF_INDUSTRIES                                 :{BLACK}No. of industries:
 
STR_MAPGEN_HEIGHTMAP_HEIGHT                                     :{BLACK}Highest peak:
 
STR_MAPGEN_HEIGHTMAP_HEIGHT_UP                                  :{BLACK}Increase the maximum height of highest peak on the map by one
 
STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN                                :{BLACK}Decrease the maximum height of highest peak on the map by one
 
STR_MAPGEN_SNOW_COVERAGE                                        :{BLACK}Snow coverage:
 
STR_MAPGEN_SNOW_COVERAGE_UP                                     :{BLACK}Increase snow coverage by ten percent
 
STR_MAPGEN_SNOW_COVERAGE_DOWN                                   :{BLACK}Decrease snow coverage by ten percent
 
STR_MAPGEN_SNOW_COVERAGE_TEXT                                   :{BLACK}{NUM}%
 
STR_MAPGEN_DESERT_COVERAGE                                      :{BLACK}Desert coverage:
 
STR_MAPGEN_DESERT_COVERAGE_UP                                   :{BLACK}Increase desert coverage by ten percent
 
STR_MAPGEN_DESERT_COVERAGE_DOWN                                 :{BLACK}Decrease desert coverage by ten percent
 
STR_MAPGEN_DESERT_COVERAGE_TEXT                                 :{BLACK}{NUM}%
 
STR_MAPGEN_LAND_GENERATOR                                       :{BLACK}Land generator:
 
STR_MAPGEN_TERRAIN_TYPE                                         :{BLACK}Terrain type:
 
STR_MAPGEN_QUANTITY_OF_SEA_LAKES                                :{BLACK}Sea level:
 
STR_MAPGEN_QUANTITY_OF_RIVERS                                   :{BLACK}Rivers:
 
@@ -2924,25 +2927,25 @@ STR_MAPGEN_SOUTHEAST                    
 
STR_MAPGEN_SOUTHWEST                                            :{BLACK}Southwest
 
STR_MAPGEN_BORDER_FREEFORM                                      :{BLACK}Freeform
 
STR_MAPGEN_BORDER_WATER                                         :{BLACK}Water
 
STR_MAPGEN_BORDER_RANDOM                                        :{BLACK}Random
 
STR_MAPGEN_BORDER_RANDOMIZE                                     :{BLACK}Random
 
STR_MAPGEN_BORDER_MANUAL                                        :{BLACK}Manual
 

	
 
STR_MAPGEN_HEIGHTMAP_ROTATION                                   :{BLACK}Heightmap rotation:
 
STR_MAPGEN_HEIGHTMAP_NAME                                       :{BLACK}Heightmap name:
 
STR_MAPGEN_HEIGHTMAP_SIZE_LABEL                                 :{BLACK}Size:
 
STR_MAPGEN_HEIGHTMAP_SIZE                                       :{ORANGE}{NUM} x {NUM}
 

	
 
STR_MAPGEN_MAX_HEIGHTLEVEL_QUERY_CAPT                           :{WHITE}Change maximum map height
 
STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT                          :{WHITE}Highest peak
 
STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT                             :{WHITE}Snow coverage (in %)
 
STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT                           :{WHITE}Desert coverage (in %)
 
STR_MAPGEN_START_DATE_QUERY_CAPT                                :{WHITE}Change starting year
 

	
 
# SE Map generation
 
STR_SE_MAPGEN_CAPTION                                           :{WHITE}Scenario Type
 
STR_SE_MAPGEN_FLAT_WORLD                                        :{WHITE}Flat land
 
STR_SE_MAPGEN_FLAT_WORLD_TOOLTIP                                :{BLACK}Generate a flat land
 
STR_SE_MAPGEN_RANDOM_LAND                                       :{WHITE}Random land
 
STR_SE_MAPGEN_FLAT_WORLD_HEIGHT                                 :{BLACK}Height of flat land:
 
STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_DOWN                            :{BLACK}Move the height of flat land one down
 
STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_UP                              :{BLACK}Move the height of flat land one up
src/settings_type.h
Show inline comments
 
@@ -290,24 +290,25 @@ struct NetworkSettings {
 
/** Settings related to the creation of games. */
 
struct GameCreationSettings {
 
	uint32 generation_seed;                  ///< noise seed for world generation
 
	Year   starting_year;                    ///< starting date
 
	Year   ending_year;                      ///< scoring end date
 
	uint8  map_x;                            ///< X size of map
 
	uint8  map_y;                            ///< Y size of map
 
	byte   land_generator;                   ///< the landscape generator
 
	byte   oil_refinery_limit;               ///< distance oil refineries allowed from map edge
 
	byte   snow_line_height;                 ///< the configured snow line height (deduced from "snow_coverage")
 
	byte   snow_coverage;                    ///< the amount of snow coverage on the map
 
	byte   desert_coverage;                  ///< the amount of desert coverage on the map
 
	byte   heightmap_height;                 ///< highest mountain for heightmap (towards what it scales)
 
	byte   tgen_smoothness;                  ///< how rough is the terrain from 0-3
 
	byte   tree_placer;                      ///< the tree placer algorithm
 
	byte   heightmap_rotation;               ///< rotation director for the heightmap
 
	byte   se_flat_world_height;             ///< land height a flat world gets in SE
 
	byte   town_name;                        ///< the town name generator used for town names
 
	byte   landscape;                        ///< the landscape we're currently in
 
	byte   water_borders;                    ///< bitset of the borders that are water
 
	uint16 custom_town_number;               ///< manually entered number of towns
 
	byte   variety;                          ///< variety level applied to TGP
 
	byte   custom_sea_level;                 ///< manually entered percentage of water in the map
 
	byte   min_river_length;                 ///< the minimum river length
 
	byte   river_route_random;               ///< the amount of randomicity for the route finding
src/table/settings.ini
Show inline comments
 
@@ -396,24 +396,35 @@ type     = SLE_UINT8
 
from     = SLV_194
 
guiflags = SGF_NEWGAME_ONLY | SGF_SCENEDIT_TOO | SGF_0ISDISABLED
 
def      = 0
 
min      = MIN_MAP_HEIGHT_LIMIT
 
max      = MAX_MAP_HEIGHT_LIMIT
 
interval = 1
 
str      = STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT
 
strhelp  = STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_HELPTEXT
 
strval   = STR_CONFIG_SETTING_MAP_HEIGHT_LIMIT_VALUE
 
proc     = ChangeMaxHeightLevel
 
cat      = SC_ADVANCED
 

	
 
[SDT_VAR]
 
base     = GameSettings
 
var      = game_creation.heightmap_height
 
type     = SLE_UINT8
 
flags    = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
 
guiflags = SGF_NEWGAME_ONLY
 
def      = MAP_HEIGHT_LIMIT_AUTO_MINIMUM
 
min      = MIN_HEIGHTMAP_HEIGHT
 
max      = MAX_MAP_HEIGHT_LIMIT
 
interval = 1
 

	
 
[SDT_BOOL]
 
base     = GameSettings
 
var      = construction.build_on_slopes
 
guiflags = SGF_NO_NETWORK
 
def      = true
 
cat      = SC_EXPERT
 

	
 
[SDT_VAR]
 
base     = GameSettings
 
var      = construction.command_pause_level
 
type     = SLE_UINT8
 
from     = SLV_154
src/tile_type.h
Show inline comments
 
@@ -12,24 +12,26 @@
 

	
 
static const uint TILE_SIZE           = 16;                    ///< Tile size in world coordinates.
 
static const uint TILE_UNIT_MASK      = TILE_SIZE - 1;         ///< For masking in/out the inner-tile world coordinate units.
 
static const uint TILE_PIXELS         = 32;                    ///< Pixel distance between tile columns/rows in #ZOOM_LVL_BASE.
 
static const uint TILE_HEIGHT         =  8;                    ///< Height of a height level in world coordinate AND in pixels in #ZOOM_LVL_BASE.
 

	
 
static const uint MAX_BUILDING_PIXELS = 200;                   ///< Maximum height of a building in pixels in #ZOOM_LVL_BASE. (Also applies to "bridge buildings" on the bridge floor.)
 
static const int MAX_VEHICLE_PIXEL_X  = 192;                   ///< Maximum width of a vehicle in pixels in #ZOOM_LVL_BASE.
 
static const int MAX_VEHICLE_PIXEL_Y  = 96;                    ///< Maximum height of a vehicle in pixels in #ZOOM_LVL_BASE.
 

	
 
static const uint MAX_TILE_HEIGHT     = 255;                   ///< Maximum allowed tile height
 

	
 
static const uint MIN_HEIGHTMAP_HEIGHT = 1;                    ///< Lowest possible peak value for heightmap creation
 

	
 
static const uint MIN_MAP_HEIGHT_LIMIT = 15;                   ///< Lower bound of maximum allowed heightlevel (in the construction settings)
 
static const uint MAX_MAP_HEIGHT_LIMIT = MAX_TILE_HEIGHT;      ///< Upper bound of maximum allowed heightlevel (in the construction settings)
 

	
 
static const uint MIN_SNOWLINE_HEIGHT = 2;                     ///< Minimum snowline height
 
static const uint DEF_SNOWLINE_HEIGHT = 10;                    ///< Default snowline height
 
static const uint MAX_SNOWLINE_HEIGHT = (MAX_TILE_HEIGHT - 2); ///< Maximum allowed snowline height
 

	
 
static const uint DEF_SNOW_COVERAGE = 40;                      ///< Default snow coverage.
 
static const uint DEF_DESERT_COVERAGE = 50;                    ///< Default desert coverage.
 

	
 

	
 
/**
src/widgets/genworld_widget.h
Show inline comments
 
@@ -17,24 +17,28 @@ enum GenerateLandscapeWidgets {
 
	WID_GL_TROPICAL,                    ///< Button with icon "Tropical".
 
	WID_GL_TOYLAND,                     ///< Button with icon "Toyland".
 

	
 
	WID_GL_MAPSIZE_X_PULLDOWN,          ///< Dropdown 'map X size'.
 
	WID_GL_MAPSIZE_Y_PULLDOWN,          ///< Dropdown 'map Y size'.
 

	
 
	WID_GL_TOWN_PULLDOWN,               ///< Dropdown 'No. of towns'.
 
	WID_GL_TOWNNAME_DROPDOWN,           ///< Dropdown 'Townnames'.
 
	WID_GL_INDUSTRY_PULLDOWN,           ///< Dropdown 'No. of industries'.
 

	
 
	WID_GL_GENERATE_BUTTON,             ///< 'Generate' button.
 

	
 
	WID_GL_HEIGHTMAP_HEIGHT_DOWN,       ///< Decrease heightmap highest mountain
 
	WID_GL_HEIGHTMAP_HEIGHT_TEXT,       ///< Max. heightmap highest mountain
 
	WID_GL_HEIGHTMAP_HEIGHT_UP,         ///< Increase max. heightmap highest mountain
 

	
 
	WID_GL_START_DATE_DOWN,             ///< Decrease start year.
 
	WID_GL_START_DATE_TEXT,             ///< Start year.
 
	WID_GL_START_DATE_UP,               ///< Increase start year.
 

	
 
	WID_GL_SNOW_COVERAGE_DOWN,          ///< Decrease snow coverage.
 
	WID_GL_SNOW_COVERAGE_TEXT,          ///< Snow coverage.
 
	WID_GL_SNOW_COVERAGE_UP,            ///< Increase snow coverage.
 

	
 
	WID_GL_DESERT_COVERAGE_DOWN,        ///< Decrease desert coverage.
 
	WID_GL_DESERT_COVERAGE_TEXT,        ///< Desert coverage.
 
	WID_GL_DESERT_COVERAGE_UP,          ///< Increase desert coverage.
 

	
0 comments (0 inline, 0 general)