Commit 15db923c authored by Brad Payne (Vir Linden)'s avatar Brad Payne (Vir Linden)
Browse files

merge

parents 7d309ed5 e9ead7cc
......@@ -550,3 +550,4 @@ a3143db58a0f6b005232bf9018e7fef17ff9ec90 6.1.0-release
706bdc7e25c6e6b8fb56f4a13fcce2936e70a79c 6.2.1-release
ec09daf1899c1c01c4ba0ba950fae572f2a612a8 6.2.2-release
ab2ec5c5423b277d23fd0511ce50c15123ff2e03 6.2.3-release
67297f9902857e357570c44722ad84de3aff974e 6.2.4-release
......@@ -33,7 +33,10 @@
#include "llpluginmessageclasses.h"
#include "llcontrol.h"
extern LLControlGroup gSavedSettings;
extern LLControlGroup gSavedSettings;
#if LL_DARWIN
extern BOOL gHiDPISupport;
#endif
static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256;
......@@ -365,11 +368,16 @@ void LLPluginClassMedia::setSizeInternal(void)
mRequestedMediaHeight = nextPowerOf2(mRequestedMediaHeight);
}
if(mRequestedMediaWidth > 2048)
mRequestedMediaWidth = 2048;
#if LL_DARWIN
if (!gHiDPISupport)
#endif
{
if (mRequestedMediaWidth > 2048)
mRequestedMediaWidth = 2048;
if(mRequestedMediaHeight > 2048)
mRequestedMediaHeight = 2048;
if (mRequestedMediaHeight > 2048)
mRequestedMediaHeight = 2048;
}
}
void LLPluginClassMedia::setAutoScale(bool auto_scale)
......
......@@ -236,14 +236,14 @@ void LLUI::dirtyRect(LLRect rect)
//static
void LLUI::setMousePositionScreen(S32 x, S32 y)
{
S32 screen_x, screen_y;
#if defined(LL_DARWIN)
screen_x = ll_round((F32)x);
screen_y = ll_round((F32)y);
S32 screen_x = ll_round(((F32)x * getScaleFactor().mV[VX]) / LLView::getWindow()->getSystemUISize());
S32 screen_y = ll_round(((F32)y * getScaleFactor().mV[VY]) / LLView::getWindow()->getSystemUISize());
#else
screen_x = ll_round((F32)x * getScaleFactor().mV[VX]);
screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
S32 screen_x = ll_round((F32)x * getScaleFactor().mV[VX]);
S32 screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
#endif
LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
}
......
......@@ -4036,7 +4036,7 @@ void LLWindowWin32::setDPIAwareness()
F32 LLWindowWin32::getSystemUISize()
{
float scale_value = 0;
F32 scale_value = 1.f;
HWND hWnd = (HWND)getPlatformWindow();
HDC hdc = GetDC(hWnd);
HMONITOR hMonitor;
......
......@@ -498,7 +498,7 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
dullahan::dullahan_settings settings;
settings.accept_language_list = mHostLanguage;
settings.background_color = 0xff282828;
settings.background_color = 0xffffffff;
settings.cache_enabled = true;
settings.cache_path = mCachePath;
settings.cookie_store_path = mCookiePath;
......
......@@ -608,15 +608,10 @@ void renderFace(LLDrawable* drawable, LLFace *face)
LLVOVolume* vobj = drawable->getVOVolume();
if (vobj)
{
LLVertexBuffer::unbind();
gGL.pushMatrix();
gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix);
LLVolume* volume = NULL;
if (drawable->isState(LLDrawable::RIGGED))
{
vobj->updateRiggedVolume();
volume = vobj->getRiggedVolume();
}
else
......@@ -629,44 +624,11 @@ void renderFace(LLDrawable* drawable, LLFace *face)
const LLVolumeFace& vol_face = volume->getVolumeFace(face->getTEOffset());
LLVertexBuffer::drawElements(LLRender::TRIANGLES, vol_face.mPositions, NULL, vol_face.mNumIndices, vol_face.mIndices);
}
gGL.popMatrix();
}
}
void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections)
void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections, bool shader)
{
//Need to because crash on ATI 3800 (and similar cards) MAINT-5018
LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
if (shader)
{
gDebugProgram.bind();
}
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
BOOL is_hud_object = mVObjp->isHUDAttachment();
if (mDrawablep->isActive())
{
gGL.loadMatrix(gGLModelView);
gGL.multMatrix((F32*)mVObjp->getRenderMatrix().mMatrix);
}
else if (!is_hud_object)
{
gGL.loadIdentity();
gGL.multMatrix(gGLModelView);
LLVector3 trans = mVObjp->getRegion()->getOriginAgent();
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
}
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
if (bRenderHiddenSelections)
{
gGL.blendFunc(LLRender::BF_SOURCE_COLOR, LLRender::BF_ONE);
......@@ -715,15 +677,6 @@ void LLFace::renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wirefram
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
renderFace(mDrawablep, this);
}
glLineWidth(1.f);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
gGL.popMatrix();
if (shader)
{
shader->bind();
}
}
/* removed in lieu of raycast uv detection
......@@ -1106,7 +1059,7 @@ void LLFace::getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_po
// Returns the necessary texture transform to align this face's TE to align_to's TE
bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offset,
LLVector2* res_st_scale, F32* res_st_rot) const
LLVector2* res_st_scale, F32* res_st_rot, LLRender::eTexIndex map) const
{
if (!align_to)
{
......@@ -1119,6 +1072,43 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs
return false;
}
F32 map_rot = 0.f, map_scaleS = 0.f, map_scaleT = 0.f, map_offsS = 0.f, map_offsT = 0.f;
switch (map)
{
case LLRender::DIFFUSE_MAP:
map_rot = orig_tep->getRotation();
map_scaleS = orig_tep->mScaleS;
map_scaleT = orig_tep->mScaleT;
map_offsS = orig_tep->mOffsetS;
map_offsT = orig_tep->mOffsetT;
break;
case LLRender::NORMAL_MAP:
if (orig_tep->getMaterialParams()->getNormalID().isNull())
{
return false;
}
map_rot = orig_tep->getMaterialParams()->getNormalRotation();
map_scaleS = orig_tep->getMaterialParams()->getNormalRepeatX();
map_scaleT = orig_tep->getMaterialParams()->getNormalRepeatY();
map_offsS = orig_tep->getMaterialParams()->getNormalOffsetX();
map_offsT = orig_tep->getMaterialParams()->getNormalOffsetY();
break;
case LLRender::SPECULAR_MAP:
if (orig_tep->getMaterialParams()->getSpecularID().isNull())
{
return false;
}
map_rot = orig_tep->getMaterialParams()->getSpecularRotation();
map_scaleS = orig_tep->getMaterialParams()->getSpecularRepeatX();
map_scaleT = orig_tep->getMaterialParams()->getSpecularRepeatY();
map_offsS = orig_tep->getMaterialParams()->getSpecularOffsetX();
map_offsT = orig_tep->getMaterialParams()->getSpecularOffsetY();
break;
default: /*make compiler happy*/
break;
}
LLVector3 orig_pos, this_pos;
LLQuaternion orig_face_rot, this_face_rot;
F32 orig_proj_scale, this_proj_scale;
......@@ -1126,7 +1116,7 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs
getPlanarProjectedParams(&this_face_rot, &this_pos, &this_proj_scale);
// The rotation of "this face's" texture:
LLQuaternion orig_st_rot = LLQuaternion(orig_tep->getRotation(), LLVector3::z_axis) * orig_face_rot;
LLQuaternion orig_st_rot = LLQuaternion(map_rot, LLVector3::z_axis) * orig_face_rot;
LLQuaternion this_st_rot = orig_st_rot * ~this_face_rot;
F32 x_ang, y_ang, z_ang;
this_st_rot.getEulerAngles(&x_ang, &y_ang, &z_ang);
......@@ -1134,10 +1124,10 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs
// Offset and scale of "this face's" texture:
LLVector3 centers_dist = (this_pos - orig_pos) * ~orig_st_rot;
LLVector3 st_scale(orig_tep->mScaleS, orig_tep->mScaleT, 1.f);
LLVector3 st_scale(map_scaleS, map_scaleT, 1.f);
st_scale *= orig_proj_scale;
centers_dist.scaleVec(st_scale);
LLVector2 orig_st_offset(orig_tep->mOffsetS, orig_tep->mOffsetT);
LLVector2 orig_st_offset(map_offsS, map_offsT);
*res_st_offset = orig_st_offset + (LLVector2)centers_dist;
res_st_offset->mV[VX] -= (S32)res_st_offset->mV[VX];
......
......@@ -114,7 +114,7 @@ class LLFace : public LLTrace::MemTrackableNonVirtual<LLFace, 16>
LLVector2 surfaceToTexture(LLVector2 surface_coord, const LLVector4a& position, const LLVector4a& normal);
void getPlanarProjectedParams(LLQuaternion* face_rot, LLVector3* face_pos, F32* scale) const;
bool calcAlignedPlanarTE(const LLFace* align_to, LLVector2* st_offset,
LLVector2* st_scale, F32* st_rot) const;
LLVector2* st_scale, F32* st_rot, LLRender::eTexIndex map = LLRender::DIFFUSE_MAP) const;
U32 getState() const { return mState; }
void setState(U32 state) { mState |= state; }
......@@ -198,7 +198,7 @@ class LLFace : public LLTrace::MemTrackableNonVirtual<LLFace, 16>
void renderSelectedUV();
void renderSelected(LLViewerTexture *image, const LLColor4 &color);
void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections);
void renderOneWireframe(const LLColor4 &color, F32 fogCfx, bool wireframe_selection, bool bRenderHiddenSelections, bool shader);
F32 getKey() const { return mDistance; }
......
......@@ -784,6 +784,7 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data)
previewp->setSnapshotBufferType((LLSnapshotModel::ESnapshotLayerType)combobox->getCurrentIndex());
}
view->impl->checkAutoSnapshot(previewp, TRUE);
previewp->updateSnapshot(TRUE, TRUE);
}
}
......
......@@ -82,6 +82,8 @@ const S32 ALPHAMODE_MASK = 2; // Alpha masking mode
const S32 BUMPY_TEXTURE = 18; // use supplied normal map
const S32 SHINY_TEXTURE = 4; // use supplied specular map
BOOST_STATIC_ASSERT(MATTYPE_DIFFUSE == LLRender::DIFFUSE_MAP && MATTYPE_NORMAL == LLRender::NORMAL_MAP && MATTYPE_SPECULAR == LLRender::SPECULAR_MAP);
//
// "Use texture" label for normal/specular type comboboxes
// Filled in at initialization from translated strings
......@@ -154,6 +156,7 @@ BOOL LLPanelFace::postBuild()
childSetCommitCallback("maskcutoff",&LLPanelFace::onCommitMaterialMaskCutoff, this);
childSetAction("button align",&LLPanelFace::onClickAutoFix,this);
childSetAction("button align textures", &LLPanelFace::onAlignTexture, this);
LLTextureCtrl* mTextureCtrl;
LLTextureCtrl* mShinyTextureCtrl;
......@@ -439,11 +442,28 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
{
BOOL valid;
F32 value;
LLSpinCtrl* ctrlTexScaleS = mPanel->getChild<LLSpinCtrl>("TexScaleU");
LLSpinCtrl* ctrlTexScaleT = mPanel->getChild<LLSpinCtrl>("TexScaleV");
LLSpinCtrl* ctrlTexOffsetS = mPanel->getChild<LLSpinCtrl>("TexOffsetU");
LLSpinCtrl* ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>("TexOffsetV");
LLSpinCtrl* ctrlTexRotation = mPanel->getChild<LLSpinCtrl>("TexRot");
LLRadioGroup * radio_mat_type = mPanel->getChild<LLRadioGroup>("radio_material_type");
std::string prefix;
switch (radio_mat_type->getSelectedIndex())
{
case MATTYPE_DIFFUSE:
prefix = "Tex";
break;
case MATTYPE_NORMAL:
prefix = "bumpy";
break;
case MATTYPE_SPECULAR:
prefix = "shiny";
break;
}
LLSpinCtrl * ctrlTexScaleS = mPanel->getChild<LLSpinCtrl>(prefix + "ScaleU");
LLSpinCtrl * ctrlTexScaleT = mPanel->getChild<LLSpinCtrl>(prefix + "ScaleV");
LLSpinCtrl * ctrlTexOffsetS = mPanel->getChild<LLSpinCtrl>(prefix + "OffsetU");
LLSpinCtrl * ctrlTexOffsetT = mPanel->getChild<LLSpinCtrl>(prefix + "OffsetV");
LLSpinCtrl * ctrlTexRotation = mPanel->getChild<LLSpinCtrl>(prefix + "Rot");
LLComboBox* comboTexGen = mPanel->getChild<LLComboBox>("combobox texgen");
LLCheckBoxCtrl* cb_planar_align = mPanel->getChild<LLCheckBoxCtrl>("checkbox planar align");
bool align_planar = (cb_planar_align && cb_planar_align->get());
......@@ -466,8 +486,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (align_planar)
{
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, value, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, value, te, object->getID());
}
}
}
......@@ -491,8 +511,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (align_planar)
{
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, value, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, value, te, object->getID());
}
}
}
......@@ -507,8 +527,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (align_planar)
{
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, value, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, value, te, object->getID());
}
}
}
......@@ -523,8 +543,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (align_planar)
{
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, value, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, value, te, object->getID());
}
}
}
......@@ -539,8 +559,8 @@ struct LLPanelFaceSetTEFunctor : public LLSelectedTEFunctor
if (align_planar)
{
LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, value, te);
LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, value, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, value, te, object->getID());
}
}
}
......@@ -612,6 +632,68 @@ struct LLPanelFaceSetAlignedTEFunctor : public LLSelectedTEFunctor
LLFace* mCenterFace;
};
struct LLPanelFaceSetAlignedConcreteTEFunctor : public LLSelectedTEFunctor
{
LLPanelFaceSetAlignedConcreteTEFunctor(LLPanelFace* panel, LLFace* center_face, LLRender::eTexIndex map) :
mPanel(panel),
mChefFace(center_face),
mMap(map)
{}
virtual bool apply(LLViewerObject* object, S32 te)
{
LLFace* facep = object->mDrawable->getFace(te);
if (!facep)
{
return true;
}
if (facep->getViewerObject()->getVolume()->getNumVolumeFaces() <= te)
{
return true;
}
if (mChefFace != facep)
{
LLVector2 uv_offset, uv_scale;
F32 uv_rot;
if (facep->calcAlignedPlanarTE(mChefFace, &uv_offset, &uv_scale, &uv_rot, mMap))
{
switch (mMap)
{
case LLRender::DIFFUSE_MAP:
object->setTEOffset(te, uv_offset.mV[VX], uv_offset.mV[VY]);
object->setTEScale(te, uv_scale.mV[VX], uv_scale.mV[VY]);
object->setTERotation(te, uv_rot);
break;
case LLRender::NORMAL_MAP:
LLPanelFace::LLSelectedTEMaterial::setNormalRotation(mPanel, uv_rot, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetX(mPanel, uv_offset.mV[VX], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setNormalOffsetY(mPanel, uv_offset.mV[VY], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatX(mPanel, uv_scale.mV[VX], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setNormalRepeatY(mPanel, uv_scale.mV[VY], te, object->getID());
break;
case LLRender::SPECULAR_MAP:
LLPanelFace::LLSelectedTEMaterial::setSpecularRotation(mPanel, uv_rot, te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetX(mPanel, uv_offset.mV[VX], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularOffsetY(mPanel, uv_offset.mV[VY], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatX(mPanel, uv_scale.mV[VX], te, object->getID());
LLPanelFace::LLSelectedTEMaterial::setSpecularRepeatY(mPanel, uv_scale.mV[VY], te, object->getID());
break;
default: /*make compiler happy*/
break;
}
}
}
return true;
}
private:
LLPanelFace* mPanel;
LLFace* mChefFace;
LLRender::eTexIndex mMap;
};
// Functor that tests if a face is aligned to mCenterFace
struct LLPanelFaceGetIsAlignedTEFunctor : public LLSelectedTEFunctor
{
......@@ -697,6 +779,17 @@ void LLPanelFace::sendTextureInfo()
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
}
void LLPanelFace::alignTestureLayer()
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
LLRadioGroup * radio_mat_type = getChild<LLRadioGroup>("radio_material_type");
LLPanelFaceSetAlignedConcreteTEFunctor setfunc(this, last_face, static_cast<LLRender::eTexIndex>(radio_mat_type->getSelectedIndex()));
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
void LLPanelFace::getState()
{
updateUI();
......@@ -1017,6 +1110,7 @@ void LLPanelFace::updateUI(bool force_set_values /*false*/)
bool enabled = (editable && isIdenticalPlanarTexgen());
childSetValue("checkbox planar align", align_planar && enabled);
childSetEnabled("checkbox planar align", enabled);
childSetEnabled("button align textures", enabled && LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1);
if (align_planar && enabled)
{
......@@ -2168,7 +2262,18 @@ void LLPanelFace::onCommitMaterialBumpyRot(LLUICtrl* ctrl, void* userdata)
}
else
{
LLSelectedTEMaterial::setNormalRotation(self,self->getCurrentBumpyRot() * DEG_TO_RAD);
if ((bool)self->childGetValue("checkbox planar align").asBoolean())
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
else
{
LLSelectedTEMaterial::setNormalRotation(self, self->getCurrentBumpyRot() * DEG_TO_RAD);
}
}
}
......@@ -2185,7 +2290,18 @@ void LLPanelFace::onCommitMaterialShinyRot(LLUICtrl* ctrl, void* userdata)
}
else
{
LLSelectedTEMaterial::setSpecularRotation(self,self->getCurrentShinyRot() * DEG_TO_RAD);
if ((bool)self->childGetValue("checkbox planar align").asBoolean())
{
LLFace* last_face = NULL;
bool identical_face = false;
LLSelectedTE::getFace(last_face, identical_face);
LLPanelFaceSetAlignedTEFunctor setfunc(self, last_face);
LLSelectMgr::getInstance()->getSelection()->applyToTEs(&setfunc);
}
else
{
LLSelectedTEMaterial::setSpecularRotation(self, self->getCurrentShinyRot() * DEG_TO_RAD);
}
}
}
......@@ -2442,6 +2558,11 @@ void LLPanelFace::onClickAutoFix(void* userdata)
LLSelectMgr::getInstance()->getSelection()->applyToObjects(&sendfunc);
}
void LLPanelFace::onAlignTexture(void* userdata)
{
LLPanelFace* self = (LLPanelFace*)userdata;
self->alignTestureLayer();
}
// TODO: I don't know who put these in or what these are for???
......
......@@ -126,6 +126,7 @@ class LLPanelFace : public LLPanel
void sendFullbright(); // applies and sends full bright
void sendGlow();
void sendMedia();
void alignTestureLayer();
// this function is to return TRUE if the drag should succeed.
static BOOL onDragTexture(LLUICtrl* ctrl, LLInventoryItem* item);
......@@ -202,6 +203,7 @@ class LLPanelFace : public LLPanel
static void onCommitPlanarAlign( LLUICtrl* ctrl, void* userdata);
static void onCommitRepeatsPerMeter( LLUICtrl* ctrl, void* userinfo);
static void onClickAutoFix(void*);
static void onAlignTexture(void*);
static F32 valueGlow(LLViewerObject* object, S32 face);
......
......@@ -181,7 +181,7 @@ LLSelectMgr::LLSelectMgr()
sHighlightThickness = gSavedSettings.getF32("SelectionHighlightThickness");
sHighlightUScale = gSavedSettings.getF32("SelectionHighlightUScale");
sHighlightVScale = gSavedSettings.getF32("SelectionHighlightVScale");
sHighlightAlpha = gSavedSettings.getF32("SelectionHighlightAlpha");
sHighlightAlpha = gSavedSettings.getF32("SelectionHighlightAlpha") * 2;
sHighlightAlphaTest = gSavedSettings.getF32("SelectionHighlightAlphaTest");
sHighlightUAnim = gSavedSettings.getF32("SelectionHighlightUAnim");
sHighlightVAnim = gSavedSettings.getF32("SelectionHighlightVAnim");
......@@ -5841,6 +5841,84 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud)
gGL.scalef(cur_zoom, cur_zoom, cur_zoom);
}
bool wireframe_selection = (gFloaterTools && gFloaterTools->getVisible()) || LLSelectMgr::sRenderHiddenSelections;
F32 fogCfx = (F32)llclamp((LLSelectMgr::getInstance()->getSelectionCenterGlobal() - gAgentCamera.getCameraPositionGlobal()).magVec() / (LLSelectMgr::getInstance()->getBBoxOfSelection().getExtentLocal().magVec() * 4), 0.0, 1.0);
static LLColor4 sParentColor = LLColor4(sSilhouetteParentColor[VRED], sSilhouetteParentColor[VGREEN], sSilhouetteParentColor[VBLUE], LLSelectMgr::sHighlightAlpha);
static LLColor4 sChildColor = LLColor4(sSilhouetteChildColor[VRED], sSilhouetteChildColor[VGREEN], sSilhouetteChildColor[VBLUE], LLSelectMgr::sHighlightAlpha);
auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor)
{
//Need to because crash on ATI 3800 (and similar cards) MAINT-5018
LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE_ARB : 0);
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
if (shader)
{
gDebugProgram.bind();
}
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
BOOL is_hud_object = objectp->isHUDAttachment();
if (!is_hud_object)
{
gGL.loadIdentity();
gGL.multMatrix(gGLModelView);
}
if (objectp->mDrawable->isActive())
{
gGL.multMatrix((F32*)objectp->getRenderMatrix().mMatrix);
}
else if (!is_hud_object)
{
LLVector3 trans = objectp->getRegion()->getOriginAgent();
gGL.translatef(trans.mV[0], trans.mV[1], trans.mV[2]);
}
bool bRenderHidenSelection = node->isTransient() ? false : LLSelectMgr::sRenderHiddenSelections;
LLVOVolume* vobj = objectp->mDrawable->getVOVolume();
if (vobj)
{
LLVertexBuffer::unbind();
gGL.pushMatrix();
gGL.multMatrix((F32*)vobj->getRelativeXform().mMatrix);
if (objectp->mDrawable->isState(LLDrawable::RIGGED))
{
vobj->updateRiggedVolume(true);
}
}
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
S32 num_tes = llmin((S32)objectp->getNumTEs(), (S32)objectp->getNumFaces()); // avatars have TEs but no faces
for (S32 te = 0; te < num_tes; ++te)
{
if (node->isTESelected(te))
{
objectp->mDrawable->getFace(te)->renderOneWireframe(hlColor, fogCfx, wireframe_selection, bRenderHidenSelection, nullptr != shader);