summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.h
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-06-20 12:41:46 -0700
committerGraham Linden <graham@lindenlab.com>2013-06-20 12:41:46 -0700
commit65f0972a64f77388752794610e6dedc27b9eb228 (patch)
tree1039b9fd9d5bb597968bb034905fd0ad9b08016e /indra/newview/llpanelface.h
parent42a46595558c5d87f62c9fd8e52fdad1c6960e4d (diff)
NORSPEC-262 make drag and drop aware of editing context so that editing normal/spec textures causes application to the correct tex channel
Diffstat (limited to 'indra/newview/llpanelface.h')
-rwxr-xr-xindra/newview/llpanelface.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 42c1f6bd48..834ad9e14c 100755
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -100,6 +100,19 @@ public:
void setMediaURL(const std::string& url);
void setMediaType(const std::string& mime_type);
+ LLMaterialPtr createDefaultMaterial(LLMaterialPtr current_material)
+ {
+ LLMaterialPtr new_material(!current_material.isNull() ? new LLMaterial(current_material->asLLSD()) : new LLMaterial());
+ llassert_always(new_material);
+
+ // Preserve old diffuse alpha mode or assert correct default blend mode as appropriate for the alpha channel content of the diffuse texture
+ //
+ new_material->setDiffuseAlphaMode(current_material.isNull() ? (isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE) : current_material->getDiffuseAlphaMode());
+ return new_material;
+ }
+
+ LLRender::eTexIndex getTextureChannelToEdit();
+
protected:
void getState();
@@ -178,6 +191,8 @@ protected:
static F32 valueGlow(LLViewerObject* object, S32 face);
+
+
private:
bool isAlpha() { return mIsAlpha; }
@@ -234,7 +249,7 @@ private:
{
if (_edit)
{
- LLMaterialPtr new_material(!current_material.isNull() ? new LLMaterial(current_material->asLLSD()) : new LLMaterial());
+ LLMaterialPtr new_material = _panel->createDefaultMaterial(current_material);
llassert_always(new_material);
// Determine correct alpha mode for current diffuse texture
@@ -242,10 +257,6 @@ private:
//
U8 default_alpha_mode = (_panel->isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
- // Default to matching expected state of UI
- //
- new_material->setDiffuseAlphaMode(current_material.isNull() ? default_alpha_mode : current_material->getDiffuseAlphaMode());
-
// Do "It"!
//
_edit->apply(new_material);