mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-24 23:36:50 +00:00
Merge branch 'fix/hardcoded-weather-meshes' into 'master'
Fix: hardcoded weather meshes, use settings instead See merge request OpenMW/openmw!3880
This commit is contained in:
commit
ef8228f2f3
2 changed files with 12 additions and 9 deletions
|
@ -528,7 +528,7 @@ namespace MWRender
|
||||||
if (hasRain())
|
if (hasRain())
|
||||||
return mRainRipplesEnabled;
|
return mRainRipplesEnabled;
|
||||||
|
|
||||||
if (mParticleNode && mCurrentParticleEffect == "meshes\\snow.nif")
|
if (mParticleNode && mCurrentParticleEffect == Settings::models().mWeathersnow.get())
|
||||||
return mSnowRipplesEnabled;
|
return mSnowRipplesEnabled;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -554,7 +554,7 @@ namespace MWRender
|
||||||
osg::Quat quat;
|
osg::Quat quat;
|
||||||
quat.makeRotate(MWWorld::Weather::defaultDirection(), mStormParticleDirection);
|
quat.makeRotate(MWWorld::Weather::defaultDirection(), mStormParticleDirection);
|
||||||
// Morrowind deliberately rotates the blizzard mesh, so so should we.
|
// Morrowind deliberately rotates the blizzard mesh, so so should we.
|
||||||
if (mCurrentParticleEffect == "meshes\\blizzard.nif")
|
if (mCurrentParticleEffect == Settings::models().mWeatherblizzard.get())
|
||||||
quat.makeRotate(osg::Vec3f(-1, 0, 0), mStormParticleDirection);
|
quat.makeRotate(osg::Vec3f(-1, 0, 0), mStormParticleDirection);
|
||||||
mParticleNode->setAttitude(quat);
|
mParticleNode->setAttitude(quat);
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,7 @@ namespace MWRender
|
||||||
|
|
||||||
const osg::Vec3 defaultWrapRange = osg::Vec3(1024, 1024, 800);
|
const osg::Vec3 defaultWrapRange = osg::Vec3(1024, 1024, 800);
|
||||||
const bool occlusionEnabledForEffect
|
const bool occlusionEnabledForEffect
|
||||||
= !mRainEffect.empty() || mCurrentParticleEffect == "meshes\\snow.nif";
|
= !mRainEffect.empty() || mCurrentParticleEffect == Settings::models().mWeathersnow.get();
|
||||||
|
|
||||||
for (unsigned int i = 0; i < findPSVisitor.mFoundNodes.size(); ++i)
|
for (unsigned int i = 0; i < findPSVisitor.mFoundNodes.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "weather.hpp"
|
#include "weather.hpp"
|
||||||
|
|
||||||
|
#include <components/settings/values.hpp>
|
||||||
|
|
||||||
#include <components/misc/rng.hpp>
|
#include <components/misc/rng.hpp>
|
||||||
|
|
||||||
#include <components/esm3/esmreader.hpp>
|
#include <components/esm3/esmreader.hpp>
|
||||||
|
@ -45,7 +47,8 @@ namespace MWWorld
|
||||||
osg::Vec3f calculateStormDirection(const std::string& particleEffect)
|
osg::Vec3f calculateStormDirection(const std::string& particleEffect)
|
||||||
{
|
{
|
||||||
osg::Vec3f stormDirection = MWWorld::Weather::defaultDirection();
|
osg::Vec3f stormDirection = MWWorld::Weather::defaultDirection();
|
||||||
if (particleEffect == "meshes\\ashcloud.nif" || particleEffect == "meshes\\blightcloud.nif")
|
if (particleEffect == Settings::models().mWeatherashcloud.get()
|
||||||
|
|| particleEffect == Settings::models().mWeatherblightcloud.get())
|
||||||
{
|
{
|
||||||
osg::Vec3f playerPos = MWMechanics::getPlayer().getRefData().getPosition().asVec3();
|
osg::Vec3f playerPos = MWMechanics::getPlayer().getRefData().getPosition().asVec3();
|
||||||
playerPos.z() = 0;
|
playerPos.z() = 0;
|
||||||
|
@ -581,10 +584,10 @@ namespace MWWorld
|
||||||
addWeather("Overcast", 0.7f, 0.0f); // 3
|
addWeather("Overcast", 0.7f, 0.0f); // 3
|
||||||
addWeather("Rain", 0.5f, 10.0f); // 4
|
addWeather("Rain", 0.5f, 10.0f); // 4
|
||||||
addWeather("Thunderstorm", 0.5f, 20.0f); // 5
|
addWeather("Thunderstorm", 0.5f, 20.0f); // 5
|
||||||
addWeather("Ashstorm", 0.2f, 50.0f, "meshes\\ashcloud.nif"); // 6
|
addWeather("Ashstorm", 0.2f, 50.0f, Settings::models().mWeatherashcloud.get()); // 6
|
||||||
addWeather("Blight", 0.2f, 60.0f, "meshes\\blightcloud.nif"); // 7
|
addWeather("Blight", 0.2f, 60.0f, Settings::models().mWeatherblightcloud.get()); // 7
|
||||||
addWeather("Snow", 0.5f, 40.0f, "meshes\\snow.nif"); // 8
|
addWeather("Snow", 0.5f, 40.0f, Settings::models().mWeathersnow.get()); // 8
|
||||||
addWeather("Blizzard", 0.16f, 70.0f, "meshes\\blizzard.nif"); // 9
|
addWeather("Blizzard", 0.16f, 70.0f, Settings::models().mWeatherblizzard.get()); // 9
|
||||||
|
|
||||||
Store<ESM::Region>::iterator it = store.get<ESM::Region>().begin();
|
Store<ESM::Region>::iterator it = store.get<ESM::Region>().begin();
|
||||||
for (; it != store.get<ESM::Region>().end(); ++it)
|
for (; it != store.get<ESM::Region>().end(); ++it)
|
||||||
|
@ -720,7 +723,7 @@ namespace MWWorld
|
||||||
|
|
||||||
// For some reason Ash Storm is not considered as a precipitation weather in game
|
// For some reason Ash Storm is not considered as a precipitation weather in game
|
||||||
mPrecipitation = !(mResult.mParticleEffect.empty() && mResult.mRainEffect.empty())
|
mPrecipitation = !(mResult.mParticleEffect.empty() && mResult.mRainEffect.empty())
|
||||||
&& mResult.mParticleEffect != "meshes\\ashcloud.nif";
|
&& mResult.mParticleEffect != Settings::models().mWeatherashcloud.get();
|
||||||
|
|
||||||
mStormDirection = calculateStormDirection(mResult.mParticleEffect);
|
mStormDirection = calculateStormDirection(mResult.mParticleEffect);
|
||||||
mRendering.getSkyManager()->setStormParticleDirection(mStormDirection);
|
mRendering.getSkyManager()->setStormParticleDirection(mStormDirection);
|
||||||
|
|
Loading…
Reference in a new issue