mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-16 16:20:53 +00:00
Merge branch 'ZoomableMapsIncreasesLoadingTimes' into 'master'
Zoomable maps increases loading times Closes #6204 See merge request OpenMW/openmw!1106
This commit is contained in:
commit
eb3c50842d
@ -36,7 +36,7 @@ namespace
|
||||
{
|
||||
|
||||
const int cellSize = Constants::CellSizeInUnits;
|
||||
constexpr float speed = 1.08; //the zoom speed, it should be greater than 1
|
||||
constexpr float speed = 1.08f; //the zoom speed, it should be greater than 1
|
||||
|
||||
enum LocalMapWidgetDepth
|
||||
{
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -791,14 +790,17 @@ namespace MWGui
|
||||
getWidget(mEventBoxGlobal, "EventBoxGlobal");
|
||||
mEventBoxGlobal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
||||
mEventBoxGlobal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||
mEventBoxGlobal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
|
||||
const bool allowZooming = Settings::Manager::getBool("allow zooming", "Map");
|
||||
if(allowZooming)
|
||||
mEventBoxGlobal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
|
||||
mEventBoxGlobal->setDepth(Global_ExploreOverlayLayer);
|
||||
|
||||
getWidget(mEventBoxLocal, "EventBoxLocal");
|
||||
mEventBoxLocal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
||||
mEventBoxLocal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||
mEventBoxLocal->eventMouseButtonDoubleClick += MyGUI::newDelegate(this, &MapWindow::onMapDoubleClicked);
|
||||
mEventBoxLocal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
|
||||
if (allowZooming)
|
||||
mEventBoxLocal->eventMouseWheel += MyGUI::newDelegate(this, &MapWindow::onMapZoomed);
|
||||
|
||||
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, getLocalViewingDistance());
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user