summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-06-20 16:46:23 -0700
committerRichard Linden <none@none>2013-06-20 16:46:23 -0700
commita2a6bf20d71f923e9a5e43f71213fffbfea5a2a6 (patch)
tree7e2711d256f98872db24e1f9de4449d47e75ed88 /indra/newview/llpanelface.cpp
parent2655c7a17ae38a073dcf8f05b0127b68edc34c95 (diff)
parente2e6963677657e4f5c417edc8d60e8b2a37ad204 (diff)
merge with release
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-xindra/newview/llpanelface.cpp148
1 files changed, 74 insertions, 74 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 911af9df04..7ef427fa3e 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -324,7 +324,7 @@ void LLPanelFace::sendBump(U32 bumpiness)
{
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
if (bumpiness < BUMPY_TEXTURE)
- {
+{
LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL;
bumpytexture_ctrl->clear();
bumpytexture_ctrl->setImageAssetID(LLUUID());
@@ -345,7 +345,7 @@ void LLPanelFace::sendBump(U32 bumpiness)
//
LLSelectedTEMaterial::setNormalID(this, current_normal_map);
- LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
+ LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
}
void LLPanelFace::sendTexGen()
@@ -361,7 +361,7 @@ void LLPanelFace::sendShiny(U32 shininess)
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
if (shininess < SHINY_TEXTURE)
- {
+{
texture_ctrl->clear();
texture_ctrl->setImageAssetID(LLUUID());
}
@@ -648,7 +648,7 @@ void LLPanelFace::updateUI()
// only turn on auto-adjust button if there is a media renderer and the media is loaded
getChildView("button align")->setEnabled(editable);
-
+
LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia");
if (combobox_matmedia)
{
@@ -683,15 +683,15 @@ void LLPanelFace::updateUI()
bool identical_diffuse = false;
bool identical_norm = false;
bool identical_spec = false;
-
- LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
+
+ LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
LLTextureCtrl* shinytexture_ctrl = getChild<LLTextureCtrl>("shinytexture control");
LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
LLUUID id;
LLUUID normmap_id;
LLUUID specmap_id;
-
+
// Color swatch
{
getChildView("color label")->setEnabled(editable);
@@ -702,7 +702,7 @@ void LLPanelFace::updateUI()
bool identical_color = false;
if(mColorSwatch)
- {
+ {
LLSelectedTE::getColor(color, identical_color);
mColorSwatch->setOriginal(color);
@@ -734,7 +734,7 @@ void LLPanelFace::updateUI()
LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess");
if (combobox_shininess)
- {
+ {
combobox_shininess->selectNthItem((S32)shiny);
}
@@ -747,15 +747,15 @@ void LLPanelFace::updateUI()
getChildView("label environment")->setEnabled(editable);
getChildView("environment")->setEnabled(editable);
getChildView("label shinycolor")->setEnabled(editable);
-
+
getChild<LLUICtrl>("combobox shininess")->setTentative(!identical_spec);
getChild<LLUICtrl>("glossiness")->setTentative(!identical_spec);
getChild<LLUICtrl>("environment")->setTentative(!identical_spec);
getChild<LLUICtrl>("shinycolorswatch")->setTentative(!identical_spec);
-
+
LLColorSwatchCtrl* mShinyColorSwatch = getChild<LLColorSwatchCtrl>("shinycolorswatch");
if(mShinyColorSwatch)
- {
+ {
mShinyColorSwatch->setValid(editable);
mShinyColorSwatch->setEnabled( editable );
mShinyColorSwatch->setCanApplyImmediately( editable );
@@ -763,7 +763,7 @@ void LLPanelFace::updateUI()
U8 bumpy = 0;
// Bumpy
- {
+ {
bool identical_bumpy = false;
LLSelectedTE::getBumpmap(bumpy,identical_bumpy);
@@ -773,18 +773,18 @@ void LLPanelFace::updateUI()
bumpy = norm_map_id.isNull() ? bumpy : BUMPY_TEXTURE;
if (combobox_bumpiness)
- {
+ {
combobox_bumpiness->selectNthItem((S32)bumpy);
- }
+ }
else
- {
+ {
llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl;
- }
+ }
getChildView("combobox bumpiness")->setEnabled(editable);
getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical_bumpy);
getChildView("label bumpiness")->setEnabled(editable);
- }
+ }
// Texture
{
@@ -812,9 +812,9 @@ void LLPanelFace::updateUI()
default:
{
llwarns << "Unexpected tex format in LLPanelFace...resorting to no alpha" << llendl;
- }
+ }
break;
- }
+ }
if(LLViewerMedia::textureHasMedia(id))
{
@@ -852,8 +852,8 @@ void LLPanelFace::updateUI()
updateAlphaControls();
- if(texture_ctrl)
- {
+ if(texture_ctrl)
+ {
if (identical_diffuse)
{
texture_ctrl->setTentative( FALSE );
@@ -865,22 +865,22 @@ void LLPanelFace::updateUI()
getChildView("label maskcutoff")->setEnabled(editable && mIsAlpha);
}
else if (id.isNull())
- {
- // None selected
- texture_ctrl->setTentative( FALSE );
- texture_ctrl->setEnabled( FALSE );
- texture_ctrl->setImageAssetID( LLUUID::null );
+ {
+ // None selected
+ texture_ctrl->setTentative( FALSE );
+ texture_ctrl->setEnabled( FALSE );
+ texture_ctrl->setImageAssetID( LLUUID::null );
getChildView("combobox alphamode")->setEnabled( FALSE );
getChildView("label alphamode")->setEnabled( FALSE );
getChildView("maskcutoff")->setEnabled( FALSE);
getChildView("label maskcutoff")->setEnabled( FALSE );
- }
- else
- {
- // Tentative: multiple selected with different textures
- texture_ctrl->setTentative( TRUE );
- texture_ctrl->setEnabled( editable );
- texture_ctrl->setImageAssetID( id );
+ }
+ else
+ {
+ // Tentative: multiple selected with different textures
+ texture_ctrl->setTentative( TRUE );
+ texture_ctrl->setEnabled( editable );
+ texture_ctrl->setImageAssetID( id );
getChildView("combobox alphamode")->setEnabled(editable && mIsAlpha && transparency <= 0.f);
getChildView("label alphamode")->setEnabled(editable && mIsAlpha);
getChildView("maskcutoff")->setEnabled(editable && mIsAlpha);
@@ -895,20 +895,20 @@ void LLPanelFace::updateUI()
shinytexture_ctrl->setTentative( FALSE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( specmap_id );
- }
+ }
else if (specmap_id.isNull())
{
shinytexture_ctrl->setTentative( FALSE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( LLUUID::null );
- }
+ }
else
{
shinytexture_ctrl->setTentative( TRUE );
shinytexture_ctrl->setEnabled( editable );
shinytexture_ctrl->setImageAssetID( specmap_id );
- }
- }
+ }
+ }
if (bumpytexture_ctrl)
{
@@ -939,7 +939,7 @@ void LLPanelFace::updateUI()
{
LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align");
align_planar = (cb_planar_align && cb_planar_align->get());
-
+
bool enabled = (editable && isIdenticalPlanarTexgen());
childSetValue("checkbox planar align", align_planar && enabled);
childSetEnabled("checkbox planar align", enabled);
@@ -1132,7 +1132,7 @@ void LLPanelFace::updateUI()
F32 diff_rot_deg = diff_rotation * RAD_TO_DEG;
F32 norm_rot_deg = norm_rotation * RAD_TO_DEG;
F32 spec_rot_deg = spec_rotation * RAD_TO_DEG;
-
+
getChildView("TexRot")->setEnabled(editable);
getChildView("shinyRot")->setEnabled(editable && specmap_id.notNull());
getChildView("bumpyRot")->setEnabled(editable && normmap_id.notNull());
@@ -1153,10 +1153,10 @@ void LLPanelFace::updateUI()
getChild<LLUICtrl>("glow")->setValue(glow);
getChild<LLUICtrl>("glow")->setTentative(!identical_glow);
getChildView("glow")->setEnabled(editable);
- getChildView("glow label")->setEnabled(editable);
+ getChildView("glow label")->setEnabled(editable);
}
- {
+ {
LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen");
if (combobox_texgen)
{
@@ -1164,9 +1164,9 @@ void LLPanelFace::updateUI()
combobox_texgen->selectNthItem(((S32)selected_texgen) >> 1);
}
else
- {
+ {
llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl;
- }
+ }
getChildView("combobox texgen")->setEnabled(editable);
getChild<LLUICtrl>("combobox texgen")->setTentative(!identical);
@@ -1182,7 +1182,7 @@ void LLPanelFace::updateUI()
{
getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per face"));
}
- }
+ }
{
U8 fullbright_flag = 0;
@@ -1194,7 +1194,7 @@ void LLPanelFace::updateUI()
getChildView("checkbox fullbright")->setEnabled(editable);
getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright);
}
-
+
// Repeats per meter
{
F32 repeats_diff = 1.f;
@@ -1211,7 +1211,7 @@ void LLPanelFace::updateUI()
LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen");
if (mComboTexGen)
- {
+ {
S32 index = mComboTexGen ? mComboTexGen->getCurrentIndex() : 0;
BOOL enabled = editable && (index != 1);
BOOL identical_repeats = true;
@@ -1219,26 +1219,26 @@ void LLPanelFace::updateUI()
U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? combobox_mattype->getCurrentIndex() : MATTYPE_DIFFUSE;
switch (material_type)
- {
+ {
default:
case MATTYPE_DIFFUSE:
- {
+ {
enabled = editable && !id.isNull();
identical_repeats = identical_diff_repeats;
repeats = repeats_diff;
- }
+ }
break;
case MATTYPE_SPECULAR:
- {
+ {
enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull()));
identical_repeats = identical_spec_repeats;
repeats = repeats_spec;
- }
+ }
break;
case MATTYPE_NORMAL:
- {
+ {
enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull()));
identical_repeats = identical_norm_repeats;
repeats = repeats_norm;
@@ -1278,14 +1278,14 @@ void LLPanelFace::updateUI()
if (!mIsAlpha)
{ // ... unless there is no alpha channel in the texture, in which case alpha mode MUST ebe none
alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
- }
+ }
combobox_alphamode->selectNthItem(alpha_mode);
- }
- else
- {
+ }
+ else
+ {
llwarns << "failed childGetSelectionInterface for 'combobox alphamode'" << llendl;
- }
+ }
getChild<LLUICtrl>("maskcutoff")->setValue(material->getAlphaMaskCutoff());
updateAlphaControls();
@@ -1297,15 +1297,15 @@ void LLPanelFace::updateUI()
texture_ctrl->setImageAssetID(material->getSpecularID());
if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE))
- {
+ {
material->getSpecularOffset(offset_x,offset_y);
material->getSpecularRepeat(repeat_x,repeat_y);
if (identical_planar_texgen)
- {
+ {
repeat_x *= 2.0f;
repeat_y *= 2.0f;
- }
+ }
rot = material->getSpecularRotation();
getChild<LLUICtrl>("shinyScaleU")->setValue(repeat_x);
@@ -1317,13 +1317,13 @@ void LLPanelFace::updateUI()
getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity());
updateShinyControls(!material->getSpecularID().isNull(), true);
- }
+ }
// Assert desired colorswatch color to match material AFTER updateShinyControls
// to avoid getting overwritten with the default on some UI state changes.
//
if (!material->getSpecularID().isNull())
- {
+ {
getChild<LLColorSwatchCtrl>("shinycolorswatch")->setOriginal(material->getSpecularLightColor());
getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE);
}
@@ -1331,12 +1331,12 @@ void LLPanelFace::updateUI()
// Update sel manager as to which channel we're editing so it can reflect the correct overlay UI
// NORSPEC-103
LLRender::eTexIndex channel_to_edit = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP;
-
+
if ( ((channel_to_edit == LLRender::NORMAL_MAP) && material->getNormalID().isNull())
||((channel_to_edit == LLRender::SPECULAR_MAP) && material->getSpecularID().isNull()))
- {
+ {
channel_to_edit = LLRender::DIFFUSE_MAP;
- }
+ }
LLSelectMgr::getInstance()->setTextureChannel(channel_to_edit);
@@ -1345,16 +1345,16 @@ void LLPanelFace::updateUI()
texture_ctrl->setImageAssetID(material->getNormalID());
if (!material->getNormalID().isNull())
- {
+ {
material->getNormalOffset(offset_x,offset_y);
material->getNormalRepeat(repeat_x,repeat_y);
if (identical_planar_texgen)
- {
+ {
repeat_x *= 2.0f;
repeat_y *= 2.0f;
- }
-
+ }
+
rot = material->getNormalRotation();
getChild<LLUICtrl>("bumpyScaleU")->setValue(repeat_x);
getChild<LLUICtrl>("bumpyScaleV")->setValue(repeat_y);
@@ -1410,7 +1410,7 @@ void LLPanelFace::updateUI()
getChildView("button align")->setEnabled(FALSE);
//getChildView("has media")->setEnabled(FALSE);
//getChildView("media info set")->setEnabled(FALSE);
-
+
updateVisibility();
// Set variable values for numeric expressions
@@ -1768,7 +1768,7 @@ BOOL LLPanelFace::onDragTexture(LLUICtrl*, LLInventoryItem* item)
void LLPanelFace::onCommitTexture( const LLSD& data )
{
- LLViewerStats::getInstance()->incStat(LLViewerStats::ST_EDIT_TEXTURE_COUNT );
+ add(LLStatViewer::EDIT_TEXTURE, 1);
sendTexture();
}
@@ -2023,8 +2023,8 @@ void LLPanelFace::onCommitRepeatsPerMeter(LLUICtrl* ctrl, void* userdata)
{
case MATTYPE_DIFFUSE:
{
- LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
- }
+ LLSelectMgr::getInstance()->selectionTexScaleAutofit( repeats_per_meter );
+}
break;
case MATTYPE_NORMAL: