summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.h
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-07-31 17:35:42 +0100
committerGraham Linden <graham@lindenlab.com>2018-07-31 17:35:42 +0100
commitd748dbce457dabf6bc46eb22c5c5315f50af159c (patch)
tree804a416cf30511e82f12171370bd4da46a64213b /indra/newview/llpanelface.h
parent60d256e80f019e77afef941bc02eb65be6f9bc6d (diff)
MAINT-8909
Loosen precision when checking rotation and other false negatives when comparing faces to see if they can be considered planar aligned. This was causing fields to be marked tentative (grayed display) incorrectly.
Diffstat (limited to 'indra/newview/llpanelface.h')
-rw-r--r--indra/newview/llpanelface.h70
1 files changed, 35 insertions, 35 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index c6f4c2f826..17850dbc77 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -334,7 +334,7 @@ private:
typename DataType,
typename ReturnType,
ReturnType (LLMaterial::* const MaterialGetFunc)() const >
- static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value)
+ static void getTEMaterialValue(DataType& data_to_return, bool& identical,DataType default_value, bool has_tolerance = HasTolerance, DataType tolerance = DataType())
{
DataType data_value;
struct GetTEMaterialVal : public LLSelectedTEGetFunctor<DataType>
@@ -359,7 +359,7 @@ private:
}
DataType _default;
} GetFunc(default_value);
- identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetFunc, data_value);
+ identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetFunc, data_value, has_tolerance, tolerance);
data_to_return = data_value;
}
@@ -367,7 +367,7 @@ private:
typename DataType,
typename ReturnType, // some kids just have to different...
ReturnType (LLTextureEntry::* const TEGetFunc)() const >
- static void getTEValue(DataType& data_to_return, bool& identical, DataType default_value)
+ static void getTEValue(DataType& data_to_return, bool& identical, DataType default_value, bool has_tolerance = false, DataType tolerance = DataType())
{
DataType data_value;
struct GetTEVal : public LLSelectedTEGetFunctor<DataType>
@@ -381,7 +381,7 @@ private:
}
DataType _default;
} GetTEValFunc(default_value);
- identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetTEValFunc, data_value );
+ identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &GetTEValFunc, data_value, has_tolerance, tolerance );
data_to_return = data_value;
}
@@ -429,10 +429,10 @@ public:
// Accessors for selected TE material state
//
- #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue) \
- static void MaterialMemberFunc(DataType& data, bool& identical) \
- { \
- getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical,DefaultValue); \
+ #define DEF_GET_MAT_STATE(DataType,ReturnType,MaterialMemberFunc,DefaultValue,HasTolerance,Tolerance) \
+ static void MaterialMemberFunc(DataType& data, bool& identical, bool has_tolerance = HasTolerance, DataType tolerance = Tolerance) \
+ { \
+ getTEMaterialValue< DataType, ReturnType, &LLMaterial::MaterialMemberFunc >(data, identical, DefaultValue, has_tolerance, tolerance); \
}
// Mutators for selected TE material
@@ -445,10 +445,10 @@ public:
// Accessors for selected TE state proper (legacy settings etc)
//
- #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue) \
- static void TexEntryMemberFunc(DataType& data, bool& identical) \
- { \
- getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical,DefaultValue); \
+ #define DEF_GET_TE_STATE(DataType,ReturnType,TexEntryMemberFunc,DefaultValue,HasTolerance,Tolerance) \
+ static void TexEntryMemberFunc(DataType& data, bool& identical, bool has_tolerance = HasTolerance, DataType tolerance = Tolerance) \
+ { \
+ getTEValue< DataType, ReturnType, &LLTextureEntry::TexEntryMemberFunc >(data, identical, DefaultValue, has_tolerance, tolerance); \
}
class LLSelectedTEMaterial
@@ -459,19 +459,19 @@ public:
static void getMaxNormalRepeats(F32& repeats, bool& identical);
static void getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical, bool diffuse_texture_has_alpha);
- DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null)
- DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f)
- DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f)
+ DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getNormalID,LLUUID::null, false, LLUUID::null)
+ DEF_GET_MAT_STATE(LLUUID,const LLUUID&,getSpecularID,LLUUID::null, false, LLUUID::null)
+ DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatX,1.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getSpecularRepeatY,1.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetX,0.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getSpecularOffsetY,0.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getSpecularRotation,0.0f, true, 0.001f)
- DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f)
- DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f)
- DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f)
- DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f)
- DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f)
+ DEF_GET_MAT_STATE(F32,F32,getNormalRepeatX,1.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getNormalRepeatY,1.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getNormalOffsetX,0.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getNormalOffsetY,0.0f, true, 0.001f)
+ DEF_GET_MAT_STATE(F32,F32,getNormalRotation,0.0f, true, 0.001f)
DEF_EDIT_MAT_STATE(U8,U8,setDiffuseAlphaMode);
DEF_EDIT_MAT_STATE(U8,U8,setAlphaMaskCutoff);
@@ -507,17 +507,17 @@ public:
static void getObjectScaleT(F32& scale_t, bool& identical);
static void getMaxDiffuseRepeats(F32& repeats, bool& identical);
- DEF_GET_TE_STATE(U8,U8,getBumpmap,0)
- DEF_GET_TE_STATE(U8,U8,getShiny,0)
- DEF_GET_TE_STATE(U8,U8,getFullbright,0)
- DEF_GET_TE_STATE(F32,F32,getRotation,0.0f)
- DEF_GET_TE_STATE(F32,F32,getOffsetS,0.0f)
- DEF_GET_TE_STATE(F32,F32,getOffsetT,0.0f)
- DEF_GET_TE_STATE(F32,F32,getScaleS,1.0f)
- DEF_GET_TE_STATE(F32,F32,getScaleT,1.0f)
- DEF_GET_TE_STATE(F32,F32,getGlow,0.0f)
- DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT)
- DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white)
+ DEF_GET_TE_STATE(U8,U8,getBumpmap,0, false, 0)
+ DEF_GET_TE_STATE(U8,U8,getShiny,0, false, 0)
+ DEF_GET_TE_STATE(U8,U8,getFullbright,0, false, 0)
+ DEF_GET_TE_STATE(F32,F32,getRotation,0.0f, true, 0.001f)
+ DEF_GET_TE_STATE(F32,F32,getOffsetS,0.0f, true, 0.001f)
+ DEF_GET_TE_STATE(F32,F32,getOffsetT,0.0f, true, 0.001f)
+ DEF_GET_TE_STATE(F32,F32,getScaleS,1.0f, true, 0.001f)
+ DEF_GET_TE_STATE(F32,F32,getScaleT,1.0f, true, 0.001f)
+ DEF_GET_TE_STATE(F32,F32,getGlow,0.0f, true, 0.001f)
+ DEF_GET_TE_STATE(LLTextureEntry::e_texgen,LLTextureEntry::e_texgen,getTexGen,LLTextureEntry::TEX_GEN_DEFAULT, false, LLTextureEntry::TEX_GEN_DEFAULT)
+ DEF_GET_TE_STATE(LLColor4,const LLColor4&,getColor,LLColor4::white, false, LLColor4::black);
};
};