forked from mirror/openmw-tes3mp
Merge pull request #1034 from Allofich/telekinesis
Correct telekinesis glow length
This commit is contained in:
commit
7e167ab7e2
3 changed files with 7 additions and 5 deletions
|
@ -124,7 +124,7 @@ namespace MWClass
|
||||||
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
int index = ESM::MagicEffect::effectStringToId("sEffectTelekinesis");
|
||||||
const ESM::MagicEffect *effect = store.get<ESM::MagicEffect>().find(index);
|
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
|
// make key id lowercase
|
||||||
|
|
|
@ -1187,7 +1187,7 @@ namespace MWRender
|
||||||
int mLowestUnusedTexUnit;
|
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);
|
osg::Vec4f glowColor(1,1,1,1);
|
||||||
glowColor.x() = effect->mData.mRed / 255.f;
|
glowColor.x() = effect->mData.mRed / 255.f;
|
||||||
|
@ -1202,10 +1202,10 @@ namespace MWRender
|
||||||
if (mGlowUpdater && mGlowUpdater->isPermanentGlowUpdater())
|
if (mGlowUpdater && mGlowUpdater->isPermanentGlowUpdater())
|
||||||
{
|
{
|
||||||
mGlowUpdater->setColor(glowColor);
|
mGlowUpdater->setColor(glowColor);
|
||||||
mGlowUpdater->setDuration(1.5); // Glow length measured from original engine as about 1.5 seconds
|
mGlowUpdater->setDuration(glowDuration);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
addGlow(mObjectRoot, glowColor, 1.5);
|
addGlow(mObjectRoot, glowColor, glowDuration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -360,7 +360,9 @@ public:
|
||||||
void removeEffect (int effectId);
|
void removeEffect (int effectId);
|
||||||
void getLoopingEffects (std::vector<int>& out) const;
|
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);
|
virtual void updatePtr(const MWWorld::Ptr &ptr);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue