1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-30 13:15:32 +00:00

Correct telekinesis glow length

This commit is contained in:
Allofich 2016-08-23 23:13:37 +09:00
parent 346f5a19a3
commit 7db31ab58a
3 changed files with 7 additions and 5 deletions

View file

@ -124,7 +124,7 @@ namespace MWClass
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
animation->addSpellCastGlow(effect); // TODO: Telekinesis glow should only be as long as the door animation
animation->addSpellCastGlow(effect, 1); // 1 second glow to match the time taken for a door opening or closing
}
// make key id lowercase

View file

@ -1187,7 +1187,7 @@ namespace MWRender
int mLowestUnusedTexUnit;
};
void Animation::addSpellCastGlow(const ESM::MagicEffect *effect)
void Animation::addSpellCastGlow(const ESM::MagicEffect *effect, float glowDuration)
{
osg::Vec4f glowColor(1,1,1,1);
glowColor.x() = effect->mData.mRed / 255.f;
@ -1202,10 +1202,10 @@ namespace MWRender
if (mGlowUpdater && mGlowUpdater->isPermanentGlowUpdater())
{
mGlowUpdater->setColor(glowColor);
mGlowUpdater->setDuration(1.5); // Glow length measured from original engine as about 1.5 seconds
mGlowUpdater->setDuration(glowDuration);
}
else
addGlow(mObjectRoot, glowColor, 1.5);
addGlow(mObjectRoot, glowColor, glowDuration);
}
}

View file

@ -360,7 +360,9 @@ public:
void removeEffect (int effectId);
void getLoopingEffects (std::vector<int>& out) const;
void addSpellCastGlow(const ESM::MagicEffect *effect);
// Add a spell casting glow to an object. From measuring video taken from the original engine,
// the glow seems to be about 1.5 seconds except for telekinesis, which is 1 second.
void addSpellCastGlow(const ESM::MagicEffect *effect, float glowDuration = 1.5);
virtual void updatePtr(const MWWorld::Ptr &ptr);