Commit 665598a5 authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

Merge remote-tracking branch 'origin/master' into DRTVWR-517

parents 3ae6057e 21565a1f
......@@ -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>
......
......@@ -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
......
......@@ -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;
......
......@@ -156,7 +156,7 @@ class LLAvatarAppearance : public LLCharacter
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 @@ class LLAvatarAppearance : public LLCharacter
// 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 @@ class LLAvatarAppearance : public LLCharacter
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 @@ class LLAvatarAppearance : public LLCharacter
polymesh_map_t mPolyMeshes;
avatar_joint_list_t mMeshLOD;
// mesh entries and backed textures
static LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary* sAvatarDictionary;
/** Meshes
** **
*******************************************************************************/
......
......@@ -257,19 +257,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
......@@ -281,16 +279,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
......@@ -303,10 +300,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
......
......@@ -142,13 +142,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();
......@@ -234,14 +235,14 @@ class LLAvatarAppearanceDictionary : public LLSingleton<LLAvatarAppearanceDictio
//--------------------------------------------------------------------
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);
......
......@@ -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
......
......@@ -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;
......
......@@ -339,7 +339,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);
}
......@@ -349,7 +349,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++)
{
......
......@@ -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;
......
......@@ -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;
}
//---------------------------------------------------------------------------
......
......@@ -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;
};
//============================================================================
......
......@@ -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;
}
......
......@@ -244,7 +244,7 @@ class LLInventoryCategory : public LLInventoryObject
LLInventoryCategory(const LLInventoryCategory* other);
void copyCategory(const LLInventoryCategory* other); // LLRefCount requires custom copy
protected:
~LLInventoryCategory();
virtual ~LLInventoryCategory();
//--------------------------------------------------------------------
// Accessors And Mutators
......
......@@ -5241,9 +5241,9 @@ class LLVCacheLRU
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)
{
......
......@@ -285,12 +285,27 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName&
return;
}
bool updated_account = true; // assume obsolete value for new arrivals by default