RLVa 1.1.2 to 1.1.3 upgrade. InvLinks + COF

This commit is contained in:
Siana Gearz
2010-11-25 23:47:11 +01:00
parent 074bec3ad1
commit f9dcb1bb09
88 changed files with 8710 additions and 4707 deletions

View File

@@ -22,6 +22,7 @@ set(llcommon_SOURCE_FILES
llbase32.cpp
llbase64.cpp
llcommon.cpp
llcommonutils.cpp
llcrc.cpp
llcriticaldamp.cpp
llcursortypes.cpp
@@ -96,6 +97,7 @@ set(llcommon_HEADER_FILES
llchat.h
llclickaction.h
llcommon.h
llcommonutils.h
llcrc.h
llcriticaldamp.h
llcursortypes.h

View File

@@ -255,6 +255,10 @@ const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// group constants
const S32 MAX_AGENT_GROUPS = 25;
// attachment constants
const S32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80;
// god levels
const U8 GOD_MAINTENANCE = 250;
const U8 GOD_FULL = 200;

View File

@@ -70,7 +70,13 @@ asset_info_t asset_types[] =
{ LLAssetType::AT_ANIMATION, "ANIMATION" },
{ LLAssetType::AT_GESTURE, "GESTURE" },
{ LLAssetType::AT_SIMSTATE, "SIMSTATE" },
{ LLAssetType::AT_NONE, "NONE" },
{ LLAssetType::AT_FAVORITE, "FAVORITE" },
{ LLAssetType::AT_LINK, "LINK" },
{ LLAssetType::AT_LINK_FOLDER, "CURRENT" },
{ LLAssetType::AT_CURRENT_OUTFIT, "FOLDER_LINK" },
{ LLAssetType::AT_OUTFIT, "OUTFIT" },
{ LLAssetType::AT_MY_OUTFITS, "MY_OUTFITS" },
{ LLAssetType::AT_NONE, "NONE" }
};
LLAssetType::EType LLAssetType::getType(const std::string& sin)
@@ -129,7 +135,33 @@ const char* LLAssetType::mAssetTypeNames[LLAssetType::AT_COUNT] =
"jpeg",
"animatn",
"gesture",
"simstate"
"simstate",
"favorite",
"link",
"link_f",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"current",
"outfit",
"my_otfts"
};
// This table is meant for decoding to human readable form. Put any
@@ -159,7 +191,33 @@ const char* LLAssetType::mAssetTypeHumanNames[LLAssetType::AT_COUNT] =
"jpeg image",
"animation",
"gesture",
"simstate"
"simstate",
"",
"symbolic link",
"symbolic folder link"
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"current outfit",
"outfit",
"my outfits"
};
///----------------------------------------------------------------------------
@@ -248,6 +306,12 @@ EDragAndDropType LLAssetType::lookupDragAndDropType( EType asset )
case AT_BODYPART: return DAD_BODYPART;
case AT_ANIMATION: return DAD_ANIMATION;
case AT_GESTURE: return DAD_GESTURE;
case AT_FAVORITE: return DAD_CATEGORY;
case AT_LINK: return DAD_LINK;
case AT_LINK_FOLDER: return DAD_LINK;
case AT_CURRENT_OUTFIT: return DAD_LINK;
case AT_OUTFIT: return DAD_LINK;
case AT_MY_OUTFITS: return DAD_CATEGORY;
default: return DAD_NONE;
};
}
@@ -265,3 +329,17 @@ void LLAssetType::generateDescriptionFor(LLAssetType::EType type,
desc.assign(time_str);
desc.append(LLAssetType::lookupHumanReadable(type));
}
// static
bool LLAssetType::lookupCanLink(EType asset_type)
{
return (asset_type == AT_CLOTHING || asset_type == AT_OBJECT || asset_type == AT_CATEGORY ||
asset_type == AT_BODYPART || asset_type == AT_GESTURE);
}
// static
// Not adding this to dictionary since we probably will only have these two types
bool LLAssetType::lookupIsLinkType(EType asset_type)
{
return (asset_type == AT_LINK || asset_type == AT_LINK_FOLDER);
}

