add support for additional metadata stored in the comments of the baked eye layer

This commit is contained in:
Hazim Gazov
2010-08-07 23:38:12 +00:00
parent 13678ca85f
commit f026ffaeca
2 changed files with 30 additions and 10 deletions

View File

@@ -86,6 +86,7 @@
// <edit>
#include "llfloaterexploreanimations.h"
#include "llao.h"
#include "llimagemetadatareader.h"
// </edit>
#if LL_MSVC
@@ -3012,7 +3013,7 @@ void LLVOAvatar::idleUpdateWindEffect()
}
}
}
void LLVOAvatar::getClientTag(std::string& client, LLColor4& color, BOOL useComment)
void LLVOAvatar::getClientInfo(std::string& client, LLColor4& color, BOOL useComment)
{
std::string uuid_str = getTE(TEX_HEAD_BODYPAINT)->getID().asString(); //UUID of the head texture
if(getTEImage(TEX_HEAD_BODYPAINT)->getID() == IMG_DEFAULT_AVATAR)
@@ -3060,7 +3061,7 @@ void LLVOAvatar::getClientTag(std::string& client, LLColor4& color, BOOL useComm
}
else
{
color = LLColor4(0.5f, 0.5f, 0.5f);
color = LLColor4(0.5f, 0.5f, 0.5f);
client = "Viewer 2.0";
return;
}
@@ -3206,14 +3207,32 @@ void LLVOAvatar::getClientTag(std::string& client, LLColor4& color, BOOL useComm
if(useComment)
{
LLUUID id = getTE(9)->getID();
LLPointer<LLViewerImage> image = gImageList.getImage(id);
if(image && image->decodedComment.length())
LLUUID baked_head_id = getTE(9)->getID();
LLPointer<LLViewerImage> baked_head_image = gImageList.getImage(baked_head_id);
if(baked_head_image && baked_head_image->decodedComment.length())
{
if(client.length())
client += " , " + image->decodedComment;
else
client = image->decodedComment;
client += ", ";
if(baked_head_image->commentEncryptionType == ENC_EMKDU_V1 || baked_head_image->commentEncryptionType == ENC_ONYXKDU)
client += "(XOR) ";
else if(baked_head_image->commentEncryptionType == ENC_EMKDU_V2)
client += "(AES) ";
client += baked_head_image->decodedComment;
}
LLPointer<LLViewerImage> baked_eye_image = gImageList.getImage(getTE(11)->getID());
if(baked_eye_image && !baked_eye_image->decodedComment.empty()
&& baked_eye_image->decodedComment != baked_head_image->decodedComment)
{
if(baked_eye_image->commentEncryptionType == ENC_EMKDU_V1 || baked_eye_image->commentEncryptionType == ENC_ONYXKDU)
extraMetadata = "(XOR) ";
else if(baked_eye_image->commentEncryptionType == ENC_EMKDU_V2)
extraMetadata = "(AES) ";
extraMetadata += baked_eye_image->decodedComment;
}
}
}
@@ -3308,7 +3327,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last)
// <edit>
if(isFullyLoaded() && !mIsSelf)
{
getClientTag(client,avatar_name_color);
getClientInfo(client,avatar_name_color);
}
// </edit>
avatar_name_color.setAlpha(alpha);

View File

@@ -89,7 +89,8 @@ public:
static void updateImpostors();
// <edit>
void getClientTag(std::string& client, LLColor4& color, BOOL useComment = FALSE);
void getClientInfo(std::string& clientTag, LLColor4& tagColor, BOOL useComment=FALSE);
std::string extraMetadata;
// </edit>
//--------------------------------------------------------------------