Merge branch 'viewer/build' into rlva/development

master
Kitty Barnett 2021-04-05 14:55:26 +02:00
commit 39d77476df
133 changed files with 2169 additions and 879 deletions

View File

@ -244,9 +244,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>322dd6c45c384d454ae14ef127984a4e</string>
<string>ae90d19cdcddf539f6d0b41cab12f918</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65457/612879/bugsplat-1.0.7.546418-darwin64-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72773/702861/bugsplat-1.0.7.552580-darwin64-552580.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -256,9 +256,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>010a0e73c0fddaa2316411803fad8e69</string>
<string>f5936eceb6a33ff0f1cc31996a40f29c</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65456/612876/bugsplat-3.6.0.8.546418-windows-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72774/702905/bugsplat-3.6.0.8.552580-windows-552580.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -268,16 +268,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>7e8530762e7b50663708a888c23b8780</string>
<string>9cd940754e53e0670030b3da5ba8f373</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65455/612874/bugsplat-3.6.0.8.546418-windows64-546418.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/72775/702906/bugsplat-3.6.0.8.552580-windows64-552580.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>3.6.0.8.546418</string>
<string>3.6.0.8.552580</string>
</map>
<key>colladadom</key>
<map>
@ -2187,18 +2187,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>9f4687d7d328b0c13a9e651e805e880a</string>
<string>c541838a933e0714a954e9ef6c89345d</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/71501/691487/llca-202011010215.551526-common-551526.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/73387/708088/llca-202012011600.553112-common-553112.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>202011010215.551526</string>
<string>202012011600.553112</string>
</map>
<key>llphysicsextensions_source</key>
<map>

View File

@ -480,10 +480,12 @@ then
fi
# Run upload extensions
# Ex: bugsplat
if [ -d ${build_dir}/packages/upload-extensions ]; then
for extension in ${build_dir}/packages/upload-extensions/*.sh; do
begin_section "Upload Extension $extension"
. $extension
[ $? -eq 0 ] || fatal "Upload of extension $extension failed"
end_section "Upload Extension $extension"
done
fi

View File

@ -171,10 +171,9 @@ LLAvatarAppearance::LLAvatarXmlInfo::~LLAvatarXmlInfo()
//-----------------------------------------------------------------------------
// Static Data
//-----------------------------------------------------------------------------
LLXmlTree LLAvatarAppearance::sXMLTree;
LLXmlTree LLAvatarAppearance::sSkeletonXMLTree;
LLAvatarSkeletonInfo* LLAvatarAppearance::sAvatarSkeletonInfo = NULL;
LLAvatarAppearance::LLAvatarXmlInfo* LLAvatarAppearance::sAvatarXmlInfo = NULL;
LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* LLAvatarAppearance::sAvatarDictionary = NULL;
LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
@ -202,7 +201,7 @@ LLAvatarAppearance::LLAvatarAppearance(LLWearableData* wearable_data) :
mBakedTextureDatas[i].mIsLoaded = false;
mBakedTextureDatas[i].mIsUsed = false;
mBakedTextureDatas[i].mMaskTexName = 0;
mBakedTextureDatas[i].mTextureIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
mBakedTextureDatas[i].mTextureIndex = sAvatarDictionary->bakedToLocalTextureIndex((LLAvatarAppearanceDefines::EBakedTextureIndex)i);
}
}
@ -215,8 +214,8 @@ void LLAvatarAppearance::initInstance()
mRoot = createAvatarJoint();
mRoot->setName( "mRoot" );
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = sAvatarDictionary->getMeshEntries().begin();
iter != sAvatarDictionary->getMeshEntries().end();
++iter)
{
const EMeshIndex mesh_index = iter->first;
@ -261,8 +260,8 @@ void LLAvatarAppearance::initInstance()
//-------------------------------------------------------------------------
// associate baked textures with meshes
//-------------------------------------------------------------------------
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = sAvatarDictionary->getMeshEntries().begin();
iter != sAvatarDictionary->getMeshEntries().end();
++iter)
{
const EMeshIndex mesh_index = iter->first;
@ -336,6 +335,12 @@ void LLAvatarAppearance::initClass()
//static
void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, const std::string& skeleton_file_name_arg)
{
// init dictionary (don't repeat on second login attempt)
if (!sAvatarDictionary)
{
sAvatarDictionary = new LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary();
}
std::string avatar_file_name;
if (!avatar_file_name_arg.empty())
@ -346,14 +351,15 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
{
avatar_file_name = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,AVATAR_DEFAULT_CHAR + "_lad.xml");
}
BOOL success = sXMLTree.parseFile( avatar_file_name, FALSE );
LLXmlTree xml_tree;
BOOL success = xml_tree.parseFile( avatar_file_name, FALSE );
if (!success)
{
LL_ERRS() << "Problem reading avatar configuration file:" << avatar_file_name << LL_ENDL;
}
// now sanity check xml file
LLXmlTreeNode* root = sXMLTree.getRoot();
LLXmlTreeNode* root = xml_tree.getRoot();
if (!root)
{
LL_ERRS() << "No root node found in avatar configuration file: " << avatar_file_name << LL_ENDL;
@ -400,8 +406,9 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
}
std::string skeleton_path;
LLXmlTree skeleton_xml_tree;
skeleton_path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,skeleton_file_name);
if (!parseSkeletonFile(skeleton_path))
if (!parseSkeletonFile(skeleton_path, skeleton_xml_tree))
{
LL_ERRS() << "Error parsing skeleton file: " << skeleton_path << LL_ENDL;
}
@ -414,7 +421,7 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
delete sAvatarSkeletonInfo;
}
sAvatarSkeletonInfo = new LLAvatarSkeletonInfo;
if (!sAvatarSkeletonInfo->parseXml(sSkeletonXMLTree.getRoot()))
if (!sAvatarSkeletonInfo->parseXml(skeleton_xml_tree.getRoot()))
{
LL_ERRS() << "Error parsing skeleton XML file: " << skeleton_path << LL_ENDL;
}
@ -453,9 +460,8 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
void LLAvatarAppearance::cleanupClass()
{
delete_and_clear(sAvatarXmlInfo);
// *TODO: What about sAvatarSkeletonInfo ???
sSkeletonXMLTree.cleanup();
sXMLTree.cleanup();
delete_and_clear(sAvatarDictionary);
delete_and_clear(sAvatarSkeletonInfo);
}
using namespace LLAvatarAppearanceDefines;
@ -577,12 +583,12 @@ void LLAvatarAppearance::computeBodySize()
//-----------------------------------------------------------------------------
// parseSkeletonFile()
//-----------------------------------------------------------------------------
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree)
{
//-------------------------------------------------------------------------
// parse the file
//-------------------------------------------------------------------------
BOOL parsesuccess = sSkeletonXMLTree.parseFile( filename, FALSE );
BOOL parsesuccess = skeleton_xml_tree.parseFile( filename, FALSE );
if (!parsesuccess)
{
@ -591,7 +597,7 @@ BOOL LLAvatarAppearance::parseSkeletonFile(const std::string& filename)
}
// now sanity check xml file
LLXmlTreeNode* root = sSkeletonXMLTree.getRoot();
LLXmlTreeNode* root = skeleton_xml_tree.getRoot();
if (!root)
{
LL_ERRS() << "No root node found in avatar skeleton file: " << filename << LL_ENDL;
@ -999,7 +1005,7 @@ BOOL LLAvatarAppearance::loadAvatar()
{
LLAvatarXmlInfo::LLAvatarMorphInfo *info = *iter;
EBakedTextureIndex baked = LLAvatarAppearanceDictionary::findBakedByRegionName(info->mRegion);
EBakedTextureIndex baked = sAvatarDictionary->findBakedByRegionName(info->mRegion);
if (baked != BAKED_NUM_INDICES)
{
LLVisualParam* morph_param;
@ -1135,8 +1141,8 @@ BOOL LLAvatarAppearance::loadMeshNodes()
switch(lod)
case 0:
mesh = &mHairMesh0; */
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator mesh_iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
mesh_iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator mesh_iter = sAvatarDictionary->getMeshEntries().begin();
mesh_iter != sAvatarDictionary->getMeshEntries().end();
++mesh_iter)
{
const EMeshIndex mesh_index = mesh_iter->first;
@ -1264,8 +1270,8 @@ BOOL LLAvatarAppearance::loadLayersets()
// scan baked textures and associate the layerset with the appropriate one
EBakedTextureIndex baked_index = BAKED_NUM_INDICES;
for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = sAvatarDictionary->getBakedTextures().begin();
baked_iter != sAvatarDictionary->getBakedTextures().end();
++baked_iter)
{
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second;

View File

@ -156,7 +156,7 @@ public:
protected:
static BOOL parseSkeletonFile(const std::string& filename);
static BOOL parseSkeletonFile(const std::string& filename, LLXmlTree& skeleton_xml_tree);
virtual void buildCharacter();
virtual BOOL loadAvatar();
@ -211,9 +211,6 @@ public:
// XML parse tree
//--------------------------------------------------------------------
protected:
static LLXmlTree sXMLTree; // avatar config file
static LLXmlTree sSkeletonXMLTree; // avatar skeleton file
static LLAvatarSkeletonInfo* sAvatarSkeletonInfo;
static LLAvatarXmlInfo* sAvatarXmlInfo;
@ -255,6 +252,7 @@ public:
public:
virtual void updateMeshTextures() = 0;
virtual void dirtyMesh() = 0; // Dirty the avatar mesh
static const LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary *getDictionary() { return sAvatarDictionary; }
protected:
virtual void dirtyMesh(S32 priority) = 0; // Dirty the avatar mesh, with priority
@ -263,6 +261,9 @@ protected:
polymesh_map_t mPolyMeshes;
avatar_joint_list_t mMeshLOD;
// mesh entries and backed textures
static LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* sAvatarDictionary;
/** Meshes
** **
*******************************************************************************/

View File

@ -258,19 +258,17 @@ LLAvatarAppearanceDictionary::BakedEntry::BakedEntry(ETextureIndex tex_index,
}
}
// static
ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index)
ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextureIndex index) const
{
return LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(index)->mTextureIndex;
return getBakedTexture(index)->mTextureIndex;
}
// static
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name)
{
U8 index = 0;
while (index < BAKED_NUM_INDICES)
{
const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
const BakedEntry *be = getBakedTexture((EBakedTextureIndex) index);
if (be && be->mName.compare(name) == 0)
{
// baked texture found
@ -282,16 +280,15 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri
return BAKED_NUM_INDICES;
}
// static
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name)
{
U8 index = 0;
while (index < BAKED_NUM_INDICES)
{
const BakedEntry *be = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex) index);
const BakedEntry *be = getBakedTexture((EBakedTextureIndex) index);
if (be)
{
const TextureEntry *te = LLAvatarAppearanceDictionary::getInstance()->getTexture(be->mTextureIndex);
const TextureEntry *te = getTexture(be->mTextureIndex);
if (te && te->mDefaultImageName.compare(name) == 0)
{
// baked texture found
@ -304,10 +301,9 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::strin
return BAKED_NUM_INDICES;
}
// static
LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index )
LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index ) const
{
return getInstance()->getTexture(index)->mWearableType;
return getTexture(index)->mWearableType;
}
// static

View File

@ -143,13 +143,14 @@ typedef std::vector<LLWearableType::EType> wearables_vec_t;
//
// This holds const data - it is initialized once and the contents never change after that.
//------------------------------------------------------------------------
class LLAvatarAppearanceDictionary : public LLSingleton<LLAvatarAppearanceDictionary>
class LLAvatarAppearanceDictionary
{
//--------------------------------------------------------------------
// Constructors and Destructors
//--------------------------------------------------------------------
LLSINGLETON(LLAvatarAppearanceDictionary);
virtual ~LLAvatarAppearanceDictionary();
public:
LLAvatarAppearanceDictionary();
~LLAvatarAppearanceDictionary();
private:
void createAssociations();
@ -235,14 +236,14 @@ public:
//--------------------------------------------------------------------
public:
// Convert from baked texture to associated texture; e.g. BAKED_HEAD -> TEX_HEAD_BAKED
static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t);
ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t) const;
// find a baked texture index based on its name
static EBakedTextureIndex findBakedByRegionName(std::string name);
static EBakedTextureIndex findBakedByImageName(std::string name);
EBakedTextureIndex findBakedByRegionName(std::string name);
EBakedTextureIndex findBakedByImageName(std::string name);
// Given a texture entry, determine which wearable type owns it.
static LLWearableType::EType getTEWearableType(ETextureIndex index);
LLWearableType::EType getTEWearableType(ETextureIndex index) const;
static BOOL isBakedImageId(const LLUUID& id);
static EBakedTextureIndex assetIdToBakedTextureIndex(const LLUUID& id);

View File

@ -728,8 +728,8 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
/* if ("upper_shirt" == local_texture_name)
mLocalTexture = TEX_UPPER_SHIRT; */
mLocalTexture = TEX_NUM_INDICES;
for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearance::getDictionary()->getTextures().begin();
iter != LLAvatarAppearance::getDictionary()->getTextures().end();
iter++)
{
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second;
@ -979,7 +979,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const
return type;
}
return LLAvatarAppearanceDictionary::getTEWearableType(te);
return LLAvatarAppearance::getDictionary()->getTEWearableType(te);
}
LLTexLayerInterface::ERenderPass LLTexLayerInterface::getRenderPass() const

View File

@ -183,7 +183,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
void LLWearable::createLayers(S32 te, LLAvatarAppearance *avatarp)
{
LLTexLayerSet *layer_set = NULL;
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)te);
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)te);
if (texture_dict && texture_dict->mIsUsedByBakedTexture)
{
const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex;
@ -606,7 +606,7 @@ void LLWearable::syncImages(te_map_t &src, te_map_t &dst)
// Deep copy of src (copies only those tes that are current, filling in defaults where needed)
for( S32 te = 0; te < TEX_NUM_INDICES; te++ )
{
if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex) te) == mType)
if (LLAvatarAppearance::getDictionary()->getTEWearableType((ETextureIndex) te) == mType)
{
te_map_t::const_iterator iter = src.find(te);
LLUUID image_id;

View File

@ -347,7 +347,7 @@ U32 LLWearableData::getWearableCount(const LLWearableType::EType type) const
U32 LLWearableData::getWearableCount(const U32 tex_index) const
{
const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType((LLAvatarAppearanceDefines::ETextureIndex)tex_index);
const LLWearableType::EType wearable_type = LLAvatarAppearance::getDictionary()->getTEWearableType((LLAvatarAppearanceDefines::ETextureIndex)tex_index);
return getWearableCount(wearable_type);
}
@ -357,7 +357,7 @@ LLUUID LLWearableData::computeBakedTextureHash(LLAvatarAppearanceDefines::EBaked
LLUUID hash_id;
bool hash_computed = false;
LLMD5 hash;
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index);
const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearance::getDictionary()->getBakedTexture(baked_index);
for (U8 i=0; i < baked_dict->mWearables.size(); i++)
{

View File

@ -413,42 +413,60 @@ public:
static std::string typeString(Type type); // Return human-readable type as a string
};
struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
//struct llsd_select_bool : public std::unary_function<LLSD, LLSD::Boolean>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_bool
// [/SL:KB]
{
LLSD::Boolean operator()(const LLSD& sd) const
{
return sd.asBoolean();
}
};
struct llsd_select_integer : public std::unary_function<LLSD, LLSD::Integer>
//struct llsd_select_integer : public std::unary_function<LLSD, LLSD::Integer>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_integer
// [/SL:KB]
{
LLSD::Integer operator()(const LLSD& sd) const
{
return sd.asInteger();
}
};
struct llsd_select_real : public std::unary_function<LLSD, LLSD::Real>
//struct llsd_select_real : public std::unary_function<LLSD, LLSD::Real>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_real
// [/SL:KB]
{
LLSD::Real operator()(const LLSD& sd) const
{
return sd.asReal();
}
};
struct llsd_select_float : public std::unary_function<LLSD, F32>
//struct llsd_select_float : public std::unary_function<LLSD, F32>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_float
// [/SL:KB]
{
F32 operator()(const LLSD& sd) const
{
return (F32)sd.asReal();
}
};
struct llsd_select_uuid : public std::unary_function<LLSD, LLSD::UUID>
//struct llsd_select_uuid : public std::unary_function<LLSD, LLSD::UUID>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_uuid
// [/SL:KB]
{
LLSD::UUID operator()(const LLSD& sd) const
{
return sd.asUUID();
}
};
struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
//struct llsd_select_string : public std::unary_function<LLSD, LLSD::String>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct llsd_select_string
// [/SL:KB]
{
LLSD::String operator()(const LLSD& sd) const
{

View File

@ -141,39 +141,39 @@ struct DeletePairedPointerArray
// llcompose1(DeletePointerFunctor<widget>(),
// llselect2nd<map_type::value_type>()));
template<typename T>
struct DeletePointerFunctor : public std::unary_function<T*, bool>
{
bool operator()(T* ptr) const
{
delete ptr;
return true;
}
};
//template<typename T>
//struct DeletePointerFunctor : public std::unary_function<T*, bool>
//{
// bool operator()(T* ptr) const
// {
// delete ptr;
// return true;
// }
//};
// See notes about DeleteArray for why you should consider avoiding this.
template<typename T>
struct DeleteArrayFunctor : public std::unary_function<T*, bool>
{
bool operator()(T* ptr) const
{
delete[] ptr;
return true;
}
};
//template<typename T>
//struct DeleteArrayFunctor : public std::unary_function<T*, bool>
//{
// bool operator()(T* ptr) const
// {
// delete[] ptr;
// return true;
// }
//};
// CopyNewPointer is a simple helper which accepts a pointer, and
// returns a new pointer built with the copy constructor. Example:
//
// transform(in.begin(), in.end(), out.end(), CopyNewPointer());
struct CopyNewPointer
{
template<typename T> T* operator()(const T* ptr) const
{
return new T(*ptr);
}
};
//struct CopyNewPointer
//{
// template<typename T> T* operator()(const T* ptr) const
// {
// return new T(*ptr);
// }
//};
template<typename T, typename ALLOC>
void delete_and_clear(std::list<T*, ALLOC>& list)
@ -394,129 +394,129 @@ OutputIter ll_transform_n(
// helper to deal with the fact that MSDev does not package
// select... with the stl. Look up usage on the sgi website.
template <class _Pair>
struct _LLSelect1st : public std::unary_function<_Pair, typename _Pair::first_type> {
const typename _Pair::first_type& operator()(const _Pair& __x) const {
return __x.first;
}
};
//template <class _Pair>
//struct _LLSelect1st : public std::unary_function<_Pair, typename _Pair::first_type> {
// const typename _Pair::first_type& operator()(const _Pair& __x) const {
// return __x.first;
// }
//};
template <class _Pair>
struct _LLSelect2nd : public std::unary_function<_Pair, typename _Pair::second_type>
{
const typename _Pair::second_type& operator()(const _Pair& __x) const {
return __x.second;
}
};
//template <class _Pair>
//struct _LLSelect2nd : public std::unary_function<_Pair, typename _Pair::second_type>
//{
// const typename _Pair::second_type& operator()(const _Pair& __x) const {
// return __x.second;
// }
//};
template <class _Pair> struct llselect1st : public _LLSelect1st<_Pair> {};
template <class _Pair> struct llselect2nd : public _LLSelect2nd<_Pair> {};
//template <class _Pair> struct llselect1st : public _LLSelect1st<_Pair> {};
//template <class _Pair> struct llselect2nd : public _LLSelect2nd<_Pair> {};
// helper to deal with the fact that MSDev does not package
// compose... with the stl. Look up usage on the sgi website.
template <class _Operation1, class _Operation2>
class ll_unary_compose :
public std::unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type>
{
protected:
_Operation1 __op1;
_Operation2 __op2;
public:
ll_unary_compose(const _Operation1& __x, const _Operation2& __y)
: __op1(__x), __op2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return __op1(__op2(__x));
}
};
//template <class _Operation1, class _Operation2>
//class ll_unary_compose :
// public std::unary_function<typename _Operation2::argument_type,
// typename _Operation1::result_type>
//{
//protected:
// _Operation1 __op1;
// _Operation2 __op2;
//public:
// ll_unary_compose(const _Operation1& __x, const _Operation2& __y)
// : __op1(__x), __op2(__y) {}
// typename _Operation1::result_type
// operator()(const typename _Operation2::argument_type& __x) const {
// return __op1(__op2(__x));
// }
//};
template <class _Operation1, class _Operation2>
inline ll_unary_compose<_Operation1,_Operation2>
llcompose1(const _Operation1& __op1, const _Operation2& __op2)
{
return ll_unary_compose<_Operation1,_Operation2>(__op1, __op2);
}
//template <class _Operation1, class _Operation2>
//inline ll_unary_compose<_Operation1,_Operation2>
//llcompose1(const _Operation1& __op1, const _Operation2& __op2)
//{
// return ll_unary_compose<_Operation1,_Operation2>(__op1, __op2);
//}
template <class _Operation1, class _Operation2, class _Operation3>
class ll_binary_compose
: public std::unary_function<typename _Operation2::argument_type,
typename _Operation1::result_type> {
protected:
_Operation1 _M_op1;
_Operation2 _M_op2;
_Operation3 _M_op3;
public:
ll_binary_compose(const _Operation1& __x, const _Operation2& __y,
const _Operation3& __z)
: _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
return _M_op1(_M_op2(__x), _M_op3(__x));
}
};
//template <class _Operation1, class _Operation2, class _Operation3>
//class ll_binary_compose
// : public std::unary_function<typename _Operation2::argument_type,
// typename _Operation1::result_type> {
//protected:
// _Operation1 _M_op1;
// _Operation2 _M_op2;
// _Operation3 _M_op3;
//public:
// ll_binary_compose(const _Operation1& __x, const _Operation2& __y,
// const _Operation3& __z)
// : _M_op1(__x), _M_op2(__y), _M_op3(__z) { }
// typename _Operation1::result_type
// operator()(const typename _Operation2::argument_type& __x) const {
// return _M_op1(_M_op2(__x), _M_op3(__x));
// }
//};
template <class _Operation1, class _Operation2, class _Operation3>
inline ll_binary_compose<_Operation1, _Operation2, _Operation3>
llcompose2(const _Operation1& __op1, const _Operation2& __op2,
const _Operation3& __op3)
{
return ll_binary_compose<_Operation1,_Operation2,_Operation3>
(__op1, __op2, __op3);
}
//template <class _Operation1, class _Operation2, class _Operation3>
//inline ll_binary_compose<_Operation1, _Operation2, _Operation3>
//llcompose2(const _Operation1& __op1, const _Operation2& __op2,
// const _Operation3& __op3)
//{
// return ll_binary_compose<_Operation1,_Operation2,_Operation3>
// (__op1, __op2, __op3);
//}
// helpers to deal with the fact that MSDev does not package
// bind... with the stl. Again, this is from sgi.
template <class _Operation>
class llbinder1st :
public std::unary_function<typename _Operation::second_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::first_argument_type value;
public:
llbinder1st(const _Operation& __x,
const typename _Operation::first_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::second_argument_type& __x) const {
return op(value, __x);
}
};
//template <class _Operation>
//class llbinder1st :
// public std::unary_function<typename _Operation::second_argument_type,
// typename _Operation::result_type> {
//protected:
// _Operation op;
// typename _Operation::first_argument_type value;
//public:
// llbinder1st(const _Operation& __x,
// const typename _Operation::first_argument_type& __y)
// : op(__x), value(__y) {}
// typename _Operation::result_type
// operator()(const typename _Operation::second_argument_type& __x) const {
// return op(value, __x);
// }
//};
template <class _Operation, class _Tp>
inline llbinder1st<_Operation>
llbind1st(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::first_argument_type _Arg1_type;
return llbinder1st<_Operation>(__oper, _Arg1_type(__x));
}
//template <class _Operation, class _Tp>
//inline llbinder1st<_Operation>
//llbind1st(const _Operation& __oper, const _Tp& __x)
//{
// typedef typename _Operation::first_argument_type _Arg1_type;
// return llbinder1st<_Operation>(__oper, _Arg1_type(__x));
//}
template <class _Operation>
class llbinder2nd
: public std::unary_function<typename _Operation::first_argument_type,
typename _Operation::result_type> {
protected:
_Operation op;
typename _Operation::second_argument_type value;
public:
llbinder2nd(const _Operation& __x,
const typename _Operation::second_argument_type& __y)
: op(__x), value(__y) {}
typename _Operation::result_type
operator()(const typename _Operation::first_argument_type& __x) const {
return op(__x, value);
}
};
//template <class _Operation>
//class llbinder2nd
// : public std::unary_function<typename _Operation::first_argument_type,
// typename _Operation::result_type> {
//protected:
// _Operation op;
// typename _Operation::second_argument_type value;
//public:
// llbinder2nd(const _Operation& __x,
// const typename _Operation::second_argument_type& __y)
// : op(__x), value(__y) {}
// typename _Operation::result_type
// operator()(const typename _Operation::first_argument_type& __x) const {
// return op(__x, value);
// }
//};
template <class _Operation, class _Tp>
inline llbinder2nd<_Operation>
llbind2nd(const _Operation& __oper, const _Tp& __x)
{
typedef typename _Operation::second_argument_type _Arg2_type;
return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
}
//template <class _Operation, class _Tp>
//inline llbinder2nd<_Operation>
//llbind2nd(const _Operation& __oper, const _Tp& __x)
//{
// typedef typename _Operation::second_argument_type _Arg2_type;
// return llbinder2nd<_Operation>(__oper, _Arg2_type(__x));
//}
/**
* Compare std::type_info* pointers a la std::less. We break this out as a
@ -548,8 +548,11 @@ bool before(const std::type_info* lhs, const std::type_info* rhs)
namespace std
{
template <>
struct less<const std::type_info*>:
public std::binary_function<const std::type_info*, const std::type_info*, bool>
// struct less<const std::type_info*>:
// public std::binary_function<const std::type_info*, const std::type_info*, bool>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct less<const std::type_info*>
// [/SL:KB]
{
bool operator()(const std::type_info* lhs, const std::type_info* rhs) const
{
@ -558,8 +561,11 @@ namespace std
};
template <>
struct less<std::type_info*>:
public std::binary_function<std::type_info*, std::type_info*, bool>
// struct less<std::type_info*>:
// public std::binary_function<std::type_info*, std::type_info*, bool>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
struct less<std::type_info*>
// [/SL:KB]
{
bool operator()(std::type_info* lhs, std::type_info* rhs) const
{

View File

@ -567,16 +567,9 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
// Use the viewer-based thread-safe API which has a
// fast/safe check for proxy enable. Would like to
// encapsulate this someway...
if (LLProxy::instanceExists())
{
// Make sure proxy won't be initialized from here,
// it might conflict with LLStartUp::startLLProxy()
LLProxy::getInstance()->applyProxySettings(mCurlHandle);
}
else
{
LL_WARNS() << "Proxy is not initialized!" << LL_ENDL;
}
// Make sure proxy won't be getInstance() from here,
// it is not thread safe
LLProxy::applyProxySettings(mCurlHandle);
}
else if (gpolicy.mHttpProxy.size())
@ -817,6 +810,7 @@ size_t HttpOpRequest::readCallback(void * data, size_t size, size_t nmemb, void
const size_t do_size((std::min)(req_size, body_size - op->mCurlBodyPos));
const size_t read_size(op->mReqBody->read(op->mCurlBodyPos, static_cast<char *>(data), do_size));
// FIXME: singleton's instance() is Thread unsafe! Even if stats accumulators inside are.
HTTPStats::instance().recordDataUp(read_size);
op->mCurlBodyPos += read_size;
return read_size;

View File

@ -583,29 +583,39 @@ static void bilinear_scale(const U8 *src, U32 srcW, U32 srcH, U32 srcCh, U32 src
// LLImage
//---------------------------------------------------------------------------
LLImage::LLImage(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent)
//static
std::string LLImage::sLastErrorMessage;
LLMutex* LLImage::sMutex = NULL;
bool LLImage::sUseNewByteRange = false;
S32 LLImage::sMinimalReverseByteRangePercent = 75;
//static
void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent)
{
mMutex = new LLMutex();
mUseNewByteRange = use_new_byte_range;
mMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent;
sUseNewByteRange = use_new_byte_range;
sMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent;
sMutex = new LLMutex();
}
LLImage::~LLImage()
//static
void LLImage::cleanupClass()
{
delete mMutex;
mMutex = NULL;
delete sMutex;
sMutex = NULL;
}
const std::string& LLImage::getLastErrorMessage()
//static
const std::string& LLImage::getLastError()
{
static const std::string noerr("No Error");
return mLastErrorMessage.empty() ? noerr : mLastErrorMessage;
return sLastErrorMessage.empty() ? noerr : sLastErrorMessage;
}
void LLImage::setLastErrorMessage(const std::string& message)
//static
void LLImage::setLastError(const std::string& message)
{
LLMutexLock m(mMutex);
mLastErrorMessage = message;
LLMutexLock m(sMutex);
sLastErrorMessage = message;
}
//---------------------------------------------------------------------------

View File

@ -30,7 +30,6 @@
#include "lluuid.h"
#include "llstring.h"
#include "llpointer.h"
#include "llsingleton.h"
#include "lltrace.h"
const S32 MIN_IMAGE_MIP = 2; // 4x4, only used for expand/contract power of 2
@ -88,26 +87,25 @@ typedef enum e_image_codec
//============================================================================
// library initialization class
// LLImage is frequently used in threads so do not convert it to LLSingleton
class LLImage : public LLParamSingleton<LLImage>
class LLImage
{
LLSINGLETON(LLImage, bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75);
~LLImage();
public:
static void initClass(bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75);
static void cleanupClass();
const std::string& getLastErrorMessage();
static const std::string& getLastError() { return getInstance()->getLastErrorMessage(); };
void setLastErrorMessage(const std::string& message);
static void setLastError(const std::string& message) { getInstance()->setLastErrorMessage(message); }
bool useNewByteRange() { return mUseNewByteRange; }
S32 getReverseByteRangePercent() { return mMinimalReverseByteRangePercent; }
private:
LLMutex* mMutex;
std::string mLastErrorMessage;
bool mUseNewByteRange;
S32 mMinimalReverseByteRangePercent;
static const std::string& getLastError();
static void setLastError(const std::string& message);
static bool useNewByteRange() { return sUseNewByteRange; }
static S32 getReverseByteRangePercent() { return sMinimalReverseByteRangePercent; }
protected:
static LLMutex* sMutex;
static std::string sLastErrorMessage;
static bool sUseNewByteRange;
static S32 sMinimalReverseByteRangePercent;
};
//============================================================================

View File

@ -281,7 +281,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
S32 bytes;
S32 new_bytes = (S32) (sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor);
S32 old_bytes = (S32)((F32)(w*h*comp)*rate);
bytes = (LLImage::getInstance()->useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes);
bytes = llmax(bytes, calcHeaderSizeJ2C());
return bytes;
}
@ -322,7 +322,7 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes)
{
S32 bytes_needed = calcDataSize(discard_level);
// Use TextureReverseByteRange percent (see settings.xml) of the optimal size to qualify as correct rendering for the given discard level
if (bytes >= (bytes_needed*LLImage::getInstance()->getReverseByteRangePercent()/100))
if (bytes >= (bytes_needed*LLImage::getReverseByteRangePercent()/100))
{
break;
}

View File

@ -244,7 +244,7 @@ public:
LLInventoryCategory(const LLInventoryCategory* other);
void copyCategory(const LLInventoryCategory* other); // LLRefCount requires custom copy
protected:
~LLInventoryCategory();
virtual ~LLInventoryCategory();
//--------------------------------------------------------------------
// Accessors And Mutators

View File

@ -1265,8 +1265,14 @@ void LLParcel::setExperienceKeyType( const LLUUID& experience_key, U32 type )
U32 LLParcel::countExperienceKeyType( U32 type )
{
return std::count_if(
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
return std::count_if(
boost::begin(mExperienceKeys | boost::adaptors::map_values),
boost::end(mExperienceKeys | boost::adaptors::map_values),
std::bind2nd(std::equal_to<U32>(), type));
[type](U32 v) { return v == type; });
// [/SL:KB]
// return std::count_if(
// boost::begin(mExperienceKeys | boost::adaptors::map_values),
// boost::end(mExperienceKeys | boost::adaptors::map_values),
// std::bind2nd(std::equal_to<U32>(), type));
}

View File

@ -5241,9 +5241,9 @@ public:
LLVCacheTriangleData* tri = *iter;
if (tri->mActive)
{
tri->mScore = tri->mVertex[0]->mScore;
tri->mScore += tri->mVertex[1]->mScore;
tri->mScore += tri->mVertex[2]->mScore;
tri->mScore = tri->mVertex[0] ? tri->mVertex[0]->mScore : 0;
tri->mScore += tri->mVertex[1] ? tri->mVertex[1]->mScore : 0;
tri->mScore += tri->mVertex[2] ? tri->mVertex[2]->mScore : 0;
if (!mBestTriangle || mBestTriangle->mScore < tri->mScore)
{

View File

@ -284,12 +284,27 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName&
return;
}
bool updated_account = true; // assume obsolete value for new arrivals by default
std::map<LLUUID, LLAvatarName>::iterator it = mCache.find(agent_id);
if (it != mCache.end()
&& (*it).second.getAccountName() == av_name.getAccountName())
{
updated_account = false;
}
// Add to the cache
mCache[agent_id] = av_name;
// Suppress request from the queue
mPendingQueue.erase(agent_id);
// notify mute list about changes
if (updated_account && mAccountNameChangedCallback)
{
mAccountNameChangedCallback(agent_id, av_name);
}
// Signal everyone waiting on this name
signal_map_t::iterator sig_it = mSignalMap.find(agent_id);
if (sig_it != mSignalMap.end())
@ -302,6 +317,8 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName&
delete signal;
signal = NULL;
}
}
void LLAvatarNameCache::requestNamesViaCapability()

View File

@ -42,6 +42,7 @@ class LLAvatarNameCache : public LLSingleton<LLAvatarNameCache>
~LLAvatarNameCache();
public:
typedef boost::signals2::signal<void (void)> use_display_name_signal_t;
typedef boost::function<void (const LLUUID id, const LLAvatarName& av_name)> account_name_changed_callback_t;
// Import/export the name cache to file.
bool importFile(std::istream& istr);
@ -109,6 +110,8 @@ public:
void addUseDisplayNamesCallback(const use_display_name_signal_t::slot_type& cb);
void setAccountNameChangedCallback(const account_name_changed_callback_t& cb) { mAccountNameChangedCallback = cb; }
private:
// Handle name response off network.
void processName(const LLUUID& agent_id,
@ -147,6 +150,7 @@ private:
private:
use_display_name_signal_t mUseDisplayNamesSignal;
account_name_changed_callback_t mAccountNameChangedCallback;
// Cache starts in a paused state until we can determine if the
// current region supports display names.

View File

@ -437,11 +437,16 @@ LLCircuit::LLCircuit(const F32Seconds circuit_heartbeat_interval, const F32Secon
LLCircuit::~LLCircuit()
{
// delete pointers in the map.
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::for_each(mCircuitData.begin(),
mCircuitData.end(),
llcompose1(
DeletePointerFunctor<LLCircuitData>(),
llselect2nd<circuit_data_map::value_type>()));
[](const circuit_data_map::value_type& x) { delete x.second;});
// [/SL:KB]
// std::for_each(mCircuitData.begin(),
// mCircuitData.end(),
// llcompose1(
// DeletePointerFunctor<LLCircuitData>(),
// llselect2nd<circuit_data_map::value_type>()));
}
LLCircuitData *LLCircuit::addCircuitData(const LLHost &host, TPACKETID in_id)

View File

@ -58,11 +58,18 @@ bool LLDispatcher::isHandlerPresent(const key_t& name) const
void LLDispatcher::copyAllHandlerNames(keys_t& names) const
{
// copy the names onto the vector we are given
std::transform(
mHandlers.begin(),
mHandlers.end(),
std::back_insert_iterator<keys_t>(names),
llselect1st<dispatch_map_t::value_type>());
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::transform(
mHandlers.begin(),
mHandlers.end(),
std::back_insert_iterator<keys_t>(names),
[](const dispatch_map_t::value_type& e) { return e.first; });
// [/SL:KB]
// std::transform(
// mHandlers.begin(),
// mHandlers.end(),
// std::back_insert_iterator<keys_t>(names),
// llselect1st<dispatch_map_t::value_type>());
}
bool LLDispatcher::dispatch(

View File

@ -32,18 +32,18 @@
#include "llframetimer.h"
// This is used for the stl search_n function.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
struct eq_message_throttle_entry : public std::binary_function< LLMessageThrottleEntry, LLMessageThrottleEntry, bool >
{
bool operator()(const LLMessageThrottleEntry& a, const LLMessageThrottleEntry& b) const
{
return a.getHash() == b.getHash();
}
};
#else
bool eq_message_throttle_entry(LLMessageThrottleEntry a, LLMessageThrottleEntry b)
{ return a.getHash() == b.getHash(); }
#endif
//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
//struct eq_message_throttle_entry : public std::binary_function< LLMessageThrottleEntry, LLMessageThrottleEntry, bool >
//{
// bool operator()(const LLMessageThrottleEntry& a, const LLMessageThrottleEntry& b) const
// {
// return a.getHash() == b.getHash();
// }
//};
//#else
//bool eq_message_throttle_entry(LLMessageThrottleEntry a, LLMessageThrottleEntry b)
// { return a.getHash() == b.getHash(); }
//#endif
const U64 SEC_TO_USEC = 1000000;
@ -118,14 +118,18 @@ BOOL LLMessageThrottle::addViewerAlert(const LLUUID& to, const std::string& mesg
LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
// Check if this message is already in the list.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// SJB: This *should* work but has not been tested yet *TODO: Test!
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
std::bind2nd(eq_message_throttle_entry(), entry));
#else
message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
1, entry, eq_message_throttle_entry);
#endif
[&entry](const message_list_t::value_type& e) { return e.getHash() == entry.getHash(); });
// [/SL:KB]
//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// // SJB: This *should* work but has not been tested yet *TODO: Test!
// message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
// std::bind2nd(eq_message_throttle_entry(), entry));
//#else
// message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
// 1, entry, eq_message_throttle_entry);
//#endif
if (found == message_list->end())
{
// This message was not found. Add it to the list.
@ -152,14 +156,18 @@ BOOL LLMessageThrottle::addAgentAlert(const LLUUID& agent, const LLUUID& task, c
LLMessageThrottleEntry entry(hash, LLFrameTimer::getTotalTime());
// Check if this message is already in the list.
#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// SJB: This *should* work but has not been tested yet *TODO: Test!
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
std::bind2nd(eq_message_throttle_entry(), entry));
#else
message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
1, entry, eq_message_throttle_entry);
#endif
[&entry](const message_list_t::value_type& e) { return e.getHash() == entry.getHash(); });
// [/SL:KB]
//#if _MSC_VER >= 1500 // VC9 has a bug in search_n
// // SJB: This *should* work but has not been tested yet *TODO: Test!
// message_list_iterator_t found = std::find_if(message_list->begin(), message_list->end(),
// std::bind2nd(eq_message_throttle_entry(), entry));
//#else
// message_list_iterator_t found = std::search_n(message_list->begin(), message_list->end(),
// 1, entry, eq_message_throttle_entry);
//#endif
if (found == message_list->end())
{

View File

@ -40,6 +40,7 @@
// incoming packet just to do a simple bool test. The getter for this
// member is also static
bool LLProxy::sUDPProxyEnabled = false;
LLProxy* LLProxy::sProxyInstance = NULL;
// Some helpful TCP static functions.
static apr_status_t tcp_blocking_handshake(LLSocket::ptr_t handle, char * dataout, apr_size_t outlen, char * datain, apr_size_t maxinlen); // Do a TCP data handshake
@ -60,11 +61,21 @@ LLProxy::LLProxy():
LLProxy::~LLProxy()
{
if (ll_apr_is_initialized())
{
stopSOCKSProxy();
disableHTTPProxy();
}
if (ll_apr_is_initialized())
{
// locks mutex
stopSOCKSProxy();
disableHTTPProxy();
}
// The primary safety of sProxyInstance is the fact that by the
// point SUBSYSTEM_CLEANUP(LLProxy) gets called, nothing should
// be capable of using proxy
sProxyInstance = NULL;
}
void LLProxy::initSingleton()
{
sProxyInstance = this;
}
/**
@ -424,28 +435,28 @@ void LLProxy::cleanupClass()
void LLProxy::applyProxySettings(CURL* handle)
{
// Do a faster unlocked check to see if we are supposed to proxy.
if (mHTTPProxyEnabled)
if (sProxyInstance && sProxyInstance->mHTTPProxyEnabled)
{
// We think we should proxy, lock the proxy mutex.
LLMutexLock lock(&mProxyMutex);
// We think we should proxy, lock the proxy mutex. sProxyInstance is not protected by mutex
LLMutexLock lock(&sProxyInstance->mProxyMutex);
// Now test again to verify that the proxy wasn't disabled between the first check and the lock.
if (mHTTPProxyEnabled)
if (sProxyInstance->mHTTPProxyEnabled)
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXY, mHTTPProxy.getIPString().c_str()), CURLOPT_PROXY);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYPORT, mHTTPProxy.getPort()), CURLOPT_PROXYPORT);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXY, sProxyInstance->mHTTPProxy.getIPString().c_str()), CURLOPT_PROXY);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYPORT, sProxyInstance->mHTTPProxy.getPort()), CURLOPT_PROXYPORT);
if (mProxyType == LLPROXY_SOCKS)
if (sProxyInstance->mProxyType == LLPROXY_SOCKS)
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5), CURLOPT_PROXYTYPE);
if (mAuthMethodSelected == METHOD_PASSWORD)
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5), CURLOPT_PROXYTYPE);
if (sProxyInstance->mAuthMethodSelected == METHOD_PASSWORD)
{
std::string auth_string = mSocksUsername + ":" + mSocksPassword;
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYUSERPWD, auth_string.c_str()), CURLOPT_PROXYUSERPWD);
std::string auth_string = sProxyInstance->mSocksUsername + ":" + sProxyInstance->mSocksPassword;
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYUSERPWD, auth_string.c_str()), CURLOPT_PROXYUSERPWD);
}
}
else
{
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP), CURLOPT_PROXYTYPE);
LLCore::LLHttp::check_curl_code(curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP), CURLOPT_PROXYTYPE);
}
}
}

View File

@ -226,6 +226,8 @@ class LLProxy: public LLSingleton<LLProxy>
LLSINGLETON(LLProxy);
LOG_CLASS(LLProxy);
/*virtual*/ void initSingleton();
public:
// Static check for enabled status for UDP packets. Call from main thread only.
static bool isSOCKSProxyEnabled() { return sUDPProxyEnabled; }
@ -251,7 +253,7 @@ public:
// Apply the current proxy settings to a curl request. Doesn't do anything if mHTTPProxyEnabled is false.
// Safe to call from any thread.
void applyProxySettings(CURL* handle);
static void applyProxySettings(CURL* handle);
// Start a connection to the SOCKS 5 proxy. Call from main thread only.
S32 startSOCKSProxy(LLHost host);
@ -344,6 +346,10 @@ private:
/*###########################################################################################
END OF SHARED MEMBERS
###########################################################################################*/
// A hack to get arround getInstance() and capture_dependency() which are unsafe to use inside threads
// set/reset on init/cleanup, strictly for use in applyProxySettings
static LLProxy* sProxyInstance;
};
#endif

