mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
3 Commits
780717836f
...
b17a9e4e12
Author | SHA1 | Date |
---|---|---|
|
b17a9e4e12 | |
|
a8650c6b06 | |
|
cd5d13a692 |
|
@ -454,6 +454,7 @@ add_files(
|
|||
spritecache.cpp
|
||||
spritecache.h
|
||||
spritecache_internal.h
|
||||
spritecache_type.h
|
||||
station.cpp
|
||||
station_base.h
|
||||
station_cmd.cpp
|
||||
|
|
|
@ -49,6 +49,8 @@ static const uint CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY = 4; ///< Value for custom
|
|||
static const uint CUSTOM_SEA_LEVEL_MIN_PERCENTAGE = 1; ///< Minimum percentage a user can specify for custom sea level.
|
||||
static const uint CUSTOM_SEA_LEVEL_MAX_PERCENTAGE = 90; ///< Maximum percentage a user can specify for custom sea level.
|
||||
|
||||
static const uint CUSTOM_SNOW_LEVEL_NUMBER = 5; ///< Value for custom snow level in game creation settings
|
||||
|
||||
static constexpr uint MAP_HEIGHT_LIMIT_ORIGINAL = 15; ///< Original map height limit.
|
||||
|
||||
static const uint MAP_HEIGHT_LIMIT_AUTO_MINIMUM = 30; ///< When map height limit is auto, make this the lowest possible map height limit.
|
||||
|
|
|
@ -124,7 +124,7 @@ static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
|
|||
/* Labels on the left side (global column 3). */
|
||||
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize), SetPIP(0, WidgetDimensions::unscaled.vsep_sparse, 0),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_LABEL),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_SNOW_COVERAGE, STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_SNOW_LINE_LEVEL, STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_DESERT_COVERAGE, STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(NWID_SPACER), SetFill(1, 1),
|
||||
EndContainer(),
|
||||
|
@ -139,11 +139,9 @@ static constexpr NWidgetPart _nested_generate_landscape_widgets[] = {
|
|||
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize), SetPIP(0, WidgetDimensions::unscaled.vsep_sparse, 0),
|
||||
/* Climate selector. */
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_SELECTOR),
|
||||
/* Snow coverage. */
|
||||
/* Snow line level. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_DOWN), SetSpriteTip(SPR_ARROW_DOWN, STR_MAPGEN_SNOW_COVERAGE_DOWN_TOOLTIP), SetFill(0, 1), SetAspect(WidgetDimensions::ASPECT_UP_DOWN_BUTTON),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_TEXT), SetToolTip(STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_UP), SetSpriteTip(SPR_ARROW_UP, STR_MAPGEN_SNOW_COVERAGE_UP_TOOLTIP), SetFill(0, 1), SetAspect(WidgetDimensions::ASPECT_UP_DOWN_BUTTON),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_SNOW_LINE_LEVEL_PULLDOWN), SetToolTip(STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT), SetFill(1, 1),
|
||||
EndContainer(),
|
||||
/* Desert coverage. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
|
@ -259,7 +257,7 @@ static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
|
|||
/* Right half labels (global column 3) */
|
||||
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize), SetPIP(0, WidgetDimensions::unscaled.vsep_sparse, 0),
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_LABEL),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_SNOW_COVERAGE, STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_SNOW_LINE_LEVEL, STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_TEXT, INVALID_COLOUR), SetStringTip(STR_MAPGEN_DESERT_COVERAGE, STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(NWID_SPACER), SetFill(1, 1),
|
||||
EndContainer(),
|
||||
|
@ -273,11 +271,9 @@ static constexpr NWidgetPart _nested_heightmap_load_widgets[] = {
|
|||
NWidget(NWID_VERTICAL, NWidContainerFlag::EqualSize), SetPIP(0, WidgetDimensions::unscaled.vsep_sparse, 0),
|
||||
/* Climate selector. */
|
||||
NWidget(NWID_SELECTION, INVALID_COLOUR, WID_GL_CLIMATE_SEL_SELECTOR),
|
||||
/* Snow coverage. */
|
||||
/* Snow line level. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_DOWN), SetSpriteTip(SPR_ARROW_DOWN, STR_MAPGEN_SNOW_COVERAGE_DOWN_TOOLTIP), SetFill(0, 1), SetAspect(WidgetDimensions::ASPECT_UP_DOWN_BUTTON),
|
||||
NWidget(WWT_TEXTBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_TEXT), SetToolTip(STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT), SetFill(1, 1),
|
||||
NWidget(WWT_IMGBTN, COLOUR_ORANGE, WID_GL_SNOW_COVERAGE_UP), SetSpriteTip(SPR_ARROW_UP, STR_MAPGEN_SNOW_COVERAGE_UP_TOOLTIP), SetFill(0, 1), SetAspect(WidgetDimensions::ASPECT_UP_DOWN_BUTTON),
|
||||
NWidget(WWT_DROPDOWN, COLOUR_ORANGE, WID_GL_SNOW_LINE_LEVEL_PULLDOWN), SetToolTip(STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT), SetFill(1, 1),
|
||||
EndContainer(),
|
||||
/* Desert coverage. */
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
|
@ -384,6 +380,7 @@ static const StringID _rotation[] = {STR_CONFIG_SETTING_HEIGHTMAP_ROTATION_CO
|
|||
static const StringID _num_towns[] = {STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM};
|
||||
static const StringID _num_inds[] = {STR_FUNDING_ONLY, STR_MINIMAL, STR_NUM_VERY_LOW, STR_NUM_LOW, STR_NUM_NORMAL, STR_NUM_HIGH, STR_NUM_CUSTOM};
|
||||
static const StringID _variety[] = {STR_VARIETY_NONE, STR_VARIETY_VERY_LOW, STR_VARIETY_LOW, STR_VARIETY_MEDIUM, STR_VARIETY_HIGH, STR_VARIETY_VERY_HIGH};
|
||||
static const StringID _snow_levels[] = {STR_SNOW_LINE_LEVEL_VERY_LOW, STR_SNOW_LINE_LEVEL_LOW, STR_SNOW_LINE_LEVEL_MEDIUM, STR_SNOW_LINE_LEVEL_HIGH, STR_SNOW_LINE_LEVEL_VERY_HIGH, STR_SNOW_LINE_LEVEL_CUSTOM};
|
||||
|
||||
static_assert(std::size(_num_inds) == ID_END);
|
||||
|
||||
|
@ -426,7 +423,12 @@ struct GenerateLandscapeWindow : public Window {
|
|||
case WID_GL_MAPSIZE_X_PULLDOWN: return GetString(STR_JUST_INT, 1LL << _settings_newgame.game_creation.map_x);
|
||||
case WID_GL_MAPSIZE_Y_PULLDOWN: return GetString(STR_JUST_INT, 1LL << _settings_newgame.game_creation.map_y);
|
||||
case WID_GL_HEIGHTMAP_HEIGHT_TEXT: return GetString(STR_JUST_INT, _settings_newgame.game_creation.heightmap_height);
|
||||
case WID_GL_SNOW_COVERAGE_TEXT: return GetString(STR_MAPGEN_SNOW_COVERAGE_TEXT, _settings_newgame.game_creation.snow_coverage);
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN:
|
||||
if (_settings_newgame.game_creation.snow_line_level == CUSTOM_SNOW_LEVEL_NUMBER) {
|
||||
return GetString(STR_SNOW_LINE_LEVEL_CUSTOM_NUMBER, _settings_newgame.game_creation.snow_line_height);
|
||||
}
|
||||
return GetString(_snow_levels[_settings_newgame.game_creation.snow_line_level]);
|
||||
|
||||
case WID_GL_DESERT_COVERAGE_TEXT: return GetString(STR_MAPGEN_DESERT_COVERAGE_TEXT, _settings_newgame.game_creation.desert_coverage);
|
||||
|
||||
case WID_GL_TOWN_PULLDOWN:
|
||||
|
@ -523,7 +525,7 @@ struct GenerateLandscapeWindow : public Window {
|
|||
}
|
||||
|
||||
/* Disable snowline if not arctic */
|
||||
this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LandscapeType::Arctic);
|
||||
this->SetWidgetDisabledState(WID_GL_SNOW_LINE_LEVEL_PULLDOWN, _settings_newgame.game_creation.landscape != LandscapeType::Arctic);
|
||||
/* Disable desert if not tropic */
|
||||
this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_TEXT, _settings_newgame.game_creation.landscape != LandscapeType::Tropic);
|
||||
|
||||
|
@ -545,8 +547,6 @@ struct GenerateLandscapeWindow : public Window {
|
|||
}
|
||||
this->SetWidgetDisabledState(WID_GL_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= CalendarTime::MIN_YEAR);
|
||||
this->SetWidgetDisabledState(WID_GL_START_DATE_UP, _settings_newgame.game_creation.starting_year >= CalendarTime::MAX_YEAR);
|
||||
this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_DOWN, _settings_newgame.game_creation.snow_coverage <= 0 || _settings_newgame.game_creation.landscape != LandscapeType::Arctic);
|
||||
this->SetWidgetDisabledState(WID_GL_SNOW_COVERAGE_UP, _settings_newgame.game_creation.snow_coverage >= 100 || _settings_newgame.game_creation.landscape != LandscapeType::Arctic);
|
||||
this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_DOWN, _settings_newgame.game_creation.desert_coverage <= 0 || _settings_newgame.game_creation.landscape != LandscapeType::Tropic);
|
||||
this->SetWidgetDisabledState(WID_GL_DESERT_COVERAGE_UP, _settings_newgame.game_creation.desert_coverage >= 100 || _settings_newgame.game_creation.landscape != LandscapeType::Tropic);
|
||||
|
||||
|
@ -586,8 +586,8 @@ struct GenerateLandscapeWindow : public Window {
|
|||
d = GetStringBoundingBox(GetString(STR_JUST_INT, GetParamMaxValue(MAX_MAP_SIZE)));
|
||||
break;
|
||||
|
||||
case WID_GL_SNOW_COVERAGE_TEXT:
|
||||
d = GetStringBoundingBox(GetString(STR_MAPGEN_SNOW_COVERAGE_TEXT, GetParamMaxValue(MAX_TILE_HEIGHT)));
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN:
|
||||
d = GetStringBoundingBox(GetString(STR_JUST_INT, GetParamMaxValue(MAX_SNOWLINE_HEIGHT)));
|
||||
break;
|
||||
|
||||
case WID_GL_DESERT_COVERAGE_TEXT:
|
||||
|
@ -738,21 +738,8 @@ struct GenerateLandscapeWindow : public Window {
|
|||
ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.starting_year), STR_MAPGEN_START_DATE_QUERY_CAPT, 8, this, CS_NUMERAL, QueryStringFlag::EnableDefault);
|
||||
break;
|
||||
|
||||
case WID_GL_SNOW_COVERAGE_DOWN:
|
||||
case WID_GL_SNOW_COVERAGE_UP: // Snow coverage buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
|
||||
_settings_newgame.game_creation.snow_coverage = Clamp(_settings_newgame.game_creation.snow_coverage + (widget - WID_GL_SNOW_COVERAGE_TEXT) * 10, 0, 100);
|
||||
this->InvalidateData();
|
||||
}
|
||||
_left_button_clicked = false;
|
||||
break;
|
||||
|
||||
case WID_GL_SNOW_COVERAGE_TEXT: // Snow coverage text
|
||||
this->widget_id = WID_GL_SNOW_COVERAGE_TEXT;
|
||||
ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.snow_coverage), STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT, 4, this, CS_NUMERAL, QueryStringFlag::EnableDefault);
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN: // Snow line level
|
||||
ShowDropDownMenu(this, _snow_levels, _settings_newgame.game_creation.snow_line_level, WID_GL_SNOW_LINE_LEVEL_PULLDOWN, 0, 0);
|
||||
break;
|
||||
|
||||
case WID_GL_DESERT_COVERAGE_DOWN:
|
||||
|
@ -846,9 +833,9 @@ struct GenerateLandscapeWindow : public Window {
|
|||
void OnTimeout() override
|
||||
{
|
||||
if (mode == GLWM_HEIGHTMAP) {
|
||||
this->RaiseWidgetsWhenLowered(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);
|
||||
this->RaiseWidgetsWhenLowered(WID_GL_HEIGHTMAP_HEIGHT_DOWN, WID_GL_HEIGHTMAP_HEIGHT_UP, WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_DESERT_COVERAGE_UP, WID_GL_DESERT_COVERAGE_DOWN);
|
||||
} else {
|
||||
this->RaiseWidgetsWhenLowered(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);
|
||||
this->RaiseWidgetsWhenLowered(WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_DESERT_COVERAGE_UP, WID_GL_DESERT_COVERAGE_DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -863,6 +850,14 @@ struct GenerateLandscapeWindow : public Window {
|
|||
|
||||
case WID_GL_HEIGHTMAP_ROTATION_PULLDOWN: _settings_newgame.game_creation.heightmap_rotation = index; break;
|
||||
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN: // Snow line level
|
||||
if ((uint)index == CUSTOM_SNOW_LEVEL_NUMBER) {
|
||||
this->widget_id = widget;
|
||||
ShowQueryString(GetString(STR_JUST_INT, _settings_newgame.game_creation.snow_line_height), STR_MAPGEN_SNOW_LINE_LEVEL_QUERY_CAPT, 4, this, CS_NUMERAL, {});
|
||||
}
|
||||
_settings_newgame.game_creation.snow_line_level = index;
|
||||
break;
|
||||
|
||||
case WID_GL_TOWN_PULLDOWN:
|
||||
if ((uint)index == CUSTOM_TOWN_NUMBER_DIFFICULTY) {
|
||||
this->widget_id = widget;
|
||||
|
@ -922,7 +917,7 @@ struct GenerateLandscapeWindow : public Window {
|
|||
switch (this->widget_id) {
|
||||
case WID_GL_HEIGHTMAP_HEIGHT_TEXT: value = MAP_HEIGHT_LIMIT_AUTO_MINIMUM; break;
|
||||
case WID_GL_START_DATE_TEXT: value = CalendarTime::DEF_START_YEAR.base(); break;
|
||||
case WID_GL_SNOW_COVERAGE_TEXT: value = DEF_SNOW_COVERAGE; break;
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN: value = DEF_SNOWLINE_HEIGHT; break;
|
||||
case WID_GL_DESERT_COVERAGE_TEXT: value = DEF_DESERT_COVERAGE; break;
|
||||
case WID_GL_TOWN_PULLDOWN: value = 1; break;
|
||||
case WID_GL_INDUSTRY_PULLDOWN: value = 1; break;
|
||||
|
@ -943,9 +938,8 @@ struct GenerateLandscapeWindow : public Window {
|
|||
_settings_newgame.game_creation.starting_year = Clamp(TimerGameCalendar::Year(value), CalendarTime::MIN_YEAR, CalendarTime::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);
|
||||
case WID_GL_SNOW_LINE_LEVEL_PULLDOWN:
|
||||
_settings_newgame.game_creation.snow_line_height = Clamp(value, MIN_SNOWLINE_HEIGHT, MAX_SNOWLINE_HEIGHT);
|
||||
break;
|
||||
|
||||
case WID_GL_DESERT_COVERAGE_TEXT:
|
||||
|
|
|
@ -1510,13 +1510,45 @@ static uint CalculateCoverageLine(uint coverage, uint edge_multiplier)
|
|||
return best_h;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current maximum height of the map.
|
||||
* @return The maximum height of the map.
|
||||
*/
|
||||
static uint GetMapMaxHeight()
|
||||
{
|
||||
uint max_height = 0;
|
||||
|
||||
for (const auto tile : Map::Iterate()) {
|
||||
uint h = TileHeight(tile);
|
||||
if (h > max_height) {
|
||||
max_height = h;
|
||||
}
|
||||
}
|
||||
|
||||
return max_height;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the line from which snow begins.
|
||||
*/
|
||||
static void CalculateSnowLine()
|
||||
{
|
||||
/* We do not have snow sprites on coastal tiles, so never allow "1" as height. */
|
||||
_settings_game.game_creation.snow_line_height = std::max(CalculateCoverageLine(_settings_game.game_creation.snow_coverage, 0), 2u);
|
||||
/* If snow_line_level is custom, then snow_line_height is already set
|
||||
* otherwise we have to calculate it
|
||||
*/
|
||||
if (_settings_game.game_creation.snow_line_level != CUSTOM_SNOW_LEVEL_NUMBER) {
|
||||
uint min_snow_line_height = 4; // Not too low to make room for farms
|
||||
uint max_snow_line_height = GetMapMaxHeight() - 2; // Not too high to make room for forests
|
||||
|
||||
uint max_height_diff = min_snow_line_height < max_snow_line_height
|
||||
? max_snow_line_height - min_snow_line_height
|
||||
: 0;
|
||||
|
||||
/* snow_line_level goes up to 4 so we divide by 5 to get a maximum ratio of 80% */
|
||||
uint height_diff = RoundDivSU(max_height_diff * _settings_game.game_creation.snow_line_level, 5);
|
||||
|
||||
_settings_game.game_creation.snow_line_height = min_snow_line_height + height_diff;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1217,6 +1217,15 @@ STR_TERRAIN_TYPE_ALPINIST :Alpinist
|
|||
STR_TERRAIN_TYPE_CUSTOM :Custom height
|
||||
STR_TERRAIN_TYPE_CUSTOM_VALUE :Custom height ({NUM})
|
||||
|
||||
###length 7
|
||||
STR_SNOW_LINE_LEVEL_VERY_LOW :Very Low
|
||||
STR_SNOW_LINE_LEVEL_LOW :Low
|
||||
STR_SNOW_LINE_LEVEL_MEDIUM :Medium
|
||||
STR_SNOW_LINE_LEVEL_HIGH :High
|
||||
STR_SNOW_LINE_LEVEL_VERY_HIGH :Very high
|
||||
STR_SNOW_LINE_LEVEL_CUSTOM :Custom
|
||||
STR_SNOW_LINE_LEVEL_CUSTOM_NUMBER :Custom ({NUM})
|
||||
|
||||
###length 4
|
||||
STR_CITY_APPROVAL_LENIENT :Lenient
|
||||
STR_CITY_APPROVAL_TOLERANT :Tolerant
|
||||
|
@ -1593,9 +1602,8 @@ STR_CONFIG_SETTING_OIL_REF_EDGE_DISTANCE_HELPTEXT :Limit for how f
|
|||
STR_CONFIG_SETTING_SNOWLINE_HEIGHT :Snow line height: {STRING2}
|
||||
STR_CONFIG_SETTING_SNOWLINE_HEIGHT_HELPTEXT :Choose at what height snow starts in sub-arctic landscape. Snow also affects industry generation and town growth requirements. Can only be modified via Scenario Editor or is otherwise calculated via "snow coverage"
|
||||
|
||||
STR_CONFIG_SETTING_SNOW_COVERAGE :Snow coverage: {STRING2}
|
||||
STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT :Choose the approximate amount of snow on the sub-arctic landscape. Snow also affects industry generation and town growth requirements. Only used during map generation. Sea level and coast tiles never have snow
|
||||
STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE :{NUM}%
|
||||
STR_CONFIG_SETTING_SNOW_LINE_LEVEL :Snow line level: {STRING2}
|
||||
STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT :Choose the approximate height above which all tiles will be covered by snow in sub-arctic landscape. Snow also affects industry generation and town growth requirements.
|
||||
|
||||
STR_CONFIG_SETTING_DESERT_COVERAGE :Desert coverage: {STRING2}
|
||||
STR_CONFIG_SETTING_DESERT_COVERAGE_HELPTEXT :Choose the approximate amount of desert on the tropical landscape. Desert also affects industry generation and town growth requirements. Only used during map generation
|
||||
|
@ -3352,10 +3360,7 @@ STR_MAPGEN_HEIGHTMAP_HEIGHT :{BLACK}Highest
|
|||
STR_MAPGEN_HEIGHTMAP_HEIGHT_TOOLTIP :{BLACK}Choose the highest peak that the game will attempt to create, measured in elevation above sea level
|
||||
STR_MAPGEN_HEIGHTMAP_HEIGHT_UP_TOOLTIP :{BLACK}Increase the maximum height of highest peak on the map by one
|
||||
STR_MAPGEN_HEIGHTMAP_HEIGHT_DOWN_TOOLTIP :{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_TOOLTIP :{BLACK}Increase snow coverage by ten percent
|
||||
STR_MAPGEN_SNOW_COVERAGE_DOWN_TOOLTIP :{BLACK}Decrease snow coverage by ten percent
|
||||
STR_MAPGEN_SNOW_COVERAGE_TEXT :{BLACK}{NUM}%
|
||||
STR_MAPGEN_SNOW_LINE_LEVEL :{BLACK}Snow line level:
|
||||
STR_MAPGEN_DESERT_COVERAGE :{BLACK}Desert coverage:
|
||||
STR_MAPGEN_DESERT_COVERAGE_UP_TOOLTIP :{BLACK}Increase desert coverage by ten percent
|
||||
STR_MAPGEN_DESERT_COVERAGE_DOWN_TOOLTIP :{BLACK}Decrease desert coverage by ten percent
|
||||
|
@ -3420,7 +3425,7 @@ STR_MAPGEN_HEIGHTMAP_SIZE :{ORANGE}{NUM} x
|
|||
|
||||
STR_MAPGEN_TERRAIN_TYPE_QUERY_CAPT :{WHITE}Target peak height
|
||||
STR_MAPGEN_HEIGHTMAP_HEIGHT_QUERY_CAPT :{WHITE}Highest peak
|
||||
STR_MAPGEN_SNOW_COVERAGE_QUERY_CAPT :{WHITE}Snow coverage (in %)
|
||||
STR_MAPGEN_SNOW_LINE_LEVEL_QUERY_CAPT :{WHITE}Snow line height
|
||||
STR_MAPGEN_DESERT_COVERAGE_QUERY_CAPT :{WHITE}Desert coverage (in %)
|
||||
STR_MAPGEN_START_DATE_QUERY_CAPT :{WHITE}Change starting year
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#include "../timer/timer_game_economy.h"
|
||||
#include "../timer/timer_game_tick.h"
|
||||
#include "../picker_func.h"
|
||||
#include "../genworld.h"
|
||||
|
||||
#include "saveload_internal.h"
|
||||
|
||||
|
@ -3397,6 +3398,11 @@ bool AfterLoadGame()
|
|||
}
|
||||
}
|
||||
|
||||
if (IsSavegameVersionBefore(SLV_SNOW_LINE_LEVEL)) {
|
||||
/* The snow line level replaces the snow coverage but the two do not map very well. */
|
||||
_settings_game.game_creation.snow_line_level = CUSTOM_SNOW_LEVEL_NUMBER;
|
||||
}
|
||||
|
||||
AfterLoadLabelMaps();
|
||||
AfterLoadCompanyStats();
|
||||
AfterLoadStoryBook();
|
||||
|
|
|
@ -143,7 +143,7 @@ const SaveLoadCompat _settings_sl_compat[] = {
|
|||
SLC_VAR("economy.fund_roads"),
|
||||
SLC_VAR("economy.give_money"),
|
||||
SLC_VAR("game_creation.snow_line_height"),
|
||||
SLC_VAR("game_creation.snow_coverage"),
|
||||
SLC_NULL(1, SLV_MAPGEN_SETTINGS_REVAMP, SLV_TABLE_CHUNKS),
|
||||
SLC_VAR("game_creation.desert_coverage"),
|
||||
SLC_NULL(4, SL_MIN_VERSION, SLV_144),
|
||||
SLC_VAR("game_creation.starting_year"),
|
||||
|
|
|
@ -405,6 +405,7 @@ enum SaveLoadVersion : uint16_t {
|
|||
|
||||
SLV_FACE_STYLES, ///< 355 PR#14319 Addition of face styles, replacing gender and ethnicity.
|
||||
SLV_INDUSTRY_NUM_VALID_HISTORY, ///< 356 PR#14416 Store number of valid history records for industries.
|
||||
SLV_SNOW_LINE_LEVEL, ///< 357 PR#14428 Replacement of snow coverage setting with snow line level setting
|
||||
|
||||
SL_MAX_VERSION, ///< Highest possible saveload version
|
||||
};
|
||||
|
|
|
@ -842,7 +842,7 @@ SettingsContainer &GetSettingsTree()
|
|||
genworld->Add(new SettingEntry("difficulty.terrain_type"));
|
||||
genworld->Add(new SettingEntry("game_creation.tgen_smoothness"));
|
||||
genworld->Add(new SettingEntry("game_creation.variety"));
|
||||
genworld->Add(new SettingEntry("game_creation.snow_coverage"));
|
||||
genworld->Add(new SettingEntry("game_creation.snow_line_level"));
|
||||
genworld->Add(new SettingEntry("game_creation.snow_line_height"));
|
||||
genworld->Add(new SettingEntry("game_creation.desert_coverage"));
|
||||
genworld->Add(new SettingEntry("game_creation.amount_of_rivers"));
|
||||
|
|
|
@ -363,8 +363,8 @@ struct GameCreationSettings {
|
|||
uint8_t map_y; ///< Y size of map
|
||||
uint8_t land_generator; ///< the landscape generator
|
||||
uint8_t oil_refinery_limit; ///< distance oil refineries allowed from map edge
|
||||
uint8_t snow_line_height; ///< the configured snow line height (deduced from "snow_coverage")
|
||||
uint8_t snow_coverage; ///< the amount of snow coverage on the map
|
||||
uint8_t snow_line_height; ///< the configured snow line height (deduced from "snow_line_level" unless it is set on "custom")
|
||||
uint8_t snow_line_level; ///< the approximate snow line level on the map
|
||||
uint8_t desert_coverage; ///< the amount of desert coverage on the map
|
||||
uint8_t heightmap_height; ///< highest mountain for heightmap (towards what it scales)
|
||||
uint8_t tgen_smoothness; ///< how rough is the terrain from 0-3
|
||||
|
|
|
@ -535,7 +535,7 @@ static void *ReadSprite(const SpriteCache *sc, SpriteID id, SpriteType sprite_ty
|
|||
|
||||
struct GrfSpriteOffset {
|
||||
size_t file_pos;
|
||||
uint8_t control_flags;
|
||||
SpriteCacheCtrlFlags control_flags{};
|
||||
};
|
||||
|
||||
/** Map from sprite numbers to position in the GRF file. */
|
||||
|
@ -565,7 +565,7 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
|
|||
size_t old_pos = file.GetPos();
|
||||
file.SeekTo(data_offset, SEEK_CUR);
|
||||
|
||||
GrfSpriteOffset offset = { 0, 0 };
|
||||
GrfSpriteOffset offset{0};
|
||||
|
||||
/* Loop over all sprite section entries and store the file
|
||||
* offset for each newly encountered ID. */
|
||||
|
@ -574,7 +574,6 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
|
|||
if (id != prev_id) {
|
||||
_grf_sprite_offsets[prev_id] = offset;
|
||||
offset.file_pos = file.GetPos() - 4;
|
||||
offset.control_flags = 0;
|
||||
}
|
||||
prev_id = id;
|
||||
uint length = file.ReadDword();
|
||||
|
@ -585,11 +584,11 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
|
|||
uint8_t zoom = file.ReadByte();
|
||||
length--;
|
||||
if (colour.Any() && zoom == 0) { // ZoomLevel::Normal (normal zoom)
|
||||
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_1X_32BPP : SCCF_ALLOW_ZOOM_MIN_1X_PAL);
|
||||
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_2X_32BPP : SCCF_ALLOW_ZOOM_MIN_2X_PAL);
|
||||
offset.control_flags.Set((colour != SpriteComponent::Palette) ? SpriteCacheCtrlFlag::AllowZoomMin1x32bpp : SpriteCacheCtrlFlag::AllowZoomMin1xPal);
|
||||
offset.control_flags.Set((colour != SpriteComponent::Palette) ? SpriteCacheCtrlFlag::AllowZoomMin2x32bpp : SpriteCacheCtrlFlag::AllowZoomMin2xPal);
|
||||
}
|
||||
if (colour.Any() && zoom == 2) { // ZoomLevel::In2x (2x zoomed in)
|
||||
SetBit(offset.control_flags, (colour != SpriteComponent::Palette) ? SCCF_ALLOW_ZOOM_MIN_2X_32BPP : SCCF_ALLOW_ZOOM_MIN_2X_PAL);
|
||||
offset.control_flags.Set((colour != SpriteComponent::Palette) ? SpriteCacheCtrlFlag::AllowZoomMin2x32bpp : SpriteCacheCtrlFlag::AllowZoomMin2xPal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -621,7 +620,7 @@ bool LoadNextSprite(SpriteID load_index, SpriteFile &file, uint file_sprite_id)
|
|||
uint8_t grf_type = file.ReadByte();
|
||||
|
||||
SpriteType type;
|
||||
uint8_t control_flags = 0;
|
||||
SpriteCacheCtrlFlags control_flags;
|
||||
if (grf_type == 0xFF) {
|
||||
/* Some NewGRF files have "empty" pseudo-sprites which are 1
|
||||
* byte long. Catch these so the sprites won't be displayed. */
|
||||
|
|
|
@ -11,24 +11,9 @@
|
|||
#define SPRITECACHE_H
|
||||
|
||||
#include "gfx_type.h"
|
||||
#include "spritecache_type.h"
|
||||
#include "spriteloader/spriteloader.hpp"
|
||||
|
||||
/** Data structure describing a sprite. */
|
||||
struct Sprite {
|
||||
uint16_t height; ///< Height of the sprite.
|
||||
uint16_t width; ///< Width of the sprite.
|
||||
int16_t x_offs; ///< Number of pixels to shift the sprite to the right.
|
||||
int16_t y_offs; ///< Number of pixels to shift the sprite downwards.
|
||||
std::byte data[]; ///< Sprite data.
|
||||
};
|
||||
|
||||
enum SpriteCacheCtrlFlags : uint8_t {
|
||||
SCCF_ALLOW_ZOOM_MIN_1X_PAL = 0, ///< Allow use of sprite min zoom setting at 1x in palette mode.
|
||||
SCCF_ALLOW_ZOOM_MIN_1X_32BPP = 1, ///< Allow use of sprite min zoom setting at 1x in 32bpp mode.
|
||||
SCCF_ALLOW_ZOOM_MIN_2X_PAL = 2, ///< Allow use of sprite min zoom setting at 2x in palette mode.
|
||||
SCCF_ALLOW_ZOOM_MIN_2X_32BPP = 3, ///< Allow use of sprite min zoom setting at 2x in 32bpp mode.
|
||||
};
|
||||
|
||||
extern uint _sprite_cache_size;
|
||||
|
||||
/** SpriteAllocator that allocates memory via a unique_ptr array. */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include "core/math_func.hpp"
|
||||
#include "gfx_type.h"
|
||||
#include "spritecache_type.h"
|
||||
#include "spriteloader/spriteloader.hpp"
|
||||
|
||||
#include "table/sprites.h"
|
||||
|
@ -27,7 +28,7 @@ struct SpriteCache {
|
|||
uint32_t lru = 0;
|
||||
SpriteType type = SpriteType::Invalid; ///< In some cases a single sprite is misused by two NewGRFs. Once as real sprite and once as recolour sprite. If the recolour sprite gets into the cache it might be drawn as real sprite which causes enormous trouble.
|
||||
bool warned = false; ///< True iff the user has been warned about incorrect use of this sprite
|
||||
uint8_t control_flags = 0; ///< Control flags, see SpriteCacheCtrlFlags
|
||||
SpriteCacheCtrlFlags control_flags{}; ///< Control flags, see SpriteCacheCtrlFlags
|
||||
|
||||
void ClearSpriteData();
|
||||
};
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file spritecache_type.h Types related to the sprite cache. */
|
||||
|
||||
#ifndef SPRITECACHE_TYPE_H
|
||||
#define SPRITECACHE_TYPE_H
|
||||
|
||||
#include "core/enum_type.hpp"
|
||||
|
||||
/** Data structure describing a sprite. */
|
||||
struct Sprite {
|
||||
uint16_t height; ///< Height of the sprite.
|
||||
uint16_t width; ///< Width of the sprite.
|
||||
int16_t x_offs; ///< Number of pixels to shift the sprite to the right.
|
||||
int16_t y_offs; ///< Number of pixels to shift the sprite downwards.
|
||||
std::byte data[]; ///< Sprite data.
|
||||
};
|
||||
|
||||
enum class SpriteCacheCtrlFlag : uint8_t {
|
||||
AllowZoomMin1xPal, ///< Allow use of sprite min zoom setting at 1x in palette mode.
|
||||
AllowZoomMin1x32bpp, ///< Allow use of sprite min zoom setting at 1x in 32bpp mode.
|
||||
AllowZoomMin2xPal, ///< Allow use of sprite min zoom setting at 2x in palette mode.
|
||||
AllowZoomMin2x32bpp, ///< Allow use of sprite min zoom setting at 2x in 32bpp mode.
|
||||
};
|
||||
|
||||
using SpriteCacheCtrlFlags = EnumBitSet<SpriteCacheCtrlFlag, uint8_t>;
|
||||
|
||||
#endif /* SPRITECACHE_TYPE_H */
|
|
@ -256,7 +256,7 @@ static ZoomLevels LoadSpriteV1(SpriteLoader::SpriteCollection &sprite, SpriteFil
|
|||
return {};
|
||||
}
|
||||
|
||||
static ZoomLevels LoadSpriteV2(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
static ZoomLevels LoadSpriteV2(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
{
|
||||
static const ZoomLevel zoom_lvl_map[6] = {ZoomLevel::Normal, ZoomLevel::In4x, ZoomLevel::In2x, ZoomLevel::Out2x, ZoomLevel::Out4x, ZoomLevel::Out8x};
|
||||
|
||||
|
@ -295,11 +295,11 @@ static ZoomLevels LoadSpriteV2(SpriteLoader::SpriteCollection &sprite, SpriteFil
|
|||
is_wanted_zoom_lvl = true;
|
||||
ZoomLevel zoom_min = sprite_type == SpriteType::Font ? ZoomLevel::Min : _settings_client.gui.sprite_zoom_min;
|
||||
if (zoom_min >= ZoomLevel::In2x &&
|
||||
HasBit(control_flags, load_32bpp ? SCCF_ALLOW_ZOOM_MIN_2X_32BPP : SCCF_ALLOW_ZOOM_MIN_2X_PAL) && zoom_lvl < ZoomLevel::In2x) {
|
||||
control_flags.Test(load_32bpp ? SpriteCacheCtrlFlag::AllowZoomMin2x32bpp : SpriteCacheCtrlFlag::AllowZoomMin2xPal) && zoom_lvl < ZoomLevel::In2x) {
|
||||
is_wanted_zoom_lvl = false;
|
||||
}
|
||||
if (zoom_min >= ZoomLevel::Normal &&
|
||||
HasBit(control_flags, load_32bpp ? SCCF_ALLOW_ZOOM_MIN_1X_32BPP : SCCF_ALLOW_ZOOM_MIN_1X_PAL) && zoom_lvl < ZoomLevel::Normal) {
|
||||
control_flags.Test(load_32bpp ? SpriteCacheCtrlFlag::AllowZoomMin1x32bpp : SpriteCacheCtrlFlag::AllowZoomMin1xPal) && zoom_lvl < ZoomLevel::Normal) {
|
||||
is_wanted_zoom_lvl = false;
|
||||
}
|
||||
} else {
|
||||
|
@ -359,7 +359,7 @@ static ZoomLevels LoadSpriteV2(SpriteLoader::SpriteCollection &sprite, SpriteFil
|
|||
return loaded_sprites;
|
||||
}
|
||||
|
||||
ZoomLevels SpriteLoaderGrf::LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
ZoomLevels SpriteLoaderGrf::LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
{
|
||||
if (this->container_ver >= 2) {
|
||||
return LoadSpriteV2(sprite, file, file_pos, sprite_type, load_32bpp, control_flags, avail_8bpp, avail_32bpp);
|
||||
|
|
|
@ -17,7 +17,7 @@ class SpriteLoaderGrf : public SpriteLoader {
|
|||
uint8_t container_ver;
|
||||
public:
|
||||
SpriteLoaderGrf(uint8_t container_ver) : container_ver(container_ver) {}
|
||||
ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) override;
|
||||
ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) override;
|
||||
};
|
||||
|
||||
#endif /* SPRITELOADER_GRF_HPP */
|
||||
|
|
|
@ -48,7 +48,7 @@ static void Convert32bppTo8bpp(SpriteLoader::Sprite &sprite)
|
|||
}
|
||||
}
|
||||
|
||||
ZoomLevels SpriteLoaderMakeIndexed::LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
ZoomLevels SpriteLoaderMakeIndexed::LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp)
|
||||
{
|
||||
ZoomLevels avail = this->baseloader.LoadSprite(sprite, file, file_pos, sprite_type, true, control_flags, avail_8bpp, avail_32bpp);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ class SpriteLoaderMakeIndexed : public SpriteLoader {
|
|||
SpriteLoader &baseloader;
|
||||
public:
|
||||
SpriteLoaderMakeIndexed(SpriteLoader &baseloader) : baseloader(baseloader) {}
|
||||
ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) override;
|
||||
ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) override;
|
||||
};
|
||||
|
||||
#endif /* SPRITELOADER_MAKEINDEXED_H */
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "../core/alloc_type.hpp"
|
||||
#include "../core/enum_type.hpp"
|
||||
#include "../gfx_type.h"
|
||||
#include "../spritecache_type.h"
|
||||
#include "sprite_file_type.hpp"
|
||||
|
||||
struct Sprite;
|
||||
|
@ -94,7 +95,7 @@ public:
|
|||
* @param[out] avail_32bpp Available 32bpp sprites.
|
||||
* @return Available sprites matching \a load_32bpp.
|
||||
*/
|
||||
virtual ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, uint8_t control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) = 0;
|
||||
virtual ZoomLevels LoadSprite(SpriteLoader::SpriteCollection &sprite, SpriteFile &file, size_t file_pos, SpriteType sprite_type, bool load_32bpp, SpriteCacheCtrlFlags control_flags, ZoomLevels &avail_8bpp, ZoomLevels &avail_32bpp) = 0;
|
||||
|
||||
virtual ~SpriteLoader() = default;
|
||||
};
|
||||
|
|
|
@ -97,17 +97,17 @@ strval = STR_JUST_COMMA
|
|||
cat = SC_BASIC
|
||||
|
||||
[SDT_VAR]
|
||||
var = game_creation.snow_coverage
|
||||
var = game_creation.snow_line_level
|
||||
type = SLE_UINT8
|
||||
from = SLV_MAPGEN_SETTINGS_REVAMP
|
||||
flags = SettingFlag::NewgameOnly
|
||||
def = DEF_SNOW_COVERAGE
|
||||
from = SLV_SNOW_LINE_LEVEL
|
||||
flags = SettingFlag::GuiDropdown, SettingFlag::NewgameOnly
|
||||
def = 1
|
||||
min = 0
|
||||
max = 100
|
||||
interval = 10
|
||||
str = STR_CONFIG_SETTING_SNOW_COVERAGE
|
||||
strhelp = STR_CONFIG_SETTING_SNOW_COVERAGE_HELPTEXT
|
||||
strval = STR_CONFIG_SETTING_SNOW_COVERAGE_VALUE
|
||||
max = 5
|
||||
interval = 1
|
||||
str = STR_CONFIG_SETTING_SNOW_LINE_LEVEL
|
||||
strhelp = STR_CONFIG_SETTING_SNOW_LINE_LEVEL_HELPTEXT
|
||||
strval = STR_SNOW_LINE_LEVEL_VERY_LOW
|
||||
cat = SC_BASIC
|
||||
|
||||
[SDT_VAR]
|
||||
|
|
|
@ -33,7 +33,7 @@ static bool MockLoadNextSprite(SpriteID load_index)
|
|||
sc->id = 0;
|
||||
sc->type = is_mapgen ? SpriteType::MapGen : SpriteType::Normal;
|
||||
sc->warned = false;
|
||||
sc->control_flags = 0;
|
||||
sc->control_flags = {};
|
||||
|
||||
/* Fill with empty sprites up until the default sprite count. */
|
||||
return load_index < SPR_OPENTTD_BASE + OPENTTD_SPRITE_COUNT;
|
||||
|
|
|
@ -33,7 +33,6 @@ static const uint MIN_SNOWLINE_HEIGHT = 2; ///< Minimum snow
|
|||
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.
|
||||
|
||||
|
||||
|
|
|
@ -34,9 +34,7 @@ enum GenerateLandscapeWidgets : WidgetID {
|
|||
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_SNOW_LINE_LEVEL_PULLDOWN, ///< Snow line level.
|
||||
|
||||
WID_GL_DESERT_COVERAGE_DOWN, ///< Decrease desert coverage.
|
||||
WID_GL_DESERT_COVERAGE_TEXT, ///< Desert coverage.
|
||||
|
|
Loading…
Reference in New Issue