summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-03-31 15:16:44 -0400
committerLoren Shih <seraph@lindenlab.com>2010-03-31 15:16:44 -0400
commit1ee1004e126293bbfc2fd901f0e6f73e1952cc73 (patch)
tree98e3506cbf467479881df3fda52cf0d285463d15 /indra
parentfc8c4ea485f34ef52b2c3e037124795e5df9c064 (diff)
EXT-6666 : Enable debug avatar textures in God, versus non-Release, mode
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloateravatartextures.cpp92
-rw-r--r--indra/newview/llviewermenu.cpp7
2 files changed, 47 insertions, 52 deletions
diff --git a/indra/newview/llfloateravatartextures.cpp b/indra/newview/llfloateravatartextures.cpp
index 8c7899af3e..18db60705b 100644
--- a/indra/newview/llfloateravatartextures.cpp
+++ b/indra/newview/llfloateravatartextures.cpp
@@ -31,15 +31,14 @@
*/
#include "llviewerprecompiledheaders.h"
-
#include "llfloateravatartextures.h"
+#include "llagent.h"
+#include "llagentwearables.h"
#include "lltexturectrl.h"
-
#include "lluictrlfactory.h"
#include "llviewerobjectlist.h"
#include "llvoavatar.h"
-#include "llagentwearables.h"
using namespace LLVOAvatarDefines;
@@ -75,7 +74,6 @@ void LLFloaterAvatarTextures::draw()
LLFloater::draw();
}
-#if !LL_RELEASE_FOR_DOWNLOAD
static void update_texture_ctrl(LLVOAvatar* avatarp,
LLTextureCtrl* ctrl,
ETextureIndex te)
@@ -132,72 +130,68 @@ static LLVOAvatar* find_avatar(const LLUUID& id)
void LLFloaterAvatarTextures::refresh()
{
- LLVOAvatar *avatarp = find_avatar(mID);
- if (avatarp)
+ if (gAgent.isGodlike())
{
- std::string fullname;
- if (gCacheName->getFullName(avatarp->getID(), fullname))
+ LLVOAvatar *avatarp = find_avatar(mID);
+ if (avatarp)
{
- setTitle(mTitle + ": " + fullname);
+ std::string fullname;
+ if (gCacheName->getFullName(avatarp->getID(), fullname))
+ {
+ setTitle(mTitle + ": " + fullname);
+ }
+ for (U32 i=0; i < TEX_NUM_INDICES; i++)
+ {
+ update_texture_ctrl(avatarp, mTextures[i], ETextureIndex(i));
+ }
}
- for (U32 i=0; i < TEX_NUM_INDICES; i++)
+ else
{
- update_texture_ctrl(avatarp, mTextures[i], ETextureIndex(i));
+ setTitle(mTitle + ": " + getString("InvalidAvatar") + " (" + mID.asString() + ")");
}
}
- else
- {
- setTitle(mTitle + ": " + getString("InvalidAvatar") + " (" + mID.asString() + ")");
- }
}
-#else
-
-void LLFloaterAvatarTextures::refresh()
-{
-}
-
-#endif
-
// static
void LLFloaterAvatarTextures::onClickDump(void* data)
{
-#if !LL_RELEASE_FOR_DOWNLOAD
- LLFloaterAvatarTextures* self = (LLFloaterAvatarTextures*)data;
- LLVOAvatar* avatarp = find_avatar(self->mID);
- if (!avatarp) return;
-
- for (S32 i = 0; i < avatarp->getNumTEs(); i++)
+ if (gAgent.isGodlike())
{
- const LLTextureEntry* te = avatarp->getTE(i);
- if (!te) continue;
+ LLFloaterAvatarTextures* self = (LLFloaterAvatarTextures*)data;
+ LLVOAvatar* avatarp = find_avatar(self->mID);
+ if (!avatarp) return;
- if (LLVOAvatar::isIndexLocalTexture((ETextureIndex)i))
+ for (S32 i = 0; i < avatarp->getNumTEs(); i++)
{
- LLUUID id = IMG_DEFAULT_AVATAR;
- EWearableType wearable_type = LLVOAvatarDictionary::getInstance()->getTEWearableType((ETextureIndex)i);
- LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
- if (wearable)
+ const LLTextureEntry* te = avatarp->getTE(i);
+ if (!te) continue;
+
+ if (LLVOAvatar::isIndexLocalTexture((ETextureIndex)i))
{
- LLLocalTextureObject *lto = wearable->getLocalTextureObject(i);
- if (lto)
+ LLUUID id = IMG_DEFAULT_AVATAR;
+ EWearableType wearable_type = LLVOAvatarDictionary::getInstance()->getTEWearableType((ETextureIndex)i);
+ LLWearable *wearable = gAgentWearables.getWearable(wearable_type, 0);
+ if (wearable)
{
- id = lto->getID();
+ LLLocalTextureObject *lto = wearable->getLocalTextureObject(i);
+ if (lto)
+ {
+ id = lto->getID();
+ }
+ }
+ if (id != IMG_DEFAULT_AVATAR)
+ {
+ llinfos << "Avatar TE " << i << " id " << id << llendl;
+ }
+ else
+ {
+ llinfos << "Avatar TE " << i << " id " << "<DEFAULT>" << llendl;
}
- }
- if (id != IMG_DEFAULT_AVATAR)
- {
- llinfos << "Avatar TE " << i << " id " << id << llendl;
}
else
{
- llinfos << "Avatar TE " << i << " id " << "<DEFAULT>" << llendl;
+ llinfos << "Avatar TE " << i << " id " << te->getID() << llendl;
}
}
- else
- {
- llinfos << "Avatar TE " << i << " id " << te->getID() << llendl;
- }
}
-#endif
}
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 3a6aed01ce..b54305f021 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -1802,9 +1802,10 @@ class LLAdvancedDebugAvatarTextures : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
-#ifndef LL_RELEASE_FOR_DOWNLOAD
- handle_debug_avatar_textures(NULL);
-#endif
+ if (gAgent.isGodlike())
+ {
+ handle_debug_avatar_textures(NULL);
+ }
return true;
}
};