summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
authorNyx Linden <nyx@lindenlab.com>2010-05-19 19:48:23 -0400
committerNyx Linden <nyx@lindenlab.com>2010-05-19 19:48:23 -0400
commit8487341b0f255e65044c3f7e3dc09461b4e2351e (patch)
tree52fa9c0591157c8e4055cb405331afa2deb9dcb2 /indra/newview/llviewermenu.cpp
parent46fc55fca546ee8ac0db8cf69b136bc3e344eed1 (diff)
AVP-44 WIP Back-end support for multiwearables
Changed a lot of areas of code that were not dealing with multiwearables properly. Little functionality changed, as the support mechanisms that were out of date were subtle, but getting closer to no further areas of code that don't properly support multi-wearables. Code reviewed by Vir.
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r--indra/newview/llviewermenu.cpp56
1 files changed, 26 insertions, 30 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index c245650d51..729424353f 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -292,8 +292,8 @@ void handle_toggle_pg(void*);
void handle_dump_attachments(void *);
void handle_dump_avatar_local_textures(void*);
void handle_debug_avatar_textures(void*);
-void handle_grab_texture(void*);
-BOOL enable_grab_texture(void*);
+void handle_grab_baked_texture(void*);
+BOOL enable_grab_baked_texture(void*);
void handle_dump_region_object_cache(void*);
BOOL enable_save_into_inventory(void*);
@@ -1460,28 +1460,28 @@ class LLAdvancedGrabBakedTexture : public view_listener_t
std::string texture_type = userdata.asString();
if ("iris" == texture_type)
{
- handle_grab_texture( (void*)TEX_EYES_BAKED );
+ handle_grab_baked_texture( (void*)BAKED_EYES );
}
else if ("head" == texture_type)
{
- handle_grab_texture( (void*)TEX_HEAD_BAKED );
+ handle_grab_baked_texture( (void*)BAKED_HEAD );
}
else if ("upper" == texture_type)
{
- handle_grab_texture( (void*)TEX_UPPER_BAKED );
+ handle_grab_baked_texture( (void*)BAKED_UPPER );
}
else if ("lower" == texture_type)
{
- handle_grab_texture( (void*)TEX_SKIRT_BAKED );
+ handle_grab_baked_texture( (void*)BAKED_LOWER );
}
else if ("skirt" == texture_type)
{
- handle_grab_texture( (void*)TEX_SKIRT_BAKED );
+ handle_grab_baked_texture( (void*)BAKED_SKIRT );
}
else if ("hair" == texture_type)
{
- handle_grab_texture( (void*)TEX_HAIR_BAKED );
-}
+ handle_grab_baked_texture( (void*)BAKED_HAIR );
+ }
return true;
}
@@ -1496,23 +1496,27 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t
if ("iris" == texture_type)
{
- new_value = enable_grab_texture( (void*)TEX_EYES_BAKED );
+ new_value = enable_grab_baked_texture( (void*)BAKED_EYES );
}
else if ("head" == texture_type)
{
- new_value = enable_grab_texture( (void*)TEX_HEAD_BAKED );
+ new_value = enable_grab_baked_texture( (void*)BAKED_HEAD );
}
else if ("upper" == texture_type)
{
- new_value = enable_grab_texture( (void*)TEX_UPPER_BAKED );
+ new_value = enable_grab_baked_texture( (void*)BAKED_UPPER );
}
else if ("lower" == texture_type)
{
- new_value = enable_grab_texture( (void*)TEX_LOWER_BAKED );
+ new_value = enable_grab_baked_texture( (void*)BAKED_LOWER );
}
else if ("skirt" == texture_type)
{
- new_value = enable_grab_texture( (void*)TEX_SKIRT_BAKED );
+ new_value = enable_grab_baked_texture( (void*)BAKED_SKIRT );
+ }
+ else if ("hair" == texture_type)
+ {
+ new_value = enable_grab_baked_texture( (void*)BAKED_HAIR );
}
return new_value;
@@ -6933,27 +6937,20 @@ void handle_debug_avatar_textures(void*)
}
}
-void handle_grab_texture(void* data)
+void handle_grab_baked_texture(void* data)
{
- ETextureIndex tex_index = (ETextureIndex)((intptr_t)data);
+ EBakedTextureIndex baked_tex_index = (EBakedTextureIndex)((intptr_t)data);
if (!isAgentAvatarValid()) return;
- // MULTI-WEARABLE: change to support an index
- const LLUUID& asset_id = gAgentAvatarp->grabLocalTexture(tex_index, 0);
+ const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index);
LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << llendl;
LLAssetType::EType asset_type = LLAssetType::AT_TEXTURE;
LLInventoryType::EType inv_type = LLInventoryType::IT_TEXTURE;
const LLUUID folder_id = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(asset_type));
if(folder_id.notNull())
{
- std::string name = "Unknown";
- const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(tex_index);
- if (texture_dict->mIsBakedTexture)
- {
- EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
- name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mNameCapitalized;
- }
- name += " Texture";
+ std::string name;
+ name = "Baked " + LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_tex_index)->mNameCapitalized + " Texture";
LLUUID item_id;
item_id.generate();
@@ -7006,13 +7003,12 @@ void handle_grab_texture(void* data)
}
}
-BOOL enable_grab_texture(void* data)
+BOOL enable_grab_baked_texture(void* data)
{
- ETextureIndex index = (ETextureIndex)((intptr_t)data);
+ EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data);
if (isAgentAvatarValid())
{
- // MULTI-WEARABLE:
- return gAgentAvatarp->canGrabLocalTexture(index,0);
+ return gAgentAvatarp->canGrabBakedTexture(index);
}
return FALSE;
}