Merge branch 'settings_values_models' into 'master'

Use settings values for Models settings (#6876)

See merge request OpenMW/openmw!3413
macos_ci_fix
psi29a 1 year ago
commit 39a209cb78
No known key found for this signature in database

@ -424,10 +424,10 @@ namespace MWClass
{
const MWWorld::LiveCellRef<ESM::NPC>* ref = ptr.get<ESM::NPC>();
std::string model = Settings::Manager::getString("baseanim", "Models");
std::string model = Settings::models().mBaseanim;
const ESM::Race* race = MWBase::Environment::get().getESMStore()->get<ESM::Race>().find(ref->mBase->mRace);
if (race->mData.mFlags & ESM::Race::Beast)
model = Settings::Manager::getString("baseanimkna", "Models");
model = Settings::models().mBaseanimkna;
return model;
}
@ -437,12 +437,12 @@ namespace MWClass
const MWWorld::LiveCellRef<ESM::NPC>* npc = ptr.get<ESM::NPC>();
const ESM::Race* race = MWBase::Environment::get().getESMStore()->get<ESM::Race>().search(npc->mBase->mRace);
if (race && race->mData.mFlags & ESM::Race::Beast)
models.emplace_back(Settings::Manager::getString("baseanimkna", "Models"));
models.push_back(Settings::models().mBaseanimkna);
// keep these always loaded just in case
models.emplace_back(Settings::Manager::getString("xargonianswimkna", "Models"));
models.emplace_back(Settings::Manager::getString("xbaseanimfemale", "Models"));
models.emplace_back(Settings::Manager::getString("xbaseanim", "Models"));
models.push_back(Settings::models().mXargonianswimkna);
models.push_back(Settings::models().mXbaseanimfemale);
models.push_back(Settings::models().mXbaseanim);
const VFS::Manager* const vfs = MWBase::Environment::get().getResourceSystem()->getVFS();

@ -1394,7 +1394,7 @@ namespace MWRender
MWWorld::LiveCellRef<ESM::Creature>* ref = mPtr.get<ESM::Creature>();
if (ref->mBase->mFlags & ESM::Creature::Bipedal)
{
defaultSkeleton = Settings::Manager::getString("xbaseanim", "Models");
defaultSkeleton = Settings::models().mXbaseanim;
inject = true;
}
}

@ -7,7 +7,7 @@
#include <components/resource/resourcesystem.hpp>
#include <components/sceneutil/positionattitudetransform.hpp>
#include <components/sceneutil/visitor.hpp>
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
#include "../mwmechanics/weapontype.hpp"
@ -27,7 +27,7 @@ namespace MWRender
setObjectRoot(model, false, false, true);
if ((ref->mBase->mFlags & ESM::Creature::Bipedal))
addAnimSource(Settings::Manager::getString("xbaseanim", "Models"), model);
addAnimSource(Settings::models().mXbaseanim.get(), model);
if (animated)
addAnimSource(model, model);
@ -47,7 +47,7 @@ namespace MWRender
setObjectRoot(model, true, false, true);
if ((ref->mBase->mFlags & ESM::Creature::Bipedal))
addAnimSource(Settings::Manager::getString("xbaseanim", "Models"), model);
addAnimSource(Settings::models().mXbaseanim.get(), model);
if (animated)
addAnimSource(model, model);