View File

@ -152,8 +152,18 @@ void LLPluginProcessParent::shutdown()
mapInstances_t::iterator it;
for (it = sInstances.begin(); it != sInstances.end(); ++it)
{
(*it).second->setState(STATE_GOODBYE);
(*it).second->idle();
EState state = (*it).second->mState;
if (state != STATE_CLEANUP
|| state != STATE_EXITING
|| state != STATE_DONE
|| state != STATE_ERROR)
{
(*it).second->setState(STATE_GOODBYE);
}
if (state != STATE_DONE)
{
(*it).second->idle();
}
}
sInstances.clear();
}

View File

@ -1472,7 +1472,8 @@ void LLDAELoader::processDomModel(LLModel* model, DAE* dae, daeElement* root, do
std::string lookingForJoint = (*jointIt).c_str();
//Look for the joint xform that we extracted from the skeleton, using the jointIt as the key
//and store it in the alternate bind matrix
if ( mJointMap.find( lookingForJoint ) != mJointMap.end() )
if (mJointMap.find(lookingForJoint) != mJointMap.end()
&& model->mSkinInfo.mInvBindMatrix.size() > i)
{
LLMatrix4 newInverse = model->mSkinInfo.mInvBindMatrix[i];
newInverse.setTranslation( mJointList[lookingForJoint].getTranslation() );

View File

@ -45,6 +45,7 @@ bool font_desc_init_from_xml(LLXMLNodePtr node, LLFontDescriptor& desc);
bool init_from_xml(LLFontRegistry* registry, LLXMLNodePtr node);
const std::string MACOSX_FONT_PATH_LIBRARY = "/Library/Fonts/";
const std::string MACOSX_FONT_SUPPLEMENTAL = "Supplemental/";
LLFontDescriptor::LLFontDescriptor():
mStyle(0)
@ -473,6 +474,8 @@ LLFontGL *LLFontRegistry::createFont(const LLFontDescriptor& desc)
font_paths.push_back(sys_path + *file_name_it);
#if LL_DARWIN
font_paths.push_back(MACOSX_FONT_PATH_LIBRARY + *file_name_it);
font_paths.push_back(MACOSX_FONT_PATH_LIBRARY + MACOSX_FONT_SUPPLEMENTAL + *file_name_it);
font_paths.push_back(sys_path + MACOSX_FONT_SUPPLEMENTAL + *file_name_it);
#endif
bool is_ft_collection = (std::find(ft_collection_list.begin(), ft_collection_list.end(), *file_name_it) != ft_collection_list.end());

View File

@ -965,6 +965,80 @@ std::string LLGLManager::getRawGLString()
return gl_string;
}
void LLGLManager::asLLSD(LLSD& info)
{
// Currently these are duplicates of fields in "system".
info["gpu_vendor"] = mGLVendorShort;
info["gpu_version"] = mDriverVersionVendorString;
info["opengl_version"] = mGLVersionString;
info["vram"] = mVRAM;
// Extensions used by everyone
info["has_multitexture"] = mHasMultitexture;
info["has_ati_mem_info"] = mHasATIMemInfo;
info["has_nvx_mem_info"] = mHasNVXMemInfo;
info["num_texture_units"] = mNumTextureUnits;
info["has_mip_map_generation"] = mHasMipMapGeneration;
info["has_compressed_textures"] = mHasCompressedTextures;
info["has_framebuffer_object"] = mHasFramebufferObject;
info["max_samples"] = mMaxSamples;
info["has_blend_func_separate"] = mHasBlendFuncSeparate;
// ARB Extensions
info["has_vertex_buffer_object"] = mHasVertexBufferObject;
info["has_vertex_array_object"] = mHasVertexArrayObject;
info["has_sync"] = mHasSync;
info["has_map_buffer_range"] = mHasMapBufferRange;
info["has_flush_buffer_range"] = mHasFlushBufferRange;
info["has_pbuffer"] = mHasPBuffer;
info["has_shader_objects"] = mHasShaderObjects;
info["has_vertex_shader"] = mHasVertexShader;
info["has_fragment_shader"] = mHasFragmentShader;
info["num_texture_image_units"] = mNumTextureImageUnits;
info["has_occlusion_query"] = mHasOcclusionQuery;
info["has_timer_query"] = mHasTimerQuery;
info["has_occlusion_query2"] = mHasOcclusionQuery2;
info["has_point_parameters"] = mHasPointParameters;
info["has_draw_buffers"] = mHasDrawBuffers;
info["has_depth_clamp"] = mHasDepthClamp;
info["has_texture_rectangle"] = mHasTextureRectangle;
info["has_texture_multisample"] = mHasTextureMultisample;
info["has_transform_feedback"] = mHasTransformFeedback;
info["max_sample_mask_words"] = mMaxSampleMaskWords;
info["max_color_texture_samples"] = mMaxColorTextureSamples;
info["max_depth_texture_samples"] = mMaxDepthTextureSamples;
info["max_integer_samples"] = mMaxIntegerSamples;
// Other extensions.
info["has_anisotropic"] = mHasAnisotropic;
info["has_arb_env_combine"] = mHasARBEnvCombine;
info["has_cube_map"] = mHasCubeMap;
info["has_debug_output"] = mHasDebugOutput;
info["has_srgb_texture"] = mHassRGBTexture;
info["has_srgb_framebuffer"] = mHassRGBFramebuffer;
info["has_texture_srgb_decode"] = mHasTexturesRGBDecode;
// Vendor-specific extensions
info["is_ati"] = mIsATI;
info["is_nvidia"] = mIsNVIDIA;
info["is_intel"] = mIsIntel;
info["is_gf2or4mx"] = mIsGF2or4MX;
info["is_gf3"] = mIsGF3;
info["is_gf_gfx"] = mIsGFFX;
info["ati_offset_vertical_lines"] = mATIOffsetVerticalLines;
info["ati_old_driver"] = mATIOldDriver;
// Other fields
info["has_requirements"] = mHasRequirements;
info["has_separate_specular_color"] = mHasSeparateSpecularColor;
info["debug_gpu"] = mDebugGPU;
info["max_vertex_range"] = mGLMaxVertexRange;
info["max_index_range"] = mGLMaxIndexRange;
info["max_texture_size"] = mGLMaxTextureSize;
info["gl_renderer"] = mGLRenderer;
}
void LLGLManager::shutdownGL()
{
if (mInited)

View File

@ -165,6 +165,8 @@ public:
void printGLInfoString();
void getGLInfo(LLSD& info);
void asLLSD(LLSD& info);
// In ALL CAPS
std::string mGLVendor;
std::string mGLVendorShort;

View File

@ -1386,6 +1386,15 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
return FALSE;
}
if (mHasExplicitFormat &&
((mFormatPrimary == GL_RGBA && mComponents < 4) ||
(mFormatPrimary == GL_RGB && mComponents < 3)))
{
LL_WARNS() << "Incorrect format: " << std::hex << mFormatPrimary << " components: " << (U32)mComponents << LL_ENDL;
mHasExplicitFormat = FALSE;
}
if( !mHasExplicitFormat )
{
switch (mComponents)

View File

@ -133,6 +133,7 @@ public:
S32 getMipBytes(S32 discard_level = -1) const;
BOOL getBoundRecently() const;
BOOL isJustBound() const;
BOOL getHasExplicitFormat() const { return mHasExplicitFormat; }
LLGLenum getPrimaryFormat() const { return mFormatPrimary; }
LLGLenum getFormatType() const { return mFormatType; }
@ -200,7 +201,7 @@ private:
U16 mPickMaskWidth;
U16 mPickMaskHeight;
S8 mUseMipMaps;
S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents)
BOOL mHasExplicitFormat; // If false (default), GL format is f(mComponents)
S8 mAutoGenMips;
BOOL mIsMask;

View File

@ -32,6 +32,7 @@
#include "llpointer.h" // LLPointer<>
#include "llrect.h"
#include "llsingleton.h"
#include "llglslshader.h"
class LLColor4;

View File

@ -131,7 +131,10 @@ protected:
boost::function<BOOL ()> mIsDockedStateForcedCallback;
private:
std::auto_ptr<LLDockControl> mDockControl;
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::unique_ptr<LLDockControl> mDockControl;
// [/SL:KB]
// std::auto_ptr<LLDockControl> mDockControl;
LLUIImagePtr mDockTongue;
static LLHandle<LLFloater> sInstanceHandle;
/**

View File

@ -303,12 +303,10 @@ void LLFloater::initFloater(const Params& p)
mButtonsEnabled[BUTTON_CLOSE] = TRUE;
}
// Help button: '?'
if ( !mHelpTopic.empty() )
{
mButtonsEnabled[BUTTON_HELP] = TRUE;
}
// Help button: '?'
//SL-14050 Disable all Help question marks
mButtonsEnabled[BUTTON_HELP] = FALSE;
// Minimize button only for top draggers
if ( !mDragOnLeft && mCanMinimize )
{

View File

@ -285,7 +285,7 @@ public:
typedef std::list<LLFolderViewModelItem*> child_list_t;
virtual void addChild(LLFolderViewModelItem* child)
{
{
mChildren.push_back(child);
child->setParent(this);
dirtyFilter();

View File

@ -763,14 +763,20 @@ void LLScrollListCtrl::updateColumns(bool force_update)
}
}
bool header_changed_width = false;
// expand last column header we encountered to full list width
if (last_header)
{
S32 old_width = last_header->getColumn()->getWidth();
S32 new_width = llmax(0, mItemListRect.mRight - last_header->getRect().mLeft);
last_header->reshape(new_width, last_header->getRect().getHeight());
last_header->setVisible(mDisplayColumnHeaders && new_width > 0);
last_header->getColumn()->setWidth(new_width);
}
if (old_width != new_width)
{
last_header->getColumn()->setWidth(new_width);
header_changed_width = true;
}
}
// propagate column widths to individual cells
if (columns_changed_width || force_update)
@ -789,6 +795,20 @@ void LLScrollListCtrl::updateColumns(bool force_update)
}
}
}
else if (header_changed_width)
{
item_list::iterator iter;
S32 index = last_header->getColumn()->mIndex; // Not always identical to last column!
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
{
LLScrollListItem *itemp = *iter;
LLScrollListCell* cell = itemp->getColumn(index);
if (cell)
{
cell->setWidth(last_header->getColumn()->getWidth());
}
}
}
}
void LLScrollListCtrl::setHeadingHeight(S32 heading_height)
@ -1381,18 +1401,34 @@ BOOL LLScrollListCtrl::setSelectedByValue(const LLSD& value, BOOL selected)
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
{
LLScrollListItem* item = *iter;
if (item->getEnabled() && (item->getValue().asString() == value.asString()))
if (item->getEnabled())
{
if (selected)
{
selectItem(item);
}
else
{
deselectItem(item);
}
found = TRUE;
break;
if (value.isBinary())
{
if (item->getValue().isBinary())
{
LLSD::Binary data1 = value.asBinary();
LLSD::Binary data2 = item->getValue().asBinary();
found = std::equal(data1.begin(), data1.end(), data2.begin()) ? TRUE : FALSE;
}
}
else
{
found = item->getValue().asString() == value.asString() ? TRUE : FALSE;
}
if (found)
{
if (selected)
{
selectItem(item);
}
else
{
deselectItem(item);
}
break;
}
}
}

View File

@ -1502,4 +1502,43 @@ void LLUrlEntryExperienceProfile::onExperienceDetails( const LLSD& experience_de
callObservers(experience_details[LLExperienceCache::EXPERIENCE_ID].asString(), name, LLStringUtil::null);
}
//
// LLUrlEntryEmail Describes an IPv6 address
//
LLUrlEntryIPv6::LLUrlEntryIPv6()
: LLUrlEntryBase()
{
mHostPath = "https?://\\[([a-f0-9:]+:+)+[a-f0-9]+]";
mPattern = boost::regex(mHostPath + "(:\\d{1,5})?(/\\S*)?",
boost::regex::perl | boost::regex::icase);
mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl");
}
std::string LLUrlEntryIPv6::getLabel(const std::string &url, const LLUrlLabelCallback &cb)
{
boost::regex regex = boost::regex(mHostPath, boost::regex::perl | boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
if (boost::regex_search(url, matches, regex))
{
return url.substr(0, matches[0].length());
}
else
{
return url;
}
}
std::string LLUrlEntryIPv6::getQuery(const std::string &url) const
{
boost::regex regex = boost::regex(mHostPath, boost::regex::perl | boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
return boost::regex_replace(url, regex, "");
}
std::string LLUrlEntryIPv6::getUrl(const std::string &string) const
{
return string;
}

View File

@ -528,5 +528,18 @@ public:
/*virtual*/ std::string getUrl(const std::string &string) const;
};
///
/// LLUrlEntryEmail Describes an IPv6 address
///
class LLUrlEntryIPv6 : public LLUrlEntryBase
{
public:
LLUrlEntryIPv6();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb);
/*virtual*/ std::string getUrl(const std::string &string) const;
/*virtual*/ std::string getQuery(const std::string &url) const;
std::string mHostPath;
};
#endif

