mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Merge pull request #403 from OpenMW/master
Add OpenMW commits up to 9 Apr 2018
This commit is contained in:
commit
fa652964fd
13 changed files with 231 additions and 90 deletions
|
@ -4,6 +4,8 @@
|
||||||
#include <MyGUI_ScrollView.h>
|
#include <MyGUI_ScrollView.h>
|
||||||
#include <MyGUI_Gui.h>
|
#include <MyGUI_Gui.h>
|
||||||
|
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
@ -72,7 +74,10 @@ namespace MWGui
|
||||||
MWWorld::ActionTeleport::getFollowersToTeleport(player, followers);
|
MWWorld::ActionTeleport::getFollowersToTeleport(player, followers);
|
||||||
|
|
||||||
// Apply followers cost, in vanilla one follower travels for free
|
// Apply followers cost, in vanilla one follower travels for free
|
||||||
price *= std::max(1, static_cast<int>(followers.size()));
|
if (Settings::Manager::getBool("charge for every follower travelling", "Game"))
|
||||||
|
price *= 1 + static_cast<int>(followers.size());
|
||||||
|
else
|
||||||
|
price *= std::max(1, static_cast<int>(followers.size()));
|
||||||
|
|
||||||
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>("SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
MyGUI::Button* toAdd = mDestinationsView->createWidget<MyGUI::Button>("SandTextButton", 0, mCurrentY, 200, sLineHeight, MyGUI::Align::Default);
|
||||||
toAdd->setEnabled(price <= playerGold);
|
toAdd->setEnabled(price <= playerGold);
|
||||||
|
|
|
@ -1502,7 +1502,20 @@ namespace MWMechanics
|
||||||
// Attacker is in combat with us, but we are not in combat with the attacker yet. Time to fight back.
|
// Attacker is in combat with us, but we are not in combat with the attacker yet. Time to fight back.
|
||||||
// Note: accidental or collateral damage attacks are ignored.
|
// Note: accidental or collateral damage attacks are ignored.
|
||||||
if (!target.getClass().getCreatureStats(target).getAiSequence().hasPackage(AiPackage::TypeIdPursue))
|
if (!target.getClass().getCreatureStats(target).getAiSequence().hasPackage(AiPackage::TypeIdPursue))
|
||||||
startCombat(target, attacker);
|
{
|
||||||
|
// If an actor has OnPCHitMe declared in his script, his Fight = 0 and the attacker is player,
|
||||||
|
// he will attack the player only if we will force him (e.g. via StartCombat console command)
|
||||||
|
bool peaceful = false;
|
||||||
|
std::string script = target.getClass().getScript(target);
|
||||||
|
if (!script.empty() && target.getRefData().getLocals().hasVar(script, "onpchitme") && attacker == getPlayer())
|
||||||
|
{
|
||||||
|
int fight = std::max(0, target.getClass().getCreatureStats(target).getAiSetting(CreatureStats::AI_Fight).getModified());
|
||||||
|
peaceful = (fight == 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!peaceful)
|
||||||
|
startCombat(target, attacker);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -214,7 +214,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress)
|
void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &class_, bool preserveProgress, bool readBook)
|
||||||
{
|
{
|
||||||
int base = getSkill (skillIndex).getBase();
|
int base = getSkill (skillIndex).getBase();
|
||||||
|
|
||||||
|
@ -256,9 +256,14 @@ void MWMechanics::NpcStats::increaseSkill(int skillIndex, const ESM::Class &clas
|
||||||
MWBase::Environment::get().getWindowManager()->playSound("skillraise");
|
MWBase::Environment::get().getWindowManager()->playSound("skillraise");
|
||||||
|
|
||||||
std::stringstream message;
|
std::stringstream message;
|
||||||
|
|
||||||
|
if (readBook)
|
||||||
|
message << std::string("#{sBookSkillMessage}\n");
|
||||||
|
|
||||||
message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", ""))
|
message << boost::format(MWBase::Environment::get().getWindowManager ()->getGameSettingString ("sNotifyMessage39", ""))
|
||||||
% std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}")
|
% std::string("#{" + ESM::Skill::sSkillNameIds[skillIndex] + "}")
|
||||||
% static_cast<int> (base);
|
% static_cast<int> (base);
|
||||||
|
|
||||||
MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never);
|
MWBase::Environment::get().getWindowManager ()->messageBox(message.str(), MWGui::ShowInDialogueMode_Never);
|
||||||
|
|
||||||
if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt())
|
if (mLevelProgress >= gmst.find("iLevelUpTotal")->getInt())
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace MWMechanics
|
||||||
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f);
|
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f);
|
||||||
///< Increase skill by usage.
|
///< Increase skill by usage.
|
||||||
|
|
||||||
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress);
|
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress, bool readBook = false);
|
||||||
|
|
||||||
int getLevelProgress() const;
|
int getLevelProgress() const;
|
||||||
|
|
||||||
|
|
|
@ -586,7 +586,7 @@ namespace MWMechanics
|
||||||
ActiveSpells::ActiveEffect effect_ = effect;
|
ActiveSpells::ActiveEffect effect_ = effect;
|
||||||
effect_.mMagnitude *= -1;
|
effect_.mMagnitude *= -1;
|
||||||
absorbEffects.push_back(effect_);
|
absorbEffects.push_back(effect_);
|
||||||
if (reflected && Settings::Manager::getBool("classic reflected absorb attribute behavior", "Game"))
|
if (reflected && Settings::Manager::getBool("classic reflect absorb attribute behavior", "Game"))
|
||||||
target.getClass().getCreatureStats(target).getActiveSpells().addSpell("", true,
|
target.getClass().getCreatureStats(target).getActiveSpells().addSpell("", true,
|
||||||
absorbEffects, mSourceName, caster.getClass().getCreatureStats(caster).getActorId());
|
absorbEffects, mSourceName, caster.getClass().getCreatureStats(caster).getActorId());
|
||||||
else
|
else
|
||||||
|
|
|
@ -51,6 +51,16 @@
|
||||||
#include "terrainstorage.hpp"
|
#include "terrainstorage.hpp"
|
||||||
#include "util.hpp"
|
#include "util.hpp"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
float DLLandFogStart;
|
||||||
|
float DLLandFogEnd;
|
||||||
|
float DLUnderwaterFogStart;
|
||||||
|
float DLUnderwaterFogEnd;
|
||||||
|
float DLInteriorFogStart;
|
||||||
|
float DLInteriorFogEnd;
|
||||||
|
}
|
||||||
|
|
||||||
namespace MWRender
|
namespace MWRender
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -173,14 +183,18 @@ namespace MWRender
|
||||||
, mResourceSystem(resourceSystem)
|
, mResourceSystem(resourceSystem)
|
||||||
, mWorkQueue(workQueue)
|
, mWorkQueue(workQueue)
|
||||||
, mUnrefQueue(new SceneUtil::UnrefQueue)
|
, mUnrefQueue(new SceneUtil::UnrefQueue)
|
||||||
, mFogDepth(0.f)
|
, mLandFogStart(0.f)
|
||||||
|
, mLandFogEnd(std::numeric_limits<float>::max())
|
||||||
|
, mUnderwaterFogStart(0.f)
|
||||||
|
, mUnderwaterFogEnd(std::numeric_limits<float>::max())
|
||||||
, mUnderwaterColor(fallback->getFallbackColour("Water_UnderwaterColor"))
|
, mUnderwaterColor(fallback->getFallbackColour("Water_UnderwaterColor"))
|
||||||
, mUnderwaterWeight(fallback->getFallbackFloat("Water_UnderwaterColorWeight"))
|
, mUnderwaterWeight(fallback->getFallbackFloat("Water_UnderwaterColorWeight"))
|
||||||
, mUnderwaterFog(0.f)
|
|
||||||
, mUnderwaterIndoorFog(fallback->getFallbackFloat("Water_UnderwaterIndoorFog"))
|
, mUnderwaterIndoorFog(fallback->getFallbackFloat("Water_UnderwaterIndoorFog"))
|
||||||
, mNightEyeFactor(0.f)
|
, mNightEyeFactor(0.f)
|
||||||
, mFieldOfViewOverride(0.f)
|
, mDistantFog(false)
|
||||||
|
, mDistantTerrain(false)
|
||||||
, mFieldOfViewOverridden(false)
|
, mFieldOfViewOverridden(false)
|
||||||
|
, mFieldOfViewOverride(0.f)
|
||||||
{
|
{
|
||||||
resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem);
|
resourceSystem->getSceneManager()->setParticleSystemMask(MWRender::Mask_ParticleSystem);
|
||||||
resourceSystem->getSceneManager()->setShaderPath(resourcePath + "/shaders");
|
resourceSystem->getSceneManager()->setShaderPath(resourcePath + "/shaders");
|
||||||
|
@ -216,12 +230,20 @@ namespace MWRender
|
||||||
|
|
||||||
mWater.reset(new Water(mRootNode, sceneRoot, mResourceSystem, mViewer->getIncrementalCompileOperation(), fallback, resourcePath));
|
mWater.reset(new Water(mRootNode, sceneRoot, mResourceSystem, mViewer->getIncrementalCompileOperation(), fallback, resourcePath));
|
||||||
|
|
||||||
const bool distantTerrain = Settings::Manager::getBool("distant terrain", "Terrain");
|
DLLandFogStart = Settings::Manager::getFloat("distant land fog start", "Fog");
|
||||||
|
DLLandFogEnd = Settings::Manager::getFloat("distant land fog end", "Fog");
|
||||||
|
DLUnderwaterFogStart = Settings::Manager::getFloat("distant underwater fog start", "Fog");
|
||||||
|
DLUnderwaterFogEnd = Settings::Manager::getFloat("distant underwater fog end", "Fog");
|
||||||
|
DLInteriorFogStart = Settings::Manager::getFloat("distant interior fog start", "Fog");
|
||||||
|
DLInteriorFogEnd = Settings::Manager::getFloat("distant interior fog end", "Fog");
|
||||||
|
|
||||||
|
mDistantFog = Settings::Manager::getBool("use distant fog", "Fog");
|
||||||
|
mDistantTerrain = Settings::Manager::getBool("distant terrain", "Terrain");
|
||||||
mTerrainStorage = new TerrainStorage(mResourceSystem, Settings::Manager::getString("normal map pattern", "Shaders"), Settings::Manager::getString("normal height map pattern", "Shaders"),
|
mTerrainStorage = new TerrainStorage(mResourceSystem, Settings::Manager::getString("normal map pattern", "Shaders"), Settings::Manager::getString("normal height map pattern", "Shaders"),
|
||||||
Settings::Manager::getBool("auto use terrain normal maps", "Shaders"), Settings::Manager::getString("terrain specular map pattern", "Shaders"),
|
Settings::Manager::getBool("auto use terrain normal maps", "Shaders"), Settings::Manager::getString("terrain specular map pattern", "Shaders"),
|
||||||
Settings::Manager::getBool("auto use terrain specular maps", "Shaders"));
|
Settings::Manager::getBool("auto use terrain specular maps", "Shaders"));
|
||||||
|
|
||||||
if (distantTerrain)
|
if (mDistantTerrain)
|
||||||
mTerrain.reset(new Terrain::QuadTreeWorld(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile));
|
mTerrain.reset(new Terrain::QuadTreeWorld(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile));
|
||||||
else
|
else
|
||||||
mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile));
|
mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile));
|
||||||
|
@ -479,14 +501,44 @@ namespace MWRender
|
||||||
{
|
{
|
||||||
osg::Vec4f color = SceneUtil::colourFromRGB(cell->mAmbi.mFog);
|
osg::Vec4f color = SceneUtil::colourFromRGB(cell->mAmbi.mFog);
|
||||||
|
|
||||||
configureFog (cell->mAmbi.mFogDensity, mUnderwaterIndoorFog, color);
|
if(mDistantFog)
|
||||||
|
{
|
||||||
|
float density = std::max(0.2f, cell->mAmbi.mFogDensity);
|
||||||
|
mLandFogStart = (DLInteriorFogEnd*(1.0f-density) + DLInteriorFogStart*density);
|
||||||
|
mLandFogEnd = DLInteriorFogEnd;
|
||||||
|
mUnderwaterFogStart = DLUnderwaterFogStart;
|
||||||
|
mUnderwaterFogEnd = DLUnderwaterFogEnd;
|
||||||
|
mFogColor = color;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
configureFog(cell->mAmbi.mFogDensity, mUnderwaterIndoorFog, 1.0f, 0.0f, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderingManager::configureFog(float fogDepth, float underwaterFog, const osg::Vec4f &color)
|
void RenderingManager::configureFog(float fogDepth, float underwaterFog, float dlFactor, float dlOffset, const osg::Vec4f &color)
|
||||||
{
|
{
|
||||||
mFogDepth = fogDepth;
|
if(mDistantFog)
|
||||||
|
{
|
||||||
|
mLandFogStart = dlFactor * (DLLandFogStart - dlOffset*DLLandFogEnd);
|
||||||
|
mLandFogEnd = dlFactor * (1.0f-dlOffset) * DLLandFogEnd;
|
||||||
|
mUnderwaterFogStart = DLUnderwaterFogStart;
|
||||||
|
mUnderwaterFogEnd = DLUnderwaterFogEnd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(fogDepth == 0.0)
|
||||||
|
{
|
||||||
|
mLandFogStart = 0.0f;
|
||||||
|
mLandFogEnd = std::numeric_limits<float>::max();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mLandFogStart = mViewDistance * (1 - fogDepth);
|
||||||
|
mLandFogEnd = mViewDistance;
|
||||||
|
}
|
||||||
|
mUnderwaterFogStart = mViewDistance * (1 - underwaterFog);
|
||||||
|
mUnderwaterFogEnd = mViewDistance;
|
||||||
|
}
|
||||||
mFogColor = color;
|
mFogColor = color;
|
||||||
mUnderwaterFog = underwaterFog;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SkyManager* RenderingManager::getSkyManager()
|
SkyManager* RenderingManager::getSkyManager()
|
||||||
|
@ -517,23 +569,15 @@ namespace MWRender
|
||||||
float viewDistance = mViewDistance;
|
float viewDistance = mViewDistance;
|
||||||
viewDistance = std::min(viewDistance, 6666.f);
|
viewDistance = std::min(viewDistance, 6666.f);
|
||||||
setFogColor(mUnderwaterColor * mUnderwaterWeight + mFogColor * (1.f-mUnderwaterWeight));
|
setFogColor(mUnderwaterColor * mUnderwaterWeight + mFogColor * (1.f-mUnderwaterWeight));
|
||||||
mStateUpdater->setFogStart(viewDistance * (1 - mUnderwaterFog));
|
mStateUpdater->setFogStart(mUnderwaterFogStart);
|
||||||
mStateUpdater->setFogEnd(viewDistance);
|
mStateUpdater->setFogEnd(mUnderwaterFogEnd);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setFogColor(mFogColor);
|
setFogColor(mFogColor);
|
||||||
|
|
||||||
if (mFogDepth == 0.f)
|
mStateUpdater->setFogStart(mLandFogStart);
|
||||||
{
|
mStateUpdater->setFogEnd(mLandFogEnd);
|
||||||
mStateUpdater->setFogStart(0.f);
|
|
||||||
mStateUpdater->setFogEnd(std::numeric_limits<float>::max());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mStateUpdater->setFogStart(mViewDistance * (1 - mFogDepth));
|
|
||||||
mStateUpdater->setFogEnd(mViewDistance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -960,7 +1004,8 @@ namespace MWRender
|
||||||
else if (it->first == "Camera" && it->second == "viewing distance")
|
else if (it->first == "Camera" && it->second == "viewing distance")
|
||||||
{
|
{
|
||||||
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
mViewDistance = Settings::Manager::getFloat("viewing distance", "Camera");
|
||||||
mStateUpdater->setFogEnd(mViewDistance);
|
if(!mDistantFog)
|
||||||
|
mStateUpdater->setFogEnd(mViewDistance);
|
||||||
updateProjectionMatrix();
|
updateProjectionMatrix();
|
||||||
}
|
}
|
||||||
else if (it->first == "General" && (it->second == "texture filter" ||
|
else if (it->first == "General" && (it->second == "texture filter" ||
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace MWRender
|
||||||
|
|
||||||
void configureAmbient(const ESM::Cell* cell);
|
void configureAmbient(const ESM::Cell* cell);
|
||||||
void configureFog(const ESM::Cell* cell);
|
void configureFog(const ESM::Cell* cell);
|
||||||
void configureFog(float fogDepth, float underwaterFog, const osg::Vec4f& colour);
|
void configureFog(float fogDepth, float underwaterFog, float dlFactor, float dlOffset, const osg::Vec4f& colour);
|
||||||
|
|
||||||
void addCell(const MWWorld::CellStore* store);
|
void addCell(const MWWorld::CellStore* store);
|
||||||
void removeCell(const MWWorld::CellStore* store);
|
void removeCell(const MWWorld::CellStore* store);
|
||||||
|
@ -241,10 +241,12 @@ namespace MWRender
|
||||||
|
|
||||||
osg::ref_ptr<StateUpdater> mStateUpdater;
|
osg::ref_ptr<StateUpdater> mStateUpdater;
|
||||||
|
|
||||||
float mFogDepth;
|
float mLandFogStart;
|
||||||
|
float mLandFogEnd;
|
||||||
|
float mUnderwaterFogStart;
|
||||||
|
float mUnderwaterFogEnd;
|
||||||
osg::Vec4f mUnderwaterColor;
|
osg::Vec4f mUnderwaterColor;
|
||||||
float mUnderwaterWeight;
|
float mUnderwaterWeight;
|
||||||
float mUnderwaterFog;
|
|
||||||
float mUnderwaterIndoorFog;
|
float mUnderwaterIndoorFog;
|
||||||
osg::Vec4f mFogColor;
|
osg::Vec4f mFogColor;
|
||||||
|
|
||||||
|
@ -253,8 +255,10 @@ namespace MWRender
|
||||||
|
|
||||||
float mNearClip;
|
float mNearClip;
|
||||||
float mViewDistance;
|
float mViewDistance;
|
||||||
|
bool mDistantFog : 1;
|
||||||
|
bool mDistantTerrain : 1;
|
||||||
|
bool mFieldOfViewOverridden : 1;
|
||||||
float mFieldOfViewOverride;
|
float mFieldOfViewOverride;
|
||||||
bool mFieldOfViewOverridden;
|
|
||||||
float mFieldOfView;
|
float mFieldOfView;
|
||||||
float mFirstPersonFieldOfView;
|
float mFirstPersonFieldOfView;
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,9 @@ namespace MWRender
|
||||||
|
|
||||||
float mFogDepth;
|
float mFogDepth;
|
||||||
|
|
||||||
|
float mDLFogFactor;
|
||||||
|
float mDLFogOffset;
|
||||||
|
|
||||||
float mWindSpeed;
|
float mWindSpeed;
|
||||||
|
|
||||||
float mCloudSpeed;
|
float mCloudSpeed;
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace MWWorld
|
||||||
playerRef->mBase->mClass
|
playerRef->mBase->mClass
|
||||||
);
|
);
|
||||||
|
|
||||||
npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true);
|
npcStats.increaseSkill (ref->mBase->mData.mSkillId, *class_, true, true);
|
||||||
|
|
||||||
npcStats.flagAsUsed (ref->mBase->mId);
|
npcStats.flagAsUsed (ref->mBase->mId);
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,8 @@ Weather::Weather(const std::string& name,
|
||||||
const Fallback::Map& fallback,
|
const Fallback::Map& fallback,
|
||||||
float stormWindSpeed,
|
float stormWindSpeed,
|
||||||
float rainSpeed,
|
float rainSpeed,
|
||||||
|
float dlFactor,
|
||||||
|
float dlOffset,
|
||||||
const std::string& particleEffect)
|
const std::string& particleEffect)
|
||||||
: mCloudTexture(fallback.getFallbackString("Weather_" + name + "_Cloud_Texture"))
|
: mCloudTexture(fallback.getFallbackString("Weather_" + name + "_Cloud_Texture"))
|
||||||
, mSkyColor(fallback.getFallbackColour("Weather_" + name +"_Sky_Sunrise_Color"),
|
, mSkyColor(fallback.getFallbackColour("Weather_" + name +"_Sky_Sunrise_Color"),
|
||||||
|
@ -141,6 +143,8 @@ Weather::Weather(const std::string& name,
|
||||||
, mFlashDecrement(fallback.getFallbackFloat("Weather_" + name + "_Flash_Decrement"))
|
, mFlashDecrement(fallback.getFallbackFloat("Weather_" + name + "_Flash_Decrement"))
|
||||||
, mFlashBrightness(0.0f)
|
, mFlashBrightness(0.0f)
|
||||||
{
|
{
|
||||||
|
mDL.FogFactor = dlFactor;
|
||||||
|
mDL.FogOffset = dlOffset;
|
||||||
mThunderSoundID[0] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_0");
|
mThunderSoundID[0] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_0");
|
||||||
mThunderSoundID[1] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_1");
|
mThunderSoundID[1] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_1");
|
||||||
mThunderSoundID[2] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_2");
|
mThunderSoundID[2] = fallback.getFallbackString("Weather_" + name + "_Thunder_Sound_ID_2");
|
||||||
|
@ -541,16 +545,18 @@ WeatherManager::WeatherManager(MWRender::RenderingManager& rendering, const Fall
|
||||||
mTimeSettings.mSunriseTime = mSunriseTime;
|
mTimeSettings.mSunriseTime = mSunriseTime;
|
||||||
|
|
||||||
mWeatherSettings.reserve(10);
|
mWeatherSettings.reserve(10);
|
||||||
addWeather("Clear", fallback); // 0
|
// These distant land fog factor and offset values are the defaults MGE XE provides. Should be
|
||||||
addWeather("Cloudy", fallback); // 1
|
// provided by settings somewhere?
|
||||||
addWeather("Foggy", fallback); // 2
|
addWeather("Clear", fallback, 1.0f, 0.0f); // 0
|
||||||
addWeather("Overcast", fallback); // 3
|
addWeather("Cloudy", fallback, 0.9f, 0.0f); // 1
|
||||||
addWeather("Rain", fallback); // 4
|
addWeather("Foggy", fallback, 0.2f, 30.0f); // 2
|
||||||
addWeather("Thunderstorm", fallback); // 5
|
addWeather("Overcast", fallback, 0.7f, 0.0f); // 3
|
||||||
addWeather("Ashstorm", fallback, "meshes\\ashcloud.nif"); // 6
|
addWeather("Rain", fallback, 0.5f, 10.0f); // 4
|
||||||
addWeather("Blight", fallback, "meshes\\blightcloud.nif"); // 7
|
addWeather("Thunderstorm", fallback, 0.5f, 20.0f); // 5
|
||||||
addWeather("Snow", fallback, "meshes\\snow.nif"); // 8
|
addWeather("Ashstorm", fallback, 0.2f, 50.0f, "meshes\\ashcloud.nif"); // 6
|
||||||
addWeather("Blizzard", fallback, "meshes\\blizzard.nif"); // 9
|
addWeather("Blight", fallback, 0.2f, 60.0f, "meshes\\blightcloud.nif"); // 7
|
||||||
|
addWeather("Snow", fallback, 0.5f, 40.0f, "meshes\\snow.nif"); // 8
|
||||||
|
addWeather("Blizzard", fallback, 0.16f, 70.0f, "meshes\\blizzard.nif"); // 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)
|
||||||
|
@ -718,7 +724,8 @@ void WeatherManager::update(float duration, bool paused, const TimeStamp& time,
|
||||||
mRendering.getSkyManager()->setMasserState(mMasser.calculateState(time));
|
mRendering.getSkyManager()->setMasserState(mMasser.calculateState(time));
|
||||||
mRendering.getSkyManager()->setSecundaState(mSecunda.calculateState(time));
|
mRendering.getSkyManager()->setSecundaState(mSecunda.calculateState(time));
|
||||||
|
|
||||||
mRendering.configureFog(mResult.mFogDepth, underwaterFog, mResult.mFogColor);
|
mRendering.configureFog(mResult.mFogDepth, underwaterFog, mResult.mDLFogFactor,
|
||||||
|
mResult.mDLFogOffset/100.0f, mResult.mFogColor);
|
||||||
mRendering.setAmbientColour(mResult.mAmbientColor);
|
mRendering.setAmbientColour(mResult.mAmbientColor);
|
||||||
mRendering.setSunColour(mResult.mSunColor, mResult.mSunColor * mResult.mGlareView);
|
mRendering.setSunColour(mResult.mSunColor, mResult.mSunColor * mResult.mGlareView);
|
||||||
|
|
||||||
|
@ -863,11 +870,12 @@ void WeatherManager::clear()
|
||||||
|
|
||||||
inline void WeatherManager::addWeather(const std::string& name,
|
inline void WeatherManager::addWeather(const std::string& name,
|
||||||
const Fallback::Map& fallback,
|
const Fallback::Map& fallback,
|
||||||
|
float dlFactor, float dlOffset,
|
||||||
const std::string& particleEffect)
|
const std::string& particleEffect)
|
||||||
{
|
{
|
||||||
static const float fStromWindSpeed = mStore.get<ESM::GameSetting>().find("fStromWindSpeed")->getFloat();
|
static const float fStromWindSpeed = mStore.get<ESM::GameSetting>().find("fStromWindSpeed")->getFloat();
|
||||||
|
|
||||||
Weather weather(name, fallback, fStromWindSpeed, mRainSpeed, particleEffect);
|
Weather weather(name, fallback, fStromWindSpeed, mRainSpeed, dlFactor, dlOffset, particleEffect);
|
||||||
|
|
||||||
mWeatherSettings.push_back(weather);
|
mWeatherSettings.push_back(weather);
|
||||||
}
|
}
|
||||||
|
@ -1055,6 +1063,8 @@ inline void WeatherManager::calculateResult(const int weatherID, const float gam
|
||||||
mResult.mNight = (gameHour < mSunriseTime || gameHour > mTimeSettings.mNightStart - 1);
|
mResult.mNight = (gameHour < mSunriseTime || gameHour > mTimeSettings.mNightStart - 1);
|
||||||
|
|
||||||
mResult.mFogDepth = current.mLandFogDepth.getValue(gameHour, mTimeSettings);
|
mResult.mFogDepth = current.mLandFogDepth.getValue(gameHour, mTimeSettings);
|
||||||
|
mResult.mDLFogFactor = current.mDL.FogFactor;
|
||||||
|
mResult.mDLFogOffset = current.mDL.FogOffset;
|
||||||
mResult.mFogColor = current.mFogColor.getValue(gameHour, mTimeSettings);
|
mResult.mFogColor = current.mFogColor.getValue(gameHour, mTimeSettings);
|
||||||
mResult.mAmbientColor = current.mAmbientColor.getValue(gameHour, mTimeSettings);
|
mResult.mAmbientColor = current.mAmbientColor.getValue(gameHour, mTimeSettings);
|
||||||
mResult.mSunColor = current.mSunColor.getValue(gameHour, mTimeSettings);
|
mResult.mSunColor = current.mSunColor.getValue(gameHour, mTimeSettings);
|
||||||
|
@ -1110,6 +1120,8 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
|
||||||
mResult.mAmbientColor = lerp(current.mAmbientColor, other.mAmbientColor, factor);
|
mResult.mAmbientColor = lerp(current.mAmbientColor, other.mAmbientColor, factor);
|
||||||
mResult.mSunDiscColor = lerp(current.mSunDiscColor, other.mSunDiscColor, factor);
|
mResult.mSunDiscColor = lerp(current.mSunDiscColor, other.mSunDiscColor, factor);
|
||||||
mResult.mFogDepth = lerp(current.mFogDepth, other.mFogDepth, factor);
|
mResult.mFogDepth = lerp(current.mFogDepth, other.mFogDepth, factor);
|
||||||
|
mResult.mDLFogFactor = lerp(current.mDLFogFactor, other.mDLFogFactor, factor);
|
||||||
|
mResult.mDLFogOffset = lerp(current.mDLFogOffset, other.mDLFogOffset, factor);
|
||||||
mResult.mWindSpeed = lerp(current.mWindSpeed, other.mWindSpeed, factor);
|
mResult.mWindSpeed = lerp(current.mWindSpeed, other.mWindSpeed, factor);
|
||||||
mResult.mCloudSpeed = lerp(current.mCloudSpeed, other.mCloudSpeed, factor);
|
mResult.mCloudSpeed = lerp(current.mCloudSpeed, other.mCloudSpeed, factor);
|
||||||
mResult.mGlareView = lerp(current.mGlareView, other.mGlareView, factor);
|
mResult.mGlareView = lerp(current.mGlareView, other.mGlareView, factor);
|
||||||
|
|
|
@ -73,6 +73,8 @@ namespace MWWorld
|
||||||
const Fallback::Map& fallback,
|
const Fallback::Map& fallback,
|
||||||
float stormWindSpeed,
|
float stormWindSpeed,
|
||||||
float rainSpeed,
|
float rainSpeed,
|
||||||
|
float dlFactor,
|
||||||
|
float dlOffset,
|
||||||
const std::string& particleEffect);
|
const std::string& particleEffect);
|
||||||
|
|
||||||
std::string mCloudTexture;
|
std::string mCloudTexture;
|
||||||
|
@ -102,6 +104,12 @@ namespace MWWorld
|
||||||
// Also appears to modify how visible the sun, moons, and stars are for various weather effects.
|
// Also appears to modify how visible the sun, moons, and stars are for various weather effects.
|
||||||
float mGlareView;
|
float mGlareView;
|
||||||
|
|
||||||
|
// Fog factor and offset used with distant land rendering.
|
||||||
|
struct {
|
||||||
|
float FogFactor;
|
||||||
|
float FogOffset;
|
||||||
|
} mDL;
|
||||||
|
|
||||||
// Sound effect
|
// Sound effect
|
||||||
// This is used for Blight, Ashstorm and Blizzard (Bloodmoon)
|
// This is used for Blight, Ashstorm and Blizzard (Bloodmoon)
|
||||||
std::string mAmbientLoopSoundID;
|
std::string mAmbientLoopSoundID;
|
||||||
|
@ -293,6 +301,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void addWeather(const std::string& name,
|
void addWeather(const std::string& name,
|
||||||
const Fallback::Map& fallback,
|
const Fallback::Map& fallback,
|
||||||
|
float dlFactor, float dlOffset,
|
||||||
const std::string& particleEffect = "");
|
const std::string& particleEffect = "");
|
||||||
|
|
||||||
void importRegions();
|
void importRegions();
|
||||||
|
|
|
@ -339,52 +339,76 @@ namespace Gui
|
||||||
+ MyGUI::utility::toString((fontSize-data[i].ascent)));
|
+ MyGUI::utility::toString((fontSize-data[i].ascent)));
|
||||||
code->addAttribute("size", MyGUI::IntSize(static_cast<int>(data[i].width), static_cast<int>(data[i].height)));
|
code->addAttribute("size", MyGUI::IntSize(static_cast<int>(data[i].width), static_cast<int>(data[i].height)));
|
||||||
|
|
||||||
// More hacks! The french game uses several win1252 characters that are not included
|
// Fall back from unavailable Windows-1252 encoding symbols to similar characters available in the game fonts
|
||||||
// in the cp437 encoding of the font. Fall back to similar available characters.
|
std::multimap<int, int> additional; // fallback glyph index, unicode
|
||||||
if (mEncoding == ToUTF8::CP437)
|
additional.insert(std::make_pair(156, 0x00A2)); // cent sign
|
||||||
|
additional.insert(std::make_pair(89, 0x00A5)); // yen sign
|
||||||
|
additional.insert(std::make_pair(221, 0x00A6)); // broken bar
|
||||||
|
additional.insert(std::make_pair(99, 0x00A9)); // copyright sign
|
||||||
|
additional.insert(std::make_pair(97, 0x00AA)); // prima ordinal indicator
|
||||||
|
additional.insert(std::make_pair(60, 0x00AB)); // double left-pointing angle quotation mark
|
||||||
|
additional.insert(std::make_pair(45, 0x00AD)); // soft hyphen
|
||||||
|
additional.insert(std::make_pair(114, 0x00AE)); // registered trademark symbol
|
||||||
|
additional.insert(std::make_pair(45, 0x00AF)); // macron
|
||||||
|
additional.insert(std::make_pair(241, 0x00B1)); // plus-minus sign
|
||||||
|
additional.insert(std::make_pair(50, 0x00B2)); // superscript two
|
||||||
|
additional.insert(std::make_pair(51, 0x00B3)); // superscript three
|
||||||
|
additional.insert(std::make_pair(44, 0x00B8)); // cedilla
|
||||||
|
additional.insert(std::make_pair(49, 0x00B9)); // superscript one
|
||||||
|
additional.insert(std::make_pair(111, 0x00BA)); // primo ordinal indicator
|
||||||
|
additional.insert(std::make_pair(62, 0x00BB)); // double right-pointing angle quotation mark
|
||||||
|
additional.insert(std::make_pair(63, 0x00BF)); // inverted question mark
|
||||||
|
additional.insert(std::make_pair(65, 0x00C6)); // latin capital ae ligature
|
||||||
|
additional.insert(std::make_pair(79, 0x00D8)); // latin capital o with stroke
|
||||||
|
additional.insert(std::make_pair(97, 0x00E6)); // latin small ae ligature
|
||||||
|
additional.insert(std::make_pair(111, 0x00F8)); // latin small o with stroke
|
||||||
|
additional.insert(std::make_pair(79, 0x0152)); // latin capital oe ligature
|
||||||
|
additional.insert(std::make_pair(111, 0x0153)); // latin small oe ligature
|
||||||
|
additional.insert(std::make_pair(83, 0x015A)); // latin capital s with caron
|
||||||
|
additional.insert(std::make_pair(115, 0x015B)); // latin small s with caron
|
||||||
|
additional.insert(std::make_pair(89, 0x0178)); // latin capital y with diaresis
|
||||||
|
additional.insert(std::make_pair(90, 0x017D)); // latin capital z with caron
|
||||||
|
additional.insert(std::make_pair(122, 0x017E)); // latin small z with caron
|
||||||
|
additional.insert(std::make_pair(102, 0x0192)); // latin small f with hook
|
||||||
|
additional.insert(std::make_pair(94, 0x02C6)); // circumflex modifier
|
||||||
|
additional.insert(std::make_pair(126, 0x02DC)); // small tilde
|
||||||
|
additional.insert(std::make_pair(69, 0x0401)); // cyrillic capital io (no diaeresis latin e is available)
|
||||||
|
additional.insert(std::make_pair(137, 0x0451)); // cyrillic small io
|
||||||
|
additional.insert(std::make_pair(45, 0x2012)); // figure dash
|
||||||
|
additional.insert(std::make_pair(45, 0x2013)); // en dash
|
||||||
|
additional.insert(std::make_pair(45, 0x2014)); // em dash
|
||||||
|
additional.insert(std::make_pair(39, 0x2018)); // left single quotation mark
|
||||||
|
additional.insert(std::make_pair(39, 0x2019)); // right single quotation mark
|
||||||
|
additional.insert(std::make_pair(44, 0x201A)); // single low quotation mark
|
||||||
|
additional.insert(std::make_pair(39, 0x201B)); // single high quotation mark (reversed)
|
||||||
|
additional.insert(std::make_pair(34, 0x201C)); // left double quotation mark
|
||||||
|
additional.insert(std::make_pair(34, 0x201D)); // right double quotation mark
|
||||||
|
additional.insert(std::make_pair(44, 0x201E)); // double low quotation mark
|
||||||
|
additional.insert(std::make_pair(34, 0x201F)); // double high quotation mark (reversed)
|
||||||
|
additional.insert(std::make_pair(43, 0x2020)); // dagger
|
||||||
|
additional.insert(std::make_pair(216, 0x2021)); // double dagger (note: this glyph is not available)
|
||||||
|
additional.insert(std::make_pair(46, 0x2026)); // ellipsis
|
||||||
|
additional.insert(std::make_pair(37, 0x2030)); // per mille sign
|
||||||
|
additional.insert(std::make_pair(60, 0x2039)); // single left-pointing angle quotation mark
|
||||||
|
additional.insert(std::make_pair(62, 0x203A)); // single right-pointing angle quotation mark
|
||||||
|
additional.insert(std::make_pair(101, 0x20AC)); // euro sign
|
||||||
|
additional.insert(std::make_pair(84, 0x2122)); // trademark sign
|
||||||
|
additional.insert(std::make_pair(45, 0x2212)); // minus sign
|
||||||
|
|
||||||
|
for (std::multimap<int, int>::iterator it = additional.begin(); it != additional.end(); ++it)
|
||||||
{
|
{
|
||||||
std::multimap<int, int> additional; // <cp437, unicode>
|
if (it->first != i)
|
||||||
additional.insert(std::make_pair(39, 0x2019)); // apostrophe
|
continue;
|
||||||
additional.insert(std::make_pair(45, 0x2013)); // dash
|
code = codes->createChild("Code");
|
||||||
additional.insert(std::make_pair(45, 0x2014)); // dash
|
code->addAttribute("index", it->second);
|
||||||
additional.insert(std::make_pair(34, 0x201D)); // right double quotation mark
|
code->addAttribute("coord", MyGUI::utility::toString(x1) + " "
|
||||||
additional.insert(std::make_pair(34, 0x201C)); // left double quotation mark
|
+ MyGUI::utility::toString(y1) + " "
|
||||||
additional.insert(std::make_pair(44, 0x201A));
|
+ MyGUI::utility::toString(w) + " "
|
||||||
additional.insert(std::make_pair(44, 0x201E));
|
+ MyGUI::utility::toString(h));
|
||||||
additional.insert(std::make_pair(43, 0x2020));
|
code->addAttribute("advance", data[i].width);
|
||||||
additional.insert(std::make_pair(94, 0x02C6));
|
code->addAttribute("bearing", MyGUI::utility::toString(data[i].kerning) + " "
|
||||||
additional.insert(std::make_pair(37, 0x2030));
|
+ MyGUI::utility::toString((fontSize-data[i].ascent)));
|
||||||
additional.insert(std::make_pair(83, 0x0160));
|
code->addAttribute("size", MyGUI::IntSize(static_cast<int>(data[i].width), static_cast<int>(data[i].height)));
|
||||||
additional.insert(std::make_pair(60, 0x2039));
|
|
||||||
additional.insert(std::make_pair(79, 0x0152));
|
|
||||||
additional.insert(std::make_pair(90, 0x017D));
|
|
||||||
additional.insert(std::make_pair(39, 0x2019));
|
|
||||||
additional.insert(std::make_pair(126, 0x02DC));
|
|
||||||
additional.insert(std::make_pair(84, 0x2122));
|
|
||||||
additional.insert(std::make_pair(83, 0x0161));
|
|
||||||
additional.insert(std::make_pair(62, 0x203A));
|
|
||||||
additional.insert(std::make_pair(111, 0x0153));
|
|
||||||
additional.insert(std::make_pair(122, 0x017E));
|
|
||||||
additional.insert(std::make_pair(89, 0x0178));
|
|
||||||
additional.insert(std::make_pair(156, 0x00A2));
|
|
||||||
additional.insert(std::make_pair(46, 0x2026));
|
|
||||||
|
|
||||||
for (std::multimap<int, int>::iterator it = additional.begin(); it != additional.end(); ++it)
|
|
||||||
{
|
|
||||||
if (it->first != i)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
code = codes->createChild("Code");
|
|
||||||
code->addAttribute("index", it->second);
|
|
||||||
code->addAttribute("coord", MyGUI::utility::toString(x1) + " "
|
|
||||||
+ MyGUI::utility::toString(y1) + " "
|
|
||||||
+ MyGUI::utility::toString(w) + " "
|
|
||||||
+ MyGUI::utility::toString(h));
|
|
||||||
code->addAttribute("advance", data[i].width);
|
|
||||||
code->addAttribute("bearing", MyGUI::utility::toString(data[i].kerning) + " "
|
|
||||||
+ MyGUI::utility::toString((fontSize-data[i].ascent)));
|
|
||||||
code->addAttribute("size", MyGUI::IntSize(static_cast<int>(data[i].width), static_cast<int>(data[i].height)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ASCII vertical bar, use this as text input cursor
|
// ASCII vertical bar, use this as text input cursor
|
||||||
|
|
|
@ -90,6 +90,24 @@ pointers cache size = 40
|
||||||
# If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells
|
# If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells
|
||||||
distant terrain = false
|
distant terrain = false
|
||||||
|
|
||||||
|
[Fog]
|
||||||
|
|
||||||
|
# If true, use extended fog parameters for distant terrain not controlled by
|
||||||
|
# viewing distance. If false, use the standard fog calculations.
|
||||||
|
use distant fog = false
|
||||||
|
|
||||||
|
distant land fog start = 16384
|
||||||
|
|
||||||
|
distant land fog end = 40960
|
||||||
|
|
||||||
|
distant underwater fog start = -4096
|
||||||
|
|
||||||
|
distant underwater fog end = 2457.6
|
||||||
|
|
||||||
|
distant interior fog start = 0
|
||||||
|
|
||||||
|
distant interior fog end = 16384
|
||||||
|
|
||||||
[Map]
|
[Map]
|
||||||
|
|
||||||
# Size of each exterior cell in pixels in the world map. (e.g. 12 to 24).
|
# Size of each exterior cell in pixels in the world map. (e.g. 12 to 24).
|
||||||
|
@ -182,6 +200,9 @@ classic reflect absorb attribute behavior = true
|
||||||
# Show duration of magic effect and lights in the spells window.
|
# Show duration of magic effect and lights in the spells window.
|
||||||
show effect duration = false
|
show effect duration = false
|
||||||
|
|
||||||
|
# Account for the first follower in fast travel cost calculations.
|
||||||
|
charge for every follower travelling = false
|
||||||
|
|
||||||
# Prevents merchants from equipping items that are sold to them.
|
# Prevents merchants from equipping items that are sold to them.
|
||||||
prevent merchant equipping = false
|
prevent merchant equipping = false
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue