Merge.
This commit is contained in:
@@ -53,8 +53,6 @@
|
||||
#pragma warning (disable:4702)
|
||||
#endif
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
using namespace LLAvatarAppearanceDefines;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -212,8 +210,9 @@ void LLAvatarAppearance::initInstance()
|
||||
mRoot = createAvatarJoint();
|
||||
mRoot->setName( "mRoot" );
|
||||
|
||||
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().begin();
|
||||
iter != LLAvatarAppearanceDictionary::getInstance()->getMeshEntries().end();
|
||||
const auto& mesh_entries = LLAvatarAppearanceDictionary::getInstance()->getMeshEntries();
|
||||
for (LLAvatarAppearanceDictionary::MeshEntries::const_iterator iter = mesh_entries.begin();
|
||||
iter != mesh_entries.end();
|
||||
++iter)
|
||||
{
|
||||
const EMeshIndex mesh_index = iter->first;
|
||||
@@ -230,7 +229,7 @@ void LLAvatarAppearance::initInstance()
|
||||
for (U32 lod = 0; lod < mesh_dict->mLOD; lod++)
|
||||
{
|
||||
LLAvatarJointMesh* mesh = createAvatarJointMesh();
|
||||
std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod);
|
||||
std::string mesh_name = "m" + mesh_dict->mName + std::to_string(lod);
|
||||
// We pre-pended an m - need to capitalize first character for camelCase
|
||||
mesh_name[1] = toupper(mesh_name[1]);
|
||||
mesh->setName(mesh_name);
|
||||
@@ -258,8 +257,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 = mesh_entries.begin();
|
||||
iter != mesh_entries.end();
|
||||
++iter)
|
||||
{
|
||||
const EMeshIndex mesh_index = iter->first;
|
||||
@@ -298,7 +297,7 @@ LLAvatarAppearance::~LLAvatarAppearance()
|
||||
mBakedTextureDatas[i].mJointMeshes.clear();
|
||||
|
||||
for (morph_list_t::iterator iter2 = mBakedTextureDatas[i].mMaskedMorphs.begin();
|
||||
iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); iter2++)
|
||||
iter2 != mBakedTextureDatas[i].mMaskedMorphs.end(); ++iter2)
|
||||
{
|
||||
LLMaskedMorph* masked_morph = (*iter2);
|
||||
delete masked_morph;
|
||||
@@ -383,8 +382,6 @@ void LLAvatarAppearance::initClass(const std::string& avatar_file_name_arg, cons
|
||||
root->getFastAttributeS32( wearable_definition_version_string, wearable_def_version );
|
||||
LLWearable::setCurrentDefinitionVersion( wearable_def_version );
|
||||
|
||||
std::string mesh_file_name;
|
||||
|
||||
LLXmlTreeNode* skeleton_node = root->getChildByName( "skeleton" );
|
||||
if (!skeleton_node)
|
||||
{
|
||||
@@ -573,7 +570,8 @@ void LLAvatarAppearance::computeBodySize()
|
||||
{
|
||||
mBodySize = new_body_size;
|
||||
|
||||
compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState);
|
||||
compareJointStateMaps(mLastBodySizeState, mCurrBodySizeState);
|
||||
bodySizeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -927,11 +925,11 @@ void LLAvatarAppearance::buildCharacter()
|
||||
//-----------------------------------------------------------------------------
|
||||
// loadAvatar()
|
||||
//-----------------------------------------------------------------------------
|
||||
//static LLFastTimer::DeclareTimer FTM_LOAD_AVATAR("Load Avatar");
|
||||
//static LLTrace::BlockTimerStatHandle FTM_LOAD_AVATAR("Load Avatar");
|
||||
|
||||
BOOL LLAvatarAppearance::loadAvatar()
|
||||
{
|
||||
// LLFastTimer t(FTM_LOAD_AVATAR);
|
||||
// LL_RECORD_BLOCK_TIME(FTM_LOAD_AVATAR);
|
||||
|
||||
// avatar_skeleton.xml
|
||||
if( !buildSkeleton(sAvatarSkeletonInfo) )
|
||||
@@ -1047,7 +1045,7 @@ BOOL LLAvatarAppearance::loadAvatar()
|
||||
addVisualParam( driver_param );
|
||||
driver_param->setParamLocation(isSelf() ? LOC_AV_SELF : LOC_AV_OTHER);
|
||||
LLVisualParam*(LLAvatarAppearance::*avatar_function)(S32)const = &LLAvatarAppearance::getVisualParam;
|
||||
if( !driver_param->linkDrivenParams(boost::bind(avatar_function,(LLAvatarAppearance*)this,_1 ), false))
|
||||
if( !driver_param->linkDrivenParams(std::bind(avatar_function,(LLAvatarAppearance*)this, std::placeholders::_1 ), false))
|
||||
{
|
||||
LL_WARNS() << "could not link driven params for avatar " << getID().asString() << " param id: " << driver_param->getID() << LL_ENDL;
|
||||
continue;
|
||||
@@ -1222,7 +1220,7 @@ BOOL LLAvatarAppearance::loadMeshNodes()
|
||||
}
|
||||
|
||||
// Multimap insert
|
||||
mPolyMeshes.insert(std::make_pair(info->mMeshFileName, poly_mesh));
|
||||
mPolyMeshes.emplace(info->mMeshFileName, poly_mesh);
|
||||
|
||||
mesh->setMesh( poly_mesh );
|
||||
mesh->setLOD( info->mMinPixelArea );
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "llviewervisualparam.h"
|
||||
#include "llxmltree.h"
|
||||
|
||||
#include <boost/container/flat_map.hpp> // <alchemy/>
|
||||
class LLTexLayerSet;
|
||||
class LLTexGlobalColor;
|
||||
class LLTexGlobalColorInfo;
|
||||
@@ -141,7 +142,7 @@ public:
|
||||
LLVector3 mHeadOffset; // current head position
|
||||
LLAvatarJoint *mRoot;
|
||||
|
||||
typedef std::vector<std::pair<char[64], LLJoint*>> joint_map_t;
|
||||
typedef std::vector<std::pair<char[64], LLJoint*> > joint_map_t;
|
||||
joint_map_t mJointMap;
|
||||
|
||||
typedef std::map<std::string, LLVector3> joint_state_map_t;
|
||||
@@ -162,6 +163,7 @@ protected:
|
||||
static BOOL parseSkeletonFile(const std::string& filename);
|
||||
virtual void buildCharacter();
|
||||
virtual BOOL loadAvatar();
|
||||
virtual void bodySizeChanged() = 0;
|
||||
|
||||
BOOL setupBone(const LLAvatarBoneInfo* info, LLJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
BOOL allocateCharacterJoints(U32 num);
|
||||
|
||||
@@ -140,7 +140,7 @@ LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary()
|
||||
// map it to the baked texture.
|
||||
void LLAvatarAppearanceDictionary::createAssociations()
|
||||
{
|
||||
for (BakedTextures::const_iterator iter = mBakedTextures.begin(); iter != mBakedTextures.end(); iter++)
|
||||
for (BakedTextures::const_iterator iter = mBakedTextures.begin(); iter != mBakedTextures.end(); ++iter)
|
||||
{
|
||||
const EBakedTextureIndex baked_index = (iter->first);
|
||||
const BakedEntry *dict = (iter->second);
|
||||
@@ -149,7 +149,7 @@ void LLAvatarAppearanceDictionary::createAssociations()
|
||||
// with this baked texture index.
|
||||
for (texture_vec_t::const_iterator local_texture_iter = dict->mLocalTextures.begin();
|
||||
local_texture_iter != dict->mLocalTextures.end();
|
||||
local_texture_iter++)
|
||||
++local_texture_iter)
|
||||
{
|
||||
const ETextureIndex local_texture_index = (ETextureIndex) *local_texture_iter;
|
||||
mTextures[local_texture_index]->mIsUsedByBakedTexture = true;
|
||||
@@ -222,7 +222,7 @@ ETextureIndex LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(EBakedTextu
|
||||
}
|
||||
|
||||
// static
|
||||
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::string name)
|
||||
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(const std::string& name)
|
||||
{
|
||||
U8 index = 0;
|
||||
while (index < BAKED_NUM_INDICES)
|
||||
@@ -240,7 +240,7 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByRegionName(std::stri
|
||||
}
|
||||
|
||||
// static
|
||||
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::string name)
|
||||
EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(const std::string& name)
|
||||
{
|
||||
U8 index = 0;
|
||||
while (index < BAKED_NUM_INDICES)
|
||||
|
||||
@@ -218,8 +218,8 @@ public:
|
||||
static ETextureIndex bakedToLocalTextureIndex(EBakedTextureIndex t);
|
||||
|
||||
// find a baked texture index based on its name
|
||||
static EBakedTextureIndex findBakedByRegionName(std::string name);
|
||||
static EBakedTextureIndex findBakedByImageName(std::string name);
|
||||
static EBakedTextureIndex findBakedByRegionName(const std::string& name);
|
||||
static EBakedTextureIndex findBakedByImageName(const std::string& name);
|
||||
|
||||
// Given a texture entry, determine which wearable type owns it.
|
||||
static LLWearableType::EType getTEWearableType(ETextureIndex index);
|
||||
|
||||
@@ -189,26 +189,26 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate)
|
||||
iter != mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||
if (!joint)
|
||||
continue;
|
||||
if (joint)
|
||||
{
|
||||
F32 jointLOD = joint->getLOD();
|
||||
|
||||
F32 jointLOD = joint->getLOD();
|
||||
|
||||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||
{
|
||||
// we've already found a joint to enable, so enable the rest as alternatives
|
||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pixel_area >= jointLOD || sDisableLOD)
|
||||
if (found_lod || jointLOD == DEFAULT_AVATAR_JOINT_LOD)
|
||||
{
|
||||
// we've already found a joint to enable, so enable the rest as alternatives
|
||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
||||
found_lod = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
lod_changed |= joint->updateLOD(pixel_area, FALSE);
|
||||
if (pixel_area >= jointLOD || sDisableLOD)
|
||||
{
|
||||
lod_changed |= joint->updateLOD(pixel_area, TRUE);
|
||||
found_lod = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
lod_changed |= joint->updateLOD(pixel_area, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void LLAvatarJoint::setMeshesToChildren()
|
||||
{
|
||||
removeAllChildren();
|
||||
for (avatar_joint_mesh_list_t::iterator iter = mMeshParts.begin();
|
||||
iter != mMeshParts.end(); iter++)
|
||||
iter != mMeshParts.end(); ++iter)
|
||||
{
|
||||
addChild((*iter));
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
LLViewerVisualParamInfo::toStream(out);
|
||||
out << "driver" << "\t";
|
||||
out << mDrivenInfoList.size() << "\t";
|
||||
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
|
||||
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); ++iter)
|
||||
{
|
||||
LLDrivenEntryInfo driven = *iter;
|
||||
out << driven.mDrivenID << "\t";
|
||||
@@ -118,14 +118,18 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
// used anywhere, so it's not an urgent problem.
|
||||
LL_WARNS_ONCE() << "Invalid usage of mDriverParam." << LL_ENDL;
|
||||
|
||||
if(mDriverParam && mDriverParam->getAvatarAppearance()->isSelf() &&
|
||||
mDriverParam->getAvatarAppearance()->isValid())
|
||||
if (!mDriverParam)
|
||||
return;
|
||||
const auto& avatar_appearance = mDriverParam->getAvatarAppearance();
|
||||
|
||||
if(avatar_appearance->isSelf() &&
|
||||
avatar_appearance->isValid())
|
||||
{
|
||||
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); iter++)
|
||||
for (entry_info_list_t::iterator iter = mDrivenInfoList.begin(); iter != mDrivenInfoList.end(); ++iter)
|
||||
{
|
||||
LLDrivenEntryInfo driven = *iter;
|
||||
LLViewerVisualParam *param =
|
||||
(LLViewerVisualParam*)mDriverParam->getAvatarAppearance()->getVisualParam(driven.mDrivenID);
|
||||
(LLViewerVisualParam*) avatar_appearance->getVisualParam(driven.mDrivenID);
|
||||
if (param)
|
||||
{
|
||||
param->getInfo()->toStream(out);
|
||||
@@ -148,7 +152,7 @@ void LLDriverParamInfo::toStream(std::ostream &out)
|
||||
else
|
||||
{
|
||||
LL_WARNS() << "could not get parameter " << driven.mDrivenID << " from avatar "
|
||||
<< mDriverParam->getAvatarAppearance()
|
||||
<< avatar_appearance
|
||||
<< " for driver parameter " << getID() << LL_ENDL;
|
||||
}
|
||||
out << std::endl;
|
||||
@@ -232,7 +236,7 @@ void LLDriverParam::setWeight(F32 weight, bool upload_bake)
|
||||
//-------|----|-------|----|-------> driver
|
||||
// | min1 max1 max2 min2
|
||||
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
LLDrivenEntryInfo* info = driven->mInfo;
|
||||
@@ -305,7 +309,7 @@ void LLDriverParam::setWeight(F32 weight, bool upload_bake)
|
||||
F32 LLDriverParam::getTotalDistortion()
|
||||
{
|
||||
F32 sum = 0.f;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum += driven->mParam->getTotalDistortion();
|
||||
@@ -320,7 +324,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion()
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
S32 count = 0;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum.add(driven->mParam->getAvgDistortion());
|
||||
@@ -335,7 +339,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion()
|
||||
F32 LLDriverParam::getMaxDistortion()
|
||||
{
|
||||
F32 max = 0.f;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
F32 param_max = driven->mParam->getMaxDistortion();
|
||||
@@ -353,7 +357,7 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
|
||||
{
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum.add(driven->mParam->getVertexDistortion( index, poly_mesh ));
|
||||
@@ -365,7 +369,7 @@ const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **pol
|
||||
{
|
||||
mCurrentDistortionParam = NULL;
|
||||
const LLVector4a* v = NULL;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
v = driven->mParam->getFirstDistortion( index, poly_mesh );
|
||||
@@ -391,7 +395,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly
|
||||
entry_list_t::iterator iter;
|
||||
|
||||
// Set mDriven iteration to the right point
|
||||
for( iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
driven = &(*iter);
|
||||
if( driven->mParam == mCurrentDistortionParam )
|
||||
@@ -412,7 +416,7 @@ const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly
|
||||
{
|
||||
// This param is finished, so start the next param. It might not have any
|
||||
// distortions, though, so we have to loop to find the next param that does.
|
||||
for( iter++; iter != mDriven.end(); iter++ )
|
||||
for( ++iter; iter != mDriven.end(); ++iter )
|
||||
{
|
||||
driven = &(*iter);
|
||||
v = driven->mParam->getFirstDistortion( index, poly_mesh );
|
||||
@@ -448,7 +452,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value, bool upload_bake )
|
||||
{
|
||||
LLVisualParam::setAnimationTarget(target_value, upload_bake);
|
||||
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
F32 driven_weight = getDrivenWeight(driven, mTargetWeight);
|
||||
@@ -466,7 +470,7 @@ void LLDriverParam::stopAnimating(bool upload_bake)
|
||||
{
|
||||
LLVisualParam::stopAnimating(upload_bake);
|
||||
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
driven->mParam->setAnimating(FALSE);
|
||||
@@ -523,7 +527,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type)
|
||||
bool needs_update = (getWearableType()==driven_type);
|
||||
|
||||
// if the driver has a driven entry for the passed-in wearable type, we need to refresh the value
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); ++iter )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
if (driven && driven->mParam && driven->mParam->getCrossWearable() && driven->mParam->getWearableType() == driven_type)
|
||||
|
||||
@@ -76,6 +76,7 @@ LLLocalTextureObject::LLLocalTextureObject(const LLLocalTextureObject& lto) :
|
||||
|
||||
LLLocalTextureObject::~LLLocalTextureObject()
|
||||
{
|
||||
delete_and_clear(mTexLayers);
|
||||
}
|
||||
|
||||
LLGLTexture* LLLocalTextureObject::getImage() const
|
||||
@@ -95,7 +96,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const
|
||||
|
||||
LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name)
|
||||
{
|
||||
for( tex_layer_vec_t::iterator iter = mTexLayers.begin(); iter != mTexLayers.end(); iter++)
|
||||
for( tex_layer_vec_t::iterator iter = mTexLayers.begin(); iter != mTexLayers.end(); ++iter)
|
||||
{
|
||||
LLTexLayer *layer = *iter;
|
||||
if (layer->getName().compare(name) == 0)
|
||||
@@ -196,7 +197,7 @@ BOOL LLLocalTextureObject::removeTexLayer(U32 index)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLLocalTextureObject::setID(LLUUID new_id)
|
||||
void LLLocalTextureObject::setID(const LLUUID& new_id)
|
||||
{
|
||||
mID = new_id;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
BOOL addTexLayer(LLTexLayerTemplate *new_tex_layer, LLWearable *wearable);
|
||||
BOOL removeTexLayer(U32 index);
|
||||
|
||||
void setID(LLUUID new_id);
|
||||
void setID(const LLUUID& new_id);
|
||||
void setDiscard(S32 new_discard);
|
||||
void setBakedReady(BOOL ready);
|
||||
|
||||
|
||||
@@ -307,7 +307,11 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
//----------------------------------------------------------------
|
||||
// File Header (seek past it)
|
||||
//----------------------------------------------------------------
|
||||
fseek(fp, 24, SEEK_SET);
|
||||
if (fseek(fp, 24, SEEK_SET) != 0)
|
||||
{
|
||||
LL_ERRS() << "can't seek past header from " << fileName << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// HasWeights
|
||||
@@ -605,7 +609,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
//-------------------------------------------------------------------------
|
||||
char morphName[64+1];
|
||||
morphName[sizeof(morphName)-1] = '\0'; // ensure nul-termination
|
||||
while(fread(&morphName, sizeof(char), 64, fp) == 64)
|
||||
while(fread(morphName, sizeof(char), 64, fp) == 64)
|
||||
{
|
||||
if (!strcmp(morphName, "End Morphs"))
|
||||
{
|
||||
@@ -629,10 +633,6 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
mMorphData.insert(clone_morph_param_cleavage(morph_data,
|
||||
.75f,
|
||||
"Breast_Physics_LeftRight_Driven"));
|
||||
}
|
||||
|
||||
if (!strcmp(morphName, "Breast_Female_Cleavage"))
|
||||
{
|
||||
mMorphData.insert(clone_morph_param_duplicate(morph_data,
|
||||
"Breast_Physics_InOut_Driven"));
|
||||
}
|
||||
@@ -668,9 +668,6 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
|
||||
mMorphData.insert(clone_morph_param_direction(morph_data,
|
||||
LLVector3(0,0,0.05f),
|
||||
"Butt_Physics_UpDown_Driven"));
|
||||
}
|
||||
if (!strcmp(morphName, "Small_Butt"))
|
||||
{
|
||||
mMorphData.insert(clone_morph_param_direction(morph_data,
|
||||
LLVector3(0,0.03f,0),
|
||||
"Butt_Physics_LeftRight_Driven"));
|
||||
|
||||
@@ -109,7 +109,7 @@ LLPolyMorphData::~LLPolyMorphData()
|
||||
BOOL LLPolyMorphData::loadBinary(LLFILE *fp, LLPolyMeshSharedData *mesh)
|
||||
{
|
||||
S32 numVertices;
|
||||
S32 numRead;
|
||||
size_t numRead; // <alchemy/>
|
||||
|
||||
numRead = fread(&numVertices, sizeof(S32), 1, fp);
|
||||
llendianswizzle(&numVertices, sizeof(S32), 1);
|
||||
@@ -680,8 +680,8 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info)
|
||||
if (!mMorphData)
|
||||
{
|
||||
const std::string driven_tag = "_Driven";
|
||||
U32 pos = morph_param_name.find(driven_tag);
|
||||
if (pos > 0)
|
||||
size_t pos = morph_param_name.find(driven_tag);
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
morph_param_name = morph_param_name.substr(0,pos);
|
||||
mMorphData = mMesh->getMorphData(morph_param_name);
|
||||
@@ -835,7 +835,7 @@ F32 LLPolyMorphTarget::getMaxDistortion()
|
||||
//-----------------------------------------------------------------------------
|
||||
// apply()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_APPLY_MORPH_TARGET("Apply Morph");
|
||||
static LLTrace::BlockTimerStatHandle FTM_APPLY_MORPH_TARGET("Apply Morph");
|
||||
|
||||
void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
{
|
||||
@@ -844,7 +844,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
return;
|
||||
}
|
||||
|
||||
LLFastTimer t(FTM_APPLY_MORPH_TARGET);
|
||||
LL_RECORD_BLOCK_TIME(FTM_APPLY_MORPH_TARGET);
|
||||
|
||||
mLastSex = avatar_sex;
|
||||
|
||||
@@ -937,7 +937,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
|
||||
}
|
||||
|
||||
// now apply volume changes
|
||||
for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
|
||||
for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); ++iter )
|
||||
{
|
||||
LLPolyVolumeMorph* volume_morph = &(*iter);
|
||||
LLVector3 scale_delta = volume_morph->mScale * delta_weight;
|
||||
@@ -1030,7 +1030,7 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3
|
||||
void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight)
|
||||
{
|
||||
// now apply volume changes
|
||||
for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); iter++ )
|
||||
for( volume_list_t::iterator iter = mVolumeMorphs.begin(); iter != mVolumeMorphs.end(); ++iter )
|
||||
{
|
||||
LLPolyVolumeMorph* volume_morph = &(*iter);
|
||||
LLVector3 scale_delta = volume_morph->mScale * delta_weight;
|
||||
|
||||
@@ -141,54 +141,58 @@ LLPolySkeletalDistortion::~LLPolySkeletalDistortion()
|
||||
BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
{
|
||||
llassert(mInfo == NULL);
|
||||
if (info->mID < 0)
|
||||
return FALSE;
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
if (info->mID < 0)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
mInfo = info;
|
||||
mID = info->mID;
|
||||
setWeight(getDefaultWeight());
|
||||
|
||||
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
|
||||
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); iter++)
|
||||
LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter;
|
||||
for (iter = getInfo()->mBoneInfoList.begin(); iter != getInfo()->mBoneInfoList.end(); ++iter)
|
||||
{
|
||||
LLPolySkeletalBoneInfo *bone_info = &(*iter);
|
||||
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
|
||||
if (!joint)
|
||||
{
|
||||
LLPolySkeletalBoneInfo *bone_info = &(*iter);
|
||||
LLJoint* joint = mAvatar->getJoint(bone_info->mBoneName);
|
||||
if (!joint)
|
||||
{
|
||||
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (mJointScales.find(joint) != mJointScales.end())
|
||||
{
|
||||
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
|
||||
// store it
|
||||
mJointScales[joint] = bone_info->mScaleDeformation;
|
||||
|
||||
// apply to children that need to inherit it
|
||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
||||
iter != joint->mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||
if (child_joint && child_joint->inheritScale())
|
||||
{
|
||||
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
||||
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
||||
mJointScales[child_joint] = childDeformation;
|
||||
}
|
||||
}
|
||||
|
||||
if (bone_info->mHasPositionDeformation)
|
||||
{
|
||||
if (mJointOffsets.find(joint) != mJointOffsets.end())
|
||||
{
|
||||
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
mJointOffsets[joint] = bone_info->mPositionDeformation;
|
||||
}
|
||||
// There's no point continuing after this error - means
|
||||
// that either the skeleton or lad file is broken.
|
||||
LL_WARNS() << "Joint " << bone_info->mBoneName << " not found." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
if (mJointScales.find(joint) != mJointScales.end())
|
||||
{
|
||||
LL_WARNS() << "Scale deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
|
||||
// store it
|
||||
mJointScales[joint] = bone_info->mScaleDeformation;
|
||||
|
||||
// apply to children that need to inherit it
|
||||
for (LLJoint::child_list_t::iterator iter = joint->mChildren.begin();
|
||||
iter != joint->mChildren.end(); ++iter)
|
||||
{
|
||||
LLAvatarJoint* child_joint = dynamic_cast<LLAvatarJoint*>(*iter);
|
||||
if (child_joint && child_joint->inheritScale())
|
||||
{
|
||||
LLVector3 childDeformation = LLVector3(child_joint->getScale());
|
||||
childDeformation.scaleVec(bone_info->mScaleDeformation);
|
||||
mJointScales[child_joint] = childDeformation;
|
||||
}
|
||||
}
|
||||
|
||||
if (bone_info->mHasPositionDeformation)
|
||||
{
|
||||
if (mJointOffsets.find(joint) != mJointOffsets.end())
|
||||
{
|
||||
LL_WARNS() << "Offset deformation already supplied for joint " << joint->getName() << "." << LL_ENDL;
|
||||
}
|
||||
mJointOffsets[joint] = bone_info->mPositionDeformation;
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*virtual*/ LLViewerVisualParam* LLPolySkeletalDistortion::cloneParam(LLWearable* wearable) const
|
||||
@@ -199,11 +203,11 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info)
|
||||
//-----------------------------------------------------------------------------
|
||||
// apply()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
|
||||
static LLTrace::BlockTimerStatHandle FTM_POLYSKELETAL_DISTORTION_APPLY("Skeletal Distortion");
|
||||
|
||||
void LLPolySkeletalDistortion::apply( ESex avatar_sex )
|
||||
{
|
||||
LLFastTimer t(FTM_POLYSKELETAL_DISTORTION_APPLY);
|
||||
LL_RECORD_BLOCK_TIME(FTM_POLYSKELETAL_DISTORTION_APPLY);
|
||||
|
||||
F32 effective_weight = ( getSex() & avatar_sex ) ? mCurWeight : getDefaultWeight();
|
||||
|
||||
@@ -212,7 +216,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
|
||||
|
||||
for (iter = mJointScales.begin();
|
||||
iter != mJointScales.end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
joint = iter->first;
|
||||
LLVector3 newScale = joint->getScale();
|
||||
@@ -230,13 +234,13 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
|
||||
joint->setScale(newScale, true);
|
||||
}
|
||||
|
||||
for (iter = mJointOffsets.begin();
|
||||
iter != mJointOffsets.end();
|
||||
iter++)
|
||||
{
|
||||
joint = iter->first;
|
||||
LLVector3 newPosition = joint->getPosition();
|
||||
LLVector3 positionDelta = iter->second;
|
||||
for (iter = mJointOffsets.begin();
|
||||
iter != mJointOffsets.end();
|
||||
++iter)
|
||||
{
|
||||
joint = iter->first;
|
||||
LLVector3 newPosition = joint->getPosition();
|
||||
LLVector3 positionDelta = iter->second;
|
||||
newPosition = newPosition + (effective_weight * positionDelta) - (mLastWeight * positionDelta);
|
||||
// SL-315
|
||||
bool allow_attachment_pos_overrides = true;
|
||||
|
||||
@@ -57,7 +57,7 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info)
|
||||
mParamGlobalColorList.reserve(mInfo->mParamColorInfoList.size());
|
||||
for (param_color_info_list_t::iterator iter = mInfo->mParamColorInfoList.begin();
|
||||
iter != mInfo->mParamColorInfoList.end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this);
|
||||
if (!param_color->setInfo(*iter, TRUE))
|
||||
|
||||
@@ -256,7 +256,7 @@ void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
//layer_info_list_t mLayerInfoList;
|
||||
for (layer_info_list_t::iterator layer_iter = mLayerInfoList.begin();
|
||||
layer_iter != mLayerInfoList.end();
|
||||
layer_iter++)
|
||||
++layer_iter)
|
||||
{
|
||||
LLTexLayerInfo *layer_info = *layer_iter;
|
||||
layer_info->createVisualParams(appearance);
|
||||
@@ -299,7 +299,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info)
|
||||
mLayerList.reserve(info->mLayerInfoList.size());
|
||||
for (LLTexLayerSetInfo::layer_info_list_t::const_iterator iter = info->mLayerInfoList.begin();
|
||||
iter != info->mLayerInfoList.end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
LLTexLayerInterface *layer = NULL;
|
||||
if ( (*iter)->isUserSettable() )
|
||||
@@ -358,12 +358,12 @@ BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node)
|
||||
|
||||
void LLTexLayerSet::deleteCaches()
|
||||
{
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
layer->deleteCaches();
|
||||
}
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++)
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); ++iter)
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
layer->deleteCaches();
|
||||
@@ -378,7 +378,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
|
||||
|
||||
if (mMaskLayerList.size() > 0)
|
||||
{
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++)
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); ++iter)
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
if (layer->isInvisibleAlphaMask())
|
||||
@@ -417,7 +417,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height )
|
||||
if (mIsVisible)
|
||||
{
|
||||
// composite color layers
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
if (layer->getRenderPass() == LLTexLayer::RP_COLOR)
|
||||
@@ -521,13 +521,13 @@ const LLTexLayerSetBuffer* LLTexLayerSet::getComposite() const
|
||||
return mComposite;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
|
||||
static LLTrace::BlockTimerStatHandle FTM_GATHER_MORPH_MASK_ALPHA("gatherMorphMaskAlpha");
|
||||
void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_GATHER_MORPH_MASK_ALPHA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_GATHER_MORPH_MASK_ALPHA);
|
||||
memset(data, 255, width * height);
|
||||
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
layer->gatherAlphaMasks(data, origin_x, origin_y, width, height);
|
||||
@@ -537,10 +537,10 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S
|
||||
renderAlphaMaskTextures(origin_x, origin_y, width, height, true);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
|
||||
static LLTrace::BlockTimerStatHandle FTM_RENDER_ALPHA_MASK_TEXTURES("renderAlphaMaskTextures");
|
||||
void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, bool forceClear)
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_ALPHA_MASK_TEXTURES);
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_ALPHA_MASK_TEXTURES);
|
||||
const LLTexLayerSetInfo *info = getInfo();
|
||||
|
||||
bool use_shaders = LLGLSLShader::sNoFixedFunction;
|
||||
@@ -591,7 +591,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height,
|
||||
{
|
||||
gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA);
|
||||
gGL.getTexUnit(0)->setTextureBlendType( LLTexUnit::TB_REPLACE );
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++)
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); ++iter)
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
gGL.flush();
|
||||
@@ -615,7 +615,7 @@ void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_
|
||||
|
||||
BOOL LLTexLayerSet::isMorphValid() const
|
||||
{
|
||||
for(layer_list_t::const_iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for(layer_list_t::const_iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
const LLTexLayerInterface* layer = *iter;
|
||||
if (layer && !layer->isMorphValid())
|
||||
@@ -628,7 +628,7 @@ BOOL LLTexLayerSet::isMorphValid() const
|
||||
|
||||
void LLTexLayerSet::invalidateMorphMasks()
|
||||
{
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
if (layer)
|
||||
@@ -727,7 +727,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node)
|
||||
mLocalTexture = TEX_NUM_INDICES;
|
||||
for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
|
||||
iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second;
|
||||
if (local_texture_name == texture_dict->mName)
|
||||
@@ -801,7 +801,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
BOOL success = TRUE;
|
||||
for (param_color_info_list_t::iterator color_info_iter = mParamColorInfoList.begin();
|
||||
color_info_iter != mParamColorInfoList.end();
|
||||
color_info_iter++)
|
||||
++color_info_iter)
|
||||
{
|
||||
LLTexLayerParamColorInfo * color_info = *color_info_iter;
|
||||
LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance);
|
||||
@@ -815,7 +815,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance)
|
||||
|
||||
for (param_alpha_info_list_t::iterator alpha_info_iter = mParamAlphaInfoList.begin();
|
||||
alpha_info_iter != mParamAlphaInfoList.end();
|
||||
alpha_info_iter++)
|
||||
++alpha_info_iter)
|
||||
{
|
||||
LLTexLayerParamAlphaInfo * alpha_info = *alpha_info_iter;
|
||||
LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance);
|
||||
@@ -862,7 +862,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||
mParamColorList.reserve(mInfo->mParamColorInfoList.size());
|
||||
for (param_color_info_list_t::const_iterator iter = mInfo->mParamColorInfoList.begin();
|
||||
iter != mInfo->mParamColorInfoList.end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
LLTexLayerParamColor* param_color;
|
||||
if (!wearable)
|
||||
@@ -889,7 +889,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab
|
||||
mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size());
|
||||
for (param_alpha_info_list_t::const_iterator iter = mInfo->mParamAlphaInfoList.begin();
|
||||
iter != mInfo->mParamAlphaInfoList.end();
|
||||
iter++)
|
||||
++iter)
|
||||
{
|
||||
LLTexLayerParamAlpha* param_alpha;
|
||||
if (!wearable)
|
||||
@@ -940,7 +940,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const
|
||||
param_color_list_t::const_iterator color_iter = mParamColorList.begin();
|
||||
param_alpha_list_t::const_iterator alpha_iter = mParamAlphaList.begin();
|
||||
|
||||
for (; color_iter != mParamColorList.end(); color_iter++)
|
||||
for (; color_iter != mParamColorList.end(); ++color_iter)
|
||||
{
|
||||
LLTexLayerParamColor* param = *color_iter;
|
||||
if (param)
|
||||
@@ -957,7 +957,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const
|
||||
}
|
||||
}
|
||||
|
||||
for (; alpha_iter != mParamAlphaList.end(); alpha_iter++)
|
||||
for (; alpha_iter != mParamAlphaList.end(); ++alpha_iter)
|
||||
{
|
||||
LLTexLayerParamAlpha* param = *alpha_iter;
|
||||
if (param)
|
||||
@@ -1059,7 +1059,7 @@ LLTexLayer::~LLTexLayer()
|
||||
//std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer());
|
||||
|
||||
for( alpha_cache_t::iterator iter = mAlphaCache.begin();
|
||||
iter != mAlphaCache.end(); iter++ )
|
||||
iter != mAlphaCache.end(); ++iter )
|
||||
{
|
||||
U8* alpha_data = iter->second;
|
||||
delete [] alpha_data;
|
||||
@@ -1086,7 +1086,7 @@ BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable )
|
||||
void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color)
|
||||
{
|
||||
for (param_color_list_t::const_iterator iter = param_list.begin();
|
||||
iter != param_list.end(); iter++)
|
||||
iter != param_list.end(); ++iter)
|
||||
{
|
||||
const LLTexLayerParamColor* param = *iter;
|
||||
LLColor4 param_net = param->getNetColor();
|
||||
@@ -1114,7 +1114,7 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL
|
||||
{
|
||||
// Only need to delete caches for alpha params. Color params don't hold extra memory
|
||||
for (param_alpha_list_t::iterator iter = mParamAlphaList.begin();
|
||||
iter != mParamAlphaList.end(); iter++ )
|
||||
iter != mParamAlphaList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerParamAlpha* param = *iter;
|
||||
param->deleteCaches();
|
||||
@@ -1309,7 +1309,7 @@ const U8* LLTexLayer::getAlphaData() const
|
||||
const LLUUID& uuid = getUUID();
|
||||
alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES);
|
||||
|
||||
for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++)
|
||||
for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); ++iter)
|
||||
{
|
||||
const LLTexLayerParamAlpha* param = *iter;
|
||||
// MULTI-WEARABLE: verify visual parameters used here
|
||||
@@ -1430,7 +1430,7 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height)
|
||||
addAlphaMask(data, originX, originY, width, height);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_MORPH_MASKS("renderMorphMasks");
|
||||
static LLTrace::BlockTimerStatHandle FTM_RENDER_MORPH_MASKS("renderMorphMasks");
|
||||
void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLColor4 &layer_color, bool force_render)
|
||||
{
|
||||
if (!force_render && !hasMorph())
|
||||
@@ -1438,7 +1438,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
LL_DEBUGS() << "skipping renderMorphMasks for " << getUUID() << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
LLFastTimer t(FTM_RENDER_MORPH_MASKS);
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_MORPH_MASKS);
|
||||
BOOL success = TRUE;
|
||||
|
||||
llassert( !mParamAlphaList.empty() );
|
||||
@@ -1470,7 +1470,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
// Accumulate alphas
|
||||
LLGLSNoAlphaTest gls_no_alpha_test;
|
||||
gGL.color4f( 1.f, 1.f, 1.f, 1.f );
|
||||
for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++)
|
||||
for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); ++iter)
|
||||
{
|
||||
LLTexLayerParamAlpha* param = *iter;
|
||||
success &= param->render( x, y, width, height );
|
||||
@@ -1549,7 +1549,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
const LLUUID& uuid = getUUID();
|
||||
alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES);
|
||||
|
||||
for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++)
|
||||
for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); ++iter)
|
||||
{
|
||||
const LLTexLayerParamAlpha* param = *iter;
|
||||
F32 param_weight = param->getWeight();
|
||||
@@ -1588,10 +1588,10 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
|
||||
}
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_ADD_ALPHA_MASK("addAlphaMask");
|
||||
static LLTrace::BlockTimerStatHandle FTM_ADD_ALPHA_MASK("addAlphaMask");
|
||||
void LLTexLayer::addAlphaMask(U8 *data, S32 originX, S32 originY, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_ADD_ALPHA_MASK);
|
||||
LL_RECORD_BLOCK_TIME(FTM_ADD_ALPHA_MASK);
|
||||
S32 size = width * height;
|
||||
const U8* alphaData = getAlphaData();
|
||||
if (!alphaData && hasAlphaParams())
|
||||
@@ -1744,7 +1744,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||
|
||||
BOOL success = TRUE;
|
||||
updateWearableCache();
|
||||
for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); iter++)
|
||||
for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); ++iter)
|
||||
{
|
||||
LLWearable* wearable = NULL;
|
||||
LLLocalTextureObject *lto = NULL;
|
||||
@@ -1846,7 +1846,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const
|
||||
//-----------------------------------------------------------------------------
|
||||
LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name)
|
||||
{
|
||||
for (layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for (layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
if (layer->getName() == name)
|
||||
@@ -1854,7 +1854,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name)
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ )
|
||||
for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerInterface* layer = *iter;
|
||||
if (layer->getName() == name)
|
||||
@@ -1868,7 +1868,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name)
|
||||
void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable)
|
||||
{
|
||||
// initialize all texlayers with this texture type for this LTO
|
||||
for( LLTexLayerSet::layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ )
|
||||
for( LLTexLayerSet::layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter;
|
||||
if (layer->getInfo()->getLocalTexture() == (S32) tex_index)
|
||||
@@ -1876,7 +1876,7 @@ void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearance
|
||||
lto->addTexLayer(layer, wearable);
|
||||
}
|
||||
}
|
||||
for( LLTexLayerSet::layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ )
|
||||
for( LLTexLayerSet::layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); ++iter )
|
||||
{
|
||||
LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter;
|
||||
if (layer->getInfo()->getLocalTexture() == (S32) tex_index)
|
||||
@@ -1932,10 +1932,10 @@ void LLTexLayerStaticImageList::deleteCachedImages()
|
||||
|
||||
// Returns an LLImageTGA that contains the encoded data from a tga file named file_name.
|
||||
// Caches the result to speed identical subsequent requests.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TGA("getImageTGA");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TGA("getImageTGA");
|
||||
LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_STATIC_TGA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TGA);
|
||||
const char *namekey = mImageNames.addString(file_name);
|
||||
image_tga_map_t::const_iterator iter = mStaticImageListTGA.find(namekey);
|
||||
if( iter != mStaticImageListTGA.end() )
|
||||
@@ -1962,10 +1962,10 @@ LLImageTGA* LLTexLayerStaticImageList::getImageTGA(const std::string& file_name)
|
||||
|
||||
// Returns a GL Image (without a backing ImageRaw) that contains the decoded data from a tga file named file_name.
|
||||
// Caches the result to speed identical subsequent requests.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_STATIC_TEXTURE("getTexture");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_STATIC_TEXTURE("getTexture");
|
||||
LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name, BOOL is_mask)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_STATIC_TEXTURE);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_STATIC_TEXTURE);
|
||||
LLPointer<LLGLTexture> tex;
|
||||
const char *namekey = mImageNames.addString(file_name);
|
||||
|
||||
@@ -2012,10 +2012,10 @@ LLGLTexture* LLTexLayerStaticImageList::getTexture(const std::string& file_name,
|
||||
|
||||
// Reads a .tga file, decodes it, and puts the decoded data in image_raw.
|
||||
// Returns TRUE if successful.
|
||||
static LLFastTimer::DeclareTimer FTM_LOAD_IMAGE_RAW("loadImageRaw");
|
||||
static LLTrace::BlockTimerStatHandle FTM_LOAD_IMAGE_RAW("loadImageRaw");
|
||||
BOOL LLTexLayerStaticImageList::loadImageRaw(const std::string& file_name, LLImageRaw* image_raw)
|
||||
{
|
||||
LLFastTimer t(FTM_LOAD_IMAGE_RAW);
|
||||
LL_RECORD_BLOCK_TIME(FTM_LOAD_IMAGE_RAW);
|
||||
BOOL success = FALSE;
|
||||
std::string path;
|
||||
path = gDirUtilp->getExpandedFilename(LL_PATH_CHARACTER,file_name);
|
||||
|
||||
@@ -103,7 +103,7 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes)
|
||||
*gl_bytes = 0;
|
||||
|
||||
for (param_alpha_ptr_list_t::iterator iter = sInstances.begin();
|
||||
iter != sInstances.end(); iter++)
|
||||
iter != sInstances.end(); ++iter)
|
||||
{
|
||||
LLTexLayerParamAlpha* instance = *iter;
|
||||
LLGLTexture* tex = instance->mCachedProcessedTexture;
|
||||
@@ -260,10 +260,10 @@ BOOL LLTexLayerParamAlpha::getSkip() const
|
||||
}
|
||||
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
|
||||
static LLTrace::BlockTimerStatHandle FTM_TEX_LAYER_PARAM_ALPHA("alpha render");
|
||||
BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height)
|
||||
{
|
||||
LLFastTimer t(FTM_TEX_LAYER_PARAM_ALPHA);
|
||||
LL_RECORD_BLOCK_TIME(FTM_TEX_LAYER_PARAM_ALPHA);
|
||||
BOOL success = TRUE;
|
||||
|
||||
if (!mTexLayer)
|
||||
|
||||
@@ -76,7 +76,7 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node)
|
||||
static LLStdStringHandle edit_group_string = LLXmlTree::addAttributeString("edit_group");
|
||||
if (!node->getFastAttributeString( edit_group_string, mEditGroup))
|
||||
{
|
||||
mEditGroup = "";
|
||||
mEditGroup.clear();
|
||||
}
|
||||
|
||||
static LLStdStringHandle cross_wearable_string = LLXmlTree::addAttributeString("cross_wearable");
|
||||
|
||||
@@ -169,9 +169,9 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp)
|
||||
// need this line to disambiguate between versions of LLCharacter::getVisualParam()
|
||||
LLVisualParam*(LLAvatarAppearance::*param_function)(S32)const = &LLAvatarAppearance::getVisualParam;
|
||||
param->resetDrivenParams();
|
||||
if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false))
|
||||
if (!param->linkDrivenParams(std::bind(wearable_function,(LLWearable*)this, std::placeholders::_1), false))
|
||||
{
|
||||
if( !param->linkDrivenParams(boost::bind(param_function,avatarp,_1 ), true))
|
||||
if (!param->linkDrivenParams(std::bind(param_function,avatarp, std::placeholders::_1 ), true))
|
||||
{
|
||||
LL_WARNS() << "could not link driven params for wearable " << getName() << " id: " << param->getID() << LL_ENDL;
|
||||
continue;
|
||||
|
||||
@@ -105,7 +105,7 @@ protected:
|
||||
|
||||
//Why this weird structure? LLWearableType::WT_COUNT small and known, therefore it's more efficient to make an array of vectors, indexed
|
||||
//by wearable type. This allows O(1) lookups. This structure simply lets us plug in this optimization without touching any code elsewhere.
|
||||
typedef boost::array<std::pair<LLWearableType::EType,wearableentry_vec_t>,LLWearableType::WT_COUNT> wearable_array_t;
|
||||
typedef std::array<std::pair<LLWearableType::EType, wearableentry_vec_t>, LLWearableType::WT_COUNT> wearable_array_t;
|
||||
struct wearableentry_map_t : public wearable_array_t
|
||||
{
|
||||
wearableentry_map_t()
|
||||
|
||||
Reference in New Issue
Block a user