summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-05-21 15:27:52 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-05-21 15:27:52 -0700
commit06b3879acc2f0a306cace145f3772433e5fff5c9 (patch)
treee6947f12851efdea085d509fd139dda4e4cd38d8 /indra/newview
parent756c3d30eee4700c3edb1cb55c03bf5f51d648a7 (diff)
NORSPEC-200 fix regression from 188 fix caused by not having enough bits to store SHINY_TEXTURE in the TEs bitfield
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llpanelface.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d0eea6eb9b..31e67960bd 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -686,6 +686,25 @@ void LLPanelFace::updateUI()
getChildView("ColorTrans")->setEnabled(editable);
}
+ // Specular map
+ struct spec_get : public LLSelectedTEGetFunctor<LLUUID>
+ {
+ LLUUID get(LLViewerObject* object, S32 te_index)
+ {
+ LLUUID id;
+
+ LLMaterial* mat = object->getTE(te_index)->getMaterialParams().get();
+
+ if (mat)
+ {
+ id = mat->getSpecularID();
+ }
+
+ return id;
+ }
+ } spec_get_func;
+ identical_spec = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &spec_get_func, specmap_id );
+
U8 shiny = 0;
// Shiny
@@ -701,9 +720,10 @@ void LLPanelFace::updateUI()
LLCtrlSelectionInterface* combobox_shininess =
childGetSelectionInterface("combobox shininess");
+
if (combobox_shininess)
{
- combobox_shininess->selectNthItem((S32)shiny);
+ combobox_shininess->selectNthItem(specmap_id.isNull() ? (S32)shiny : SHINY_TEXTURE);
}
else
{
@@ -813,28 +833,6 @@ void LLPanelFace::updateUI()
if (bumpy != BUMPY_TEXTURE)
normmap_id = LLUUID::null;
- // Specular map
- struct spec_get : public LLSelectedTEGetFunctor<LLUUID>
- {
- LLUUID get(LLViewerObject* object, S32 te_index)
- {
- LLUUID id;
-
- LLMaterial* mat = object->getTE(te_index)->getMaterialParams().get();
-
- if (mat)
- {
- id = mat->getSpecularID();
- }
-
- return id;
- }
- } spec_get_func;
- identical_spec = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &spec_get_func, specmap_id );
-
- if (shiny != SHINY_TEXTURE)
- specmap_id = LLUUID::null;
-
mIsAlpha = FALSE;
LLGLenum image_format;
struct f2 : public LLSelectedTEGetFunctor<LLGLenum>
@@ -960,7 +958,9 @@ void LLPanelFace::updateUI()
if (shinytexture_ctrl && !shinytexture_ctrl->isPickerShown())
{
- if (identical_spec && (shiny == SHINY_TEXTURE))
+ // Can't use this test as we can't actually store SHINY_TEXTURE in the TEs *sigh*
+ //
+ if (identical_spec /*&& (shiny == SHINY_TEXTURE)*/)
{
shinytexture_ctrl->setTentative( FALSE );
shinytexture_ctrl->setEnabled( editable );
@@ -1850,7 +1850,7 @@ void LLPanelFace::updateMaterial()
LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
- if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE))
+ if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE))
{
LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess << LL_ENDL;
material->setSpecularID(spec_map_id);