diff options
author | JJ Linden <jj@lindenlab.com> | 2013-09-30 15:41:51 -0700 |
---|---|---|
committer | JJ Linden <jj@lindenlab.com> | 2013-09-30 15:41:51 -0700 |
commit | a6c20ae524610de2f8681cff8353d062a69b923e (patch) | |
tree | 929e4a253e4b83ca7e07543916e709d50fdf855e /indra/newview/llpanelface.cpp | |
parent | 6c13c4dd552a05cf055a90bdd90937de9f3903a5 (diff) | |
parent | ad777b46d0fe5d790e43efb1771e9f64f3ad3dfb (diff) |
merging
Diffstat (limited to 'indra/newview/llpanelface.cpp')
-rwxr-xr-x | indra/newview/llpanelface.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 911af9df04..3869219da6 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -66,7 +66,7 @@ #include "llvovolume.h" #include "lluictrlfactory.h" #include "llpluginclassmedia.h" -#include "llviewertexturelist.h" +#include "llviewertexturelist.h"// Update sel manager as to which channel we're editing so it can reflect the correct overlay UI // // Constant definitions for comboboxes @@ -89,6 +89,19 @@ const S32 SHINY_TEXTURE = 4; // use supplied specular map // std::string USE_TEXTURE; +LLRender::eTexIndex LLPanelFace::getTextureChannelToEdit() +{ + LLComboBox* combobox_matmedia = getChild<LLComboBox>("combobox matmedia"); + LLComboBox* combobox_mattype = getChild<LLComboBox>("combobox mattype"); + + LLRender::eTexIndex channel_to_edit = (combobox_matmedia && combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? + (combobox_mattype ? (LLRender::eTexIndex)combobox_mattype->getCurrentIndex() : LLRender::DIFFUSE_MAP) : LLRender::DIFFUSE_MAP; + + channel_to_edit = (channel_to_edit == LLRender::NORMAL_MAP) ? (getCurrentNormalMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; + channel_to_edit = (channel_to_edit == LLRender::SPECULAR_MAP) ? (getCurrentSpecularMap().isNull() ? LLRender::DIFFUSE_MAP : channel_to_edit) : channel_to_edit; + return channel_to_edit; +} + // Things the UI provides... // LLUUID LLPanelFace::getCurrentNormalMap() { return getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); } @@ -1194,7 +1207,8 @@ void LLPanelFace::updateUI() getChildView("checkbox fullbright")->setEnabled(editable); getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical_fullbright); } - + + // Repeats per meter { F32 repeats_diff = 1.f; @@ -1218,6 +1232,9 @@ void LLPanelFace::updateUI() F32 repeats = 1.0f; U32 material_type = (combobox_matmedia->getCurrentIndex() == MATMEDIA_MATERIAL) ? combobox_mattype->getCurrentIndex() : MATTYPE_DIFFUSE; + + LLSelectMgr::getInstance()->setTextureChannel(LLRender::eTexIndex(material_type)); + switch (material_type) { default: @@ -1328,18 +1345,6 @@ void LLPanelFace::updateUI() getChild<LLColorSwatchCtrl>("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE); } - // 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); - // Bumpy (normal) texture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); texture_ctrl->setImageAssetID(material->getNormalID()); @@ -1365,10 +1370,6 @@ void LLPanelFace::updateUI() updateBumpyControls(!material->getNormalID().isNull(), true); } } - else - { - LLSelectMgr::getInstance()->setTextureChannel(LLRender::DIFFUSE_MAP); - } } // Set variable values for numeric expressions |