mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 09:06:43 +00:00
Tidying up
This commit is contained in:
parent
ef5cf76ad8
commit
c2e5f24e98
1 changed files with 4 additions and 4 deletions
|
@ -169,7 +169,7 @@ namespace MWWorld
|
||||||
|
|
||||||
if (createLight)
|
if (createLight)
|
||||||
{
|
{
|
||||||
// Combine colors of individual effects
|
// Case: magical effects (combine colors of individual effects)
|
||||||
osg::Vec4 lightDiffuseColor;
|
osg::Vec4 lightDiffuseColor;
|
||||||
if (state.mIdMagic.size() > 0)
|
if (state.mIdMagic.size() > 0)
|
||||||
{
|
{
|
||||||
|
@ -189,14 +189,14 @@ namespace MWWorld
|
||||||
, lightDiffuseGreen / numberOfEffects
|
, lightDiffuseGreen / numberOfEffects
|
||||||
, lightDiffuseBlue / numberOfEffects
|
, lightDiffuseBlue / numberOfEffects
|
||||||
, 1.0f);
|
, 1.0f);
|
||||||
printf("%f, %f, %f", (lightDiffuseRed / numberOfEffects), (lightDiffuseGreen / numberOfEffects), (lightDiffuseBlue / numberOfEffects));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Case: no magical effects, but still creating light
|
||||||
lightDiffuseColor = osg::Vec4(0.814f, 0.682f, 0.652f, 1.0f);
|
lightDiffuseColor = osg::Vec4(0.814f, 0.682f, 0.652f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add magic bolt light
|
// Add light
|
||||||
osg::ref_ptr<osg::Light> projectileLight(new osg::Light);
|
osg::ref_ptr<osg::Light> projectileLight(new osg::Light);
|
||||||
projectileLight->setAmbient(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
projectileLight->setAmbient(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||||
projectileLight->setDiffuse(lightDiffuseColor);
|
projectileLight->setDiffuse(lightDiffuseColor);
|
||||||
|
@ -206,7 +206,7 @@ namespace MWWorld
|
||||||
projectileLight->setQuadraticAttenuation(0.f);
|
projectileLight->setQuadraticAttenuation(0.f);
|
||||||
projectileLight->setPosition(osg::Vec4(pos, 1.0));
|
projectileLight->setPosition(osg::Vec4(pos, 1.0));
|
||||||
|
|
||||||
// Add magic bolt light source
|
// Add light source
|
||||||
SceneUtil::LightSource* projectileLightSource = new SceneUtil::LightSource;
|
SceneUtil::LightSource* projectileLightSource = new SceneUtil::LightSource;
|
||||||
projectileLightSource->setNodeMask(MWRender::Mask_Lighting);
|
projectileLightSource->setNodeMask(MWRender::Mask_Lighting);
|
||||||
projectileLightSource->setRadius(66.f);
|
projectileLightSource->setRadius(66.f);
|
||||||
|
|
Loading…
Reference in a new issue