View File

@ -85,6 +85,7 @@ LLUrlRegistry::LLUrlRegistry()
mUrlEntrySLLabel = new LLUrlEntrySLLabel();
registerUrl(mUrlEntrySLLabel);
registerUrl(new LLUrlEntryEmail());
registerUrl(new LLUrlEntryIPv6());
}
LLUrlRegistry::~LLUrlRegistry()

View File

@ -903,4 +903,38 @@ namespace tut
"and even no www something lindenlab.com",
"");
}
template<> template<>
void object::test<16>()
{
//
// test LLUrlEntryIPv6
//
LLUrlEntryIPv6 url;
// Regex tests.
testRegex("match urls with a protocol", url,
"this url should match http://[::1]",
"http://[::1]");
testRegex("match urls with a protocol and query", url,
"this url should match http://[::1]/file.mp3",
"http://[::1]/file.mp3");
testRegex("match urls with a protocol", url,
"this url should match http://[2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d]",
"http://[2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d]");
testRegex("match urls with port", url,
"let's specify some port http://[2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d]:8080",
"http://[2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d]:8080");
testRegex("don't match urls w/o protocol", url,
"looks like an url something [2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d] but no https prefix",
"");
testRegex("don't match incorrect urls", url,
"http://[ 2001:0db8:11a3:09d7:1f34:8a2e:07a0:765d ]",
"");
}
}

View File

@ -168,6 +168,10 @@ public:
// Get system UI size based on DPI (for 96 DPI UI size should be 1.0)
virtual F32 getSystemUISize() { return 1.0; }
// windows only DirectInput8 for joysticks
virtual void* getDirectInput8() { return NULL; };
virtual bool getInputDevices(U32 device_type_filter, void * devices_callback, void* userdata) { return false; };
protected:
LLWindow(LLWindowCallbacks* callbacks, BOOL fullscreen, U32 flags);
virtual ~LLWindow();

View File

@ -59,6 +59,9 @@
#include <dinput.h>
#include <Dbt.h.>
#include <InitGuid.h> // needed for llurlentry test to build on some systems
#pragma comment(lib, "dxguid.lib") // needed for llurlentry test to build on some systems
#pragma comment(lib, "dinput8")
const S32 MAX_MESSAGE_PER_UPDATE = 20;
const S32 BITS_PER_PIXEL = 32;
@ -76,6 +79,7 @@ const F32 ICON_FLASH_TIME = 0.5f;
extern BOOL gDebugWindowProc;
LPWSTR gIconResource = IDI_APPLICATION;
LPDIRECTINPUT8 gDirectInput8;
LLW32MsgCallback gAsyncMsgCallback = NULL;
@ -482,6 +486,21 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
mhInstance = GetModuleHandle(NULL);
mWndProc = NULL;
// Init Direct Input - needed for joystick / Spacemouse
LPDIRECTINPUT8 di8_interface;
HRESULT status = DirectInput8Create(
mhInstance, // HINSTANCE hinst,
DIRECTINPUT_VERSION, // DWORD dwVersion,
IID_IDirectInput8, // REFIID riidltf,
(LPVOID*)&di8_interface, // LPVOID * ppvOut,
NULL // LPUNKNOWN punkOuter
);
if (status == DI_OK)
{
gDirectInput8 = di8_interface;
}
mSwapMethod = SWAP_METHOD_UNDEFINED;
// No WPARAM yet.
@ -4185,6 +4204,28 @@ void LLWindowWin32::setDPIAwareness()
}
}
void* LLWindowWin32::getDirectInput8()
{
return &gDirectInput8;
}
bool LLWindowWin32::getInputDevices(U32 device_type_filter, void * di8_devices_callback, void* userdata)
{
if (gDirectInput8 != NULL)
{
// Enumerate devices
HRESULT status = gDirectInput8->EnumDevices(
(DWORD) device_type_filter, // DWORD dwDevType,
(LPDIENUMDEVICESCALLBACK)di8_devices_callback, // LPDIENUMDEVICESCALLBACK lpCallback, // BOOL DIEnumDevicesCallback( LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef ) // BOOL CALLBACK DinputDevice::DevicesCallback
(LPVOID*)userdata, // LPVOID pvRef
DIEDFL_ATTACHEDONLY // DWORD dwFlags
);
return status == DI_OK;
}
return false;
}
F32 LLWindowWin32::getSystemUISize()
{
F32 scale_value = 1.f;

View File

@ -116,6 +116,9 @@ public:
static std::vector<std::string> getDynamicFallbackFontList();
static void setDPIAwareness();
/*virtual*/ void* getDirectInput8();
/*virtual*/ bool getInputDevices(U32 device_type_filter, void * di8_devices_callback, void* userdata);
protected:
LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,

View File

@ -641,6 +641,24 @@ LLSD LLControlGroup::getLLSD(const std::string& name)
return get<LLSD>(name);
}
LLSD LLControlGroup::asLLSD(bool diffs_only)
{
// Dump all stored values as LLSD
LLSD result = LLSD::emptyArray();
for (ctrl_name_table_t::iterator iter = mNameTable.begin();
iter != mNameTable.end(); iter++)
{
LLControlVariable *control = iter->second;
if (!control || control->isType(TYPE_STRING) || (diffs_only && control->isDefault()))
{
continue;
}
const std::string& name = iter->first;
result[name] = getLLSD(name);
}
return result;
}
BOOL LLControlGroup::controlExists(const std::string& name)
{
ctrl_name_table_t::iterator iter = mNameTable.find(name);

View File

@ -245,6 +245,8 @@ public:
LLColor4 getColor4(const std::string& name);
LLColor3 getColor3(const std::string& name);
LLSD asLLSD(bool diffs_only);
// generic getter
template<typename T> T get(const std::string& name)
{

View File

@ -1120,6 +1120,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>FramePerSecondLimit</key>
<map>
<key>Comment</key>
<string>Controls upper limit of frames per second</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>120</integer>
</map>
<key>BackgroundYieldTime</key>
<map>
<key>Comment</key>
@ -5561,6 +5572,17 @@
<key>Value</key>
<string />
</map>
<key>JoystickDeviceUUID</key>
<map>
<key>Comment</key>
<string>Preffered device ID.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string />
</map>
<key>JoystickMouselookYaw</key>
<map>
<key>Comment</key>

View File

@ -922,6 +922,18 @@ boost::signals2::connection LLAgent::addParcelChangedCallback(parcel_changed_cal
return mParcelChangedSignal.connect(cb);
}
// static
void LLAgent::capabilityReceivedCallback(const LLUUID &region_id)
{
LLViewerRegion* region = gAgent.getRegion();
if (region && region->getRegionID() == region_id)
{
region->requestSimulatorFeatures();
LLAppViewer::instance()->updateNameLookupUrl();
}
}
//-----------------------------------------------------------------------------
// setRegion()
//-----------------------------------------------------------------------------
@ -968,10 +980,11 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
if (regionp->capabilitiesReceived())
{
regionp->requestSimulatorFeatures();
LLAppViewer::instance()->updateNameLookupUrl();
}
else
{
regionp->setCapabilitiesReceivedCallback(boost::bind(&LLViewerRegion::requestSimulatorFeatures, regionp));
regionp->setCapabilitiesReceivedCallback(LLAgent::capabilityReceivedCallback);
}
}
@ -990,6 +1003,15 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
// Update all of the regions.
LLWorld::getInstance()->updateAgentOffset(mAgentOriginGlobal);
if (regionp->capabilitiesReceived())
{
LLAppViewer::instance()->updateNameLookupUrl();
}
else
{
regionp->setCapabilitiesReceivedCallback([](const LLUUID &region_id) {LLAppViewer::instance()->updateNameLookupUrl(); });
}
}
// Pass new region along to metrics components that care about this level of detail.

View File

@ -254,6 +254,8 @@ public:
boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t);
private:
static void capabilityReceivedCallback(const LLUUID &region_id);
typedef boost::signals2::signal<void()> parcel_changed_signal_t;
parcel_changed_signal_t mParcelChangedSignal;

View File

