diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index 5a6ec06e56..2f2882368f 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -45,6 +45,9 @@ #include #include +#include +#include + #include #include "../mwbase/environment.hpp" @@ -1164,7 +1167,7 @@ void SkyManager::create() { assert(!mCreated); - mAtmosphereDay = mSceneManager->getInstance("meshes/sky_atmosphere.nif", mEarlyRenderBinRoot); + mAtmosphereDay = mSceneManager->getInstance(Settings::Manager::getString("skyatmosphere", "Models"), mEarlyRenderBinRoot); ModVertexAlphaVisitor modAtmosphere(0); mAtmosphereDay->accept(modAtmosphere); @@ -1176,10 +1179,10 @@ void SkyManager::create() mEarlyRenderBinRoot->addChild(mAtmosphereNightNode); osg::ref_ptr atmosphereNight; - if (mSceneManager->getVFS()->exists("meshes/sky_night_02.nif")) - atmosphereNight = mSceneManager->getInstance("meshes/sky_night_02.nif", mAtmosphereNightNode); + if (mSceneManager->getVFS()->exists(Settings::Manager::getString("skynight02", "Models"))) + atmosphereNight = mSceneManager->getInstance(Settings::Manager::getString("skynight02", "Models"), mAtmosphereNightNode); else - atmosphereNight = mSceneManager->getInstance("meshes/sky_night_01.nif", mAtmosphereNightNode); + atmosphereNight = mSceneManager->getInstance(Settings::Manager::getString("skynight01", "Models"), mAtmosphereNightNode); atmosphereNight->getOrCreateStateSet()->setAttributeAndModes(createAlphaTrackingUnlitMaterial(), osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE); ModVertexAlphaVisitor modStars(2); atmosphereNight->accept(modStars); @@ -1193,14 +1196,14 @@ void SkyManager::create() mCloudNode = new osg::PositionAttitudeTransform; mEarlyRenderBinRoot->addChild(mCloudNode); - mCloudMesh = mSceneManager->getInstance("meshes/sky_clouds_01.nif", mCloudNode); + mCloudMesh = mSceneManager->getInstance(Settings::Manager::getString("skyclouds", "Models"), mCloudNode); ModVertexAlphaVisitor modClouds(1); mCloudMesh->accept(modClouds); mCloudUpdater = new CloudUpdater; mCloudUpdater->setOpacity(1.f); mCloudMesh->addUpdateCallback(mCloudUpdater); - mCloudMesh2 = mSceneManager->getInstance("meshes/sky_clouds_01.nif", mCloudNode); + mCloudMesh2 = mSceneManager->getInstance(Settings::Manager::getString("skyclouds", "Models"), mCloudNode); mCloudMesh2->accept(modClouds); mCloudUpdater2 = new CloudUpdater; mCloudUpdater2->setOpacity(0.f); @@ -1597,7 +1600,7 @@ void SkyManager::update(float duration) if (mParticleNode) { // Morrowind deliberately rotates the blizzard mesh, so so should we. - if (mCurrentParticleEffect == "meshes\\blizzard.nif") + if (mCurrentParticleEffect == Settings::Manager::getString("weatherblizzard", "Models")) quat.makeRotate(osg::Vec3f(-1,0,0), mStormDirection); mParticleNode->setAttitude(quat); } @@ -1897,16 +1900,16 @@ void SkyManager::setWaterHeight(float height) void SkyManager::listAssetsToPreload(std::vector& models, std::vector& textures) { - models.emplace_back("meshes/sky_atmosphere.nif"); - if (mSceneManager->getVFS()->exists("meshes/sky_night_02.nif")) - models.emplace_back("meshes/sky_night_02.nif"); - models.emplace_back("meshes/sky_night_01.nif"); - models.emplace_back("meshes/sky_clouds_01.nif"); - - models.emplace_back("meshes\\ashcloud.nif"); - models.emplace_back("meshes\\blightcloud.nif"); - models.emplace_back("meshes\\snow.nif"); - models.emplace_back("meshes\\blizzard.nif"); + 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.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")); textures.emplace_back("textures/tx_mooncircle_full_s.dds"); textures.emplace_back("textures/tx_mooncircle_full_m.dds"); diff --git a/files/settings-default.cfg b/files/settings-default.cfg index d439c46351..78487b1735 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -1005,6 +1005,30 @@ xbaseanimfemalekf = meshes/xbase_anim_female.kf # File to load xargonianswimkna animations from xargonianswimknakf = meshes/xargonian_swimkna.kf +# Sky atmosphere mesh +skyatmosphere = meshes/sky_atmosphere.nif + +# Sky clouds mesh +skyclouds = meshes/sky_clouds_01.nif + +# Sky stars mesh 01 +skynight01 = meshes/sky_night_01.nif + +# Sky stars mesh 02 +skynight02 = meshes/sky_night_02.nif + +# Ash clouds weather effect +weatherashcloud = meshes/ashcloud.nif + +# Blight clouds weather effect +weatherblightcloud = meshes/blightcloud.nif + +# Snow falling weather effect +weathersnow = meshes/snow.nif + +# Blizzard weather effect +weatherblizzard = meshes/blizzard.nif + [Groundcover] # enable separate groundcover handling