summaryrefslogtreecommitdiff
path: root/indra/llappearance
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llappearance')
-rw-r--r--indra/llappearance/llavatarappearance.cpp1
-rw-r--r--indra/llappearance/llavatarappearancedefines.cpp7
-rw-r--r--indra/llappearance/llpolymorph.cpp8
-rw-r--r--indra/llappearance/llwearable.cpp17
4 files changed, 17 insertions, 16 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 95d55c835f..3d66809ed6 100644
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -799,7 +799,6 @@ void LLAvatarAppearance::buildCharacter()
bool status = loadAvatar();
stop_glerror();
-// gPrintMessagesThisFrame = true;
LL_DEBUGS() << "Avatar load took " << timer.getElapsedTimeF32() << " seconds." << LL_ENDL;
if (!status)
diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp
index 580e6433c5..47798844bc 100644
--- a/indra/llappearance/llavatarappearancedefines.cpp
+++ b/indra/llappearance/llavatarappearancedefines.cpp
@@ -28,8 +28,8 @@
#include "llavatarappearancedefines.h"
#include "indra_constants.h"
-const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 1024;
-const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 1024;
+const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_WIDTH = 2048;
+const S32 LLAvatarAppearanceDefines::SCRATCH_TEX_HEIGHT = 2048;
using namespace LLAvatarAppearanceDefines;
@@ -300,7 +300,8 @@ EBakedTextureIndex LLAvatarAppearanceDictionary::findBakedByImageName(std::strin
LLWearableType::EType LLAvatarAppearanceDictionary::getTEWearableType(ETextureIndex index ) const
{
- return getTexture(index)->mWearableType;
+ auto* tex = getTexture(index);
+ return tex ? tex->mWearableType : LLWearableType::WT_INVALID;
}
// static
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 8df8a9726f..5ee6649164 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -550,12 +550,12 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
mLastSex = avatar_sex;
- // Check for NaN condition (NaN is detected if a variable doesn't equal itself.
- if (mCurWeight != mCurWeight)
+ // Check for NaN condition
+ if (llisnan(mCurWeight))
{
- mCurWeight = 0.0;
+ mCurWeight = 0.f;
}
- if (mLastWeight != mLastWeight)
+ if (llisnan(mLastWeight))
{
mLastWeight = mCurWeight+.001f;
}
diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp
index a7e5292fed..4acb0ef3d4 100644
--- a/indra/llappearance/llwearable.cpp
+++ b/indra/llappearance/llwearable.cpp
@@ -645,27 +645,28 @@ void LLWearable::addVisualParam(LLVisualParam *param)
void LLWearable::setVisualParamWeight(S32 param_index, F32 value)
{
- if( is_in_map(mVisualParamIndexMap, param_index ) )
+ visual_param_index_map_t::iterator found = mVisualParamIndexMap.find(param_index);
+ if(found != mVisualParamIndexMap.end())
{
- LLVisualParam *wearable_param = mVisualParamIndexMap[param_index];
+ LLVisualParam *wearable_param = found->second;
wearable_param->setWeight(value);
}
else
{
- LL_ERRS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
+ LL_WARNS() << "LLWearable::setVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
}
F32 LLWearable::getVisualParamWeight(S32 param_index) const
{
- if( is_in_map(mVisualParamIndexMap, param_index ) )
+ visual_param_index_map_t::const_iterator found = mVisualParamIndexMap.find(param_index);
+ if(found != mVisualParamIndexMap.end())
{
- const LLVisualParam *wearable_param = mVisualParamIndexMap.find(param_index)->second;
- return wearable_param->getWeight();
+ return found->second->getWeight();
}
else
{
- LL_WARNS() << "LLWerable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
+ LL_WARNS() << "LLWearable::getVisualParam passed invalid parameter index: " << param_index << " for wearable type: " << this->getName() << LL_ENDL;
}
return (F32)-1.0;
}
@@ -726,7 +727,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
if (!avatarp) return;
// Pull params
- for( LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() )
+ for( const LLVisualParam* param = avatarp->getFirstVisualParam(); param; param = avatarp->getNextVisualParam() )
{
// cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the
// avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way.