Refactoring.
-New LLWearableType class, uses LLDictionary for typeindex<->typename<->assettype<->typelabel conversions. -LLAvatarDefines cleaned up. Uses LLDictionary for Mesh, TE, Baked lookups/conversions. -LLAgentWearables TEWearable stuff removed. Use LLAvatarDefines. -LLWearable WearableType conversions yanked. Use LLWearableType. -LLVOAvatar TEWEarable stuff removed. Use LLAvatarDefines. -EWearableType now LLWearableType::EType -LLWearable::getID() renamed to LLWearable::getAssetID() VOAvatar cleanup. -Removed redundant TEWearable functions. -Some code migrated to F32 LLVOAvatar::calcMorphAmount(). No functional change. -LLVOAvatar::removeMissingBakedTextures virtual. Implementation moved to VOAvatarSelf
This commit is contained in:
@@ -735,11 +735,11 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const
|
||||
// Example: #RLV/Separates/Shoes/ChiChi Pumps/.[shoes] with items: "Shoe Base", "Shoe (left foot)" and "Shoe (right foot)"
|
||||
// -> as long as "Shoe Base" is worn, @getattach should not reflect "left foot", nor "right foot"
|
||||
std::string strComposite; LLViewerInventoryCategory* pFolder;
|
||||
EWearableType type; S32 idxAttachPt;
|
||||
LLWearableType::EType type; S32 idxAttachPt;
|
||||
if ( (getCompositeInfo(idItem, &strComposite, &pFolder)) && (cstrItemType != strComposite) )
|
||||
{
|
||||
LLUUID idCompositeItem;
|
||||
if ((type = LLWearable::typeNameToType(strComposite)) != WT_INVALID)
|
||||
if ((type = LLWearable::typeNameToType(strComposite)) != LLWearableType::WT_INVALID)
|
||||
{
|
||||
idCompositeItem = gAgentWearables.getWearableItemID(type);
|
||||
}
|
||||
@@ -837,7 +837,7 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const
|
||||
case LLAssetType::AT_CLOTHING:
|
||||
{
|
||||
// NOTE: without its asset we don't know what type the wearable is so we need to look at the item's flags instead
|
||||
EWearableType wtType = (EWearableType)(pItem->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
|
||||
LLWearableType::EType wtType = (LLWearableType::EType)(pItem->getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK);
|
||||
LLViewerInventoryCategory* pFolder;
|
||||
if ( (!isWearable(wtType)) ||
|
||||
( (gAgent.getWearable(wtType)) && (!isRemovable(wtType)) ) ||
|
||||
@@ -956,14 +956,14 @@ ERlvCmdRet RlvHandler::processAddRemCommand(const RlvCommand& rlvCmd)
|
||||
RlvForceWear::instance().done();
|
||||
|
||||
ERlvLockMask eLock = (RLV_BHVR_ADDOUTFIT == eBhvr) ? RLV_LOCK_ADD : RLV_LOCK_REMOVE;
|
||||
for (int idxType = 0; idxType < WT_COUNT; idxType++)
|
||||
for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
|
||||
{
|
||||
if ( (rlvCmdOption.isEmpty()) || ((EWearableType)idxType == rlvCmdOption.getWearableType()) )
|
||||
if ( (rlvCmdOption.isEmpty()) || ((LLWearableType::EType)idxType == rlvCmdOption.getWearableType()) )
|
||||
{
|
||||
if (RLV_TYPE_ADD == eType)
|
||||
gRlvWearableLocks.addWearableTypeLock((EWearableType)idxType, rlvCmd.getObjectID(), eLock);
|
||||
gRlvWearableLocks.addWearableTypeLock((LLWearableType::EType)idxType, rlvCmd.getObjectID(), eLock);
|
||||
else
|
||||
gRlvWearableLocks.removeWearableTypeLock((EWearableType)idxType, rlvCmd.getObjectID(), eLock);
|
||||
gRlvWearableLocks.removeWearableTypeLock((LLWearableType::EType)idxType, rlvCmd.getObjectID(), eLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1559,10 +1559,10 @@ ERlvCmdRet RlvHandler::onForceRemOutfit(const RlvCommand& rlvCmd) const
|
||||
if ( (!rlvCmdOption.isWearableType()) && (!rlvCmdOption.isEmpty()) )
|
||||
return RLV_RET_FAILED_OPTION;
|
||||
|
||||
for (int idxType = 0; idxType < WT_COUNT; idxType++)
|
||||
for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
|
||||
{
|
||||
if ( (rlvCmdOption.isEmpty()) || ((EWearableType)idxType == rlvCmdOption.getWearableType()))
|
||||
RlvForceWear::instance().forceRemove((EWearableType)idxType);
|
||||
if ( (rlvCmdOption.isEmpty()) || ((LLWearableType::EType)idxType == rlvCmdOption.getWearableType()))
|
||||
RlvForceWear::instance().forceRemove((LLWearableType::EType)idxType);
|
||||
}
|
||||
return RLV_RET_SUCCESS;
|
||||
}
|
||||
@@ -1988,25 +1988,25 @@ ERlvCmdRet RlvHandler::onGetOutfit(const RlvCommand& rlvCmd, std::string& strRep
|
||||
RLV_ASSERT(RLV_BHVR_GETOUTFIT == rlvCmd.getBehaviourType());
|
||||
|
||||
// (Compatibility: RLV-1.16.1 will execute @getoutfit=<channel> if <layer> is invalid while we just return failure)
|
||||
EWearableType wtType = LLWearable::typeNameToType(rlvCmd.getOption());
|
||||
if ( (WT_INVALID == wtType) && (!rlvCmd.getOption().empty()) )
|
||||
LLWearableType::EType wtType = LLWearableType::typeNameToType(rlvCmd.getOption());
|
||||
if ( (LLWearableType::WT_INVALID == wtType) && (!rlvCmd.getOption().empty()) )
|
||||
return RLV_RET_FAILED_OPTION;
|
||||
|
||||
const EWearableType wtRlvTypes[] =
|
||||
const LLWearableType::EType wtRlvTypes[] =
|
||||
{
|
||||
WT_GLOVES, WT_JACKET, WT_PANTS, WT_SHIRT, WT_SHOES, WT_SKIRT, WT_SOCKS,
|
||||
WT_UNDERPANTS, WT_UNDERSHIRT, WT_SKIN, WT_EYES, WT_HAIR, WT_SHAPE, WT_ALPHA, WT_TATTOO, WT_PHYSICS
|
||||
LLWearableType::WT_GLOVES, LLWearableType::WT_JACKET, LLWearableType::WT_PANTS, LLWearableType::WT_SHIRT, LLWearableType::WT_SHOES, LLWearableType::WT_SKIRT, LLWearableType::WT_SOCKS,
|
||||
LLWearableType::WT_UNDERPANTS, LLWearableType::WT_UNDERSHIRT, LLWearableType::WT_SKIN, LLWearableType::WT_EYES, LLWearableType::WT_HAIR, LLWearableType::WT_SHAPE, LLWearableType::WT_ALPHA, LLWearableType::WT_TATTOO, LLWearableType::WT_PHYSICS
|
||||
};
|
||||
|
||||
for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(EWearableType); idxType < cntType; idxType++)
|
||||
for (int idxType = 0, cntType = sizeof(wtRlvTypes) / sizeof(LLWearableType::EType); idxType < cntType; idxType++)
|
||||
{
|
||||
if ( (WT_INVALID == wtType) || (wtRlvTypes[idxType] == wtType) )
|
||||
if ( (LLWearableType::WT_INVALID == wtType) || (wtRlvTypes[idxType] == wtType) )
|
||||
{
|
||||
// We never hide body parts, even if they're "locked" and we're hiding locked layers
|
||||
// (nor do we hide a layer if the issuing object is the only one that has this layer locked)
|
||||
bool fWorn = (gAgentWearables.getWearable(wtRlvTypes[idxType])) &&
|
||||
( (!RlvSettings::getHideLockedLayers()) ||
|
||||
(LLAssetType::AT_BODYPART == LLWearable::typeToAssetType(wtRlvTypes[idxType])) ||
|
||||
(LLAssetType::AT_BODYPART == LLWearableType::getAssetType(wtRlvTypes[idxType])) ||
|
||||
(RlvForceWear::isForceRemovable(wtRlvTypes[idxType], true, rlvCmd.getObjectID())) );
|
||||
strReply.push_back( (fWorn) ? '1' : '0' );
|
||||
}
|
||||
@@ -2026,9 +2026,9 @@ ERlvCmdRet RlvHandler::onGetOutfitNames(const RlvCommand& rlvCmd, std::string& s
|
||||
return RLV_RET_FAILED_OPTION;
|
||||
|
||||
// RELEASE-RLVa: [SL-2.0.0] Needs revisiting/rewriting once 'LLAgentWearables::MAX_WEARABLES_PER_TYPE > 1'
|
||||
for (int idxType = 0; idxType < WT_COUNT; idxType++)
|
||||
for (int idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++)
|
||||
{
|
||||
bool fAdd = false; EWearableType wtType = (EWearableType)idxType;
|
||||
bool fAdd = false; LLWearableType::EType wtType = (LLWearableType::EType)idxType;
|
||||
switch (rlvCmd.getBehaviourType())
|
||||
{
|
||||
case RLV_BHVR_GETOUTFITNAMES: // Every layer that's worn
|
||||
@@ -2050,7 +2050,7 @@ ERlvCmdRet RlvHandler::onGetOutfitNames(const RlvCommand& rlvCmd, std::string& s
|
||||
{
|
||||
if (!strReply.empty())
|
||||
strReply.push_back(',');
|
||||
strReply.append(LLWearable::typeToTypeName((EWearableType)idxType));
|
||||
strReply.append(LLWearableType::getTypeName((LLWearableType::EType)idxType));
|
||||
}
|
||||
}
|
||||
return RLV_RET_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user