@ -2049,7 +2049,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
}
// Moved from LLWearableList::ContextMenu for wider utility.
bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids)
bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) const
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
@ -2059,7 +2059,7 @@ bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids)
// Count given clothes (by wearable type) and objects.
for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
const LLViewerInventoryItem* item = gInventory.getItem(*it);
if (!item)
{
return false;

View File

@ -106,7 +106,7 @@ public:
bool getCanReplaceCOF(const LLUUID& outfit_cat_id);
// Can we add all referenced items to the avatar?
bool canAddWearables(const uuid_vec_t& item_ids);
bool canAddWearables(const uuid_vec_t& item_ids) const;
// Copy all items in a category.
void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
@ -298,7 +298,10 @@ private:
LLUUID mCOFImageID;
std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::unique_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// [/SL:KB]
// std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// Set of temp attachment UUIDs that should be removed
typedef std::set<LLUUID> doomed_temp_attachments_t;

View File

@ -294,7 +294,7 @@ extern BOOL gHiDPISupport;
////////////////////////////////////////////////////////////
// All from the last globals push...
F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
F32 gSimLastTime; // Used in LLAppViewer::init and send_viewer_stats()
F32 gSimFrames;
BOOL gShowObjectUpdates = FALSE;
@ -697,6 +697,7 @@ LLAppViewer::LLAppViewer()
mPurgeCacheOnExit(false),
mPurgeUserDataOnExit(false),
mSecondInstance(false),
mUpdaterNotFound(false),
mSavedFinalSnapshot(false),
mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded.
mQuitRequested(false),
@ -709,7 +710,8 @@ LLAppViewer::LLAppViewer()
mPeriodicSlowFrame(LLCachedControl<bool>(gSavedSettings,"Periodic Slow Frame", FALSE)),
mFastTimerLogThread(NULL),
mSettingsLocationList(NULL),
mIsFirstRun(false)
mIsFirstRun(false),
mMinMicroSecPerFrame(0.f)
{
if(NULL != sInstance)
{
@ -1180,7 +1182,7 @@ bool LLAppViewer::init()
gGLActive = FALSE;
#if LL_RELEASE_FOR_DOWNLOAD
#if LL_RELEASE_FOR_DOWNLOAD
if (!gSavedSettings.getBOOL("CmdLineSkipUpdater"))
{
LLProcess::Params updater;
@ -1188,14 +1190,18 @@ bool LLAppViewer::init()
// Because it's the updater, it MUST persist beyond the lifespan of the
// viewer itself.
updater.autokill = false;
std::string updater_file;
#if LL_WINDOWS
updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker.exe");
updater_file = "SLVersionChecker.exe";
updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, updater_file);
#elif LL_DARWIN
// explicitly run the system Python interpreter on SLVersionChecker.py
updater.executable = "python";
updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", "SLVersionChecker.py"));
updater_file = "SLVersionChecker.py";
updater.args.add(gDirUtilp->add(gDirUtilp->getAppRODataDir(), "updater", updater_file));
#else
updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "SLVersionChecker");
updater_file = "SLVersionChecker";
updater.executable = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, updater_file);
#endif
// add LEAP mode command-line argument to whichever of these we selected
updater.args.add("leap");
@ -1208,37 +1214,58 @@ bool LLAppViewer::init()
// ForceAddressSize
updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize")));
// Run the updater. An exception from launching the updater should bother us.
LLLeap::create(updater, true);
try
{
// Run the updater. An exception from launching the updater should bother us.
LLLeap::create(updater, true);
mUpdaterNotFound = false;
}
catch (...)
{
LLUIString details = LLNotifications::instance().getGlobalString("LLLeapUpdaterFailure");
details.setArg("[UPDATER_APP]", updater_file);
OSMessageBox(
details.getString(),
LLStringUtil::null,
OSMB_OK);
mUpdaterNotFound = true;
}
}
else
{
LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL;
}
// Iterate over --leap command-line options. But this is a bit tricky: if
// there's only one, it won't be an array at all.
LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand"));
LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL;
if (LeapCommand.isDefined() && ! LeapCommand.isArray())
{
// If LeapCommand is actually a scalar value, make an array of it.
// Have to do it in two steps because LeapCommand.append(LeapCommand)
// trashes content! :-P
LLSD item(LeapCommand);
LeapCommand.append(item);
}
BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
{
LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
// We don't have any better description of this plugin than the
// user-specified command line. Passing "" causes LLLeap to derive a
// description from the command line itself.
// Suppress LLLeap::Error exception: trust LLLeap's own logging. We
// don't consider any one --leap command mission-critical, so if one
// fails, log it, shrug and carry on.
LLLeap::create("", leap, false); // exception=false
}
if (mUpdaterNotFound)
{
LL_WARNS("InitInfo") << "Failed to launch updater. Skipping Leap commands." << LL_ENDL;
}
else
{
// Iterate over --leap command-line options. But this is a bit tricky: if
// there's only one, it won't be an array at all.
LLSD LeapCommand(gSavedSettings.getLLSD("LeapCommand"));
LL_DEBUGS("InitInfo") << "LeapCommand: " << LeapCommand << LL_ENDL;
if (LeapCommand.isDefined() && !LeapCommand.isArray())
{
// If LeapCommand is actually a scalar value, make an array of it.
// Have to do it in two steps because LeapCommand.append(LeapCommand)
// trashes content! :-P
LLSD item(LeapCommand);
LeapCommand.append(item);
}
BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
{
LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
// We don't have any better description of this plugin than the
// user-specified command line. Passing "" causes LLLeap to derive a
// description from the command line itself.
// Suppress LLLeap::Error exception: trust LLLeap's own logging. We
// don't consider any one --leap command mission-critical, so if one
// fails, log it, shrug and carry on.
LLLeap::create("", leap, false); // exception=false
}
}
if (gSavedSettings.getBOOL("QAMode") && gSavedSettings.getS32("QAModeEventHostPort") > 0)
{
@ -1246,7 +1273,7 @@ bool LLAppViewer::init()
<< "lleventhost no longer supported as a dynamic library"
<< LL_ENDL;
}
#endif
#endif //LL_RELEASE_FOR_DOWNLOAD
LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
@ -1292,6 +1319,10 @@ bool LLAppViewer::init()
joystick = LLViewerJoystick::getInstance();
joystick->setNeedsReset(true);
/*----------------------------------------------------------------------*/
gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2));
onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit"));
return true;
}
@ -1511,6 +1542,21 @@ bool LLAppViewer::doFrame()
display();
static U64 last_call = 0;
if (!gTeleportDisplay)
{
// Frame/draw throttling, controlled by FramePerSecondLimit
U64 elapsed_time = LLTimer::getTotalTime() - last_call;
if (elapsed_time < mMinMicroSecPerFrame)
{
LL_RECORD_BLOCK_TIME(FTM_SLEEP);
// llclamp for when time function gets funky
U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6);
micro_sleep(sleep_time, 0);
}
}
last_call = LLTimer::getTotalTime();
pingMainloopTimeout("Main:Snapshot");
LLFloaterSnapshot::update(); // take snapshots
LLFloaterOutfitSnapshot::update();
@ -1880,8 +1926,6 @@ bool LLAppViewer::cleanup()
SUBSYSTEM_CLEANUP(LLAvatarAppearance);
SUBSYSTEM_CLEANUP(LLAvatarAppearance);
SUBSYSTEM_CLEANUP(LLPostProcess);
LLTracker::cleanupInstance();
@ -2083,6 +2127,7 @@ bool LLAppViewer::cleanup()
LLUIImageList::getInstance()->cleanUp();
// This should eventually be done in LLAppViewer
SUBSYSTEM_CLEANUP(LLImage);
SUBSYSTEM_CLEANUP(LLVFSThread);
SUBSYSTEM_CLEANUP(LLLFSThread);
@ -2126,6 +2171,7 @@ bool LLAppViewer::cleanup()
LLWeb::loadURLExternal( gLaunchFileOnQuit, false );
LL_INFOS() << "File launched." << LL_ENDL;
}
// make sure nothing uses applyProxySettings by this point.
LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL;
SUBSYSTEM_CLEANUP(LLProxy);
LLCore::LLHttp::cleanup();
@ -2181,7 +2227,7 @@ bool LLAppViewer::initThreads()
{
static const bool enable_threads = true;
LLImage::initParamSingleton(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange"));
LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange"));
LLVFSThread::initClass(enable_threads && false);
LLLFSThread::initClass(enable_threads && false);
@ -3163,7 +3209,7 @@ LLSD LLAppViewer::getViewerInfo() const
info["REGION"] = gAgent.getRegion()->getName();
boost::regex regex("\\.(secondlife|lindenlab)\\..*");
info["HOSTNAME"] = boost::regex_replace(gAgent.getRegion()->getHost().getHostName(), regex, "");
info["HOSTNAME"] = boost::regex_replace(gAgent.getRegion()->getSimHostName(), regex, "");
info["SERVER_VERSION"] = gLastVersionChannel;
LLSLURL slurl;
LLAgentUI::buildSLURL(slurl);
@ -3633,7 +3679,7 @@ void LLAppViewer::handleViewerCrash()
if(gAgent.getRegion())
{
gDebugInfo["Dynamic"]["CurrentSimHost"] = gAgent.getRegionHost().getHostName();
gDebugInfo["Dynamic"]["CurrentSimHost"] = gAgent.getRegion()->getSimHostName();
gDebugInfo["Dynamic"]["CurrentRegion"] = gAgent.getRegion()->getName();
const LLVector3& loc = gAgent.getPositionAgent();
@ -4025,7 +4071,9 @@ void LLAppViewer::requestQuit()
gFloaterView->closeAllChildren(true);
}
send_stats();
// Send preferences once, when exiting
bool include_preferences = true;
send_viewer_stats(include_preferences);
gLogoutTimer.reset();
mQuitRequested = true;
@ -4824,7 +4872,8 @@ void LLAppViewer::idle()
if (viewer_stats_timer.getElapsedTimeF32() >= SEND_STATS_PERIOD && !gDisconnected)
{
LL_INFOS() << "Transmitting sessions stats" << LL_ENDL;
send_stats();
bool include_preferences = false;
send_viewer_stats(include_preferences);
viewer_stats_timer.reset();
}
@ -5235,11 +5284,56 @@ void LLAppViewer::sendLogoutRequest()
}
}
void LLAppViewer::updateNameLookupUrl()
{
LLViewerRegion* region = gAgent.getRegion();
if (!region || !region->capabilitiesReceived())
{
return;
}
LLAvatarNameCache *name_cache = LLAvatarNameCache::getInstance();
bool had_capability = LLAvatarNameCache::getInstance()->hasNameLookupURL();
std::string name_lookup_url;
name_lookup_url.reserve(128); // avoid a memory allocation below
name_lookup_url = region->getCapability("GetDisplayNames");
bool have_capability = !name_lookup_url.empty();
if (have_capability)
{
// we have support for display names, use it
U32 url_size = name_lookup_url.size();
// capabilities require URLs with slashes before query params:
// https://<host>:<port>/cap/<uuid>/?ids=<blah>
// but the caps are granted like:
// https://<host>:<port>/cap/<uuid>
if (url_size > 0 && name_lookup_url[url_size - 1] != '/')
{
name_lookup_url += '/';
}
name_cache->setNameLookupURL(name_lookup_url);
}
else
{
// Display names not available on this region
name_cache->setNameLookupURL(std::string());
}
// Error recovery - did we change state?
if (had_capability != have_capability)
{
// name tags are persistant on screen, so make sure they refresh
LLVOAvatar::invalidateNameTags();
}
}
void LLAppViewer::idleNameCache()
{
// Neither old nor new name cache can function before agent has a region
LLViewerRegion* region = gAgent.getRegion();
if (!region) return;
if (!region)
{
return;
}
// deal with any queued name requests and replies.
gCacheName->processPending();
@ -5247,47 +5341,12 @@ void LLAppViewer::idleNameCache()
// Can't run the new cache until we have the list of capabilities
// for the agent region, and can therefore decide whether to use
// display names or fall back to the old name system.
if (!region->capabilitiesReceived()) return;
if (!region->capabilitiesReceived())
{
return;
}
// Agent may have moved to a different region, so need to update cap URL
// for name lookups. Can't do this in the cap grant code, as caps are
// granted to neighbor regions before the main agent gets there. Can't
// do it in the move-into-region code because cap not guaranteed to be
// granted yet, for example on teleport.
LLAvatarNameCache *name_cache = LLAvatarNameCache::getInstance();
bool had_capability = LLAvatarNameCache::getInstance()->hasNameLookupURL();
std::string name_lookup_url;
name_lookup_url.reserve(128); // avoid a memory allocation below
name_lookup_url = region->getCapability("GetDisplayNames");
bool have_capability = !name_lookup_url.empty();
if (have_capability)
{
// we have support for display names, use it
U32 url_size = name_lookup_url.size();
// capabilities require URLs with slashes before query params:
// https://<host>:<port>/cap/<uuid>/?ids=<blah>
// but the caps are granted like:
// https://<host>:<port>/cap/<uuid>
if (url_size > 0 && name_lookup_url[url_size-1] != '/')
{
name_lookup_url += '/';
}
name_cache->setNameLookupURL(name_lookup_url);
}
else
{
// Display names not available on this region
name_cache->setNameLookupURL( std::string() );
}
// Error recovery - did we change state?
if (had_capability != have_capability)
{
// name tags are persistant on screen, so make sure they refresh
LLVOAvatar::invalidateNameTags();
}
name_cache->idle();
LLAvatarNameCache::getInstance()->idle();
}
//
@ -5498,6 +5557,19 @@ void LLAppViewer::disconnectViewer()
LLUrlEntryParcel::setDisconnected(gDisconnected);
}
bool LLAppViewer::onChangeFrameLimit(LLSD const & evt)
{
if (evt.asInteger() > 0)
{
mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger()));
}
else
{
mMinMicroSecPerFrame = 0;
}
return false;
}
void LLAppViewer::forceErrorLLError()
{
LL_ERRS() << "This is a deliberate llerror" << LL_ENDL;
@ -5635,7 +5707,7 @@ void LLAppViewer::handleLoginComplete()
if(gAgent.getRegion())
{
gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName();
gDebugInfo["CurrentSimHost"] = gAgent.getRegion()->getSimHostName();
gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName();
}

View File

@ -95,6 +95,7 @@ public:
bool quitRequested() { return mQuitRequested; }
bool logoutRequestSent() { return mLogoutRequestSent; }
bool isSecondInstance() { return mSecondInstance; }
bool isUpdaterMissing() { return mUpdaterNotFound; }
void writeDebugInfo(bool isStatic=true);
@ -205,7 +206,9 @@ public:
// llcorehttp init/shutdown/config information.
LLAppCoreHttp & getAppCoreHttp() { return mAppCoreHttp; }
void updateNameLookupUrl();
protected:
virtual bool initWindow(); // Initialize the viewer's window.
virtual void initLoggingAndGetLastDuration(); // Initialize log files, logging system
@ -255,11 +258,14 @@ private:
void sendLogoutRequest();
void disconnectViewer();
bool onChangeFrameLimit(LLSD const & evt);
// *FIX: the app viewer class should be some sort of singleton, no?
// Perhaps its child class is the singleton and this should be an abstract base.
static LLAppViewer* sInstance;
bool mSecondInstance; // Is this a second instance of the app?
bool mUpdaterNotFound; // True when attempt to start updater failed
std::string mMarkerFileName;
LLAPRFile mMarkerFile; // A file created to indicate the app is running.
@ -311,7 +317,10 @@ private:
// llcorehttp library init/shutdown helper
LLAppCoreHttp mAppCoreHttp;
bool mIsFirstRun;
bool mIsFirstRun;
U64 mMinMicroSecPerFrame; // frame throttling
};
// consts from viewer.h

View File

