summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-03-07 11:24:48 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-03-07 11:24:48 -0500
commit88cb6814f0883cdce15ca1942409da708ab07af5 (patch)
treed0067d27341a945fbfab91299c0c79cce9037b54
parent9ca9a44acfc06de529489d76eea934ed6652fe81 (diff)
SL-315 WIP - more call stack tracing, initial hooks for avatar reset skeleton option.
-rw-r--r--indra/llcommon/llcallstack.cpp40
-rw-r--r--indra/llcommon/llcallstack.h6
-rwxr-xr-xindra/newview/llagent.cpp6
-rwxr-xr-xindra/newview/llviewermenu.cpp13
-rwxr-xr-xindra/newview/llvoavatar.cpp7
-rwxr-xr-xindra/newview/llvoavatar.h1
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_attachment_other.xml9
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_attachment_self.xml7
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_avatar_other.xml9
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_avatar_self.xml6
10 files changed, 97 insertions, 7 deletions
diff --git a/indra/llcommon/llcallstack.cpp b/indra/llcommon/llcallstack.cpp
index 2409f7a876..9978645ff4 100644
--- a/indra/llcommon/llcallstack.cpp
+++ b/indra/llcommon/llcallstack.cpp
@@ -29,6 +29,7 @@
#include "llcommon.h"
#include "llcallstack.h"
#include "StackWalker.h"
+#include "llthreadlocalstorage.h"
#if LL_WINDOWS
class LLCallStackImpl: public StackWalker
@@ -88,6 +89,19 @@ LLCallStack::LLCallStack(S32 skip_count, bool verbose):
s_impl->getStack(m_strings, m_skipCount, m_verbose);
}
+bool LLCallStack::contains(const std::string& str)
+{
+ for (std::vector<std::string>::const_iterator it = m_strings.begin();
+ it != m_strings.end(); ++it)
+ {
+ if (it->find(str) != std::string::npos)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
{
std::vector<std::string>::const_iterator it;
@@ -98,8 +112,6 @@ std::ostream& operator<<(std::ostream& s, const LLCallStack& call_stack)
return s;
}
-#include "llthreadlocalstorage.h"
-
LLContextStrings::LLContextStrings()
{
}
@@ -136,17 +148,39 @@ void LLContextStrings::removeContextString(const std::string& str)
}
// static
+bool LLContextStrings::contains(const std::string& str)
+{
+ const std::map<std::string,S32>& strings =
+ LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
+ for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
+ {
+ if (it->first.find(str) != std::string::npos)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+// static
void LLContextStrings::output(std::ostream& os)
{
- const std::map<std::string,S32>& strings = LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
+ const std::map<std::string,S32>& strings =
+ LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->m_contextStrings;
for (std::map<std::string,S32>::const_iterator it = strings.begin(); it!=strings.end(); ++it)
{
os << it->first << "[" << it->second << "]" << "\n";
}
}
+// static
std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status)
{
LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->output(s);
return s;
}
+
+bool LLContextStatus::contains(const std::string& str)
+{
+ return LLThreadLocalSingletonPointer<LLContextStrings>::getInstance()->contains(str);
+}
diff --git a/indra/llcommon/llcallstack.h b/indra/llcommon/llcallstack.h
index 7196907980..1f7a7689d7 100644
--- a/indra/llcommon/llcallstack.h
+++ b/indra/llcommon/llcallstack.h
@@ -34,6 +34,7 @@ public:
LLCallStack(S32 skip_count=0, bool verbose=false);
std::vector<std::string> m_strings;
bool m_verbose;
+ bool contains(const std::string& str);
private:
static LLCallStackImpl *s_impl;
S32 m_skipCount;
@@ -49,6 +50,7 @@ public:
static void removeContextString(const std::string& str);
static void output(std::ostream& os);
static LLContextStrings* getThreadLocalInstance();
+ static bool contains(const std::string& str);
private:
std::map<std::string,S32> m_contextStrings;
};
@@ -69,10 +71,10 @@ private:
std::string m_str;
};
-// This doesn't really have any state, just acts as class to hook the
-// ostream override to.
+// Mostly exists as a class to hook an ostream override to.
struct LLContextStatus
{
+ bool contains(const std::string& str);
};
LL_COMMON_API std::ostream& operator<<(std::ostream& s, const LLContextStatus& context_status);
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 3f32be1d68..0393f41666 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -4137,6 +4137,8 @@ void LLAgent::setTeleportState(ETeleportState state)
void LLAgent::stopCurrentAnimations()
{
+ LL_DEBUGS("Avatar") << "Stopping current animations" << LL_ENDL;
+
// This function stops all current overriding animations on this
// avatar, propagating this change back to the server.
if (isAgentAvatarValid())
@@ -4154,6 +4156,7 @@ void LLAgent::stopCurrentAnimations()
// don't cancel a ground-sit anim, as viewers
// use this animation's status in
// determining whether we're sitting. ick.
+ LL_DEBUGS("Avatar") << "sit or do-not-disturb animation will not be stopped" << LL_ENDL;
}
else
{
@@ -4183,8 +4186,7 @@ void LLAgent::stopCurrentAnimations()
// re-assert at least the default standing animation, because
// viewers get confused by avs with no associated anims.
- sendAnimationRequest(ANIM_AGENT_STAND,
- ANIM_REQUEST_START);
+ sendAnimationRequest(ANIM_AGENT_STAND, ANIM_REQUEST_START);
}
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index bbd7183dd2..fefbcabb2b 100755
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6031,6 +6031,18 @@ class LLAvatarToggleMyProfile : public view_listener_t
}
};
+class LLAvatarResetSkeleton: public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );
+ if(avatar)
+ {
+ avatar->resetSkeleton();
+ }
+ return true;
+ }
+};
class LLAvatarAddContact : public view_listener_t
{
@@ -9017,6 +9029,7 @@ void initialize_menus()
enable.add("Avatar.EnableCall", boost::bind(&LLAvatarActions::canCall));
view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse");
view_listener_t::addMenu(new LLAvatarToggleMyProfile(), "Avatar.ToggleMyProfile");
+ view_listener_t::addMenu(new LLAvatarResetSkeleton(), "Avatar.ResetSkeleton");
enable.add("Avatar.IsMyProfileOpen", boost::bind(&my_profile_visible));
commit.add("Avatar.OpenMarketplace", boost::bind(&LLWeb::loadURLExternal, gSavedSettings.getString("MarketplaceURL")));
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index a8cc797f16..204432dc16 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1801,6 +1801,13 @@ void LLVOAvatar::buildCharacter()
mMeshValid = TRUE;
}
+//-----------------------------------------------------------------------------
+// resetSkeleton()
+//-----------------------------------------------------------------------------
+void LLVOAvatar::resetSkeleton()
+{
+ LL_DEBUGS("Avatar") << avString() << LL_ENDL;
+}
//-----------------------------------------------------------------------------
// releaseMeshData()
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index e1b4885bbb..76b40fb90a 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -364,6 +364,7 @@ public:
/*virtual*/ BOOL loadSkeletonNode();
/*virtual*/ void buildCharacter();
+ void resetSkeleton();
LLVector3 mCurRootToHeadOffset;
LLVector3 mTargetRootToHeadOffset;
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_other.xml b/indra/newview/skins/default/xui/en/menu_attachment_other.xml
index ba91b0b5d9..c3c6701d01 100755
--- a/indra/newview/skins/default/xui/en/menu_attachment_other.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_other.xml
@@ -40,6 +40,15 @@
function="Avatar.InviteToGroup" />
</menu_item_call>
<menu_item_separator />
+
+ <menu_item_call label="Reset Skeleton"
+ layout="topleft"
+ name="Reset Skeleton">
+ <menu_item_call.on_click
+ function="Avatar.ResetSkeleton" />
+ </menu_item_call>
+
+ <menu_item_separator />
<menu_item_call
enabled="false"
label="Block"
diff --git a/indra/newview/skins/default/xui/en/menu_attachment_self.xml b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
index c6ae844d67..ced0dd37b1 100755
--- a/indra/newview/skins/default/xui/en/menu_attachment_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_attachment_self.xml
@@ -99,6 +99,13 @@ name="Edit Outfit">
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
+ <menu_item_call label="Reset Skeleton"
+ layout="topleft"
+ name="Reset Skeleton">
+ <menu_item_call.on_click
+ function="Avatar.ResetSkeleton" />
+ </menu_item_call>
+
<menu_item_call
label="My Friends"
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_avatar_other.xml b/indra/newview/skins/default/xui/en/menu_avatar_other.xml
index cfbbe41f95..f04a70d0a5 100755
--- a/indra/newview/skins/default/xui/en/menu_avatar_other.xml
+++ b/indra/newview/skins/default/xui/en/menu_avatar_other.xml
@@ -41,6 +41,15 @@
</menu_item_call>
<menu_item_separator />
+
+ <menu_item_call label="Reset Skeleton"
+ layout="topleft"
+ name="Reset Skeleton">
+ <menu_item_call.on_click
+ function="Avatar.ResetSkeleton" />
+ </menu_item_call>
+
+ <menu_item_separator />
<menu_item_call
enabled="false"
diff --git a/indra/newview/skins/default/xui/en/menu_avatar_self.xml b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
index d3b0b07f70..924e8b8454 100755
--- a/indra/newview/skins/default/xui/en/menu_avatar_self.xml
+++ b/indra/newview/skins/default/xui/en/menu_avatar_self.xml
@@ -237,6 +237,12 @@
<menu_item_call.on_enable
function="Edit.EnableHoverHeight" />
</menu_item_call>
+ <menu_item_call label="Reset Skeleton"
+ layout="topleft"
+ name="Reset Skeleton">
+ <menu_item_call.on_click
+ function="Avatar.ResetSkeleton" />
+ </menu_item_call>
<menu_item_call
label="My Friends"
layout="topleft"