Skip to content
Snippets Groups Projects
Commit d1573cb5 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Revert "Some small speedups to avatar animation processing"

This reverts commit eb945ddf.
parent 16ac6f02
No related branches found
No related tags found
No related merge requests found
......@@ -3974,7 +3974,7 @@ bool LLAgent::teleportCore(bool is_local)
// Stop all animation before actual teleporting
if (isAgentAvatarValid())
{
for (auto anim_it = gAgentAvatarp->mPlayingAnimations.begin();
for ( LLVOAvatar::AnimIterator anim_it= gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end();
++anim_it)
{
......@@ -4548,10 +4548,13 @@ void LLAgent::stopCurrentAnimations()
{
std::vector<LLUUID> anim_ids;
for (const auto& anim_pair : gAgentAvatarp->mPlayingAnimations)
for ( LLVOAvatar::AnimIterator anim_it =
gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end();
anim_it++)
{
if ((anim_pair.first == ANIM_AGENT_DO_NOT_DISTURB)||
(anim_pair.first == ANIM_AGENT_SIT_GROUND_CONSTRAINED))
if ((anim_it->first == ANIM_AGENT_DO_NOT_DISTURB)||
(anim_it->first == ANIM_AGENT_SIT_GROUND_CONSTRAINED))
{
// don't cancel a ground-sit anim, as viewers
// use this animation's status in
......@@ -4561,9 +4564,9 @@ void LLAgent::stopCurrentAnimations()
else
{
// stop this animation locally
gAgentAvatarp->stopMotion(anim_pair.first, TRUE);
gAgentAvatarp->stopMotion(anim_it->first, TRUE);
// ...and tell the server to tell everyone.
anim_ids.push_back(anim_pair.first);
anim_ids.push_back(anim_it->first);
}
}
......
......@@ -569,14 +569,14 @@ void LLControlAvatar::updateAnimations()
// Rebuild mSignaledAnimations from the associated volumes.
auto& signaled_anim_map = LLObjectSignaledAnimationMap::instance().getMap();
anim_map_t anims;
std::map<LLUUID, S32> anims;
for (LLVOVolume* volp : volumes)
{
//LL_INFOS("AnimatedObjects") << "updating anim for vol " << volp->getID() << " root " << mRootVolp->getID() << LL_ENDL;
signaled_animation_map_t& signaled_animations = signaled_anim_map[volp->getID()];
for (const auto& anim_pair : signaled_animations)
{
auto found_anim_it = anims.find(anim_pair.first);
std::map<LLUUID,S32>::iterator found_anim_it = anims.find(anim_pair.first);
if (found_anim_it != anims.end())
{
// Animation already present, use the larger sequence id
......
......@@ -101,7 +101,7 @@ class LLControlAvatar final :
static boost::signals2::connection sRegionChangedSlot;
};
typedef absl::flat_hash_map<LLUUID, S32> signaled_animation_map_t;
typedef std::map<LLUUID, S32> signaled_animation_map_t;
typedef std::map<LLUUID, signaled_animation_map_t> object_signaled_animation_map_t;
// Stores information about previously requested animations, by object id.
......
......@@ -830,7 +830,7 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture)
{
// look in signaled animations (simulator's view of what is
// currently playing.
auto play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it);
LLVOAvatar::AnimIterator play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it);
if (play_it != gAgentAvatarp->mSignaledAnimations.end())
{
++gest_it;
......@@ -849,7 +849,7 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture)
gest_it != gesture->mRequestedAnimIDs.end();
)
{
auto play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it);
LLVOAvatar::AnimIterator play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it);
if (play_it != gAgentAvatarp->mSignaledAnimations.end())
{
// Hooray, this animation has started playing!
......
......@@ -5917,15 +5917,17 @@ void LLVOAvatar::processAnimationStateChanges()
// clear all current animations
for (auto anim_it = mPlayingAnimations.begin(); anim_it != mPlayingAnimations.end();)
{
auto copy_anim_it = anim_it++;
auto found_anim = mSignaledAnimations.find(copy_anim_it->first);
AnimIterator found_anim = mSignaledAnimations.find(anim_it->first);
// playing, but not signaled, so stop
if (found_anim == mSignaledAnimations.end())
{
processSingleAnimationStateChange(copy_anim_it->first, FALSE);
mPlayingAnimations.erase(copy_anim_it);
processSingleAnimationStateChange(anim_it->first, FALSE);
anim_it = mPlayingAnimations.erase(anim_it);
}
else
{
++anim_it;
}
}
......@@ -5940,7 +5942,7 @@ void LLVOAvatar::processAnimationStateChanges()
{
for (auto anim_it = mSignaledAnimations.begin(); anim_it != mSignaledAnimations.end();)
{
auto found_anim = mPlayingAnimations.find(anim_it->first);
AnimIterator found_anim = mPlayingAnimations.find(anim_it->first);
// signaled but not playing, or different sequence id, start motion
if (found_anim == mPlayingAnimations.end() || found_anim->second != anim_it->second)
......@@ -5964,11 +5966,13 @@ void LLVOAvatar::processAnimationStateChanges()
for (source_it = mAnimationSources.begin(); source_it != mAnimationSources.end();)
{
auto copy_source_it = source_it++;
if (mSignaledAnimations.find(source_it->second) == mSignaledAnimations.end())
{
mAnimationSources.erase(copy_source_it);
mAnimationSources.erase(source_it++);
}
else
{
++source_it;
}
}
}
......@@ -10916,10 +10920,12 @@ void LLVOAvatar::setOverallAppearanceJellyDoll()
// stop current animations
{
for (const auto& anim_pair : mPlayingAnimations)
for ( LLVOAvatar::AnimIterator anim_it= mPlayingAnimations.begin();
anim_it != mPlayingAnimations.end();
++anim_it)
{
{
stopMotion(anim_pair.first, TRUE);
stopMotion(anim_it->first, TRUE);
}
}
}
......
......@@ -908,10 +908,9 @@ class LLVOAvatar :
// Animation state data
//--------------------------------------------------------------------
public:
using anim_map_t = absl::flat_hash_map<LLUUID, S32>;
anim_map_t mSignaledAnimations; // requested state of Animation name/value
anim_map_t mPlayingAnimations; // current state of Animation name/value
typedef std::map<LLUUID, S32>::iterator AnimIterator;
std::map<LLUUID, S32> mSignaledAnimations; // requested state of Animation name/value
std::map<LLUUID, S32> mPlayingAnimations; // current state of Animation name/value
typedef std::multimap<LLUUID, LLUUID> AnimationSourceMap;
typedef AnimationSourceMap::iterator AnimSourceIterator;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment