mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 21:45:35 +00:00
Apply ambient lighting to free magic VFX
This commit is contained in:
parent
d476c8cf57
commit
d0918ed1f2
6 changed files with 7 additions and 9 deletions
|
@ -516,7 +516,7 @@ namespace MWBase
|
||||||
virtual void spawnBloodEffect(const MWWorld::Ptr& ptr, const osg::Vec3f& worldPosition) = 0;
|
virtual void spawnBloodEffect(const MWWorld::Ptr& ptr, const osg::Vec3f& worldPosition) = 0;
|
||||||
|
|
||||||
virtual void spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
virtual void spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
||||||
const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true, bool useAmbientLight = false)
|
const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true, bool useAmbientLight = true)
|
||||||
= 0;
|
= 0;
|
||||||
|
|
||||||
/// @see MWWorld::WeatherManager::isInStorm
|
/// @see MWWorld::WeatherManager::isInStorm
|
||||||
|
|
|
@ -329,10 +329,8 @@ namespace MWLua
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
context.mLuaManager->addAction(
|
context.mLuaManager->addAction([world, model = VFS::Path::Normalized(model),
|
||||||
[world, model = VFS::Path::Normalized(model), worldPos]() {
|
worldPos]() { world->spawnEffect(model, "", worldPos, 1.f); },
|
||||||
world->spawnEffect(model, "", worldPos, 1.f, true, true);
|
|
||||||
},
|
|
||||||
"openmw.vfx.spawn");
|
"openmw.vfx.spawn");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,7 +35,7 @@ namespace MWRender
|
||||||
|
|
||||||
/// Add an effect. When it's finished playing, it will be removed automatically.
|
/// Add an effect. When it's finished playing, it will be removed automatically.
|
||||||
void addEffect(VFS::Path::NormalizedView model, std::string_view textureOverride,
|
void addEffect(VFS::Path::NormalizedView model, std::string_view textureOverride,
|
||||||
const osg::Vec3f& worldPosition, float scale, bool isMagicVFX = true, bool useAmbientLight = false);
|
const osg::Vec3f& worldPosition, float scale, bool isMagicVFX = true, bool useAmbientLight = true);
|
||||||
|
|
||||||
void update(float dt);
|
void update(float dt);
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ namespace MWRender
|
||||||
SkyManager* getSkyManager();
|
SkyManager* getSkyManager();
|
||||||
|
|
||||||
void spawnEffect(VFS::Path::NormalizedView model, std::string_view texture, const osg::Vec3f& worldPosition,
|
void spawnEffect(VFS::Path::NormalizedView model, std::string_view texture, const osg::Vec3f& worldPosition,
|
||||||
float scale = 1.f, bool isMagicVFX = true, bool useAmbientLight = false);
|
float scale = 1.f, bool isMagicVFX = true, bool useAmbientLight = true);
|
||||||
|
|
||||||
/// Clear all savegame-specific data
|
/// Clear all savegame-specific data
|
||||||
void clear();
|
void clear();
|
||||||
|
|
|
@ -3685,7 +3685,7 @@ namespace MWWorld
|
||||||
const VFS::Path::Normalized model = Misc::ResourceHelpers::correctMeshPath(
|
const VFS::Path::Normalized model = Misc::ResourceHelpers::correctMeshPath(
|
||||||
VFS::Path::Normalized(Fallback::Map::getString("Blood_Model_" + std::to_string(number))));
|
VFS::Path::Normalized(Fallback::Map::getString("Blood_Model_" + std::to_string(number))));
|
||||||
|
|
||||||
mRendering->spawnEffect(model, texture, worldPosition, 1.0f, false);
|
mRendering->spawnEffect(model, texture, worldPosition, 1.0f, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
void World::spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
||||||
|
|
|
@ -604,7 +604,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
void spawnEffect(VFS::Path::NormalizedView model, const std::string& textureOverride,
|
||||||
const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true,
|
const osg::Vec3f& worldPos, float scale = 1.f, bool isMagicVFX = true,
|
||||||
bool useAmbientLight = false) override;
|
bool useAmbientLight = true) override;
|
||||||
|
|
||||||
/// @see MWWorld::WeatherManager::isInStorm
|
/// @see MWWorld::WeatherManager::isInStorm
|
||||||
bool isInStorm() const override;
|
bool isInStorm() const override;
|
||||||
|
|
Loading…
Reference in a new issue