summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-xindra/newview/llpanelface.cpp39
1 files changed, 28 insertions, 11 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 30ccbeb917..4fd55e1cf2 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -317,8 +317,6 @@ void LLPanelFace::sendTexture()
void LLPanelFace::sendBump(U32 bumpiness)
{
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
- LLUUID current_normal_map = bumpytexture_ctrl->getImageAssetID();
-
if (bumpiness < BUMPY_TEXTURE)
{
LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL;
@@ -330,6 +328,8 @@ void LLPanelFace::sendBump(U32 bumpiness)
LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
updateBumpyControls(bumpiness == BUMPY_TEXTURE, true);
+
+ LLUUID current_normal_map = bumpytexture_ctrl->getImageAssetID();
LLSelectedTEMaterial::setNormalID(this, current_normal_map);
}
@@ -747,8 +747,15 @@ void LLPanelFace::updateUI()
LLUUID norm_map_id = getCurrentNormalMap();
LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness");
if (combobox_bumpiness)
- {
- combobox_bumpiness->selectNthItem((S32)bumpy);
+ {
+ if ((bumpy == BUMPY_TEXTURE) && !norm_map_id.isNull())
+ {
+ combobox_bumpiness->selectNthItem((S32)BUMPY_TEXTURE);
+ }
+ else
+ {
+ combobox_bumpiness->selectNthItem((S32)((bumpy < BUMPY_TEXTURE) ? bumpy : 0));
+ }
}
else
{
@@ -771,7 +778,7 @@ void LLPanelFace::updateUI()
}
mIsAlpha = FALSE;
- LLGLenum image_format;
+ LLGLenum image_format = GL_RGB;
bool identical_image_format = false;
LLSelectedTE::getImageFormat(image_format, identical_image_format);
@@ -799,17 +806,25 @@ void LLPanelFace::updateUI()
}
// Diffuse Alpha Mode
- U8 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+
+ // Init to the default that is appropriate for the alpha content of the asset
+ //
+ U8 alpha_mode = mIsAlpha ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+
bool identical_alpha_mode = false;
+
+ // See if that's been overridden by a material setting for same...
+ //
LLSelectedTEMaterial::getDiffuseAlphaMode(alpha_mode, identical_alpha_mode);
LLCtrlSelectionInterface* combobox_alphamode = childGetSelectionInterface("combobox alphamode");
if (combobox_alphamode)
{
//it is invalid to have any alpha mode other than blend if transparency is greater than zero ...
+ // Want masking? Want emissive? Tough! You get BLEND!
alpha_mode = (transparency > 0.f) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : alpha_mode;
- // ... unless there is no alpha channel in the texture, in which case alpha mode MUST ebe none
+ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST be none
alpha_mode = mIsAlpha ? alpha_mode : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
combobox_alphamode->selectNthItem(alpha_mode);
@@ -1592,6 +1607,7 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh
if (comboShiny->itemExists(USE_TEXTURE))
{
comboShiny->remove(SHINY_TEXTURE);
+ comboShiny->selectFirstItem();
}
}
}
@@ -1642,9 +1658,8 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co
{
if (comboBumpy->itemExists(USE_TEXTURE))
{
- // HACK: This depends on adding the "Use texture"
- // item at the end of a list of known length.
comboBumpy->remove(BUMPY_TEXTURE);
+ comboBumpy->selectFirstItem();
}
}
}
@@ -2164,7 +2179,8 @@ void LLPanelFace::LLSelectedTE::getFace(LLFace*& face_to_return, bool& identical
}
void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return, bool& identical_face)
-{
+{
+ LLGLenum image_format;
struct LLSelectedTEGetImageFormat : public LLSelectedTEGetFunctor<LLGLenum>
{
LLGLenum get(LLViewerObject* object, S32 te_index)
@@ -2173,7 +2189,8 @@ void LLPanelFace::LLSelectedTE::getImageFormat(LLGLenum& image_format_to_return,
return image ? image->getPrimaryFormat() : GL_RGB;
}
} get_glenum;
- identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_glenum, image_format_to_return);
+ identical_face = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_glenum, image_format);
+ image_format_to_return = image_format;
}
void LLPanelFace::LLSelectedTE::getTexId(LLUUID& id, bool& identical)