1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 04:53:51 +00:00

Use const ref instead of value

This commit is contained in:
Nelsson Huotari 2020-11-20 19:41:01 +02:00
parent 32d4344803
commit 3232faa703

View file

@ -115,7 +115,7 @@ namespace OsgaController
float newTime = time; float newTime = time;
//Find the correct animation based on time //Find the correct animation based on time
for (auto emulatedAnimation : mEmulatedAnimations) for (const EmulatedAnimation& emulatedAnimation : mEmulatedAnimations)
{ {
if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime) if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime)
{ {
@ -125,7 +125,7 @@ namespace OsgaController
} }
//Find the root transform track in animation //Find the root transform track in animation
for (auto mergedAnimationTrack : mMergedAnimationTracks) for (const osg::ref_ptr<Resource::Animation> mergedAnimationTrack : mMergedAnimationTracks)
{ {
if (mergedAnimationTrack->getName() != animationName) continue; if (mergedAnimationTrack->getName() != animationName) continue;
@ -150,7 +150,7 @@ namespace OsgaController
void KeyframeController::update(float time, std::string animationName) void KeyframeController::update(float time, std::string animationName)
{ {
for (auto mergedAnimationTrack : mMergedAnimationTracks) for (const osg::ref_ptr<Resource::Animation> mergedAnimationTrack : mMergedAnimationTracks)
{ {
if (mergedAnimationTrack->getName() == animationName) mergedAnimationTrack->update(time); if (mergedAnimationTrack->getName() == animationName) mergedAnimationTrack->update(time);
} }
@ -162,7 +162,7 @@ namespace OsgaController
{ {
if (mNeedToLink) if (mNeedToLink)
{ {
for (auto mergedAnimationTrack : mMergedAnimationTracks) for (const osg::ref_ptr<Resource::Animation> mergedAnimationTrack : mMergedAnimationTracks)
{ {
if (!mLinker.valid()) mLinker = new LinkVisitor(); if (!mLinker.valid()) mLinker = new LinkVisitor();
mLinker->setAnimation(mergedAnimationTrack); mLinker->setAnimation(mergedAnimationTrack);
@ -173,7 +173,7 @@ namespace OsgaController
float time = getInputValue(nv); float time = getInputValue(nv);
for (auto emulatedAnimation : mEmulatedAnimations) for (const EmulatedAnimation& emulatedAnimation : mEmulatedAnimations)
{ {
if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime) if (time > emulatedAnimation.mStartTime && time < emulatedAnimation.mStopTime)
{ {