Permalink
Browse files

Compile Fixes

Updates RLVHelper.
  • Loading branch information...
Lirusaito committed May 26, 2016
1 parent 4bfd4b3 commit cfea4f4ccf4af686f2ba003a08b38a9777d41ca7
@@ -701,7 +701,7 @@ void LLAgentWearables::wearableUpdated(LLWearable *wearable, BOOL removed)
{
LL_INFOS() << "forcing wearable type " << wearable->getType() << " to version 22 from 24" << LL_ENDL;
wearable->setDefinitionVersion(22);
- saveWearable(wearable->getType(),index,TRUE);
+ saveWearable(wearable->getType(),index);
}
}
@@ -174,7 +174,7 @@ class LLAgentWearables : public LLInitClass<LLAgentWearables>, public LLWearable
//--------------------------------------------------------------------
public:
LLViewerWearable* saveWearableAs(const LLWearableType::EType type, const U32 index, const std::string& new_name, const std::string& description, BOOL save_in_lost_and_found);
- void saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update = TRUE,
+ void saveWearable(const LLWearableType::EType type, const U32 index,
const std::string new_name = "");
void saveAllWearables();
void revertWearable(const LLWearableType::EType type, const U32 index);
@@ -1430,7 +1430,7 @@ const LLUUID LLAppearanceMgr::getBaseOutfitUUID()
return outfit_cat->getUUID();
}
-void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace = false)
+void wear_on_avatar_cb(const LLUUID& inv_item, bool do_replace /*= false*/)
{
if (inv_item.isNull())
return;
@@ -4441,7 +4441,7 @@ void LLAppearanceMgr::removeItemsFromAvatar(const uuid_vec_t& ids_to_remove, LLP
cb = new LLUpdateAppearanceOnDestroy();
removeCOFItemLinks(linked_item_id, cb, immediate_delete);
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2015-03-01 (Catznip-3.7)
- clearPendingAttachment(linked_item_id);
+ LLAttachmentsMgr::instance().clearPendingAttachmentLink(linked_item_id);
// [/SL:KB]
addDoomedTempAttachment(linked_item_id);
}
@@ -300,7 +300,7 @@ BOOL get_can_item_be_worn(const LLUUID& id)
if (!item)
return FALSE;
- if (LLAppearanceMgr::isLinkedInCOF(item->getLinkedUUID()))
+ if (LLAppearanceMgr::instance().isLinkedInCOF(item->getLinkedUUID()))
{
// an item having links in COF (i.e. a worn item)
return FALSE;
@@ -1284,7 +1284,7 @@ void LLPanelEditWearable::saveChanges(bool force_save_as, std::string new_name)
remove_inventory_item(link_item, NULL);
}
- gAgentWearables.saveWearable(mType, index, TRUE, new_name);
+ gAgentWearables.saveWearable(mType, index, new_name);
}
}
@@ -96,7 +96,7 @@ bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBeh
strOption = strParam = "";
// If <param> is missing it's an improperly formatted command
- if ( (-1 == idxParam) || ((int)strCommand.length() - 1 == idxParam) )
+ if ( (-1 == idxParam) || (static_cast<int>(strCommand.length()) - 1 == idxParam) )
{
// Unless "<behaviour> == "clear" AND (idxOption == 0)"
// OR <behaviour> == "clear" AND (idxParam != 0) [see table above]
@@ -187,12 +187,12 @@ void RlvCommand::initLookupTable()
//
// Checked: 2010-09-28 (RLVa-1.2.1c) | Added: RLVa-1.2.1c
-RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption)
+RlvCommandOptionGeneric::RlvCommandOptionGeneric(const std::string& strOption): m_fEmpty(false)
{
LLWearableType::EType wtType(LLWearableType::WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID);
LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL;
- if (!(m_fEmpty = strOption.empty())) // <option> could be an empty string
+ if (!(m_fEmpty == strOption.empty())) // <option> could be an empty string
{
if ( ((wtType = LLWearableType::typeNameToType(strOption)) != LLWearableType::WT_INVALID) && (wtType != LLWearableType::WT_NONE) )
m_varOption = wtType; // ... or specify a (valid) clothing layer
@@ -229,7 +229,7 @@ class RlvCommandOptionGetPathCallback
gIdleCallbacks.deleteFunction(&onIdle, this);
}
- void onAttachment(LLViewerObject* pAttachObj, LLVOAvatarSelf::EAttachAction eAction)
+ void onAttachment(LLViewerObject* pAttachObj, LLVOAvatarSelf::EAttachAction eAction) const
{
if ( (LLVOAvatarSelf::ACTION_ATTACH == eAction) && (pAttachObj->getID() == mObjectId) )
{
@@ -359,7 +359,7 @@ RlvCommandOptionTpTo::RlvCommandOptionTpTo(const RlvCommand &rlvCmd)
m_fValid = (3 == cmdTokens.size());
for (int idxAxis = 0; (idxAxis < 3) && (m_fValid); idxAxis++)
- m_fValid &= (bool)LLStringUtil::convertToF64(cmdTokens[idxAxis], m_posGlobal[idxAxis]);
+ m_fValid &= static_cast<bool>(LLStringUtil::convertToF64(cmdTokens[idxAxis], m_posGlobal[idxAxis]));
}
// =========================================================================
@@ -805,7 +805,7 @@ void RlvForceWear::addAttachment(const LLViewerInventoryItem* pItem, EWearAction
m_addAttachments.insert(addattachment_pair_t(idxAttachPt, LLInventoryModel::item_array_t()));
itAddAttachments = m_addAttachments.find(idxAttachPt);
}
- itAddAttachments->second.push_back((LLViewerInventoryItem*)pItem);
+ itAddAttachments->second.push_back(const_cast<LLViewerInventoryItem*>(pItem));
}
}
else if (ACTION_WEAR_REPLACE == eAction)
@@ -824,7 +824,7 @@ void RlvForceWear::addAttachment(const LLViewerInventoryItem* pItem, EWearAction
if (0 != idxAttachPt)
itAddAttachments->second.clear();
- itAddAttachments->second.push_back((LLViewerInventoryItem*)pItem);
+ itAddAttachments->second.push_back(const_cast<LLViewerInventoryItem*>(pItem));
}
}
@@ -877,12 +877,12 @@ void RlvForceWear::addWearable(const LLViewerInventoryItem* pItem, EWearAction e
if (ACTION_WEAR_ADD == eAction) // Add it at the back if it's not already there
{
if (!isAddWearable(pItem))
- itAddWearables->second.push_back((LLViewerInventoryItem*)pItem);
+ itAddWearables->second.push_back(const_cast<LLViewerInventoryItem*>(pItem));
}
else if (ACTION_WEAR_REPLACE == eAction) // Replace all pending wearables of this type with the specified item
{
itAddWearables->second.clear();
- itAddWearables->second.push_back((LLViewerInventoryItem*)pItem);
+ itAddWearables->second.push_back(const_cast<LLViewerInventoryItem*>(pItem));
}
}
@@ -913,15 +913,15 @@ void RlvForceWear::updatePendingAttachments()
{
RlvForceWear* pThis = RlvForceWear::getInstance();
for (const auto& itAttach : pThis->m_pendingAttachments)
- LLAttachmentsMgr::instance().addAttachment(itAttach.first, itAttach.second & ~ATTACHMENT_ADD, itAttach.second & ATTACHMENT_ADD);
+ LLAttachmentsMgr::instance().addAttachmentRequest(itAttach.first, itAttach.second & ~ATTACHMENT_ADD, itAttach.second & ATTACHMENT_ADD);
pThis->m_pendingAttachments.clear();
}
}
// Checked: 2015-05-05 (RLVa-1.4.12)
void RlvForceWear::addPendingAttachment(const LLUUID& idItem, U8 idxPoint)
{
- pendingattachments_map_t::iterator itAttach = m_pendingAttachments.find(idItem);
+ auto itAttach = m_pendingAttachments.find(idItem);
if (m_pendingAttachments.end() == itAttach)
m_pendingAttachments.insert(std::make_pair(idItem, idxPoint));
else
@@ -982,7 +982,7 @@ void RlvForceWear::done()
// Wearables need to be split into AT_BODYPART and AT_CLOTHING for COF
LLInventoryModel::item_array_t addBodyParts, addClothing;
- for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.begin(); itAddWearables != m_addWearables.end(); ++itAddWearables)
+ for (addwearables_map_t::const_iterator itAddWearables = m_addWearables.cbegin(); itAddWearables != m_addWearables.cend(); ++itAddWearables)
{
// NOTE: LLAppearanceMgr will filter our duplicates so no need for us to check here
for (LLViewerInventoryItem* pItem : itAddWearables->second)
@@ -996,7 +996,7 @@ void RlvForceWear::done()
m_addWearables.clear();
// Until LL provides a way for updateCOF to selectively attach add/replace we have to deal with attachments ourselves
- for (addattachments_map_t::const_iterator itAddAttachments = m_addAttachments.begin(); itAddAttachments != m_addAttachments.end(); ++itAddAttachments)
+ for (addattachments_map_t::const_iterator itAddAttachments = m_addAttachments.cbegin(); itAddAttachments != m_addAttachments.cend(); ++itAddAttachments)
{
for (const LLViewerInventoryItem* pItem : itAddAttachments->second)
addPendingAttachment(pItem->getLinkedUUID(), itAddAttachments->first);
@@ -1018,8 +1018,17 @@ void RlvForceWear::done()
LLAppearanceMgr::instance().removeItemsFromAvatar(remItems, cb, true);
}
- if ( (!addBodyParts.empty()) || (!addClothing.empty()) || (!m_addGestures.empty()) )
+ if ( (addBodyParts.empty()) && (!addClothing.empty()) && (m_addGestures.empty()) )
{
+ // Clothing items only
+ uuid_vec_t idClothing;
+ for (const LLViewerInventoryItem* pItem : addClothing)
+ idClothing.push_back(pItem->getUUID());
+ LLAppearanceMgr::instance().wearItemsOnAvatar(idClothing, false, false, cb);
+ }
+ else if ( (!addBodyParts.empty()) || (!addClothing.empty()) || (!m_addGestures.empty()) )
+ {
+ // Mixture of body parts, clothing and/or gestures
LLInventoryModel::item_array_t addAttachments;
LLAppearanceMgr::instance().updateCOF(addBodyParts, addClothing, addAttachments, m_addGestures, true, LLUUID::null, cb);
@@ -1067,7 +1076,7 @@ void RlvForceWear::onWearableArrived(LLWearable* pWearable, void* pParam)
*/
// ============================================================================
-// RlvBehaviourNotifyHandler
+// RlvBehaviourNotifyObserver
//
// Checked: 2010-03-03 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
@@ -1078,8 +1087,10 @@ RlvBehaviourNotifyHandler::RlvBehaviourNotifyHandler()
m_ConnCommand = gRlvHandler.setCommandCallback(boost::bind(&RlvBehaviourNotifyHandler::onCommand, this, _1, _2, _3));
}
+// ReSharper disable once CppMemberFunctionMayBeStatic
+
// Checked: 2010-03-03 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a
-void RlvBehaviourNotifyHandler::onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal)
+void RlvBehaviourNotifyHandler::onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal) const
{
if (fInternal)
return;
@@ -1198,7 +1209,7 @@ ERlvAttachGroupType rlvAttachGroupFromString(const std::string& strGroup)
{
for (int idx = 0; idx < RLV_ATTACHGROUP_COUNT; idx++)
if (cstrAttachGroups[idx] == strGroup)
- return (ERlvAttachGroupType)idx;
+ return static_cast<ERlvAttachGroupType>(idx);
return RLV_ATTACHGROUP_INVALID;
}
View
@@ -53,7 +53,7 @@ class RlvCommand
typedef std::map<std::string, ERlvBehaviour> bhvr_map_t;
static ERlvBehaviour getBehaviourFromString(const std::string& strBhvr, bool* pfStrict = NULL);
static bool getCommands(bhvr_map_t& cmdList, const std::string& strMatch);
- static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr);
+ //static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr); // not implemented
static bool hasStrictVariant(ERlvBehaviour eBhvr);
static void initLookupTable();
@@ -313,7 +313,7 @@ class RlvForceWear : public LLSingleton<RlvForceWear>
};
// ============================================================================
-// RlvBehaviourNotifyHandler
+// RlvBehaviourNotifyObserver
//
class RlvBehaviourNotifyHandler : public LLSingleton<RlvBehaviourNotifyHandler>
@@ -347,16 +347,15 @@ class RlvBehaviourNotifyHandler : public LLSingleton<RlvBehaviourNotifyHandler>
/*
* Event handlers
*/
-public:
+//public:
static void onWear(LLWearableType::EType eType, bool fAllowed);
static void onTakeOff(LLWearableType::EType eType, bool fAllowed);
static void onAttach(const LLViewerJointAttachment* pAttachPt, bool fAllowed);
static void onDetach(const LLViewerJointAttachment* pAttachPt, bool fAllowed);
static void onReattach(const LLViewerJointAttachment* pAttachPt, bool fAllowed);
protected:
- void onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal);
+ void onCommand(const RlvCommand& rlvCmd, ERlvCmdRet eRet, bool fInternal) const;
-protected:
struct notifyData
{
S32 nChannel;
@@ -394,6 +393,7 @@ class RlvGCTimer : public LLEventTimer
virtual BOOL tick();
};
+// NOTE: Unused as of SL-3.7.2
class RlvCallbackTimerOnce : public LLEventTimer
{
public:
@@ -409,6 +409,7 @@ class RlvCallbackTimerOnce : public LLEventTimer
nullary_func_t m_Callback;
};
+// NOTE: Unused as of SL-3.7.2
inline void rlvCallbackTimerOnce(F32 nPeriod, RlvCallbackTimerOnce::nullary_func_t cb)
{
// Timer will automatically delete itself after the callback

0 comments on commit cfea4f4

Please sign in to comment.