@ -515,7 +515,7 @@ namespace MWRender
if (!is1stPerson)
{
const std::string& base = Settings::Manager::getString("xbaseanim", "Models");
const std::string& base = Settings::models().mXbaseanim;
if (smodel != base && !isWerewolf)
addAnimSource(base, smodel);
@ -529,7 +529,7 @@ namespace MWRender
}
else
{
const std::string& base = Settings::Manager::getString("xbaseanim1st", "Models");
const std::string& base = Settings::models().mXbaseanim1st;
if (smodel != base && !isWerewolf)
addAnimSource(base, smodel);

@ -543,8 +543,8 @@ namespace MWRender
MWBase::Environment::get().getWindowManager()->setCullMask(mask);
NifOsg::Loader::setHiddenNodeMask(Mask_UpdateVisitor);
NifOsg::Loader::setIntersectionDisabledNodeMask(Mask_Effect);
Nif::Reader::setLoadUnsupportedFiles(Settings::Manager::getBool("load unsupported nif files", "Models"));
Nif::Reader::setWriteNifDebugLog(Settings::Manager::getBool("write nif debug log", "Models"));
Nif::Reader::setLoadUnsupportedFiles(Settings::models().mLoadUnsupportedNifFiles);
Nif::Reader::setWriteNifDebugLog(Settings::models().mWriteNifDebugLog);
mStateUpdater->setFogEnd(mViewDistance);
@ -606,15 +606,15 @@ namespace MWRender
mSky->listAssetsToPreload(workItem->mModels, workItem->mTextures);
mWater->listAssetsToPreload(workItem->mTextures);
workItem->mModels.push_back(Settings::Manager::getString("xbaseanim", "Models"));
workItem->mModels.push_back(Settings::Manager::getString("xbaseanim1st", "Models"));
workItem->mModels.push_back(Settings::Manager::getString("xbaseanimfemale", "Models"));
workItem->mModels.push_back(Settings::Manager::getString("xargonianswimkna", "Models"));
workItem->mModels.push_back(Settings::models().mXbaseanim);
workItem->mModels.push_back(Settings::models().mXbaseanim1st);
workItem->mModels.push_back(Settings::models().mXbaseanimfemale);
workItem->mModels.push_back(Settings::models().mXargonianswimkna);
workItem->mKeyframes.push_back(Settings::Manager::getString("xbaseanimkf", "Models"));
workItem->mKeyframes.push_back(Settings::Manager::getString("xbaseanim1stkf", "Models"));
workItem->mKeyframes.push_back(Settings::Manager::getString("xbaseanimfemalekf", "Models"));
workItem->mKeyframes.push_back(Settings::Manager::getString("xargonianswimknakf", "Models"));
workItem->mKeyframes.push_back(Settings::models().mXbaseanimkf);
workItem->mKeyframes.push_back(Settings::models().mXbaseanim1stkf);
workItem->mKeyframes.push_back(Settings::models().mXbaseanimfemalekf);
workItem->mKeyframes.push_back(Settings::models().mXargonianswimknakf);
workItem->mTextures.emplace_back("textures/_land_default.dds");

@ -302,8 +302,7 @@ namespace MWRender
bool forceShaders = mSceneManager->getForceShaders();
mAtmosphereDay
= mSceneManager->getInstance(Settings::Manager::getString("skyatmosphere", "Models"), mEarlyRenderBinRoot);
mAtmosphereDay = mSceneManager->getInstance(Settings::models().mSkyatmosphere, mEarlyRenderBinRoot);
ModVertexAlphaVisitor modAtmosphere(ModVertexAlphaVisitor::Atmosphere);
mAtmosphereDay->accept(modAtmosphere);
@ -315,12 +314,10 @@ namespace MWRender
mEarlyRenderBinRoot->addChild(mAtmosphereNightNode);
osg::ref_ptr<osg::Node> atmosphereNight;
if (mSceneManager->getVFS()->exists(Settings::Manager::getString("skynight02", "Models")))
atmosphereNight = mSceneManager->getInstance(
Settings::Manager::getString("skynight02", "Models"), mAtmosphereNightNode);
if (mSceneManager->getVFS()->exists(Settings::models().mSkynight02.get()))
atmosphereNight = mSceneManager->getInstance(Settings::models().mSkynight02, mAtmosphereNightNode);
else
atmosphereNight = mSceneManager->getInstance(
Settings::Manager::getString("skynight01", "Models"), mAtmosphereNightNode);
atmosphereNight = mSceneManager->getInstance(Settings::models().mSkynight01, mAtmosphereNightNode);
atmosphereNight->getOrCreateStateSet()->setAttributeAndModes(
createAlphaTrackingUnlitMaterial(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
@ -340,8 +337,7 @@ namespace MWRender
mEarlyRenderBinRoot->addChild(mCloudNode);
mCloudMesh = new osg::PositionAttitudeTransform;
osg::ref_ptr<osg::Node> cloudMeshChild
= mSceneManager->getInstance(Settings::Manager::getString("skyclouds", "Models"), mCloudMesh);
osg::ref_ptr<osg::Node> cloudMeshChild = mSceneManager->getInstance(Settings::models().mSkyclouds, mCloudMesh);
mCloudUpdater = new CloudUpdater(forceShaders);
mCloudUpdater->setOpacity(1.f);
cloudMeshChild->addUpdateCallback(mCloudUpdater);
@ -349,7 +345,7 @@ namespace MWRender
mNextCloudMesh = new osg::PositionAttitudeTransform;
osg::ref_ptr<osg::Node> nextCloudMeshChild
= mSceneManager->getInstance(Settings::Manager::getString("skyclouds", "Models"), mNextCloudMesh);
= mSceneManager->getInstance(Settings::models().mSkyclouds, mNextCloudMesh);
mNextCloudUpdater = new CloudUpdater(forceShaders);
mNextCloudUpdater->setOpacity(0.f);
nextCloudMeshChild->addUpdateCallback(mNextCloudUpdater);
@ -911,16 +907,16 @@ namespace MWRender
void SkyManager::listAssetsToPreload(std::vector<std::string>& models, std::vector<std::string>& textures)
{
models.emplace_back(Settings::Manager::getString("skyatmosphere", "Models"));
if (mSceneManager->getVFS()->exists(Settings::Manager::getString("skynight02", "Models")))
models.emplace_back(Settings::Manager::getString("skynight02", "Models"));
models.emplace_back(Settings::Manager::getString("skynight01", "Models"));
models.emplace_back(Settings::Manager::getString("skyclouds", "Models"));
models.push_back(Settings::models().mSkyatmosphere);
if (mSceneManager->getVFS()->exists(Settings::models().mSkynight02.get()))
models.push_back(Settings::models().mSkynight02);
models.push_back(Settings::models().mSkynight01);
models.push_back(Settings::models().mSkyclouds);
models.emplace_back(Settings::Manager::getString("weatherashcloud", "Models"));
models.emplace_back(Settings::Manager::getString("weatherblightcloud", "Models"));
models.emplace_back(Settings::Manager::getString("weathersnow", "Models"));
models.emplace_back(Settings::Manager::getString("weatherblizzard", "Models"));
models.push_back(Settings::models().mWeatherashcloud);
models.push_back(Settings::models().mWeatherblightcloud);
models.push_back(Settings::models().mWeathersnow);
models.push_back(Settings::models().mWeatherblizzard);
textures.emplace_back("textures/tx_mooncircle_full_s.dds");
textures.emplace_back("textures/tx_mooncircle_full_m.dds");

@ -1,6 +1,6 @@
#include "actorutil.hpp"
#include <components/settings/settings.hpp>
#include <components/settings/values.hpp>
namespace SceneUtil
{
@ -9,24 +9,24 @@ namespace SceneUtil
if (!firstPerson)
{
if (isWerewolf)
return Settings::Manager::getString("wolfskin", "Models");
return Settings::models().mWolfskin;
else if (isBeast)
return Settings::Manager::getString("baseanimkna", "Models");
return Settings::models().mBaseanimkna;
else if (isFemale)
return Settings::Manager::getString("baseanimfemale", "Models");
return Settings::models().mBaseanimfemale;
else
return Settings::Manager::getString("baseanim", "Models");
return Settings::models().mBaseanim;
}
else
{
if (isWerewolf)
return Settings::Manager::getString("wolfskin1st", "Models");
return Settings::models().mWolfskin1st;
else if (isBeast)
return Settings::Manager::getString("baseanimkna1st", "Models");
return Settings::models().mBaseanimkna1st;
else if (isFemale)
return Settings::Manager::getString("baseanimfemale1st", "Models");
return Settings::models().mBaseanimfemale1st;
else
return Settings::Manager::getString("xbaseanim1st", "Models");
return Settings::models().mXbaseanim1st;
}
}
}

Loading…
Cancel
Save