summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llpanelface.cpp36
-rwxr-xr-xindra/newview/llpanelface.h7
2 files changed, 37 insertions, 6 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 4fd55e1cf2..5d5df01782 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -815,7 +815,7 @@ void LLPanelFace::updateUI()
// See if that's been overridden by a material setting for same...
//
- LLSelectedTEMaterial::getDiffuseAlphaMode(alpha_mode, identical_alpha_mode);
+ LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(alpha_mode, identical_alpha_mode, mIsAlpha);
LLCtrlSelectionInterface* combobox_alphamode = childGetSelectionInterface("combobox alphamode");
if (combobox_alphamode)
@@ -2288,6 +2288,38 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxNormalRepeats(F32& repeats, bool&
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &max_norm_repeats_func, repeats);
}
+void LLPanelFace::LLSelectedTEMaterial::getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical, bool diffuse_texture_has_alpha)
+{
+ struct LLSelectedTEGetDiffuseAlphaMode : public LLSelectedTEGetFunctor<U8>
+ {
+ LLSelectedTEGetDiffuseAlphaMode() : _isAlpha(false) {}
+ LLSelectedTEGetDiffuseAlphaMode(bool diffuse_texture_has_alpha) : _isAlpha(diffuse_texture_has_alpha) {}
+ virtual ~LLSelectedTEGetDiffuseAlphaMode() {}
+
+ U8 get(LLViewerObject* object, S32 face)
+ {
+ U8 diffuse_mode = _isAlpha ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+
+ LLTextureEntry* tep = object->getTE(face);
+ if (tep)
+ {
+ LLMaterial* mat = tep->getMaterialParams().get();
+ mat = (tep->getMaterialID().isNull() ? NULL : mat);
+ if (mat)
+ {
+ diffuse_mode = mat->getDiffuseAlphaMode();
+ }
+ }
+
+ return diffuse_mode;
+ }
+ bool _isAlpha; // whether or not the diffuse texture selected contains alpha information
+ } get_diff_mode(diffuse_texture_has_alpha);
+ identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &get_diff_mode, diffuse_alpha_mode);
+}
+
+static void getCurrentDiffuseAlphaMode(U8& diffuse_alpha_mode, bool& identical);
+
void LLPanelFace::LLSelectedTE::getObjectScaleS(F32& scale_s, bool& identical)
{
struct LLSelectedTEGetObjectScaleS : public LLSelectedTEGetFunctor<F32>
@@ -2336,4 +2368,4 @@ void LLPanelFace::LLSelectedTE::getMaxDiffuseRepeats(F32& repeats, bool& identic
} max_diff_repeats_func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &max_diff_repeats_func, repeats );
-} \ No newline at end of file
+}
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 79e6898e49..c6a53b6aef 100755
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -297,8 +297,8 @@ private:
LLTextureEntry* tep = object ? object->getTE(face) : NULL;
if (tep)
{
- material_ptr = object->getTE(face)->getMaterialParams();
- if (!material_ptr.isNull())
+ material_ptr = tep->getMaterialParams();
+ if (!material_ptr.isNull() && !tep->getMaterialID().isNull())
{
ret = (material_ptr->*(MaterialGetFunc))();
}
@@ -404,11 +404,10 @@ private:
static void getCurrent(LLMaterialPtr& material_ptr, bool& identical_material);
static void getMaxSpecularRepeats(F32& repeats, bool& identical);
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(U8,U8,getDiffuseAlphaMode,LLMaterial::DIFFUSE_ALPHA_MODE_NONE)
-
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)