mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Merge branch 'convert_cells_settings' into 'master'
Use settings values for Cells settings (#6876) See merge request OpenMW/openmw!3048
This commit is contained in:
commit
6db9e5f0d3
@ -47,6 +47,7 @@
|
||||
#include <components/sceneutil/util.hpp>
|
||||
|
||||
#include <components/settings/shadermanager.hpp>
|
||||
#include <components/settings/values.hpp>
|
||||
|
||||
#include "mwinput/inputmanagerimp.hpp"
|
||||
|
||||
@ -670,10 +671,7 @@ void OMW::Engine::prepareEngine()
|
||||
Settings::Manager::getString("texture mipmap", "General"), Settings::Manager::getInt("anisotropy", "General"));
|
||||
mEnvironment.setResourceSystem(*mResourceSystem);
|
||||
|
||||
int numThreads = Settings::Manager::getInt("preload num threads", "Cells");
|
||||
if (numThreads <= 0)
|
||||
throw std::runtime_error("Invalid setting: 'preload num threads' must be >0");
|
||||
mWorkQueue = new SceneUtil::WorkQueue(numThreads);
|
||||
mWorkQueue = new SceneUtil::WorkQueue(Settings::cells().mPreloadNumThreads);
|
||||
mUnrefQueue = std::make_unique<SceneUtil::UnrefQueue>();
|
||||
|
||||
mScreenCaptureOperation = new SceneUtil::AsyncScreenCaptureOperation(mWorkQueue,
|
||||
|
@ -440,8 +440,7 @@ namespace MWRender
|
||||
if (getenv("OPENMW_DONT_PRECOMPILE") == nullptr)
|
||||
{
|
||||
mViewer->setIncrementalCompileOperation(new osgUtil::IncrementalCompileOperation);
|
||||
mViewer->getIncrementalCompileOperation()->setTargetFrameRate(
|
||||
Settings::Manager::getFloat("target framerate", "Cells"));
|
||||
mViewer->getIncrementalCompileOperation()->setTargetFrameRate(Settings::cells().mTargetFramerate);
|
||||
}
|
||||
|
||||
mDebugDraw
|
||||
@ -486,7 +485,7 @@ namespace MWRender
|
||||
mTerrain = std::make_unique<Terrain::TerrainGrid>(sceneRoot, mRootNode, mResourceSystem,
|
||||
mTerrainStorage.get(), Mask_Terrain, Mask_PreCompile, Mask_Debug);
|
||||
|
||||
mTerrain->setTargetFrameRate(Settings::Manager::getFloat("target framerate", "Cells"));
|
||||
mTerrain->setTargetFrameRate(Settings::cells().mTargetFramerate);
|
||||
|
||||
if (groundcover)
|
||||
{
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include <components/resource/resourcesystem.hpp>
|
||||
#include <components/resource/scenemanager.hpp>
|
||||
#include <components/sceneutil/positionattitudetransform.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/settings/values.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/luamanager.hpp"
|
||||
@ -718,7 +718,7 @@ namespace MWWorld
|
||||
|
||||
mRendering.getResourceSystem()->getSceneManager()->setIncrementalCompileOperation(
|
||||
mRendering.getIncrementalCompileOperation());
|
||||
mRendering.getResourceSystem()->setExpiryDelay(Settings::Manager::getFloat("cache expiry delay", "Cells"));
|
||||
mRendering.getResourceSystem()->setExpiryDelay(Settings::cells().mCacheExpiryDelay);
|
||||
}
|
||||
|
||||
void Scene::testInteriorCells()
|
||||
@ -776,7 +776,7 @@ namespace MWWorld
|
||||
|
||||
mRendering.getResourceSystem()->getSceneManager()->setIncrementalCompileOperation(
|
||||
mRendering.getIncrementalCompileOperation());
|
||||
mRendering.getResourceSystem()->setExpiryDelay(Settings::Manager::getFloat("cache expiry delay", "Cells"));
|
||||
mRendering.getResourceSystem()->setExpiryDelay(Settings::cells().mCacheExpiryDelay);
|
||||
}
|
||||
|
||||
void Scene::changePlayerCell(CellStore& cell, const ESM::Position& pos, bool adjustPlayerPos)
|
||||
@ -824,23 +824,23 @@ namespace MWWorld
|
||||
, mRendering(rendering)
|
||||
, mNavigator(navigator)
|
||||
, mCellLoadingThreshold(1024.f)
|
||||
, mPreloadDistance(Settings::Manager::getInt("preload distance", "Cells"))
|
||||
, mPreloadEnabled(Settings::Manager::getBool("preload enabled", "Cells"))
|
||||
, mPreloadExteriorGrid(Settings::Manager::getBool("preload exterior grid", "Cells"))
|
||||
, mPreloadDoors(Settings::Manager::getBool("preload doors", "Cells"))
|
||||
, mPreloadFastTravel(Settings::Manager::getBool("preload fast travel", "Cells"))
|
||||
, mPredictionTime(Settings::Manager::getFloat("prediction time", "Cells"))
|
||||
, mPreloadDistance(Settings::cells().mPreloadDistance)
|
||||
, mPreloadEnabled(Settings::cells().mPreloadEnabled)
|
||||
, mPreloadExteriorGrid(Settings::cells().mPreloadExteriorGrid)
|
||||
, mPreloadDoors(Settings::cells().mPreloadDoors)
|
||||
, mPreloadFastTravel(Settings::cells().mPreloadFastTravel)
|
||||
, mPredictionTime(Settings::cells().mPredictionTime)
|
||||
{
|
||||
mPreloader = std::make_unique<CellPreloader>(rendering.getResourceSystem(), physics->getShapeManager(),
|
||||
rendering.getTerrain(), rendering.getLandManager());
|
||||
mPreloader->setWorkQueue(mRendering.getWorkQueue());
|
||||
|
||||
rendering.getResourceSystem()->setExpiryDelay(Settings::Manager::getFloat("cache expiry delay", "Cells"));
|
||||
rendering.getResourceSystem()->setExpiryDelay(Settings::cells().mCacheExpiryDelay);
|
||||
|
||||
mPreloader->setExpiryDelay(Settings::Manager::getFloat("preload cell expiry delay", "Cells"));
|
||||
mPreloader->setMinCacheSize(Settings::Manager::getInt("preload cell cache min", "Cells"));
|
||||
mPreloader->setMaxCacheSize(Settings::Manager::getInt("preload cell cache max", "Cells"));
|
||||
mPreloader->setPreloadInstances(Settings::Manager::getBool("preload instances", "Cells"));
|
||||
mPreloader->setExpiryDelay(Settings::cells().mPreloadCellExpiryDelay);
|
||||
mPreloader->setMinCacheSize(Settings::cells().mPreloadCellCacheMin);
|
||||
mPreloader->setMaxCacheSize(Settings::cells().mPreloadCellCacheMax);
|
||||
mPreloader->setPreloadInstances(Settings::cells().mPreloadInstances);
|
||||
}
|
||||
|
||||
Scene::~Scene()
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <components/esm3/loadregn.hpp>
|
||||
#include <components/esm4/loadwrld.hpp>
|
||||
#include <components/loadinglistener/loadinglistener.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/settings/values.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
@ -155,8 +155,7 @@ void MWWorld::WorldModel::writeCell(ESM::ESMWriter& writer, CellStore& cell) con
|
||||
MWWorld::WorldModel::WorldModel(const MWWorld::ESMStore& store, ESM::ReadersCache& readers)
|
||||
: mStore(store)
|
||||
, mReaders(readers)
|
||||
, mIdCache(
|
||||
std::clamp(Settings::Manager::getInt("pointers cache size", "Cells"), 40, 1000), { ESM::RefId(), nullptr })
|
||||
, mIdCache(Settings::cells().mPointersCacheSize, { ESM::RefId(), nullptr })
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user