@ -603,6 +603,11 @@ bool LLCurrencyUIManager::bought()
return impl.mBought;
}
void LLCurrencyUIManager::clearError()
{
impl.clearError();
}
bool LLCurrencyUIManager::hasError()
{
return impl.mError;

View File

@ -80,6 +80,8 @@ public:
bool buying(); // are we in the process of buying?
bool bought(); // did the buy() transaction complete successfully
void clearError();
bool hasError();
std::string errorMessage();
std::string errorURI();

View File

@ -1033,7 +1033,7 @@ void LLEnvironment::onRegionChange()
}
if (!cur_region->capabilitiesReceived())
{
cur_region->setCapabilitiesReceivedCallback([](LLUUID region_id) { LLEnvironment::instance().requestRegion(); });
cur_region->setCapabilitiesReceivedCallback([](const LLUUID &region_id) { LLEnvironment::instance().requestRegion(); });
return;
}
requestRegion();
@ -1679,6 +1679,17 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader)
void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition)
{
if (!gAgent.getRegion())
{
return;
}
// mRegionId id can be null, no specification as to why and if it's valid so check valid ids only
if (gAgent.getRegion()->getRegionID() != envinfo->mRegionId && envinfo->mRegionId.notNull())
{
LL_INFOS("ENVIRONMENT") << "Requested environmend region id: " << envinfo->mRegionId << " agent is on: " << gAgent.getRegion()->getRegionID() << LL_ENDL;
return;
}
if (envinfo->mParcelId == INVALID_PARCEL_ID)
{
// the returned info applies to an entire region.

View File

@ -166,6 +166,14 @@ namespace Details
// LL_DEBUGS("LLEventPollImpl::eventPollCoro") << "<" << counter << "> result = "
// << LLSDXMLStreamer(result) << LL_ENDL;
if (gDisconnected)
{
// Lost connection or disconnected during quit, don't process sim/region update
// messages, they might populate some cleaned up classes (LLWorld, region and object list)
LL_INFOS("LLEventPollImpl") << "Dropping event messages" << LL_ENDL;
break;
}
LLSD httpResults = result["http_result"];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@ -210,7 +218,7 @@ namespace Details
llcoro::suspendUntilTimeout(waitToRetry);
if (mDone)
if (mDone || gDisconnected)
break;
LL_INFOS("LLEventPollImpl") << "<" << counter << "> About to retry request." << LL_ENDL;
continue;

View File

@ -825,8 +825,11 @@ void LLFavoritesBarCtrl::updateButtons()
if (getChildList()->size() > 0)
{
//find last visible child to get the rightest button offset
child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
std::mem_fun(&LLView::getVisible));
// child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
// std::mem_fun(&LLView::getVisible));
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(), [](const LLView* viewp) { return viewp->getVisible(); });
// [/SL:KB]
if(last_visible_it != childs->rend())
{
last_right_edge = (*last_visible_it)->getRect().mRight;

View File

@ -55,7 +55,7 @@ BOOL LLFloaterAvatarTextures::postBuild()
{
for (U32 i=0; i < TEX_NUM_INDICES; i++)
{
const std::string tex_name = LLAvatarAppearanceDictionary::getInstance()->getTexture(ETextureIndex(i))->mName;
const std::string tex_name = LLAvatarAppearance::getDictionary()->getTexture(ETextureIndex(i))->mName;
mTextures[i] = getChild<LLTextureCtrl>(tex_name);
}
mTitle = getTitle();
@ -77,7 +77,7 @@ static void update_texture_ctrl(LLVOAvatar* avatarp,
ETextureIndex te)
{
LLUUID id = IMG_DEFAULT_AVATAR;
const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture(te);
const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearance::getDictionary()->getTexture(te);
if (tex_entry && tex_entry->mIsLocalTexture)
{
if (avatarp->isSelf())
@ -165,14 +165,14 @@ void LLFloaterAvatarTextures::onClickDump(void* data)
const LLTextureEntry* te = avatarp->getTE(i);
if (!te) continue;
const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearanceDictionary::getInstance()->getTexture((ETextureIndex)(i));
const LLAvatarAppearanceDictionary::TextureEntry* tex_entry = LLAvatarAppearance::getDictionary()->getTexture((ETextureIndex)(i));
if (!tex_entry)
continue;
if (LLVOAvatar::isIndexLocalTexture((ETextureIndex)i))
{
LLUUID id = IMG_DEFAULT_AVATAR;
LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType((ETextureIndex)i);
LLWearableType::EType wearable_type = LLAvatarAppearance::getDictionary()->getTEWearableType((ETextureIndex)i);
if (avatarp->isSelf())
{
LLViewerWearable *wearable = gAgentWearables.getViewerWearable(wearable_type, 0);

View File

@ -184,6 +184,7 @@ void LLFloaterBuyCurrencyUI::updateUI()
args["TITLE"] = getString("info_cannot_buy");
args["MESSAGE"] = mManager.errorMessage();
LLNotificationsUtil::add("CouldNotBuyCurrency", args);
mManager.clearError();
closeFloater();
}
else

View File

@ -59,8 +59,17 @@ BOOL LLFloaterDeletePrefPreset::postBuild()
void LLFloaterDeletePrefPreset::onOpen(const LLSD& key)
{
mSubdirectory = key.asString();
std::string floater_title = getString(std::string("title_") + mSubdirectory);
setTitle(floater_title);
std::string title_type = std::string("title_") + mSubdirectory;
if (hasString(title_type))
{
std::string floater_title = getString(title_type);
setTitle(floater_title);
}
else
{
LL_WARNS() << title_type << " not found" << LL_ENDL;
setTitle(title_type);
}
LLComboBox* combo = getChild<LLComboBox>("preset_combo");
EDefaultOptions option = DEFAULT_HIDE;

View File

@ -457,19 +457,23 @@ void LLFloaterIMContainer::idleUpdate()
const LLConversationItem *current_session = getCurSelectedViewModelItem();
if (current_session)
{
// Update moderator options visibility
LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = current_session->getChildrenBegin();
LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = current_session->getChildrenEnd();
bool is_moderator = isGroupModerator();
bool can_ban = haveAbilityToBan();
while (current_participant_model != end_participant_model)
if (current_session->getType() == LLConversationItem::CONV_SESSION_GROUP)
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
participant_model->setModeratorOptionsVisible(is_moderator);
participant_model->setGroupBanVisible(can_ban && participant_model->getUUID() != gAgentID);
// Update moderator options visibility
LLFolderViewModelItemCommon::child_list_t::const_iterator current_participant_model = current_session->getChildrenBegin();
LLFolderViewModelItemCommon::child_list_t::const_iterator end_participant_model = current_session->getChildrenEnd();
bool is_moderator = isGroupModerator();
bool can_ban = haveAbilityToBan();
while (current_participant_model != end_participant_model)
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
participant_model->setModeratorOptionsVisible(is_moderator);
participant_model->setGroupBanVisible(can_ban && participant_model->getUUID() != gAgentID);
current_participant_model++;
current_participant_model++;
}
}
// Update floater's title as required by the currently selected session or use the default title
LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(current_session->getUUID());
setTitle(conversation_floaterp && conversation_floaterp->needsTitleOverwrite() ? conversation_floaterp->getTitle() : mGeneralTitle);

View File

@ -164,7 +164,6 @@ void LLFloaterIMSession::onClickCloseBtn(bool)
else
{
LL_WARNS() << "Empty session with id: " << (mSessionID.asString()) << LL_ENDL;
return;
}
LLFloaterIMSessionTab::onClickCloseBtn();

View File

@ -40,7 +40,17 @@
#include "llviewercontrol.h"
#include "llappviewer.h"
#include "llviewerjoystick.h"
#include "llviewerwindow.h"
#include "llwindow.h"
#include "llcheckboxctrl.h"
#include "llcombobox.h"
#if LL_WINDOWS && !LL_MESA_HEADLESS
// Require DirectInput version 8
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#endif
static LLTrace::SampleStatHandle<> sJoystickAxis0("Joystick axis 0"),
sJoystickAxis1("Joystick axis 1"),
@ -58,8 +68,33 @@ static LLTrace::SampleStatHandle<>* sJoystickAxes[6] =
&sJoystickAxis5
};
#if LL_WINDOWS && !LL_MESA_HEADLESS
BOOL CALLBACK di8_list_devices_callback(LPCDIDEVICEINSTANCE device_instance_ptr, LPVOID pvRef)
{
// Note: If a single device can function as more than one DirectInput
// device type, it is enumerated as each device type that it supports.
// Capable of detecting devices like Oculus Rift
if (device_instance_ptr && pvRef)
{
std::string product_name = utf16str_to_utf8str(llutf16string(device_instance_ptr->tszProductName));
S32 size = sizeof(GUID);
LLSD::Binary data; //just an std::vector
data.resize(size);
memcpy(&data[0], &device_instance_ptr->guidInstance /*POD _GUID*/, size);
LLFloaterJoystick * floater = (LLFloaterJoystick*)pvRef;
LLSD value = data;
floater->addDevice(product_name, value);
}
return DIENUM_CONTINUE;
}
#endif
LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
: LLFloater(data)
: LLFloater(data),
mHasDeviceList(false)
{
if (!LLViewerJoystick::getInstance()->isJoystickInitialized())
{
@ -71,14 +106,13 @@ LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
void LLFloaterJoystick::draw()
{
bool joystick_inited = LLViewerJoystick::getInstance()->isJoystickInitialized();
getChildView("enable_joystick")->setEnabled(joystick_inited);
getChildView("joystick_type")->setEnabled(joystick_inited);
std::string desc = LLViewerJoystick::getInstance()->getDescription();
if (desc.empty()) desc = getString("NoDevice");
getChild<LLUICtrl>("joystick_type")->setValue(desc);
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
bool joystick_inited = joystick->isJoystickInitialized();
if (joystick_inited != mHasDeviceList)
{
refreshListOfDevices();
}
LLViewerJoystick* joystick(LLViewerJoystick::getInstance());
for (U32 i = 0; i < 6; i++)
{
F32 value = joystick->getJoystickAxis(i);
@ -115,8 +149,8 @@ BOOL LLFloaterJoystick::postBuild()
}
}
mCheckJoystickEnabled = getChild<LLCheckBoxCtrl>("enable_joystick");
childSetCommitCallback("enable_joystick",onCommitJoystickEnabled,this);
mJoysticksCombo = getChild<LLComboBox>("joystick_combo");
childSetCommitCallback("joystick_combo",onCommitJoystickEnabled,this);
mCheckFlycamEnabled = getChild<LLCheckBoxCtrl>("JoystickFlycamEnabled");
childSetCommitCallback("JoystickFlycamEnabled",onCommitJoystickEnabled,this);
@ -125,6 +159,7 @@ BOOL LLFloaterJoystick::postBuild()
childSetAction("ok_btn", onClickOK, this);
refresh();
refreshListOfDevices();
return TRUE;
}
@ -141,6 +176,7 @@ void LLFloaterJoystick::apply()
void LLFloaterJoystick::initFromSettings()
{
mJoystickEnabled = gSavedSettings.getBOOL("JoystickEnabled");
mJoystickId = gSavedSettings.getLLSD("JoystickDeviceUUID");
mJoystickAxis[0] = gSavedSettings.getS32("JoystickAxis0");
mJoystickAxis[1] = gSavedSettings.getS32("JoystickAxis1");
@ -210,12 +246,80 @@ void LLFloaterJoystick::initFromSettings()
void LLFloaterJoystick::refresh()
{
LLFloater::refresh();
initFromSettings();
}
void LLFloaterJoystick::addDevice(std::string &name, LLSD& value)
{
mJoysticksCombo->add(name, value, ADD_BOTTOM, 1);
}
void LLFloaterJoystick::refreshListOfDevices()
{
mJoysticksCombo->removeall();
std::string no_device = getString("JoystickDisabled");
LLSD value = LLSD::Integer(0);
addDevice(no_device, value);
mHasDeviceList = false;
// di8_devices_callback callback is immediate and happens in scope of getInputDevices()
#if LL_WINDOWS && !LL_MESA_HEADLESS
// space navigator is marked as DI8DEVCLASS_GAMECTRL in ndof lib
U32 device_type = DI8DEVCLASS_GAMECTRL;
void* callback = &di8_list_devices_callback;
#else
// MAC doesn't support device search yet
// On MAC there is an ndof_idsearch and it is possible to specify product
// and manufacturer in NDOF_Device for ndof_init_first to pick specific one
U32 device_type = 0;
void* callback = NULL;
#endif
if (gViewerWindow->getWindow()->getInputDevices(device_type, callback, this))
{
mHasDeviceList = true;
}
bool is_device_id_set = LLViewerJoystick::getInstance()->isDeviceUUIDSet();
if (LLViewerJoystick::getInstance()->isJoystickInitialized() &&
(!mHasDeviceList || !is_device_id_set))
{
#if LL_WINDOWS && !LL_MESA_HEADLESS
LL_WARNS() << "NDOF connected to device without using SL provided handle" << LL_ENDL;
#endif
std::string desc = LLViewerJoystick::getInstance()->getDescription();
if (!desc.empty())
{
LLSD value = LLSD::Integer(0);
addDevice(desc, value);
mHasDeviceList = true;
}
}
if (gSavedSettings.getBOOL("JoystickEnabled") && mHasDeviceList)
{
if (is_device_id_set)
{
LLSD guid = LLViewerJoystick::getInstance()->getDeviceUUID();
mJoysticksCombo->selectByValue(guid);
}
else
{
mJoysticksCombo->selectByValue(LLSD::Integer(1));
}
}
else
{
mJoysticksCombo->selectByValue(LLSD::Integer(0));
}
}
void LLFloaterJoystick::cancel()
{
gSavedSettings.setBOOL("JoystickEnabled", mJoystickEnabled);
gSavedSettings.setLLSD("JoystickDeviceUUID", mJoystickId);
gSavedSettings.setS32("JoystickAxis0", mJoystickAxis[0]);
gSavedSettings.setS32("JoystickAxis1", mJoystickAxis[1]);
@ -285,7 +389,21 @@ void LLFloaterJoystick::cancel()
void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel)
{
LLFloaterJoystick* self = (LLFloaterJoystick*)joy_panel;
BOOL joystick_enabled = self->mCheckJoystickEnabled->get();
LLSD value = self->mJoysticksCombo->getValue();
bool joystick_enabled = true;
if (value.isInteger())
{
// ndof already has a device selected, we are just setting it enabled or disabled
joystick_enabled = value.asInteger();
}
else
{
LLViewerJoystick::getInstance()->initDevice(value);
// else joystick is enabled, because combobox holds id of device
joystick_enabled = true;
}
gSavedSettings.setBOOL("JoystickEnabled", joystick_enabled);
BOOL flycam_enabled = self->mCheckFlycamEnabled->get();
if (!joystick_enabled || !flycam_enabled)
@ -297,6 +415,12 @@ void LLFloaterJoystick::onCommitJoystickEnabled(LLUICtrl*, void *joy_panel)
joystick->toggleFlycam();
}
}
std::string device_id = LLViewerJoystick::getInstance()->getDeviceUUIDString();
gSavedSettings.setString("JoystickDeviceUUID", device_id);
LL_DEBUGS("Joystick") << "Selected " << device_id << " as joystick." << LL_ENDL;
self->refreshListOfDevices();
}
void LLFloaterJoystick::onClickRestoreSNDefaults(void *joy_panel)

View File

@ -31,6 +31,7 @@
#include "llstatview.h"
class LLCheckBoxCtrl;
class LLComboBox;
class LLFloaterJoystick : public LLFloater
{
@ -45,8 +46,11 @@ public:
virtual void draw();
static void setSNDefaults();
void addDevice(std::string &name, LLSD& value);
protected:
void refreshListOfDevices();
void onClose(bool app_quitting);
void onClickCloseBtn(bool app_quitting);
@ -65,6 +69,7 @@ private:
private:
// Device prefs
bool mJoystickEnabled;
LLSD mJoystickId;
S32 mJoystickAxis[7];
bool m3DCursor;
bool mAutoLeveling;
@ -85,8 +90,10 @@ private:
F32 mFlycamFeathering;
// Controls that can disable the flycam
LLCheckBoxCtrl *mCheckJoystickEnabled;
LLCheckBoxCtrl *mCheckFlycamEnabled;
LLComboBox *mJoysticksCombo;
bool mHasDeviceList;
// stats view
LLStatBar* mAxisStatsBar[6];

View File

@ -58,9 +58,17 @@ BOOL LLFloaterLoadPrefPreset::postBuild()
void LLFloaterLoadPrefPreset::onOpen(const LLSD& key)
{
mSubdirectory = key.asString();
std::string floater_title = getString(std::string("title_") + mSubdirectory);
setTitle(floater_title);
std::string title_type = std::string("title_") + mSubdirectory;
if (hasString(title_type))
{
std::string floater_title = getString(title_type);
setTitle(floater_title);
}
else
{
LL_WARNS() << title_type << " not found" << LL_ENDL;
setTitle(title_type);
}
LLComboBox* combo = getChild<LLComboBox>("preset_combo");

View File

@ -633,12 +633,18 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
}
// call refresh from region on all panels
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::for_each(
mInfoPanels.begin(),
mInfoPanels.end(),
llbind2nd(
std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
region));
[region](LLPanelRegionInfo* panelp) { panelp->refreshFromRegion(region); });
// [/SL:KB]
// std::for_each(
// mInfoPanels.begin(),
// mInfoPanels.end(),
// llbind2nd(
// std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
// region));
mEnvironmentPanel->refreshFromRegion(region);
}

View File

@ -64,7 +64,7 @@ void LLFloaterSidePanelContainer::onOpen(const LLSD& key)
void LLFloaterSidePanelContainer::closeFloater(bool app_quitting)
{
LLPanelOutfitEdit* panel_outfit_edit =
dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::getPanel("appearance", "panel_outfit_edit"));
dynamic_cast<LLPanelOutfitEdit*>(LLFloaterSidePanelContainer::findPanel("appearance", "panel_outfit_edit"));
if (panel_outfit_edit)
{
LLFloater *parent = gFloaterView->getParentFloater(panel_outfit_edit);
@ -167,3 +167,15 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name,
return NULL;
}
LLPanel* LLFloaterSidePanelContainer::findPanel(const std::string& floater_name, const std::string& panel_name)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance<LLFloaterSidePanelContainer>(floater_name);
if (floaterp)
{
return floaterp->findChild<LLPanel>(panel_name, true);
}
return NULL;
}

View File

@ -67,6 +67,8 @@ public:
static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key);
static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName);
static LLPanel* findPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName);
/**
* Gets the panel of given type T (doesn't show it or do anything else with it).

View File

@ -761,7 +761,10 @@ S32 LLGestureMgr::getPlayingCount() const
}
struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
//struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznîp-6.6
struct IsGesturePlaying
// [/SL:KB]
{
bool operator()(const LLMultiGesture* gesture) const
{

View File

@ -135,23 +135,14 @@ bool LLGiveInventory::isInventoryGiveAcceptable(const LLInventoryItem* item)
switch(item->getType())
{
case LLAssetType::AT_OBJECT:
if (get_is_item_worn(item->getUUID()))
{
acceptable = false;
}
break;
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
{
BOOL copyable = false;
if (item->getPermissions().allowCopyBy(gAgentID)) copyable = true;
if (!copyable && get_is_item_worn(item->getUUID()))
if (get_is_item_worn(item->getUUID()))
{
// worn no-copy items can't be transfered,
// but it is valid to transfer a copy of a worn item
acceptable = false;
}
break;
}
break;
default:

View File

@ -2257,6 +2257,19 @@ BOOL LLOutgoingCallDialog::postBuild()
// Class LLIncomingCallDialog
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const std::array<std::string, 4> voice_call_types =
{
"VoiceInviteP2P",
"VoiceInviteGroup",
"VoiceInviteAdHoc",
"InviteAdHoc"
};
bool is_voice_call_type(const std::string &value)
{
return std::find(voice_call_types.begin(), voice_call_types.end(), value) != voice_call_types.end();
}
LLIncomingCallDialog::LLIncomingCallDialog(const LLSD& payload) :
LLCallDialog(payload),
mAvatarNameCacheConnection()
@ -2286,9 +2299,28 @@ BOOL LLIncomingCallDialog::postBuild()
{
LLCallDialog::postBuild();
if (!mPayload.isMap() || mPayload.size() == 0)
{
LL_INFOS("IMVIEW") << "IncomingCall: invalid argument" << LL_ENDL;
return TRUE;
}
LLUUID session_id = mPayload["session_id"].asUUID();
LLSD caller_id = mPayload["caller_id"];
std::string caller_name = mPayload["caller_name"].asString();
if (session_id.isNull() && caller_id.asUUID().isNull())
{
LL_INFOS("IMVIEW") << "IncomingCall: invalid ids" << LL_ENDL;
return TRUE;
}
std::string notify_box_type = mPayload["notify_box_type"].asString();
if (!is_voice_call_type(notify_box_type))
{
LL_INFOS("IMVIEW") << "IncomingCall: notify_box_type was not provided" << LL_ENDL;
return TRUE;
}
// init notification's lifetime
std::istringstream ss( getString("lifetime") );
@ -2305,15 +2337,14 @@ BOOL LLIncomingCallDialog::postBuild()
if (gAgent.getGroupData(session_id, data))
{
args["[GROUP]"] = data.mName;
call_type = getString(mPayload["notify_box_type"], args);
call_type = getString(notify_box_type, args);
}
}
else
{
call_type = getString(mPayload["notify_box_type"]);
call_type = getString(notify_box_type);
}
// check to see if this is an Avaline call
bool is_avatar = LLVoiceClient::getInstance()->isParticipantAvatar(session_id);
if (caller_name == "anonymous")
@ -2343,7 +2374,6 @@ BOOL LLIncomingCallDialog::postBuild()
childSetAction("Start IM", onStartIM, this);
setDefaultBtn("Accept");
std::string notify_box_type = mPayload["notify_box_type"].asString();
if(notify_box_type != "VoiceInviteGroup" && notify_box_type != "VoiceInviteAdHoc")
{
// starting notification's timer for P2P and AVALINE invitations
@ -2494,10 +2524,10 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
correct_session_name.append(ADHOC_NAME_SUFFIX);
}
}
LL_INFOS() << "Corrected session name is " << correct_session_name << LL_ENDL;
LL_INFOS("IMVIEW") << "Corrected session name is " << correct_session_name << LL_ENDL;
break;
default:
LL_WARNS() << "Received an empty session name from a server and failed to generate a new proper session name" << LL_ENDL;
LL_WARNS("IMVIEW") << "Received an empty session name from a server and failed to generate a new proper session name" << LL_ENDL;
break;
}
}
@ -2697,6 +2727,14 @@ void LLIMMgr::addMessage(
bool new_session = !hasSession(new_session_id);
if (new_session)
{
// Group chat session was initiated by muted resident, do not start this session viewerside
// do not send leave msg either, so we are able to get group messages from other participants
if ((IM_SESSION_INVITE == dialog) && gAgent.isInGroup(new_session_id) &&
LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !from_linden)
{
return;
}
LLAvatarName av_name;
if (LLAvatarNameCache::get(other_participant_id, &av_name) && !name_is_setted)
{
@ -2740,7 +2778,7 @@ void LLIMMgr::addMessage(
LL_WARNS() << "Leaving IM session from initiating muted resident " << from << LL_ENDL;
if (!gIMMgr->leaveSession(new_session_id))
{
LL_INFOS() << "Session " << new_session_id << " does not exist." << LL_ENDL;
LL_INFOS("IMVIEW") << "Session " << new_session_id << " does not exist." << LL_ENDL;
}
return;
}
@ -2951,7 +2989,7 @@ LLUUID LLIMMgr::addSession(
//we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions
if (!new_session) return session_id;
LL_INFOS() << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << LL_ENDL;
LL_INFOS("IMVIEW") << "LLIMMgr::addSession, new session added, name = " << name << ", session id = " << session_id << LL_ENDL;
//Per Plan's suggestion commented "explicit offline status warning" out to make Dessie happier (see EXT-3609)
//*TODO After February 2010 remove this commented out line if no one will be missing that warning
@ -2988,7 +3026,7 @@ void LLIMMgr::removeSession(const LLUUID& session_id)
LLIMModel::getInstance()->clearSession(session_id);
LL_INFOS() << "LLIMMgr::removeSession, session removed, session id = " << session_id << LL_ENDL;
LL_INFOS("IMVIEW") << "LLIMMgr::removeSession, session removed, session id = " << session_id << LL_ENDL;
notifyObserverSessionRemoved(session_id);
}
@ -3054,13 +3092,13 @@ void LLIMMgr::inviteToSession(
if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagVoiceChat)
&& voice_invite && "VoiceInviteQuestionDefault" == question_type)
{
LL_INFOS() << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL;
LL_INFOS("IMVIEW") << "Rejecting voice call from initiating muted resident " << caller_name << LL_ENDL;
LLIncomingCallDialog::processCallResponse(1, payload);
return;
}
else if (LLMuteList::getInstance()->isMuted(caller_id, LLMute::flagAll & ~LLMute::flagVoiceChat) && !voice_invite)
{
LL_INFOS() << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL;
LL_INFOS("IMVIEW") << "Rejecting session invite from initiating muted resident " << caller_name << LL_ENDL;
return;
}
}

View File

@ -7824,13 +7824,12 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ
disable_context_entries_if_present(menu, disabled_items);
}
bool LLFolderViewGroupedItemBridge::canWearSelected(uuid_vec_t item_ids)
bool LLFolderViewGroupedItemBridge::canWearSelected(const uuid_vec_t& item_ids) const
{
for (uuid_vec_t::const_iterator it = item_ids.begin(); it != item_ids.end(); ++it)
{
LLViewerInventoryItem* item = gInventory.getItem(*it);
LLAssetType::EType asset_type = item->getType();
if (!item || (asset_type >= LLAssetType::AT_COUNT) || (asset_type <= LLAssetType::AT_NONE))
const LLViewerInventoryItem* item = gInventory.getItem(*it);
if (!item || (item->getType() >= LLAssetType::AT_COUNT) || (item->getType() <= LLAssetType::AT_NONE))
{
return false;
}

View File

@ -760,7 +760,7 @@ class LLFolderViewGroupedItemBridge: public LLFolderViewGroupedItemModel
public:
LLFolderViewGroupedItemBridge();
virtual void groupFilterContextMenu(folder_view_item_deque& selected_items, LLMenuGL& menu);
bool canWearSelected(uuid_vec_t item_ids);
bool canWearSelected(const uuid_vec_t& item_ids) const;
};
#endif // LL_LLINVENTORYBRIDGE_H

View File

@ -2479,16 +2479,19 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
{
bool open_multi_preview = true;
for (std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
if ("open" == action)
{
LLFolderViewItem* folder_item = *set_iter;
if (folder_item)
for (std::set<LLFolderViewItem*>::iterator set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{
LLInvFVBridge* bridge = dynamic_cast<LLInvFVBridge*>(folder_item->getViewModelItem());
if (!bridge || !bridge->isMultiPreviewAllowed())
LLFolderViewItem* folder_item = *set_iter;
if (folder_item)
{
open_multi_preview = false;
break;
LLInvFVBridge* bridge = dynamic_cast<LLInvFVBridge*>(folder_item->getViewModelItem());
if (!bridge || !bridge->isMultiPreviewAllowed())
{
open_multi_preview = false;
break;
}
}
}
}

View File

@ -158,7 +158,8 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mShowEmptyMessage(p.show_empty_message),
mSuppressFolderMenu(p.suppress_folder_menu),
mSuppressOpenItemAction(false),
mViewsInitialized(false),
mBuildViewsOnInit(p.preinitialize_views),
mViewsInitialized(VIEWS_UNINITIALIZED),
mInvFVBridgeBuilder(NULL),
mInventoryViewModel(p.name),
mGroupedItemBridge(new LLFolderViewGroupedItemBridge)
@ -285,14 +286,22 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params)
mCompletionObserver = new LLInvPanelComplObserver(boost::bind(&LLInventoryPanel::onItemsCompletion, this));
mInventory->addObserver(mCompletionObserver);
// Build view of inventory if we need default full hierarchy and inventory ready, otherwise do in onIdle.
// Initializing views takes a while so always do it onIdle if viewer already loaded.
if (mInventory->isInventoryUsable() && !mViewsInitialized && LLStartUp::getStartupState() <= STATE_WEARABLES_WAIT)
{
initializeViews();
}
gIdleCallbacks.addFunction(onIdle, (void*)this);
if (mBuildViewsOnInit)
{
// Build view of inventory if we need default full hierarchy and inventory is ready, otherwise do in onIdle.
// Initializing views takes a while so always do it onIdle if viewer already loaded.
if (mInventory->isInventoryUsable()
&& mViewsInitialized == VIEWS_UNINITIALIZED
&& LLStartUp::getStartupState() <= STATE_WEARABLES_WAIT)
{
initializeViews();
}
else if (mViewsInitialized != VIEWS_INITIALIZING)
{
mViewsInitialized = VIEWS_INITIALIZING;
gIdleCallbacks.addFunction(onIdle, (void*)this);
}
}
if (mSortOrderSetting != INHERIT_SORT_ORDER)
{
@ -338,6 +347,17 @@ LLInventoryPanel::~LLInventoryPanel()
clearFolderRoot();
}
/*virtual*/
void LLInventoryPanel::onVisibilityChange(BOOL new_visibility)
{
if (new_visibility && mViewsInitialized == VIEWS_UNINITIALIZED)
{
mViewsInitialized = VIEWS_INITIALIZING;
gIdleCallbacks.addFunction(onIdle, (void*)this);
}
LLPanel::onVisibilityChange(new_visibility);
}
void LLInventoryPanel::draw()
{
// Select the desired item (in case it wasn't loaded when the selection was requested)
@ -661,7 +681,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
{
LL_RECORD_BLOCK_TIME(FTM_REFRESH);
if (!mViewsInitialized) return;
if (mViewsInitialized != VIEWS_INITIALIZED) return;
const LLInventoryModel* model = getModel();
if (!model) return;
@ -727,11 +747,11 @@ void LLInventoryPanel::onIdle(void *userdata)
LLInventoryPanel *self = (LLInventoryPanel*)userdata;
// Inventory just initialized, do complete build
if (!self->mViewsInitialized)
if (self->mViewsInitialized != VIEWS_INITIALIZED)
{
self->initializeViews();
}
if (self->mViewsInitialized)
if (self->mViewsInitialized == VIEWS_INITIALIZED)
{
gIdleCallbacks.deleteFunction(onIdle, (void*)self);
}
@ -814,7 +834,7 @@ void LLInventoryPanel::initializeViews()
gIdleCallbacks.addFunction(idle, this);
mViewsInitialized = true;
mViewsInitialized = VIEWS_INITIALIZED;
openStartFolderOrMyInventory();

View File

@ -108,6 +108,10 @@ public:
Optional<LLFolderViewFolder::Params> folder;
Optional<LLFolderViewItem::Params> item;
// All item and folder views will be initialized on init if true (default)
// Will initialize on visibility change otherwise.
Optional<bool> preinitialize_views;
Params()
: sort_order_setting("sort_order_setting"),
inventory("", &gInventory),
@ -126,7 +130,8 @@ public:
accepts_drag_and_drop("accepts_drag_and_drop"),
folder_view("folder_view"),
folder("folder"),
item("item")
item("item"),
preinitialize_views("preinitialize_views", true)
{}
};
@ -154,6 +159,7 @@ public:
LLFolderViewModelInventory& getRootViewModel() { return mInventoryViewModel; }
// LLView methods
/*virtual*/ void onVisibilityChange(BOOL new_visibility);
void draw();
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
BOOL handleHover(S32 x, S32 y, MASK mask);
@ -313,7 +319,7 @@ public:
void addHideFolderType(LLFolderType::EType folder_type);
public:
BOOL getIsViewsInitialized() const { return mViewsInitialized; }
bool getViewsInitialized() const { return mViewsInitialized == VIEWS_INITIALIZED; }
protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews();
@ -349,8 +355,15 @@ private:
LLFolderViewItem *target_view,
LLFolderViewFolder *parent_folder_view);
bool mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild()
bool mViewsInitialized; // Views have been generated
typedef enum e_views_initialization_state
{
VIEWS_UNINITIALIZED = 0,
VIEWS_INITIALIZING,
VIEWS_INITIALIZED,
} EViewsInitializationState;
bool mBuildViewsOnInit;
EViewsInitializationState mViewsInitialized; // Whether views have been generated
};

