diff options
author | Brad Kittenbrink <brad@lindenlab.com> | 2008-02-27 18:58:14 +0000 |
---|---|---|
committer | Brad Kittenbrink <brad@lindenlab.com> | 2008-02-27 18:58:14 +0000 |
commit | 6d52efe452aa8469e0343da1c7d108f3f52ab651 (patch) | |
tree | a87be48e9840d7fc1f7ee514d7c7f994e71fdb3c /indra/newview/llselectmgr.cpp | |
parent | 6027ad2630b8650cabcf00628ee9b0d25bedd67f (diff) |
Merge of windlight into release (QAR-286). This includes all changes in
windlight14 which have passed QA (up through r79932).
svn merge -r 80831:80833 svn+ssh://svn.lindenlab.com/svn/linden/branches/merge_windlight14_r80620
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 104 |
1 files changed, 79 insertions, 25 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ffc53f0dd5..d2e3dc1ed9 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -39,6 +39,7 @@ #include "lldbstrings.h" #include "lleconomy.h" #include "llgl.h" +#include "llglimmediate.h" #include "llpermissions.h" #include "llpermissionsflags.h" #include "llptrskiplist.h" @@ -1730,6 +1731,37 @@ void LLSelectMgr::selectionSetMediaTypeAndURL(U8 media_type, const std::string& getSelection()->applyToObjects(&sendfunc); } +void LLSelectMgr::selectionSetGlow(F32 glow) +{ + struct f1 : public LLSelectedTEFunctor + { + F32 mGlow; + f1(F32 glow) : mGlow(glow) {}; + bool apply(LLViewerObject* object, S32 face) + { + if (object->permModify()) + { + // update viewer side color in anticipation of update from simulator + object->setTEGlow(face, mGlow); + } + return true; + } + } func1(glow); + mSelectedObjects->applyToTEs( &func1 ); + + struct f2 : public LLSelectedObjectFunctor + { + virtual bool apply(LLViewerObject* object) + { + if (object->permModify()) + { + object->sendTEUpdate(); + } + return true; + } + } func2; + mSelectedObjects->applyToObjects( &func2 ); +} //----------------------------------------------------------------------------- @@ -1752,6 +1784,26 @@ LLPermissions* LLSelectMgr::findObjectPermissions(const LLViewerObject* object) //----------------------------------------------------------------------------- +// selectionGetGlow() +//----------------------------------------------------------------------------- +BOOL LLSelectMgr::selectionGetGlow(F32 *glow) +{ + BOOL identical; + F32 lglow = 0.f; + struct f1 : public LLSelectedTEGetFunctor<F32> + { + F32 get(LLViewerObject* object, S32 face) + { + return object->getTE(face)->getGlow(); + } + } func; + identical = mSelectedObjects->getSelectedTEValue( &func, lglow ); + + *glow = lglow; + return identical; +} + +//----------------------------------------------------------------------------- // selectionSetMaterial() //----------------------------------------------------------------------------- void LLSelectMgr::selectionSetMaterial(U8 material) @@ -5161,7 +5213,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) if (LLSelectMgr::sRenderHiddenSelections) // && gFloaterTools && gFloaterTools->getVisible()) { - glBlendFunc(GL_SRC_COLOR, GL_ONE); + gGL.flush(); + gGL.blendFunc(GL_SRC_COLOR, GL_ONE); LLGLEnable fog(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); float d = (gCamera->getPointOfInterest()-gCamera->getOrigin()).magVec(); @@ -5172,7 +5225,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); glAlphaFunc(GL_GREATER, 0.01f); - glBegin(GL_LINES); + gGL.begin(GL_LINES); { S32 i = 0; for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) @@ -5181,18 +5234,19 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); - glTexCoord2f( u_coord, v_coord ); - glVertex3fv( mSilhouetteVertices[i].mV ); + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + gGL.texCoord2f( u_coord, v_coord ); + gGL.vertex3fv( mSilhouetteVertices[i].mV ); } } } - glEnd(); + gGL.end(); u_coord = fmod(animationTime * LLSelectMgr::sHighlightUAnim, 1.f); } - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glBegin(GL_TRIANGLES); + gGL.flush(); + gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + gGL.begin(GL_TRIANGLES); { S32 i = 0; for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) @@ -5208,15 +5262,15 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; vert += mSilhouetteVertices[i]; - glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); - glTexCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); - glVertex3fv( vert.mV ); + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); + gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); + gGL.vertex3fv( vert.mV ); u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); - glTexCoord2f( u_coord, v_coord ); - glVertex3fv( mSilhouetteVertices[i].mV ); + gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + gGL.texCoord2f( u_coord, v_coord ); + gGL.vertex3fv( mSilhouetteVertices[i].mV ); v = mSilhouetteVertices[i]; t = LLVector2(u_coord, v_coord); @@ -5225,24 +5279,24 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLVector3 vert = (mSilhouetteNormals[i]) * silhouette_thickness; vert += mSilhouetteVertices[i]; - glColor4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); - glTexCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); - glVertex3fv( vert.mV ); - glVertex3fv( vert.mV ); + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.0f); //LLSelectMgr::sHighlightAlpha); + gGL.texCoord2f( u_coord, v_coord + LLSelectMgr::sHighlightVScale ); + gGL.vertex3fv( vert.mV ); + gGL.vertex3fv( vert.mV ); - glTexCoord2fv(t.mV); + gGL.texCoord2fv(t.mV); u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - glColor4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); - glVertex3fv(v.mV); - glTexCoord2f( u_coord, v_coord ); - glVertex3fv( mSilhouetteVertices[i].mV ); + gGL.color4f(color.mV[VRED]*2, color.mV[VGREEN]*2, color.mV[VBLUE]*2, LLSelectMgr::sHighlightAlpha*2); + gGL.vertex3fv(v.mV); + gGL.texCoord2f( u_coord, v_coord ); + gGL.vertex3fv( mSilhouetteVertices[i].mV ); } } } } - glEnd(); - + gGL.end(); + gGL.flush(); } glPopMatrix(); } |