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

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

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

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

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

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

Loading…
Cancel
Save