diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-03-06 14:10:16 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-03-06 14:10:16 -0500 |
commit | c03c7eaa460e097093304177d9ba23e9af57a959 (patch) | |
tree | 3a429c15c4ac70dc85b9a4f6cc5f4c77e5548eda /indra/newview/llvoavatar.cpp | |
parent | 4e7bef91a72f6b08414fa56e9516159b848f818c (diff) |
SH-2970 WIP - framework for tracking various phases of avatar rezzing/outfit changing
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 47f7ce0f62..9cfc0f2fdd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -875,6 +875,8 @@ LLVOAvatar::~LLVOAvatar() mAnimationSources.clear(); LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList) ; + clearPhases(); + lldebugs << "LLVOAvatar Destructor end" << llendl; } @@ -957,6 +959,46 @@ S32 LLVOAvatar::getRezzedStatus() const return 1; // gray } +LLFrameTimer& LLVOAvatar::getPhaseTimer(const std::string& phase_name) +{ + phase_map_t::iterator iter = mPhases.find(phase_name); + if (iter == mPhases.end()) + { + LLFrameTimer timer; + mPhases[phase_name] = timer; + } + LLFrameTimer& timer = mPhases[phase_name]; + return timer; +} + +void LLVOAvatar::startPhase(const std::string& phase_name) +{ + LLFrameTimer& timer = getPhaseTimer(phase_name); + timer.unpause(); +} + +void LLVOAvatar::stopPhase(const std::string& phase_name) +{ + LLFrameTimer& timer = getPhaseTimer(phase_name); + timer.pause(); +} + +void LLVOAvatar::clearPhases() +{ + mPhases.clear(); +} + +LLSD LLVOAvatar::dumpPhases() +{ + LLSD result; + for (phase_map_t::iterator iter = mPhases.begin(); iter != mPhases.end(); ++iter) + { + result[iter->first]["completed"] = !(iter->second.getStarted()); + result[iter->first]["elapsed"] = iter->second.getElapsedTimeF32(); + } + return result; +} + void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) |