mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Merge branch 'sky-dehardcode' into 'master'
De-hardcode references to mesh files used by the sky. See merge request OpenMW/openmw!704
This commit is contained in:
commit
a16387df61
2 changed files with 43 additions and 16 deletions
|
@ -45,6 +45,9 @@
|
|||
#include <components/sceneutil/visitor.hpp>
|
||||
#include <components/sceneutil/shadow.hpp>
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
#include <components/misc/stringops.hpp>
|
||||
|
||||
#include <components/nifosg/particle.hpp>
|
||||
|
||||
#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<osg::Node> 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<std::string>& models, std::vector<std::string>& 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(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("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("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");
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue