summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-04-16 08:27:30 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-04-16 08:27:30 -0700
commitc4413f493e65d1c12f382a9fe4363e90c6a1b8c3 (patch)
treef58bb44f2c7f3d6e206ec579237124ac236118f3 /indra/newview
parentfafa21315f043ab51e3373e825c85646685778a6 (diff)
NORSPEC-123 et al...roll back NSPEC 91 fix to avoid knock-on and set correct default env intensity
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelface.cpp84
1 files changed, 15 insertions, 69 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index f91f1f7d3a..be88cb6ab6 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -291,55 +291,10 @@ void LLPanelFace::sendTexture()
}
LLSelectMgr::getInstance()->selectionSetImage(id);
}
-
- mIsAlpha = FALSE;
- LLGLenum image_format;
- struct f2 : public LLSelectedTEGetFunctor<LLGLenum>
- {
- LLGLenum get(LLViewerObject* object, S32 te_index)
- {
- LLGLenum image_format = GL_RGB;
-
- LLViewerTexture* image = object->getTEImage(te_index);
- if (image) image_format = image->getPrimaryFormat();
- return image_format;
- }
- } func2;
- LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func2, image_format );
-
- mIsAlpha = FALSE;
- switch (image_format)
- {
- case GL_RGBA:
- case GL_ALPHA:
- {
- mIsAlpha = TRUE;
- }
- break;
-
- case GL_RGB: break;
- default:
- {
- llwarns << "Unexpected tex format in LLPanelFace...resorting to no alpha" << llendl;
- }
- break;
- }
-
- LLComboBox* comboAlphaMode = getChild<LLComboBox>("combobox alphamode");
- if (comboAlphaMode)
- {
- U32 alpha_mode = comboAlphaMode->getCurrentIndex();
- if (mIsAlpha && (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE))
- {
- alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
- }
- comboAlphaMode->selectNthItem(alpha_mode);
- }
-
}
void LLPanelFace::sendBump()
-{
+{
LLComboBox* mComboBumpiness = getChild<LLComboBox>("combobox bumpiness");
if(!mComboBumpiness)return;
U32 bumpiness = mComboBumpiness->getCurrentIndex();
@@ -834,7 +789,7 @@ void LLPanelFace::getState()
}
} alpha_get_func;
- U8 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND;
+ U8 alpha_mode = 1;
LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &alpha_get_func, alpha_mode);
{
@@ -843,13 +798,10 @@ void LLPanelFace::getState()
if (combobox_alphamode)
{
- // Should never want to reflect something other than the correct state
- // if it's supposed to be set to NONE, that should be enforced elsewhere
- //
- //if (!mIsAlpha)
- //{
- // alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
- //}
+ if (!mIsAlpha)
+ {
+ alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+ }
combobox_alphamode->selectNthItem(alpha_mode);
}
@@ -1823,18 +1775,9 @@ void LLPanelFace::updateMaterial()
bool identical_texgen = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, selected_texgen );
bool identical_planar_texgen = (identical_texgen && (selected_texgen == LLTextureEntry::TEX_GEN_PLANAR));
- LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
- LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
-
- bool doing_diffuse_alpha = (alpha_mode != LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
- bool doing_bumps = (bumpiness == BUMPY_TEXTURE) || !norm_map_id.isNull();
- bool doing_shiny = (shininess == SHINY_TEXTURE) || !spec_map_id.isNull();
-
- doing_diffuse_alpha = doing_diffuse_alpha && mIsAlpha;
-
- if (doing_diffuse_alpha
- || doing_bumps
- || doing_shiny)
+ if ((mIsAlpha && (alpha_mode != LLMaterial::DIFFUSE_ALPHA_MODE_BLEND))
+ || (bumpiness == BUMPY_TEXTURE)
+ || (shininess == SHINY_TEXTURE))
{
// The user's specified something that needs a material.
bool new_material = false;
@@ -1843,10 +1786,11 @@ void LLPanelFace::updateMaterial()
new_material = true;
mMaterial = LLMaterialPtr(new LLMaterial());
}
-
- mMaterial->setDiffuseAlphaMode(alpha_mode);
+
+ mMaterial->setDiffuseAlphaMode(getChild<LLComboBox>("combobox alphamode")->getCurrentIndex());
mMaterial->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger()));
-
+
+ LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
if (!norm_map_id.isNull())
{
LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness << LL_ENDL;
@@ -1874,6 +1818,8 @@ void LLPanelFace::updateMaterial()
mMaterial->setNormalRepeat(1.0f,1.0f);
mMaterial->setNormalRotation(0.0f);
}
+
+ LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
if (!spec_map_id.isNull())
{