View File

@ -299,7 +299,6 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
LLButton::Params maturity_button = p.maturity_button;
mMaturityButton = LLUICtrlFactory::create<LLButton>(maturity_button);
addChild(mMaturityButton);
mMaturityButton->setClickedCallback(boost::bind(&LLLocationInputCtrl::onMaturityButtonClicked, this));
LLButton::Params for_sale_button = p.for_sale_button;
for_sale_button.tool_tip = LLTrans::getString("LocationCtrlForSaleTooltip");
@ -681,11 +680,6 @@ void LLLocationInputCtrl::onAgentParcelChange()
refresh();
}
void LLLocationInputCtrl::onMaturityButtonClicked()
{
LLUI::getInstance()->mHelpImpl->showTopic(mMaturityHelpTopic);
}
void LLLocationInputCtrl::onRegionBoundaryCrossed()
{
createNavMeshStatusListenerForCurrentRegion();

View File

@ -164,7 +164,6 @@ private:
void onForSaleButtonClicked();
void onAddLandmarkButtonClicked();
void onAgentParcelChange();
void onMaturityButtonClicked();
void onRegionBoundaryCrossed();
void onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus);
// callbacks

View File

@ -427,6 +427,7 @@ void LLLoginInstance::handleLoginSuccess(const LLSD& event)
LL_INFOS("LLLogin") << "LLLoginInstance::handleLoginSuccess" << LL_ENDL;
attemptComplete();
mRequestData.clear();
}
void LLLoginInstance::handleDisconnect(const LLSD& event)

View File

@ -30,9 +30,12 @@
#if LL_WINDOWS
#define _WIN32_DCOM
#include <iostream>
using namespace std;
//using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
using namespace std;
// [/SL:KB]
#endif
unsigned char static_unique_id[] = {0,0,0,0,0,0};
bool static has_static_unique_id = false;

View File

@ -169,6 +169,14 @@ LLMuteList::LLMuteList() :
gMessageSystem.callWhenReady(boost::bind(&LLMessageSystem::setHandlerFuncFast, _1,
_PREHASH_UseCachedMuteList, processUseCachedMuteList,
static_cast<void**>(NULL)));
// make sure mute list's instance gets initialized before we start any name requests
LLAvatarNameCache::getInstance()->setAccountNameChangedCallback([this](const LLUUID& id, const LLAvatarName& av_name)
{
// it would be better to just pass LLAvatarName instead of doing unnesssesary copies
// but this way is just more convinient
onAccountNameChanged(id, av_name.getUserName());
});
}
//-----------------------------------------------------------------------------
@ -179,6 +187,11 @@ LLMuteList::~LLMuteList()
}
void LLMuteList::cleanupSingleton()
{
LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(NULL);
}
BOOL LLMuteList::isLinden(const std::string& name) const
{
std::string username = boost::replace_all_copy(name, ".", " ");
@ -232,8 +245,8 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
LL_WARNS() << "Trying to self; ignored" << LL_ENDL;
return FALSE;
}
S32 mute_list_limit = gSavedSettings.getS32("MuteListLimit");
static LLCachedControl<S32> mute_list_limit(gSavedSettings, "MuteListLimit", 1000);
if (getMutes().size() >= mute_list_limit)
{
LL_WARNS() << "Mute limit is reached; ignored" << LL_ENDL;
@ -358,6 +371,10 @@ void LLMuteList::updateAdd(const LLMute& mute)
msg->addU32("MuteFlags", mute.mFlags);
gAgent.sendReliableMessage();
if (!mIsLoaded)
{
LL_WARNS() << "Added elements to non-initialized block list" << LL_ENDL;
}
mIsLoaded = TRUE; // why is this here? -MG
}
@ -391,6 +408,8 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
else
{
// The caller didn't pass any flags -- just remove the mute entry entirely.
// set flags to notify observers with (flag being present means that something is allowed)
localmute.mFlags = LLMute::flagAll;
}
// Always remove the entry from the set -- it will be re-added with new flags if necessary.
@ -411,8 +430,8 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
}
// Must be after erase.
notifyObservers();
notifyObserversDetailed(localmute);
setLoaded(); // why is this here? -MG
}
else
{
@ -425,8 +444,8 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags)
updateRemove(mute);
mLegacyMutes.erase(legacy_it);
// Must be after erase.
notifyObservers();
notifyObserversDetailed(mute);
setLoaded(); // why is this here? -MG
}
}
@ -584,6 +603,19 @@ BOOL LLMuteList::loadFromFile(const std::string& filename)
}
fclose(fp);
setLoaded();
// server does not maintain up-to date account names (not display names!)
// in this list, so it falls to viewer.
pending_names_t::iterator iter = mPendingAgentNameUpdates.begin();
pending_names_t::iterator end = mPendingAgentNameUpdates.end();
while (iter != end)
{
// this will send updates to server, make sure mIsLoaded is set
onAccountNameChanged(iter->first, iter->second);
iter++;
}
mPendingAgentNameUpdates.clear();
return TRUE;
}
@ -767,6 +799,48 @@ void LLMuteList::onFileMuteList(void** user_data, S32 error_code, LLExtStat ext_
delete local_filename_and_path;
}
void LLMuteList::onAccountNameChanged(const LLUUID& id, const std::string& username)
{
if (mIsLoaded)
{
LLMute mute(id, username, LLMute::AGENT);
mute_set_t::iterator mute_it = mMutes.find(mute);
if (mute_it != mMutes.end()
&& mute_it->mName != mute.mName
&& mute_it->mType == LLMute::AGENT) // just in case, it is std::set, not map
{
// existing mute, but name changed, copy data
mute.mFlags = mute_it->mFlags;
// erase old variant
mMutes.erase(mute_it);
// (re)add the mute entry.
{
std::pair<mute_set_t::iterator, bool> result = mMutes.insert(mute);
if (result.second)
{
LL_INFOS() << "Muting " << mute.mName << " id " << mute.mID << " flags " << mute.mFlags << LL_ENDL;
updateAdd(mute);
// Do not notify observers here, observers do not know or need to handle name changes
// Example: block list considers notifyObserversDetailed as a selection update;
// Various chat/voice statuses care only about id and flags
// Since apropriate update time for account names is considered to be in 'hours' it is
// fine not to update UI (will be fine after restart or couple other changes)
}
}
}
}
else
{
// Delay update until we load file
// Ex: Buddies list can arrive too early since we prerequest
// names from Buddies list before we load blocklist
mPendingAgentNameUpdates[id] = username;
}
}
void LLMuteList::addObserver(LLMuteListObserver* observer)
{
mObservers.insert(observer);

View File

@ -73,6 +73,7 @@ class LLMuteList : public LLSingleton<LLMuteList>
{
LLSINGLETON(LLMuteList);
~LLMuteList();
/*virtual*/ void cleanupSingleton();
public:
// reasons for auto-unmuting a resident
enum EAutoReason
@ -131,6 +132,7 @@ private:
static void processUseCachedMuteList(LLMessageSystem* msg, void**);
static void onFileMuteList(void** user_data, S32 code, LLExtStat ext_status);
void onAccountNameChanged(const LLUUID& id, const std::string& username);
private:
struct compare_by_name
@ -155,7 +157,9 @@ private:
};
typedef std::set<LLMute, compare_by_id> mute_set_t;
mute_set_t mMutes;
typedef std::map<LLUUID, std::string> pending_names_t;
pending_names_t mPendingAgentNameUpdates;
typedef std::set<std::string> string_set_t;
string_set_t mLegacyMutes;

View File

@ -312,10 +312,14 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& s
}
}
void LLOutputMonitorCtrl::onChange()
void LLOutputMonitorCtrl::onChangeDetailed(const LLMute& mute)
{
// check only blocking on voice. EXT-3542
mIsMuted = LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat);
if (mute.mID == mSpeakerId)
{
// Check only blocking on voice.
// Logic goes in reverse, if flag is set, action is allowed
mIsMuted = !(LLMute::flagVoiceChat & mute.mFlags);
}
}
// virtual