View File

@@ -131,6 +131,20 @@ public:
// simstate file
AT_SIMSTATE = 22,
AT_FAVORITE = 23,
// Inventory symbolic link
AT_LINK = 24,
// Inventory folder link
AT_LINK_FOLDER = 25,
AT_CURRENT_OUTFIT = 46,
AT_OUTFIT = 47,
AT_MY_OUTFITS = 48,
// +*********************************************+
// | TO ADD AN ELEMENT TO THIS ENUM: |
// +*********************************************+
@@ -140,7 +154,7 @@ public:
// | 4. ADD TO LLAssetType::mAssetTypeHumanNames |
// +*********************************************+
AT_COUNT = 23,
AT_COUNT = 49,
AT_NONE = -1
};
@@ -165,6 +179,9 @@ public:
static EType getType(const std::string& sin);
static std::string getDesc(EType type);
static bool lookupCanLink(EType asset_type);
static bool lookupIsLinkType(EType asset_type);
private:
// don't instantiate or derive one of these objects
LLAssetType( void ) {}

View File

@@ -0,0 +1,56 @@
/**
* @file llcommonutils.h
* @brief Commin utils
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#include "linden_common.h"
#include "llcommonutils.h"
void LLCommonUtils::computeDifference(
const uuid_vec_t& vnew,
const uuid_vec_t& vcur,
uuid_vec_t& vadded,
uuid_vec_t& vremoved)
{
uuid_vec_t vnew_copy(vnew);
uuid_vec_t vcur_copy(vcur);
std::sort(vnew_copy.begin(), vnew_copy.end());
std::sort(vcur_copy.begin(), vcur_copy.end());
size_t maxsize = llmax(vnew_copy.size(), vcur_copy.size());
vadded.resize(maxsize);
vremoved.resize(maxsize);
uuid_vec_t::iterator it;
// what was removed
it = set_difference(vcur_copy.begin(), vcur_copy.end(), vnew_copy.begin(), vnew_copy.end(), vremoved.begin());
vremoved.erase(it, vremoved.end());
// what was added
it = set_difference(vnew_copy.begin(), vnew_copy.end(), vcur_copy.begin(), vcur_copy.end(), vadded.begin());
vadded.erase(it, vadded.end());
}
// EOF

View File

@@ -0,0 +1,54 @@
/**
* @file llcommonutils.h
* @brief Common utils
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
#ifndef LL_LLCOMMONUTILS_H
#define LL_LLCOMMONUTILS_H
#include "llpreprocessor.h"
#include "lluuid.h"
namespace LLCommonUtils
{
/**
* Computes difference between 'vnew' and 'vcur' vectors.
* Items present in 'vnew' and missing in 'vcur' are treated as added and are copied into 'vadded'
* Items missing in 'vnew' and present in 'vcur' are treated as removed and are copied into 'vremoved'
*
* @param vnew[in] - incoming IDs
* @param vcur[in] - current IDs
* @param vadded[out] - difference between incoming and current IDS - added IDs
* @param vremoved[out] - difference between incoming and current IDS - removed IDs
*/
LL_COMMON_API void computeDifference(
const uuid_vec_t& vnew,
const uuid_vec_t& vcur,
uuid_vec_t& vadded,
uuid_vec_t& vremoved);
};
#endif //LL_LLCOMMONUTILS_H
// EOF

View File

@@ -34,6 +34,7 @@
#include <iostream>
#include <set>
#include <vector>
#include "stdtypes.h"
#include "llpreprocessor.h"
@@ -132,7 +133,7 @@ public:
U8 mData[UUID_BYTES];
};
typedef std::vector<LLUUID> uuid_vec_t;
// Construct
inline LLUUID::LLUUID()

View File

@@ -54,7 +54,8 @@ enum EDragAndDropType
DAD_BODYPART = 11,
DAD_ANIMATION = 12,
DAD_GESTURE = 13,
DAD_COUNT = 14, // number of types in this enum
DAD_LINK = 14,
DAD_COUNT = 15, // number of types in this enum
};
// Reasons for drags to be denied.