From 46fe5d49caef6c8db3df9d88f0d0ec773ef28095 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Fri, 26 Mar 2010 14:33:48 -0400 Subject: EXT-6536 : Make LLVOAvatarSelf a singleton Superficial cleanup so that all instances of gAgent.getAvatarObject() use "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject". --- indra/newview/llgesturemgr.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 0ba7bdf613..47a9961323 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -746,8 +746,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) { return; } - LLVOAvatar* avatar = gAgent.getAvatarObject(); - if (!avatar) return; + LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); + if (!avatarp) return; // Of the ones that started playing, have any stopped? @@ -758,8 +758,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) { // look in signaled animations (simulator's view of what is // currently playing. - LLVOAvatar::AnimIterator play_it = avatar->mSignaledAnimations.find(*gest_it); - if (play_it != avatar->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = avatarp->mSignaledAnimations.find(*gest_it); + if (play_it != avatarp->mSignaledAnimations.end()) { ++gest_it; } @@ -777,8 +777,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) gest_it != gesture->mRequestedAnimIDs.end(); ) { - LLVOAvatar::AnimIterator play_it = avatar->mSignaledAnimations.find(*gest_it); - if (play_it != avatar->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = avatarp->mSignaledAnimations.find(*gest_it); + if (play_it != avatarp->mSignaledAnimations.end()) { // Hooray, this animation has started playing! // Copy into playing. -- cgit v1.2.3 From 4ff53b90660477f54ba3c8ca9a9718fe0d16a1dd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Mar 2010 11:02:39 -0400 Subject: For EXT-4666: changed LLAppearanceManager to LLAppearanceMgr throughout --- indra/newview/llgesturemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 0ba7bdf613..cfbb60fe17 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -338,7 +338,7 @@ void LLGestureManager::deactivateGesture(const LLUUID& item_id) gAgent.sendReliableMessage(); - LLAppearanceManager::instance().removeCOFItemLinks(base_item_id, false); + LLAppearanceMgr::instance().removeCOFItemLinks(base_item_id, false); notifyObservers(); } -- cgit v1.2.3 From b2a667b7222640a384cb23763b32f8746b0c8cd8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 29 Mar 2010 11:10:54 -0400 Subject: For EXT-4666: changed LLGestureManager to LLGestureMgr throughout --- indra/newview/llgesturemgr.cpp | 74 +++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index cfbb60fe17..739d28c90f 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -67,7 +67,7 @@ static const LLUUID& get_linked_uuid(const LLUUID& item_id); // Lightweight constructor. // init() does the heavy lifting. -LLGestureManager::LLGestureManager() +LLGestureMgr::LLGestureMgr() : mValid(FALSE), mPlaying(), mActive(), @@ -79,7 +79,7 @@ LLGestureManager::LLGestureManager() // We own the data for gestures, so clean them up. -LLGestureManager::~LLGestureManager() +LLGestureMgr::~LLGestureMgr() { item_map_t::iterator it; for (it = mActive.begin(); it != mActive.end(); ++it) @@ -93,12 +93,12 @@ LLGestureManager::~LLGestureManager() } -void LLGestureManager::init() +void LLGestureMgr::init() { // TODO } -void LLGestureManager::changed(U32 mask) +void LLGestureMgr::changed(U32 mask) { LLInventoryFetchObserver::changed(mask); @@ -136,7 +136,7 @@ void LLGestureManager::changed(U32 mask) // Use this version when you have the item_id but not the asset_id, // and you KNOW the inventory is loaded. -void LLGestureManager::activateGesture(const LLUUID& item_id) +void LLGestureMgr::activateGesture(const LLUUID& item_id) { LLViewerInventoryItem* item = gInventory.getItem(item_id); if (!item) return; @@ -152,7 +152,7 @@ void LLGestureManager::activateGesture(const LLUUID& item_id) } -void LLGestureManager::activateGestures(LLViewerInventoryItem::item_array_t& items) +void LLGestureMgr::activateGestures(LLViewerInventoryItem::item_array_t& items) { // Load up the assets S32 count = 0; @@ -248,7 +248,7 @@ struct LLLoadInfo /** * It will load a gesture from remote storage */ -void LLGestureManager::activateGestureWithAsset(const LLUUID& item_id, +void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id, const LLUUID& asset_id, BOOL inform_server, BOOL deactivate_similar) @@ -257,7 +257,7 @@ void LLGestureManager::activateGestureWithAsset(const LLUUID& item_id, if( !gAssetStorage ) { - llwarns << "LLGestureManager::activateGestureWithAsset without valid gAssetStorage" << llendl; + llwarns << "LLGestureMgr::activateGestureWithAsset without valid gAssetStorage" << llendl; return; } // If gesture is already active, nothing to do. @@ -299,7 +299,7 @@ void LLGestureManager::activateGestureWithAsset(const LLUUID& item_id, } -void LLGestureManager::deactivateGesture(const LLUUID& item_id) +void LLGestureMgr::deactivateGesture(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); item_map_t::iterator it = mActive.find(base_item_id); @@ -344,7 +344,7 @@ void LLGestureManager::deactivateGesture(const LLUUID& item_id) } -void LLGestureManager::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& in_item_id) +void LLGestureMgr::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& in_item_id) { const LLUUID& base_in_item_id = get_linked_uuid(in_item_id); std::vector gest_item_ids; @@ -431,7 +431,7 @@ void LLGestureManager::deactivateSimilarGestures(LLMultiGesture* in, const LLUUI } -BOOL LLGestureManager::isGestureActive(const LLUUID& item_id) +BOOL LLGestureMgr::isGestureActive(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); item_map_t::iterator it = mActive.find(base_item_id); @@ -439,7 +439,7 @@ BOOL LLGestureManager::isGestureActive(const LLUUID& item_id) } -BOOL LLGestureManager::isGesturePlaying(const LLUUID& item_id) +BOOL LLGestureMgr::isGesturePlaying(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); @@ -452,7 +452,7 @@ BOOL LLGestureManager::isGesturePlaying(const LLUUID& item_id) return gesture->mPlaying; } -BOOL LLGestureManager::isGesturePlaying(LLMultiGesture* gesture) +BOOL LLGestureMgr::isGesturePlaying(LLMultiGesture* gesture) { if(!gesture) { @@ -462,7 +462,7 @@ BOOL LLGestureManager::isGesturePlaying(LLMultiGesture* gesture) return gesture->mPlaying; } -void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_gesture, const LLUUID& asset_id) +void LLGestureMgr::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_gesture, const LLUUID& asset_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); @@ -504,11 +504,11 @@ void LLGestureManager::replaceGesture(const LLUUID& item_id, LLMultiGesture* new notifyObservers(); } -void LLGestureManager::replaceGesture(const LLUUID& item_id, const LLUUID& new_asset_id) +void LLGestureMgr::replaceGesture(const LLUUID& item_id, const LLUUID& new_asset_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); - item_map_t::iterator it = LLGestureManager::instance().mActive.find(base_item_id); + item_map_t::iterator it = LLGestureMgr::instance().mActive.find(base_item_id); if (it == mActive.end()) { llwarns << "replaceGesture for inactive gesture " << base_item_id << llendl; @@ -517,10 +517,10 @@ void LLGestureManager::replaceGesture(const LLUUID& item_id, const LLUUID& new_a // mActive owns this gesture pointer, so clean up memory. LLMultiGesture* gesture = (*it).second; - LLGestureManager::instance().replaceGesture(base_item_id, gesture, new_asset_id); + LLGestureMgr::instance().replaceGesture(base_item_id, gesture, new_asset_id); } -void LLGestureManager::playGesture(LLMultiGesture* gesture) +void LLGestureMgr::playGesture(LLMultiGesture* gesture) { if (!gesture) return; @@ -539,7 +539,7 @@ void LLGestureManager::playGesture(LLMultiGesture* gesture) // Convenience function that looks up the item_id for you. -void LLGestureManager::playGesture(const LLUUID& item_id) +void LLGestureMgr::playGesture(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); @@ -556,7 +556,7 @@ void LLGestureManager::playGesture(const LLUUID& item_id) // Iterates through space delimited tokens in string, triggering any gestures found. // Generates a revised string that has the found tokens replaced by their replacement strings // and (as a minor side effect) has multiple spaces in a row replaced by single spaces. -BOOL LLGestureManager::triggerAndReviseString(const std::string &utf8str, std::string* revised_string) +BOOL LLGestureMgr::triggerAndReviseString(const std::string &utf8str, std::string* revised_string) { std::string tokenized = utf8str; @@ -649,7 +649,7 @@ BOOL LLGestureManager::triggerAndReviseString(const std::string &utf8str, std::s } -BOOL LLGestureManager::triggerGesture(KEY key, MASK mask) +BOOL LLGestureMgr::triggerGesture(KEY key, MASK mask) { std::vector matching; item_map_t::iterator it; @@ -683,7 +683,7 @@ BOOL LLGestureManager::triggerGesture(KEY key, MASK mask) } -S32 LLGestureManager::getPlayingCount() const +S32 LLGestureMgr::getPlayingCount() const { return mPlaying.size(); } @@ -697,7 +697,7 @@ struct IsGesturePlaying : public std::unary_function } }; -void LLGestureManager::update() +void LLGestureMgr::update() { S32 i; for (i = 0; i < (S32)mPlaying.size(); ++i) @@ -740,7 +740,7 @@ void LLGestureManager::update() // Run all steps until you're either done or hit a wait. -void LLGestureManager::stepGesture(LLMultiGesture* gesture) +void LLGestureMgr::stepGesture(LLMultiGesture* gesture) { if (!gesture) { @@ -888,7 +888,7 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) } -void LLGestureManager::runStep(LLMultiGesture* gesture, LLGestureStep* step) +void LLGestureMgr::runStep(LLMultiGesture* gesture, LLGestureStep* step) { switch(step->getType()) { @@ -975,7 +975,7 @@ void LLGestureManager::runStep(LLMultiGesture* gesture, LLGestureStep* step) // static -void LLGestureManager::onLoadComplete(LLVFS *vfs, +void LLGestureMgr::onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status) @@ -988,7 +988,7 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, delete info; info = NULL; - LLGestureManager& self = LLGestureManager::instance(); + LLGestureMgr& self = LLGestureMgr::instance(); self.mLoadingCount--; if (0 == status) @@ -1094,12 +1094,12 @@ void LLGestureManager::onLoadComplete(LLVFS *vfs, llwarns << "Problem loading gesture: " << status << llendl; - LLGestureManager::instance().mActive.erase(item_id); + LLGestureMgr::instance().mActive.erase(item_id); } } -void LLGestureManager::stopGesture(LLMultiGesture* gesture) +void LLGestureMgr::stopGesture(LLMultiGesture* gesture) { if (!gesture) return; @@ -1139,7 +1139,7 @@ void LLGestureManager::stopGesture(LLMultiGesture* gesture) } -void LLGestureManager::stopGesture(const LLUUID& item_id) +void LLGestureMgr::stopGesture(const LLUUID& item_id) { const LLUUID& base_item_id = get_linked_uuid(item_id); @@ -1153,12 +1153,12 @@ void LLGestureManager::stopGesture(const LLUUID& item_id) } -void LLGestureManager::addObserver(LLGestureManagerObserver* observer) +void LLGestureMgr::addObserver(LLGestureManagerObserver* observer) { mObservers.push_back(observer); } -void LLGestureManager::removeObserver(LLGestureManagerObserver* observer) +void LLGestureMgr::removeObserver(LLGestureManagerObserver* observer) { std::vector::iterator it; it = std::find(mObservers.begin(), mObservers.end(), observer); @@ -1171,9 +1171,9 @@ void LLGestureManager::removeObserver(LLGestureManagerObserver* observer) // Call this method when it's time to update everyone on a new state. // Copy the list because an observer could respond by removing itself // from the list. -void LLGestureManager::notifyObservers() +void LLGestureMgr::notifyObservers() { - lldebugs << "LLGestureManager::notifyObservers" << llendl; + lldebugs << "LLGestureMgr::notifyObservers" << llendl; std::vector observers = mObservers; @@ -1185,7 +1185,7 @@ void LLGestureManager::notifyObservers() } } -BOOL LLGestureManager::matchPrefix(const std::string& in_str, std::string* out_str) +BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) { S32 in_len = in_str.length(); @@ -1216,7 +1216,7 @@ BOOL LLGestureManager::matchPrefix(const std::string& in_str, std::string* out_s } -void LLGestureManager::getItemIDs(std::vector* ids) +void LLGestureMgr::getItemIDs(std::vector* ids) { item_map_t::const_iterator it; for (it = mActive.begin(); it != mActive.end(); ++it) @@ -1225,7 +1225,7 @@ void LLGestureManager::getItemIDs(std::vector* ids) } } -void LLGestureManager::done() +void LLGestureMgr::done() { bool notify = false; for(item_map_t::iterator it = mActive.begin(); it != mActive.end(); ++it) -- cgit v1.2.3 From 94e6e10739c8321b6fb651a109901380ef92975a Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 29 Mar 2010 12:00:26 -0400 Subject: EXT-6536 : Make LLVOAvatarSelf a singleton Superficial cleanup to replace all instances of "LLVOAvatarSelf *avatarp = gAgent.getAvatarObject" with "gAgentAvatar". --- indra/newview/llgesturemgr.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 47a9961323..c9a950ed42 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -746,8 +746,7 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) { return; } - LLVOAvatarSelf* avatarp = gAgent.getAvatarObject(); - if (!avatarp) return; + if (!isAgentAvatarValid()) return; // Of the ones that started playing, have any stopped? @@ -758,8 +757,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) { // look in signaled animations (simulator's view of what is // currently playing. - LLVOAvatar::AnimIterator play_it = avatarp->mSignaledAnimations.find(*gest_it); - if (play_it != avatarp->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = gAgentAvatar->mSignaledAnimations.find(*gest_it); + if (play_it != gAgentAvatar->mSignaledAnimations.end()) { ++gest_it; } @@ -777,8 +776,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) gest_it != gesture->mRequestedAnimIDs.end(); ) { - LLVOAvatar::AnimIterator play_it = avatarp->mSignaledAnimations.find(*gest_it); - if (play_it != avatarp->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = gAgentAvatar->mSignaledAnimations.find(*gest_it); + if (play_it != gAgentAvatar->mSignaledAnimations.end()) { // Hooray, this animation has started playing! // Copy into playing. -- cgit v1.2.3 From 58d76a9ecf83b49e42fabfada27ca20814f93cf3 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 29 Mar 2010 12:11:51 -0400 Subject: EXT-6536 : Make LLVOAvatarSelf a singleton Superficial cleanup to replace all instances of "gAgentAvatar" with "gAgentAvatarp". --- indra/newview/llgesturemgr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index c9a950ed42..1f8c42ad90 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -757,8 +757,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) { // look in signaled animations (simulator's view of what is // currently playing. - LLVOAvatar::AnimIterator play_it = gAgentAvatar->mSignaledAnimations.find(*gest_it); - if (play_it != gAgentAvatar->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it); + if (play_it != gAgentAvatarp->mSignaledAnimations.end()) { ++gest_it; } @@ -776,8 +776,8 @@ void LLGestureManager::stepGesture(LLMultiGesture* gesture) gest_it != gesture->mRequestedAnimIDs.end(); ) { - LLVOAvatar::AnimIterator play_it = gAgentAvatar->mSignaledAnimations.find(*gest_it); - if (play_it != gAgentAvatar->mSignaledAnimations.end()) + LLVOAvatar::AnimIterator play_it = gAgentAvatarp->mSignaledAnimations.find(*gest_it); + if (play_it != gAgentAvatarp->mSignaledAnimations.end()) { // Hooray, this animation has started playing! // Copy into playing. -- cgit v1.2.3 From 114e5ca0839bace7f247a6eadb6e06a28597501d Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 29 Mar 2010 16:33:35 -0400 Subject: EXT-5940 : Typedef all vector's Superficial cleanup to change all typedef std::vector to use a common typedef uuid_vec_t instead. --- indra/newview/llgesturemgr.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 561ca68f4a..fbacbd704f 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -347,7 +347,7 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) void LLGestureMgr::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& in_item_id) { const LLUUID& base_in_item_id = get_linked_uuid(in_item_id); - std::vector gest_item_ids; + uuid_vec_t gest_item_ids; // Deactivate all gestures that match item_map_t::iterator it; @@ -386,7 +386,7 @@ void LLGestureMgr::deactivateSimilarGestures(LLMultiGesture* in, const LLUUID& i // Inform database of the change LLMessageSystem* msg = gMessageSystem; BOOL start_message = TRUE; - std::vector::const_iterator vit = gest_item_ids.begin(); + uuid_vec_t::const_iterator vit = gest_item_ids.begin(); while (vit != gest_item_ids.end()) { if (start_message) @@ -1215,7 +1215,7 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) } -void LLGestureMgr::getItemIDs(std::vector* ids) +void LLGestureMgr::getItemIDs(uuid_vec_t* ids) { item_map_t::const_iterator it; for (it = mActive.begin(); it != mActive.end(); ++it) -- cgit v1.2.3