View File

@ -105,7 +105,8 @@ public:
void setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id = LLUUID::null, bool show_other_participants_speaking = false);
//called by mute list
virtual void onChange();
virtual void onChange() {};
virtual void onChangeDetailed(const LLMute& mute);
/**
* Implementation of LLSpeakingIndicator interface.

View File

@ -201,9 +201,12 @@ std::string build_notice_date(const U32& the_time)
time(&t);
}
std::string dateStr = "["+LLTrans::getString("LTimeMthNum")+"]/["
+LLTrans::getString("LTimeDay")+"]/["
+LLTrans::getString("LTimeYear")+"]";
std::string dateStr = "["+ LLTrans::getString("LTimeYear") + "]/["
+ LLTrans::getString("LTimeMthNum") + "]/["
+ LLTrans::getString("LTimeDay") + "] ["
+ LLTrans::getString("LTimeHour") + "]:["
+ LLTrans::getString("LTimeMin") + "]:["
+ LLTrans::getString("LTimeSec") + "]";
LLSD substitution;
substitution["datetime"] = (S32) t;
LLStringUtil::format (dateStr, substitution);

View File

@ -1337,8 +1337,10 @@ void LLPanelLogin::onSelectServer()
switch (index)
{
case 0: // last location
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST));
break;
case 1: // home location
// do nothing - these are grid-agnostic locations
LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_HOME));
break;
default:

View File

@ -165,6 +165,7 @@ BOOL LLPanelMainInventory::postBuild()
recent_items_panel->setSinceLogoff(TRUE);
recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
recent_items_panel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS);
LLInventoryFilter& recent_filter = recent_items_panel->getFilter();
recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY));
recent_filter.setEmptyLookupMessage("InventoryNoMatchingRecentItems");

View File

@ -566,6 +566,8 @@ BOOL LLPanelOutfitEdit::postBuild()
mGearMenuBtn->setMenu(mGearMenu);
mSaveComboBtn.reset(new LLSaveOutfitComboBtn(this));
onOutfitChanging(gAgentWearables.isCOFChangeInProgress());
return TRUE;
}
@ -710,6 +712,10 @@ void LLPanelOutfitEdit::onListViewFilterCommitted(LLUICtrl* ctrl)
S32 curr_filter_type = mListViewFilterCmbBox->getCurrentIndex();
if (curr_filter_type < 0) return;
if (curr_filter_type >= LVIT_SHAPE)
{
mWearableItemsList->setMenuWearableType(LLWearableType::EType(curr_filter_type - LVIT_SHAPE));
}
mWearableListManager->setFilterCollector(mListViewItemTypes[curr_filter_type]->collector);
}
@ -1289,6 +1295,7 @@ void LLPanelOutfitEdit::showFilteredWearablesListView(LLWearableType::EType type
//e_list_view_item_type implicitly contains LLWearableType::EType starting from LVIT_SHAPE
applyListViewFilter(static_cast<EListViewItemType>(LVIT_SHAPE + type));
mWearableItemsList->setMenuWearableType(type);
}
static void update_status_widget_rect(LLView * widget, S32 right_border)

View File

@ -237,7 +237,10 @@ private:
LLToggleableMenu* mGearMenu;
LLToggleableMenu* mAddWearablesGearMenu;
bool mInitialized;
std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::unique_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
// [/SL:KB]
// std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
LLMenuButton* mWearablesGearMenuBtn;
LLMenuButton* mGearMenuBtn;

View File

@ -71,7 +71,10 @@ protected:
private:
LLTabContainer* mAppearanceTabs;
std::string mFilterSubString;
std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
// [SL:KB] - Patch: Viewer-Build | Checked: Catznip-6.6
std::unique_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
// [/SL:KB]
// std::auto_ptr<LLSaveOutfitComboBtn> mSaveComboBtn;
//////////////////////////////////////////////////////////////////////////////////
// tab panels //

View File

@ -1000,13 +1000,45 @@ void LLPanelPermissions::refresh()
getChildView("clickaction")->setEnabled(is_perm_modify && is_nonpermanent_enforced && all_volume);
}
// Shorten name if it doesn't fit into max_pixels of two lines
void shorten_name(std::string &name, const LLStyle::Params& style_params, S32 max_pixels)
{
const LLFontGL* font = style_params.font();
LLWString wline = utf8str_to_wstring(name);
// panel supports two lines long names
S32 segment_length = font->maxDrawableChars(wline.c_str(), max_pixels, wline.length(), LLFontGL::WORD_BOUNDARY_IF_POSSIBLE);
if (segment_length == wline.length())
{
// no work needed
return;
}
S32 first_line_length = segment_length;
segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), max_pixels, wline.length(), LLFontGL::ANYWHERE);
if (segment_length + first_line_length == wline.length())
{
// no work needed
return;
}
// name does not fit, cut it, add ...
const LLWString dots_pad(utf8str_to_wstring(std::string("....")));
S32 elipses_width = font->getWidthF32(dots_pad.c_str());
segment_length = font->maxDrawableChars(wline.substr(first_line_length).c_str(), max_pixels - elipses_width, wline.length(), LLFontGL::ANYWHERE);
name = name.substr(0, segment_length + first_line_length) + std::string("...");
}
void LLPanelPermissions::updateOwnerName(const LLUUID& owner_id, const LLAvatarName& owner_name, const LLStyle::Params& style_params)
{
if (mOwnerCacheConnection.connected())
{
mOwnerCacheConnection.disconnect();
}
mLabelOwnerName->setText(owner_name.getCompleteName(), style_params);
std::string name = owner_name.getCompleteName();
shorten_name(name, style_params, mLabelOwnerName->getLocalRect().getWidth());
mLabelOwnerName->setText(name, style_params);
}
void LLPanelPermissions::updateCreatorName(const LLUUID& creator_id, const LLAvatarName& creator_name, const LLStyle::Params& style_params)
@ -1015,7 +1047,9 @@ void LLPanelPermissions::updateCreatorName(const LLUUID& creator_id, const LLAva
{
mCreatorCacheConnection.disconnect();
}
mLabelCreatorName->setText(creator_name.getCompleteName(), style_params);
std::string name = creator_name.getCompleteName();
shorten_name(name, style_params, mLabelCreatorName->getLocalRect().getWidth());
mLabelCreatorName->setText(name, style_params);
}
// static

View File

@ -548,9 +548,6 @@ void LLScriptEdCore::initMenu()
menuItem = getChild<LLMenuItemCallGL>("Go to line...");
menuItem->setClickCallback(boost::bind(&LLFloaterGotoLine::show, this));
menuItem = getChild<LLMenuItemCallGL>("Help...");
menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnHelp, this));
menuItem = getChild<LLMenuItemCallGL>("Keyword Help...");
menuItem->setClickCallback(boost::bind(&LLScriptEdCore::onBtnDynamicHelp, this));
@ -886,11 +883,6 @@ bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLS
return false;
}
void LLScriptEdCore::onBtnHelp()
{
LLUI::getInstance()->mHelpImpl->showTopic(HELP_LSL_PORTAL_TOPIC);
}
void LLScriptEdCore::onBtnDynamicHelp()
{
LLFloater* live_help_floater = mLiveHelpHandle.get();

View File

@ -144,7 +144,6 @@ public:
void setItemRemoved(bool script_removed){mScriptRemoved = script_removed;};
private:
void onBtnHelp();
void onBtnDynamicHelp();
void onBtnUndoChanges();

View File

@ -401,7 +401,7 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success,
{
const U32 ext_length = 3;
std::string extension = self->mSaveFileName.substr( self->mSaveFileName.length() - ext_length);
LLStringUtil::toLower(extension);
// We only support saving in PNG or TGA format
LLPointer<LLImageFormatted> image;
if(extension == "png")

View File

@ -431,9 +431,10 @@ void LLProgressView::initLogos()
// 108x41
icon_width = 74;
icon_height = default_height;
loadLogo(temp_str + "vivox_logo.png",
image_codec,
LLRect(texture_start_x, texture_start_y + default_height, texture_start_x + icon_width, texture_start_y),
LLRect(texture_start_x, texture_start_y + icon_height, texture_start_x + icon_width, texture_start_y),
default_clip,
default_clip);
}

View File

@ -526,8 +526,7 @@ void LLSceneMonitor::fetchQueryResult()
//dump results to a file _scene_xmonitor_results.csv
void LLSceneMonitor::dumpToFile(std::string file_name)
{ using namespace LLTrace;
{
if (!hasResults()) return;
LL_INFOS("SceneMonitor") << "Saving scene load stats to " << file_name << LL_ENDL;
@ -536,7 +535,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
os << std::setprecision(10);
PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults();
LLTrace::PeriodicRecording& scene_load_recording = mSceneLoadRecording.getResults();
const U32 frame_count = scene_load_recording.getNumRecordedPeriods();
F64Seconds frame_time;
@ -558,7 +557,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
os << '\n';
typedef StatType<CountAccumulator> trace_count;
typedef LLTrace::StatType<LLTrace::CountAccumulator> trace_count;
for (auto& it : trace_count::instance_snapshot())
{
std::ostringstream row;
@ -576,7 +575,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
for (S32 frame = 1; frame <= frame_count; frame++)
{
Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
LLTrace::Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
samples += recording.getSampleCount(it);
row << ", " << recording.getSum(it);
}
@ -589,7 +588,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
typedef StatType<EventAccumulator> trace_event;
typedef LLTrace::StatType<LLTrace::EventAccumulator> trace_event;
for (auto& it : trace_event::instance_snapshot())
{
@ -607,7 +606,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
for (S32 frame = 1; frame <= frame_count; frame++)
{
Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
LLTrace::Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
samples += recording.getSampleCount(it);
F64 mean = recording.getMean(it);
if (llisnan(mean))
@ -628,7 +627,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
typedef StatType<SampleAccumulator> trace_sample;
typedef LLTrace::StatType<LLTrace::SampleAccumulator> trace_sample;
for (auto& it : trace_sample::instance_snapshot())
{
@ -646,7 +645,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
for (S32 frame = 1; frame <= frame_count; frame++)
{
Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
LLTrace::Recording& recording = scene_load_recording.getPrevRecording(frame_count - frame);
samples += recording.getSampleCount(it);
F64 mean = recording.getMean(it);
if (llisnan(mean))
@ -667,7 +666,7 @@ void LLSceneMonitor::dumpToFile(std::string file_name)
}
}
typedef StatType<MemAccumulator> trace_mem;
typedef LLTrace::StatType<LLTrace::MemAccumulator> trace_mem;
for (auto& it : trace_mem::instance_snapshot())
{
os << it.getName() << "(KiB)";

View File

@ -140,6 +140,8 @@ BOOL LLSidepanelAppearance::postBuild()
setVisibleCallback(boost::bind(&LLSidepanelAppearance::onVisibilityChanged,this,_2));
setWearablesLoading(gAgentWearables.isCOFChangeInProgress());
return TRUE;
}

View File

@ -52,7 +52,8 @@ const S32 TEXTURE_CACHE_ENTRY_SIZE = FIRST_PACKET_SIZE;//1024;
const F32 TEXTURE_CACHE_PURGE_AMOUNT = .20f; // % amount to reduce the cache by when it exceeds its limit
const F32 TEXTURE_CACHE_LRU_SIZE = .10f; // % amount for LRU list (low overhead to regenerate)
const S32 TEXTURE_FAST_CACHE_ENTRY_OVERHEAD = sizeof(S32) * 4; //w, h, c, level
const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = 16 * 16 * 4 + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD;
const S32 TEXTURE_FAST_CACHE_DATA_SIZE = 16 * 16 * 4;
const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = TEXTURE_FAST_CACHE_DATA_SIZE + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD;
const F32 TEXTURE_LAZY_PURGE_TIME_LIMIT = .004f; // 4ms. Would be better to autoadjust, but there is a major cache rework in progress.
class LLTextureCacheWorker : public LLWorkerClass
@ -2068,7 +2069,9 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d
}
S32 image_size = head[0] * head[1] * head[2];
if(!image_size) //invalid
if(image_size <= 0
|| image_size > TEXTURE_FAST_CACHE_DATA_SIZE
|| head[3] < 0) //invalid
{
closeFastCache();
return NULL;
@ -2090,46 +2093,6 @@ LLPointer<LLImageRaw> LLTextureCache::readFromFastCache(const LLUUID& id, S32& d
return raw;
}
#if LL_WINDOWS
static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific
U32 exception_dupe_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop)
{
if (code == STATUS_MSC_EXCEPTION)
{
// C++ exception, go on
return EXCEPTION_CONTINUE_SEARCH;
}
else
{
// handle it
return EXCEPTION_EXECUTE_HANDLER;
}
}
//due to unwinding
void dupe(LLPointer<LLImageRaw> &raw)
{
raw = raw->duplicate();
}
void logExceptionDupplicate(LLPointer<LLImageRaw> &raw)
{
__try
{
dupe(raw);
}
__except (exception_dupe_filter(GetExceptionCode(), GetExceptionInformation()))
{
// convert to C++ styled exception
char integer_string[32];
sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode());
throw std::exception(integer_string);
}
}
#endif
//return the fast cache location
bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer<LLImageRaw> raw, S32 discardlevel)
{
@ -2146,8 +2109,9 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer<LLImage
c = raw->getComponents();
S32 i = 0 ;
while(((w >> i) * (h >> i) * c) > TEXTURE_FAST_CACHE_ENTRY_SIZE - TEXTURE_FAST_CACHE_ENTRY_OVERHEAD)
// Search for a discard level that will fit into fast cache
while(((w >> i) * (h >> i) * c) > TEXTURE_FAST_CACHE_DATA_SIZE)
{
++i ;
}
@ -2159,30 +2123,7 @@ bool LLTextureCache::writeToFastCache(LLUUID image_id, S32 id, LLPointer<LLImage
if(w * h *c > 0) //valid
{
// Make a duplicate to keep the original raw image untouched.
// Might be good idea to do a copy during writeToCache() call instead of here
try
{
#if LL_WINDOWS
// Temporary diagnostics for scale/duplicate crash
logExceptionDupplicate(raw);
#else
raw = raw->duplicate();
#endif
}
catch (...)
{
removeFromCache(image_id);
LL_ERRS() << "Failed to cache image: " << image_id
<< " local id: " << id
<< " Exception: " << boost::current_exception_diagnostic_information()
<< " Image new width: " << w
<< " Image new height: " << h
<< " Image new components: " << c
<< " Image discard difference: " << i
<< LL_ENDL;
return false;
}
raw = raw->duplicate();
if (raw->isBufferInvalid())
{

View File

@ -423,8 +423,8 @@ void LLAvatarTexBar::draw()
LLColor4 color;
U32 line_num = 1;
for (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
baked_iter != LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
for (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearance::getDictionary()->getBakedTextures().begin();
baked_iter != LLAvatarAppearance::getDictionary()->getBakedTextures().end();
++baked_iter)
{
const LLAvatarAppearanceDefines::EBakedTextureIndex baked_index = baked_iter->first;

Some files were not shown because too many files have changed in this diff Show More