Merge branch 'settings_values_terrain' into 'master'

Use settings values for Terrain settings (#6876)

See merge request OpenMW/openmw!3529
macos_ci_fix
Alexei Kotov 1 year ago
commit 50f3b81096

@ -89,7 +89,7 @@ namespace
{
if (!Settings::map().mAllowZooming)
return Constants::CellGridRadius;
if (!Settings::Manager::getBool("distant terrain", "Terrain"))
if (!Settings::terrain().mDistantTerrain)
return Constants::CellGridRadius;
const int viewingDistanceInCells = Settings::camera().mViewingDistance / Constants::CellSizeInUnits;
return std::clamp(

@ -258,7 +258,7 @@ namespace MWGui
, mKeyboardMode(true)
, mCurrentPage(-1)
{
bool terrain = Settings::Manager::getBool("distant terrain", "Terrain");
const bool terrain = Settings::terrain().mDistantTerrain;
const std::string_view widgetName = terrain ? "RenderingDistanceSlider" : "LargeRenderingDistanceSlider";
MyGUI::Widget* unusedSlider;
getWidget(unusedSlider, widgetName);

@ -457,14 +457,14 @@ namespace MWRender
: GenericResourceManager<ChunkId>(nullptr, Settings::cells().mCacheExpiryDelay)
, Terrain::QuadTreeWorld::ChunkManager(worldspace)
, mSceneManager(sceneManager)
, mActiveGrid(Settings::terrain().mObjectPagingActiveGrid)
, mDebugBatches(Settings::terrain().mDebugChunks)
, mMergeFactor(Settings::terrain().mObjectPagingMergeFactor)
, mMinSize(Settings::terrain().mObjectPagingMinSize)
, mMinSizeMergeFactor(Settings::terrain().mObjectPagingMinSizeMergeFactor)
, mMinSizeCostMultiplier(Settings::terrain().mObjectPagingMinSizeCostMultiplier)
, mRefTrackerLocked(false)
{
mActiveGrid = Settings::Manager::getBool("object paging active grid", "Terrain");
mDebugBatches = Settings::Manager::getBool("debug chunks", "Terrain");
mMergeFactor = Settings::Manager::getFloat("object paging merge factor", "Terrain");
mMinSize = Settings::Manager::getFloat("object paging min size", "Terrain");
mMinSizeMergeFactor = Settings::Manager::getFloat("object paging min size merge factor", "Terrain");
mMinSizeCostMultiplier = Settings::Manager::getFloat("object paging min size cost multiplier", "Terrain");
}
std::map<ESM::RefNum, ESM::CellRef> ObjectPaging::collectESM3References(

@ -1316,23 +1316,21 @@ namespace MWRender
return existingChunkMgr->second;
RenderingManager::WorldspaceChunkMgr newChunkMgr;
const float lodFactor = Settings::Manager::getFloat("lod factor", "Terrain");
const float lodFactor = Settings::terrain().mLodFactor;
const bool groundcover = Settings::groundcover().mEnabled;
bool distantTerrain = Settings::Manager::getBool("distant terrain", "Terrain");
const bool distantTerrain = Settings::terrain().mDistantTerrain;
if (distantTerrain || groundcover)
{
const int compMapResolution = Settings::Manager::getInt("composite map resolution", "Terrain");
int compMapPower = Settings::Manager::getInt("composite map level", "Terrain");
compMapPower = std::max(-3, compMapPower);
float compMapLevel = pow(2, compMapPower);
const int vertexLodMod = Settings::Manager::getInt("vertex lod mod", "Terrain");
float maxCompGeometrySize = Settings::Manager::getFloat("max composite geometry size", "Terrain");
maxCompGeometrySize = std::max(maxCompGeometrySize, 1.f);
bool debugChunks = Settings::Manager::getBool("debug chunks", "Terrain");
const int compMapResolution = Settings::terrain().mCompositeMapResolution;
const int compMapPower = Settings::terrain().mCompositeMapLevel;
const float compMapLevel = std::pow(2, compMapPower);
const int vertexLodMod = Settings::terrain().mVertexLodMod;
const float maxCompGeometrySize = Settings::terrain().mMaxCompositeGeometrySize;
const bool debugChunks = Settings::terrain().mDebugChunks;
auto quadTreeWorld = std::make_unique<Terrain::QuadTreeWorld>(mSceneRoot, mRootNode, mResourceSystem,
mTerrainStorage.get(), Mask_Terrain, Mask_PreCompile, Mask_Debug, compMapResolution, compMapLevel,
lodFactor, vertexLodMod, maxCompGeometrySize, debugChunks, worldspace);
if (Settings::Manager::getBool("object paging", "Terrain"))
if (Settings::terrain().mObjectPaging)
{
newChunkMgr.mObjectPaging
= std::make_unique<ObjectPaging>(mResourceSystem->getSceneManager(), worldspace);

Loading…
Cancel
Save