aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmaniptranslate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llmaniptranslate.cpp')
-rw-r--r--linden/indra/newview/llmaniptranslate.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp
index 2278453..30fa745 100644
--- a/linden/indra/newview/llmaniptranslate.cpp
+++ b/linden/indra/newview/llmaniptranslate.cpp
@@ -134,7 +134,7 @@ void LLManipTranslate::restoreGL()
134 134
135 GLuint* d = new GLuint[rez*rez]; 135 GLuint* d = new GLuint[rez*rez];
136 glGenTextures(1, &sGridTex); 136 glGenTextures(1, &sGridTex);
137 glBindTexture(GL_TEXTURE_2D, sGridTex); 137 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, sGridTex);
138 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); 138 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
139 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 139 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
140 140
@@ -1052,7 +1052,7 @@ void LLManipTranslate::renderSnapGuides()
1052 F32 max_subdivisions = sGridMaxSubdivisionLevel;//(F32)gSavedSettings.getS32("GridSubdivision"); 1052 F32 max_subdivisions = sGridMaxSubdivisionLevel;//(F32)gSavedSettings.getS32("GridSubdivision");
1053 F32 line_alpha = gSavedSettings.getF32("GridOpacity"); 1053 F32 line_alpha = gSavedSettings.getF32("GridOpacity");
1054 1054
1055 LLGLSNoTexture gls_no_texture; 1055 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1056 LLGLDepthTest gls_depth(GL_TRUE); 1056 LLGLDepthTest gls_depth(GL_TRUE);
1057 LLGLDisable gls_cull(GL_CULL_FACE); 1057 LLGLDisable gls_cull(GL_CULL_FACE);
1058 LLVector3 translate_axis; 1058 LLVector3 translate_axis;
@@ -1223,7 +1223,7 @@ void LLManipTranslate::renderSnapGuides()
1223 { 1223 {
1224 LLColor4 line_color = setupSnapGuideRenderPass(pass); 1224 LLColor4 line_color = setupSnapGuideRenderPass(pass);
1225 1225
1226 gGL.begin(LLVertexBuffer::LINES); 1226 gGL.begin(LLRender::LINES);
1227 { 1227 {
1228 LLVector3 line_start = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) + (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); 1228 LLVector3 line_start = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) + (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit));
1229 LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); 1229 LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit));
@@ -1299,7 +1299,7 @@ void LLManipTranslate::renderSnapGuides()
1299 LLVector3 line_start = selection_center - mSnapOffsetAxis * mSnapOffsetMeters; 1299 LLVector3 line_start = selection_center - mSnapOffsetAxis * mSnapOffsetMeters;
1300 LLVector3 line_end = selection_center + mSnapOffsetAxis * mSnapOffsetMeters; 1300 LLVector3 line_end = selection_center + mSnapOffsetAxis * mSnapOffsetMeters;
1301 1301
1302 gGL.begin(LLVertexBuffer::LINES); 1302 gGL.begin(LLRender::LINES);
1303 { 1303 {
1304 gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); 1304 gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
1305 1305
@@ -1309,7 +1309,7 @@ void LLManipTranslate::renderSnapGuides()
1309 gGL.end(); 1309 gGL.end();
1310 1310
1311 // draw snap guide arrow 1311 // draw snap guide arrow
1312 gGL.begin(LLVertexBuffer::TRIANGLES); 1312 gGL.begin(LLRender::TRIANGLES);
1313 { 1313 {
1314 gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); 1314 gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]);
1315 1315
@@ -1463,7 +1463,7 @@ void LLManipTranslate::renderSnapGuides()
1463 break; 1463 break;
1464 } 1464 }
1465 1465
1466 LLImageGL::unbindTexture(0); 1466 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1467 highlightIntersection(normal, selection_center, grid_rotation, inner_color); 1467 highlightIntersection(normal, selection_center, grid_rotation, inner_color);
1468 1468
1469 gGL.pushMatrix(); 1469 gGL.pushMatrix();
@@ -1503,7 +1503,7 @@ void LLManipTranslate::renderSnapGuides()
1503 LLGLDisable stencil(GL_STENCIL_TEST); 1503 LLGLDisable stencil(GL_STENCIL_TEST);
1504 { 1504 {
1505 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); 1505 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER);
1506 glBindTexture(GL_TEXTURE_2D, sGridTex); 1506 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, sGridTex);
1507 gGL.flush(); 1507 gGL.flush();
1508 gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA); 1508 gGL.blendFunc(LLRender::BF_ZERO, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
1509 renderGrid(u,v,tiles,0.9f, 0.9f, 0.9f,a*0.15f); 1509 renderGrid(u,v,tiles,0.9f, 0.9f, 0.9f,a*0.15f);
@@ -1514,11 +1514,11 @@ void LLManipTranslate::renderSnapGuides()
1514 { 1514 {
1515 LLGLDisable alpha_test(GL_ALPHA_TEST); 1515 LLGLDisable alpha_test(GL_ALPHA_TEST);
1516 //draw black overlay 1516 //draw black overlay
1517 LLImageGL::unbindTexture(0); 1517 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1518 renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f); 1518 renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f);
1519 1519
1520 //draw grid top 1520 //draw grid top
1521 glBindTexture(GL_TEXTURE_2D, sGridTex); 1521 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, sGridTex);
1522 renderGrid(u,v,tiles,1,1,1,a); 1522 renderGrid(u,v,tiles,1,1,1,a);
1523 1523
1524 gGL.popMatrix(); 1524 gGL.popMatrix();
@@ -1564,7 +1564,7 @@ void LLManipTranslate::renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F
1564 1564
1565 for (F32 xx = -size-d; xx < size+d; xx += d) 1565 for (F32 xx = -size-d; xx < size+d; xx += d)
1566 { 1566 {
1567 gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); 1567 gGL.begin(LLRender::TRIANGLE_STRIP);
1568 for (F32 yy = -size-d; yy < size+d; yy += d) 1568 for (F32 yy = -size-d; yy < size+d; yy += d)
1569 { 1569 {
1570 float dx, dy, da; 1570 float dx, dy, da;
@@ -1620,7 +1620,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
1620 LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS); 1620 LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS);
1621 glStencilFunc(GL_ALWAYS, 0, stencil_mask); 1621 glStencilFunc(GL_ALWAYS, 0, stencil_mask);
1622 gGL.setColorMask(false, false); 1622 gGL.setColorMask(false, false);
1623 LLImageGL::unbindTexture(0); 1623 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1624 glColor4f(1,1,1,1); 1624 glColor4f(1,1,1,1);
1625 1625
1626 //setup clip plane 1626 //setup clip plane
@@ -1686,7 +1686,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
1686 1686
1687 //draw volume/plane intersections 1687 //draw volume/plane intersections
1688 { 1688 {
1689 LLImageGL::unbindTexture(0); 1689 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1690 LLGLDepthTest depth(GL_FALSE); 1690 LLGLDepthTest depth(GL_FALSE);
1691 LLGLEnable stencil(GL_STENCIL_TEST); 1691 LLGLEnable stencil(GL_STENCIL_TEST);
1692 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); 1692 glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
@@ -1834,7 +1834,7 @@ void LLManipTranslate::renderTranslationHandles()
1834 relative_camera_dir.normVec(); 1834 relative_camera_dir.normVec();
1835 1835
1836 { 1836 {
1837 LLGLSNoTexture gls_ui_no_texture; 1837 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
1838 LLGLDisable cull_face(GL_CULL_FACE); 1838 LLGLDisable cull_face(GL_CULL_FACE);
1839 1839
1840 LLColor4 color1; 1840 LLColor4 color1;
@@ -1877,7 +1877,7 @@ void LLManipTranslate::renderTranslationHandles()
1877 color1.setVec(0.f, 1.f, 0.f, 0.6f); 1877 color1.setVec(0.f, 1.f, 0.f, 0.6f);
1878 color2.setVec(0.f, 0.f, 1.f, 0.6f); 1878 color2.setVec(0.f, 0.f, 1.f, 0.6f);
1879 } 1879 }
1880 gGL.begin(LLVertexBuffer::TRIANGLES); 1880 gGL.begin(LLRender::TRIANGLES);
1881 { 1881 {
1882 gGL.color4fv(color1.mV); 1882 gGL.color4fv(color1.mV);
1883 gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); 1883 gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f));
@@ -1892,7 +1892,7 @@ void LLManipTranslate::renderTranslationHandles()
1892 gGL.end(); 1892 gGL.end();
1893 1893
1894 LLUI::setLineWidth(3.0f); 1894 LLUI::setLineWidth(3.0f);
1895 gGL.begin(LLVertexBuffer::LINES); 1895 gGL.begin(LLRender::LINES);
1896 { 1896 {
1897 gGL.color4f(0.f, 0.f, 0.f, 0.3f); 1897 gGL.color4f(0.f, 0.f, 0.f, 0.3f);
1898 gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); 1898 gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f);
@@ -1932,7 +1932,7 @@ void LLManipTranslate::renderTranslationHandles()
1932 color2.setVec(1.f, 0.f, 0.f, 0.6f); 1932 color2.setVec(1.f, 0.f, 0.f, 0.6f);
1933 } 1933 }
1934 1934
1935 gGL.begin(LLVertexBuffer::TRIANGLES); 1935 gGL.begin(LLRender::TRIANGLES);
1936 { 1936 {
1937 gGL.color4fv(color1.mV); 1937 gGL.color4fv(color1.mV);
1938 gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); 1938 gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f));
@@ -1947,7 +1947,7 @@ void LLManipTranslate::renderTranslationHandles()
1947 gGL.end(); 1947 gGL.end();
1948 1948
1949 LLUI::setLineWidth(3.0f); 1949 LLUI::setLineWidth(3.0f);
1950 gGL.begin(LLVertexBuffer::LINES); 1950 gGL.begin(LLRender::LINES);
1951 { 1951 {
1952 gGL.color4f(0.f, 0.f, 0.f, 0.3f); 1952 gGL.color4f(0.f, 0.f, 0.f, 0.3f);
1953 gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); 1953 gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f);
@@ -2011,7 +2011,7 @@ void LLManipTranslate::renderTranslationHandles()
2011 color2.setVec(0.f, 0.8f, 0.f, 0.6f); 2011 color2.setVec(0.f, 0.8f, 0.f, 0.6f);
2012 } 2012 }
2013 2013
2014 gGL.begin(LLVertexBuffer::TRIANGLES); 2014 gGL.begin(LLRender::TRIANGLES);
2015 { 2015 {
2016 gGL.color4fv(color1.mV); 2016 gGL.color4fv(color1.mV);
2017 gGL.vertex3fv(v0.mV); 2017 gGL.vertex3fv(v0.mV);
@@ -2026,7 +2026,7 @@ void LLManipTranslate::renderTranslationHandles()
2026 gGL.end(); 2026 gGL.end();
2027 2027
2028 LLUI::setLineWidth(3.0f); 2028 LLUI::setLineWidth(3.0f);
2029 gGL.begin(LLVertexBuffer::LINES); 2029 gGL.begin(LLRender::LINES);
2030 { 2030 {
2031 gGL.color4f(0.f, 0.f, 0.f, 0.3f); 2031 gGL.color4f(0.f, 0.f, 0.f, 0.3f);
2032 LLVector3 v12 = (v1 + v2) * .5f; 2032 LLVector3 v12 = (v1 + v2) * .5f;
@@ -2052,7 +2052,7 @@ void LLManipTranslate::renderTranslationHandles()
2052 } 2052 }
2053 } 2053 }
2054 { 2054 {
2055 LLGLSNoTexture gls_ui_no_texture; 2055 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
2056 2056
2057 // Since we draw handles with depth testing off, we need to draw them in the 2057 // Since we draw handles with depth testing off, we need to draw them in the
2058 // proper depth order. 2058 // proper depth order.
@@ -2126,7 +2126,7 @@ void LLManipTranslate::renderTranslationHandles()
2126 2126
2127void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_size, F32 arrow_size, F32 handle_size, BOOL reverse_direction) 2127void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_size, F32 arrow_size, F32 handle_size, BOOL reverse_direction)
2128{ 2128{
2129 LLGLSNoTexture gls_ui_no_texture; 2129 gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
2130 LLGLEnable gls_blend(GL_BLEND); 2130 LLGLEnable gls_blend(GL_BLEND);
2131 LLGLEnable gls_color_material(GL_COLOR_MATERIAL); 2131 LLGLEnable gls_color_material(GL_COLOR_MATERIAL);
2132 2132
@@ -2160,7 +2160,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_
2160 2160
2161 { 2161 {
2162 LLUI::setLineWidth(2.0f); 2162 LLUI::setLineWidth(2.0f);
2163 gGL.begin(LLVertexBuffer::LINES); 2163 gGL.begin(LLRender::LINES);
2164 vec.mV[index] = box_size; 2164 vec.mV[index] = box_size;
2165 gGL.vertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); 2165 gGL.vertex3f(vec.mV[0], vec.mV[1], vec.mV[2]);
2166 2166