diff --git a/apps/openmw/mwgui/mapwindow.cpp b/apps/openmw/mwgui/mapwindow.cpp index 9f7cfc73e6..7f1ecd89d8 100644 --- a/apps/openmw/mwgui/mapwindow.cpp +++ b/apps/openmw/mwgui/mapwindow.cpp @@ -99,10 +99,9 @@ namespace return Constants::CellGridRadius; if (!Settings::Manager::getBool("distant terrain", "Terrain")) return Constants::CellGridRadius; - const float localViewingDistanceCoef = Settings::Manager::getFloat("local viewing distance coef", "Map"); - const int viewingDistance = Settings::Manager::getInt("viewing distance", "Camera"); - const int localViewingDistanceInCells = (viewingDistance * localViewingDistanceCoef) / double(Constants::CellSizeInUnits); - return std::max(Constants::CellGridRadius, localViewingDistanceInCells); + const int maxLocalViewingDistance = std::max(Settings::Manager::getInt("max local viewing distance", "Map"), Constants::CellGridRadius); + const int viewingDistanceInCells = Settings::Manager::getFloat("viewing distance", "Camera") / Constants::CellSizeInUnits; + return std::min(maxLocalViewingDistance, viewingDistanceInCells); } } diff --git a/docs/source/reference/modding/settings/map.rst b/docs/source/reference/modding/settings/map.rst index eeef0a1f39..a4d3cd7e0d 100644 --- a/docs/source/reference/modding/settings/map.rst +++ b/docs/source/reference/modding/settings/map.rst @@ -115,14 +115,18 @@ If this setting is true the user can zoom in/out on local and global map with th This setting can be controlled in Advanced tab of the launcher. -local viewing distance coef +max local viewing distance --------------------------- -:Type: float -:Range: > 0 and <= 1 -:Default: 0.5 +:Type: integer +:Range: > 0 +:Default: 10 -This setting controls viewing distance on local map. It is the coefficient of the viewing distance viewable on the local map if 'distant terrain' is enabled otherwise you will see the default value (a 3x3 square centered on the player). +This setting controls the viewing distance on local map when 'distant terrain' is enabled. +If this setting is greater than the viewing distance then only up to the viewing distance is used for local map, otherwise the viewing distance is used. If view distance is changed in settings menu during the game, then viewable distance on the local map is not updated. +.. warning:: + Increasing this setting can increase cell load times, + because the localmap take a snapshot of each cell contained in a square of 2 x (max local viewing distance) + 1 square. This setting can not be configured except by editing the settings configuration file. diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 2c287a889c..4737fcf5ee 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -205,8 +205,8 @@ global = false # If true, allow zoom on local and global maps allow zooming = false -# The local view distance coefficient (1.0 is full view distance if distant terrain is enabled) -local viewing distance coef = 0.5 +# The local view distance in number of cells (up to the view distance) +max local viewing distance = 10 [GUI]