From 8538c0f35dc5fb780f02930256e627e5266ede4a Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:49 -0500 Subject: Second Life viewer sources 1.20.6 --- linden/indra/llrender/llfontgl.cpp | 4 +- linden/indra/llrender/llglimmediate.cpp | 117 ++++++--------------- linden/indra/llrender/llglimmediate.h | 11 +- linden/indra/llrender/llvertexbuffer.cpp | 65 +++++++----- linden/indra/llrender/llvertexbuffer.h | 8 +- linden/indra/llui/llui.cpp | 56 +++++----- linden/indra/llui/llview.cpp | 2 +- linden/indra/llui/llviewborder.cpp | 2 +- linden/indra/llwindow/llgl.h | 15 +++ linden/indra/lscript/lscript_compile/indra.l | 6 +- .../lscript/lscript_compile/lscript_compile.vcproj | 6 +- .../lscript_compile/lscript_compile_vc8.vcproj | 6 +- .../lscript_compile/lscript_compile_vc9.vcproj | 6 +- linden/indra/newview/llbox.cpp | 2 +- linden/indra/newview/lldrawpoolavatar.cpp | 8 +- linden/indra/newview/lldynamictexture.cpp | 9 +- linden/indra/newview/llface.cpp | 2 +- linden/indra/newview/llfasttimerview.cpp | 4 +- linden/indra/newview/llfloateranimpreview.cpp | 11 +- linden/indra/newview/llfloatercolorpicker.cpp | 2 +- linden/indra/newview/llfloaterimagepreview.cpp | 17 ++- linden/indra/newview/llfloatersnapshot.cpp | 8 +- linden/indra/newview/llglsandbox.cpp | 32 +++--- linden/indra/newview/llhudeffectlookat.cpp | 2 +- linden/indra/newview/llhudeffectpointat.cpp | 2 +- linden/indra/newview/llhudicon.cpp | 2 +- linden/indra/newview/llhudobject.cpp | 2 + linden/indra/newview/llhudtext.cpp | 2 +- linden/indra/newview/lljoystickbutton.cpp | 2 +- linden/indra/newview/llmanip.cpp | 6 +- linden/indra/newview/llmaniprotate.cpp | 10 +- linden/indra/newview/llmanipscale.cpp | 10 +- linden/indra/newview/llmaniptranslate.cpp | 26 ++--- linden/indra/newview/llnetmap.cpp | 10 +- linden/indra/newview/llselectmgr.cpp | 4 +- linden/indra/newview/llspatialpartition.cpp | 18 ++-- linden/indra/newview/lltexlayer.cpp | 4 - linden/indra/newview/lltexturectrl.cpp | 2 +- linden/indra/newview/lltoolbrush.cpp | 2 +- linden/indra/newview/lltoolmorph.cpp | 8 +- linden/indra/newview/lltracker.cpp | 4 +- linden/indra/newview/llviewerdisplay.cpp | 31 +++--- linden/indra/newview/llviewerjoint.cpp | 6 +- linden/indra/newview/llviewerjointattachment.cpp | 2 +- linden/indra/newview/llviewermessage.cpp | 6 +- linden/indra/newview/llviewerobjectlist.cpp | 4 +- linden/indra/newview/llviewerparceloverlay.cpp | 4 +- linden/indra/newview/llviewerwindow.cpp | 8 +- linden/indra/newview/llvoavatar.cpp | 8 +- linden/indra/newview/llvoicevisualizer.cpp | 8 +- linden/indra/newview/llwebbrowserctrl.cpp | 8 +- linden/indra/newview/llworldmapview.cpp | 18 ++-- linden/indra/newview/pipeline.cpp | 47 +++++---- .../indra/newview/skins/xui/de/floater_gesture.xml | 2 +- .../newview/skins/xui/de/floater_joystick.xml | 7 +- .../skins/xui/de/panel_preferences_graphics1.xml | 9 +- .../newview/skins/xui/en-us/floater_tools.xml | 22 ++-- .../indra/newview/skins/xui/ja/floater_gesture.xml | 4 +- .../newview/skins/xui/ja/floater_joystick.xml | 3 + .../newview/skins/xui/ja/panel_group_invite.xml | 16 ++- linden/indra/newview/skins/xui/ja/panel_place.xml | 8 +- .../newview/skins/xui/ja/panel_place_small.xml | 10 +- .../newview/skins/xui/ko/floater_joystick.xml | 3 + 63 files changed, 367 insertions(+), 382 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llrender/llfontgl.cpp b/linden/indra/llrender/llfontgl.cpp index 53e8c2b..938dd73 100644 --- a/linden/indra/llrender/llfontgl.cpp +++ b/linden/indra/llrender/llfontgl.cpp @@ -845,7 +845,7 @@ S32 LLFontGL::render(const LLWString &wstr, if (style & UNDERLINE) { LLGLSNoTexture no_texture; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2f(start_x, cur_y - (mDescender)); gGL.vertex2f(cur_x, cur_y - (mDescender)); gGL.end(); @@ -1340,7 +1340,7 @@ void LLFontGL::drawGlyph(const LLRectf& screen_rect, const LLRectf& uv_rect, con F32 slant_offset; slant_offset = ((style & ITALIC) ? ( -mAscender * 0.2f) : 0.f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { //FIXME: bold and drop shadow are mutually exclusive only for convenience //Allow both when we need them. diff --git a/linden/indra/llrender/llglimmediate.cpp b/linden/indra/llrender/llglimmediate.cpp index da9239d..edc694a 100644 --- a/linden/indra/llrender/llglimmediate.cpp +++ b/linden/indra/llrender/llglimmediate.cpp @@ -36,64 +36,19 @@ LLGLImmediate gGL; -#ifdef LL_RELEASE_FOR_DOWNLOAD -#define IMM_ERRS llwarns -#else -#define IMM_ERRS llerrs -#endif - bool LLGLImmediate::sClever = false; -BOOL LLGLImmediate::sStarted = FALSE; + +const U32 immediate_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD; LLGLImmediate::LLGLImmediate() { mCount = 0; - mMode = GL_TRIANGLES; - memset(mBuffer, 0, sizeof(Vertex)*4096); -} - -void LLGLImmediate::start() -{ - if(sClever) - { - if (sStarted) - { - llerrs << "Redundant start." << llendl; - } - - LLVertexBuffer::unbind(); - sStarted = TRUE; - - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - - const U32 stride = sizeof(Vertex); - - glVertexPointer(3, GL_FLOAT, stride, &(mBuffer[0].v)); - glTexCoordPointer(2, GL_FLOAT, stride, &(mBuffer[0].uv)); - glColorPointer(4, GL_UNSIGNED_BYTE, stride, &(mBuffer[0].c)); - - color4f(1,1,1,1); - } -} - -void LLGLImmediate::stop() -{ - if (sClever) - { - if (!sStarted) - { - llerrs << "Redundant stop." << llendl; - } - - flush(); - - sStarted = FALSE; - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - } + mMode = LLVertexBuffer::TRIANGLES; + mBuffer = new LLVertexBuffer(immediate_mask, 0); + mBuffer->allocateBuffer(4096, 0, TRUE); + mBuffer->getVertexStrider(mVerticesp); + mBuffer->getTexCoordStrider(mTexcoordsp); + mBuffer->getColorStrider(mColorsp); } void LLGLImmediate::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z) @@ -116,10 +71,7 @@ void LLGLImmediate::popMatrix() void LLGLImmediate::blendFunc(GLenum sfactor, GLenum dfactor) { - if (sStarted) - { - flush(); - } + flush(); glBlendFunc(sfactor, dfactor); } @@ -129,10 +81,10 @@ void LLGLImmediate::begin(const GLuint& mode) { if (mode != mMode) { - if (mMode == GL_QUADS || - mMode == GL_LINES || - mMode == GL_TRIANGLES || - mMode == GL_POINTS) + if (mMode == LLVertexBuffer::QUADS || + mMode == LLVertexBuffer::LINES || + mMode == LLVertexBuffer::TRIANGLES || + mMode == LLVertexBuffer::POINTS) { flush(); } @@ -146,7 +98,7 @@ void LLGLImmediate::begin(const GLuint& mode) } else { - glBegin(mode); + glBegin(LLVertexBuffer::sGLMode[mode]); } } @@ -156,13 +108,14 @@ void LLGLImmediate::end() { if (mCount == 0) { - IMM_ERRS << "GL begin and end called with no vertices specified." << llendl; + return; + //IMM_ERRS << "GL begin and end called with no vertices specified." << llendl; } - if ((mMode != GL_QUADS && - mMode != GL_LINES && - mMode != GL_TRIANGLES && - mMode != GL_POINTS) || + if ((mMode != LLVertexBuffer::QUADS && + mMode != LLVertexBuffer::LINES && + mMode != LLVertexBuffer::TRIANGLES && + mMode != LLVertexBuffer::POINTS) || mCount > 2048) { flush(); @@ -221,12 +174,13 @@ void LLGLImmediate::flush() llerrs << "foo 6" << llendl; } #endif - if (!sStarted) - { - llerrs << "Drawing call issued outside start/stop." << llendl; - } - glDrawArrays(mMode, 0, mCount); - mBuffer[0] = mBuffer[mCount]; + + mBuffer->setBuffer(immediate_mask); + mBuffer->drawArrays(mMode, 0, mCount); + + mVerticesp[0] = mVerticesp[mCount]; + mTexcoordsp[0] = mTexcoordsp[mCount]; + mColorsp[0] = mColorsp[mCount]; mCount = 0; } } @@ -242,13 +196,13 @@ void LLGLImmediate::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& return; } - mBuffer[mCount].v[0] = x; - mBuffer[mCount].v[1] = y; - mBuffer[mCount].v[2] = z; + mVerticesp[mCount] = LLVector3(x,y,z); mCount++; if (mCount < 4096) { - mBuffer[mCount] = mBuffer[mCount-1]; + mVerticesp[mCount] = mVerticesp[mCount-1]; + mColorsp[mCount] = mColorsp[mCount-1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; } } else @@ -281,8 +235,7 @@ void LLGLImmediate::texCoord2f(const GLfloat& x, const GLfloat& y) { if (sClever) { - mBuffer[mCount].uv[0] = x; - mBuffer[mCount].uv[1] = y; + mTexcoordsp[mCount] = LLVector2(x,y); } else { @@ -304,10 +257,7 @@ void LLGLImmediate::color4ub(const GLubyte& r, const GLubyte& g, const GLubyte& { if (sClever) { - mBuffer[mCount].c[0] = r; - mBuffer[mCount].c[1] = g; - mBuffer[mCount].c[2] = b; - mBuffer[mCount].c[3] = a; + mColorsp[mCount] = LLColor4U(r,g,b,a); } else { @@ -345,7 +295,6 @@ void LLGLImmediate::color3fv(const GLfloat* c) void LLGLImmediate::setClever(bool do_clever) { - llassert(!sStarted); llassert(mCount == 0); sClever = do_clever; diff --git a/linden/indra/llrender/llglimmediate.h b/linden/indra/llrender/llglimmediate.h index cf4dc4f..e0cddff 100644 --- a/linden/indra/llrender/llglimmediate.h +++ b/linden/indra/llrender/llglimmediate.h @@ -40,6 +40,7 @@ #include "stdtypes.h" #include "llgltypes.h" #include "llglheaders.h" +#include "llvertexbuffer.h" class LLGLImmediate { @@ -50,8 +51,6 @@ public: void pushMatrix(); void popMatrix(); void blendFunc(GLenum sfactor, GLenum dfactor); - void start(); - void stop(); void flush(); void begin(const GLuint& mode); @@ -91,15 +90,15 @@ public: GLfloat uv[2]; }; -public: - static BOOL sStarted; - private: static bool sClever; U32 mCount; U32 mMode; - Vertex mBuffer[4096]; + LLPointer mBuffer; + LLStrider mVerticesp; + LLStrider mTexcoordsp; + LLStrider mColorsp; }; extern LLGLImmediate gGL; diff --git a/linden/indra/llrender/llvertexbuffer.cpp b/linden/indra/llrender/llvertexbuffer.cpp index ce80343..4c663e2 100644 --- a/linden/indra/llrender/llvertexbuffer.cpp +++ b/linden/indra/llrender/llvertexbuffer.cpp @@ -60,7 +60,6 @@ U32 LLVertexBuffer::sLastMask = 0; BOOL LLVertexBuffer::sVBOActive = FALSE; BOOL LLVertexBuffer::sIBOActive = FALSE; U32 LLVertexBuffer::sAllocatedBytes = 0; -BOOL LLVertexBuffer::sRenderActive = FALSE; BOOL LLVertexBuffer::sMapped = FALSE; std::vector LLVertexBuffer::sDeleteList; @@ -84,16 +83,18 @@ U32 LLVertexBuffer::sGLMode[LLVertexBuffer::NUM_MODES] = GL_TRIANGLE_FAN, GL_POINTS, GL_LINES, - GL_LINE_STRIP + GL_LINE_STRIP, + GL_QUADS, + GL_LINE_LOOP, }; //static void LLVertexBuffer::setupClientArrays(U32 data_mask) { - if (LLGLImmediate::sStarted) + /*if (LLGLImmediate::sStarted) { llerrs << "Cannot use LLGLImmediate and LLVertexBuffer simultaneously!" << llendl; - } + }*/ if (sLastMask != data_mask) { @@ -186,6 +187,11 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi llerrs << "Wrong vertex buffer bound." << llendl; } + if (mode > NUM_MODES) + { + llerrs << "Invalid draw mode: " << mode << llendl; + } + glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT, ((U16*) getIndicesPointer()) + indices_offset); } @@ -208,10 +214,37 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const llerrs << "Wrong vertex buffer bound." << llendl; } + if (mode > NUM_MODES) + { + llerrs << "Invalid draw mode: " << mode << llendl; + } + glDrawElements(sGLMode[mode], count, GL_UNSIGNED_SHORT, ((U16*) getIndicesPointer()) + indices_offset); } +void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const +{ + + if (first >= (U32) mRequestedNumVerts || + first + count > (U32) mRequestedNumVerts) + { + llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl; + } + + if (mGLBuffer != sGLRenderBuffer) + { + llerrs << "Wrong vertex buffer bound." << llendl; + } + + if (mode > NUM_MODES) + { + llerrs << "Invalid draw mode: " << mode << llendl; + } + + glDrawArrays(sGLMode[mode], first, count); +} + //static void LLVertexBuffer::initClass(bool use_vbo) { @@ -246,24 +279,8 @@ void LLVertexBuffer::unbind() void LLVertexBuffer::cleanupClass() { LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); - startRender(); - stopRender(); - clientCopy(); // deletes GL buffers -} - -//static, call before rendering VBOs -void LLVertexBuffer::startRender() -{ - LLMemType mt(LLMemType::MTYPE_VERTEX_DATA); - - unbind(); - sRenderActive = TRUE; -} - -void LLVertexBuffer::stopRender() -{ unbind(); - sRenderActive = FALSE; + clientCopy(); // deletes GL buffers } void LLVertexBuffer::clientCopy(F64 max_time) @@ -717,7 +734,7 @@ BOOL LLVertexBuffer::useVBOs() const return FALSE; } #endif - return sEnableVBOs; // && (!sRenderActive || !mLocked); + return sEnableVBOs; } //---------------------------------------------------------------------------- @@ -1000,10 +1017,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) sGLRenderBuffer = mGLBuffer; if (data_mask && setup) { - if (!sRenderActive) - { - llwarns << "Vertex buffer set for rendering outside of render frame." << llendl; - } setupVertexBuffer(data_mask); // subclass specific setup (virtual function) sSetCount++; } diff --git a/linden/indra/llrender/llvertexbuffer.h b/linden/indra/llrender/llvertexbuffer.h index 453f3ac..64a6f60 100644 --- a/linden/indra/llrender/llvertexbuffer.h +++ b/linden/indra/llrender/llvertexbuffer.h @@ -85,9 +85,7 @@ public: static void initClass(bool use_vbo); static void cleanupClass(); static void setupClientArrays(U32 data_mask); - static void startRender(); //between start and stop render, no client copies will occur - static void stopRender(); //any buffer not copied to GL will be rendered from client memory - static void clientCopy(F64 max_time = 0.005); //copy data from client to GL + static void clientCopy(F64 max_time = 0.005); //copy data from client to GL static void unbind(); //unbind any bound vertex buffer //get the size of a vertex with the given typemask @@ -131,6 +129,8 @@ public: POINTS, LINES, LINE_STRIP, + QUADS, + LINE_LOOP, NUM_MODES }; protected: @@ -205,6 +205,7 @@ public: void markDirty(U32 vert_index, U32 vert_count, U32 indices_index, U32 indices_count); void draw(U32 mode, U32 count, U32 indices_offset) const; + void drawArrays(U32 mode, U32 offset, U32 count) const; void drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const; protected: @@ -244,7 +245,6 @@ protected: std::vector mDirtyRegions; //vector of dirty regions to rebuild public: - static BOOL sRenderActive; static S32 sCount; static S32 sGLCount; static S32 sMappedCount; diff --git a/linden/indra/llui/llui.cpp b/linden/indra/llui/llui.cpp index aafd3af..45b1175 100644 --- a/linden/indra/llui/llui.cpp +++ b/linden/indra/llui/llui.cpp @@ -152,7 +152,7 @@ void gl_draw_x(const LLRect& rect, const LLColor4& color) gGL.color4fv( color.mV ); - gGL.begin( GL_LINES ); + gGL.begin( LLVertexBuffer::LINES ); gGL.vertex2i( rect.mLeft, rect.mTop ); gGL.vertex2i( rect.mRight, rect.mBottom ); gGL.vertex2i( rect.mLeft, rect.mBottom ); @@ -193,7 +193,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) // Counterclockwise quad will face the viewer if( filled ) { - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -205,7 +205,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) if( gGLManager.mATIOffsetVerticalLines ) { // Work around bug in ATI driver: vertical lines are offset by (-1,-1) - gGL.begin( GL_LINES ); + gGL.begin( LLVertexBuffer::LINES ); // Verticals gGL.vertex2i(left + 1, top); @@ -228,7 +228,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) { top--; right--; - gGL.begin( GL_LINE_STRIP ); + gGL.begin( LLVertexBuffer::LINE_STRIP ); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -269,7 +269,7 @@ void gl_drop_shadow(S32 left, S32 top, S32 right, S32 bottom, const LLColor4 &st LLColor4 end_color = start_color; end_color.mV[VALPHA] = 0.f; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); // Right edge, CCW faces screen gGL.color4fv(start_color.mV); @@ -331,7 +331,7 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2 ) LLGLSNoTexture no_texture; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); gGL.end(); @@ -352,7 +352,7 @@ void gl_line_2d(S32 x1, S32 y1, S32 x2, S32 y2, const LLColor4 &color ) gGL.color4fv( color.mV ); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); gGL.end(); @@ -366,11 +366,11 @@ void gl_triangle_2d(S32 x1, S32 y1, S32 x2, S32 y2, S32 x3, S32 y3, const LLColo if (filled) { - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); } else { - gGL.begin(GL_LINE_LOOP); + gGL.begin(LLVertexBuffer::LINE_LOOP); } gGL.vertex2i(x1, y1); gGL.vertex2i(x2, y2); @@ -384,7 +384,7 @@ void gl_corners_2d(S32 left, S32 top, S32 right, S32 bottom, S32 length, F32 max length = llmin((S32)(max_frac*(right - left)), length); length = llmin((S32)(max_frac*(top - bottom)), length); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2i(left, top); gGL.vertex2i(left + length, top); @@ -515,7 +515,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLIma gGL.color4fv(color.mV); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { // draw bottom left gGL.texCoord2f(uv_rect.mLeft, uv_rect.mBottom); @@ -675,7 +675,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre gGL.color4fv(color.mV); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2f(uv_rect.mRight, uv_rect.mTop); gGL.vertex2i(width, height ); @@ -713,7 +713,7 @@ void gl_draw_scaled_image_inverted(S32 x, S32 y, S32 width, S32 height, LLImageG gGL.color4fv(color.mV); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2f(uv_rect.mRight, uv_rect.mBottom); gGL.vertex2i(width, height ); @@ -748,7 +748,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL glLineWidth(2.5f); glLineStipple(2, 0x3333 << shift); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv( start.mV ); gGL.vertex3fv( end.mV ); @@ -765,7 +765,7 @@ void gl_rect_2d_xor(S32 left, S32 top, S32 right, S32 bottom) glLogicOp( GL_XOR ); stop_glerror(); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); gGL.vertex2i(right, bottom); @@ -797,14 +797,14 @@ void gl_arc_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled, F if (filled) { - gGL.begin(GL_TRIANGLE_FAN); + gGL.begin(LLVertexBuffer::TRIANGLE_FAN); gGL.vertex2f(0.f, 0.f); // make sure circle is complete steps += 1; } else { - gGL.begin(GL_LINE_STRIP); + gGL.begin(LLVertexBuffer::LINE_STRIP); } while( steps-- ) @@ -836,14 +836,14 @@ void gl_circle_2d(F32 center_x, F32 center_y, F32 radius, S32 steps, BOOL filled if (filled) { - gGL.begin(GL_TRIANGLE_FAN); + gGL.begin(LLVertexBuffer::TRIANGLE_FAN); gGL.vertex2f(0.f, 0.f); // make sure circle is complete steps += 1; } else { - gGL.begin(GL_LINE_LOOP); + gGL.begin(LLVertexBuffer::LINE_LOOP); } while( steps-- ) @@ -865,7 +865,7 @@ void gl_deep_circle( F32 radius, F32 depth, S32 steps ) F32 x = radius; F32 y = 0.f; F32 angle_delta = F_TWO_PI / (F32)steps; - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); { S32 step = steps + 1; // An extra step to close the circle. while( step-- ) @@ -952,7 +952,7 @@ void gl_washer_2d(F32 outer_radius, F32 inner_radius, S32 steps, const LLColor4& LLGLSNoTexture gls_no_texture; - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); { steps += 1; // An extra step to close the circle. while( steps-- ) @@ -988,7 +988,7 @@ void gl_washer_segment_2d(F32 outer_radius, F32 inner_radius, F32 start_radians, F32 y2 = inner_radius * sin( start_radians ); LLGLSNoTexture gls_no_texture; - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); { steps += 1; // An extra step to close the circle. while( steps-- ) @@ -1025,7 +1025,7 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL LLGLSNoTexture gls_no_texture; - gGL.begin( GL_LINES ); + gGL.begin( LLVertexBuffer::LINES ); { while( count-- ) { @@ -1048,7 +1048,7 @@ void gl_washer_spokes_2d(F32 outer_radius, F32 inner_radius, S32 count, const LL void gl_rect_2d_simple_tex( S32 width, S32 height ) { - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(width, height); @@ -1067,7 +1067,7 @@ void gl_rect_2d_simple_tex( S32 width, S32 height ) void gl_rect_2d_simple( S32 width, S32 height ) { - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); gGL.vertex2i(width, height); gGL.vertex2i(0, height); gGL.vertex2i(0, 0); @@ -1109,7 +1109,7 @@ void gl_segmented_rect_2d_tex(const S32 left, LLVector2 width_vec((F32)width, 0.f); LLVector2 height_vec(0.f, (F32)height); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { // draw bottom left gGL.texCoord2f(0.f, 0.f); @@ -1277,7 +1277,7 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left, LLVector2 x_min; LLVector2 x_max; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { if (start_fragment < middle_start) { @@ -1434,7 +1434,7 @@ void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& bo LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { // draw bottom left gGL.texCoord2f(0.f, 0.f); diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index c9828dd..750821c 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -1306,7 +1306,7 @@ void LLView::drawDebugRect() gGL.color4fv( border_color.mV ); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2i(0, debug_rect.getHeight() - 1); gGL.vertex2i(0, 0); diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index e8cff7b..e9b7ca5 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp @@ -248,7 +248,7 @@ void LLViewBorder::drawTextureTrapezoid( F32 degrees, S32 width, S32 length, F32 gGL.translatef(start_x, start_y, 0.f); glRotatef( degrees, 0, 0, 1 ); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { // width, width /---------\ length-width, width // // / \ // diff --git a/linden/indra/llwindow/llgl.h b/linden/indra/llwindow/llgl.h index 25ad0d6..e8f17bf 100644 --- a/linden/indra/llwindow/llgl.h +++ b/linden/indra/llwindow/llgl.h @@ -252,12 +252,27 @@ protected: BOOL mIsEnabled; }; +// New LLGLState class wrappers that don't depend on actual GL flags. +class LLGLEnableBlending : public LLGLState +{ +public: + LLGLEnableBlending(bool enable); +}; + +class LLGLEnableAlphaReject : public LLGLState +{ +public: + LLGLEnableAlphaReject(bool enable); +}; + +/// TODO: Being deprecated. class LLGLEnable : public LLGLState { public: LLGLEnable(LLGLenum state) : LLGLState(state, TRUE) {} }; +/// TODO: Being deprecated. class LLGLDisable : public LLGLState { public: diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 8bb26ab..03c8321 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/indra/lscript/lscript_compile/indra.l @@ -12,6 +12,7 @@ FS (f|F) #include "linden_common.h" // Deal with the fact that lex/yacc generates unreachable code #ifdef LL_WINDOWS +#pragma warning (disable : 4018) // warning C4018: signed/unsigned mismatch #pragma warning (disable : 4702) // warning C4702: unreachable code #endif // LL_WINDOWS #include "llmath.h" @@ -44,7 +45,10 @@ void parse_string(); #define YYLMAX 16384 #define YY_NEVER_INTERACTIVE 1 /* stops flex from calling isatty() */ - +#ifdef LL_WINDOWS +#define isatty(x) 0 /* hack for bug in cygwin flex 2.5.35 */ +#endif + #ifdef ECHO #undef ECHO #endif diff --git a/linden/indra/lscript/lscript_compile/lscript_compile.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile.vcproj index f2c75c5..a95c05e 100644 --- a/linden/indra/lscript/lscript_compile/lscript_compile.vcproj +++ b/linden/indra/lscript/lscript_compile/lscript_compile.vcproj @@ -20,7 +20,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;LL_DEBUG;YY_NO_UNISTD_H" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -66,7 +66,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Oy-" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" ForceConformanceInForLoopScope="TRUE" @@ -111,7 +111,7 @@ AdditionalOptions="/Oy-" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" ForceConformanceInForLoopScope="TRUE" diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj index 0622c32..9972c52 100644 --- a/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj +++ b/linden/indra/lscript/lscript_compile/lscript_compile_vc8.vcproj @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;YY_NO_UNISTD_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -111,7 +111,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Oy-" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" TreatWChar_tAsBuiltInType="false" @@ -179,7 +179,7 @@ AdditionalOptions="/Oy-" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" TreatWChar_tAsBuiltInType="false" diff --git a/linden/indra/lscript/lscript_compile/lscript_compile_vc9.vcproj b/linden/indra/lscript/lscript_compile/lscript_compile_vc9.vcproj index 581c99e..6167895 100644 --- a/linden/indra/lscript/lscript_compile/lscript_compile_vc9.vcproj +++ b/linden/indra/lscript/lscript_compile/lscript_compile_vc9.vcproj @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG" + PreprocessorDefinitions="WIN32;_DEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_DEBUG;YY_NO_UNISTD_H" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -112,7 +112,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Oy-" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" TreatWChar_tAsBuiltInType="false" @@ -180,7 +180,7 @@ AdditionalOptions="/Oy-" Optimization="0" AdditionalIncludeDirectories="..;..\..\llcommon;..\..\llmath;..\..\llvfs;..\..\llmessage;..\..\llinventory;"..\..\..\libraries\i686-win32\include";..\..\..\libraries\include" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;LL_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_USE_32BIT_TIME_T;LL_RELEASE;YY_NO_UNISTD_H" RuntimeLibrary="0" StructMemberAlignment="0" TreatWChar_tAsBuiltInType="false" diff --git a/linden/indra/newview/llbox.cpp b/linden/indra/newview/llbox.cpp index 49dacc1..984d15b 100644 --- a/linden/indra/newview/llbox.cpp +++ b/linden/indra/newview/llbox.cpp @@ -81,7 +81,7 @@ void LLBox::renderface(S32 which_face) {7, 4, 0, 3} }; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); //gGL.normal3fv(&normals[which_face][0]); gGL.texCoord2f(1,0); gGL.vertex3fv(&mVertex[ faces[which_face][0] ][0]); diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index 8e3341a..6cfd131 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp @@ -483,7 +483,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) LLVector3 pos = avatarp->getPositionAgent(); gGL.color4f(1.0f, 0.0f, 0.0f, 0.8f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv((pos - LLVector3(0.2f, 0.f, 0.f)).mV); gGL.vertex3fv((pos + LLVector3(0.2f, 0.f, 0.f)).mV); @@ -495,7 +495,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) pos = avatarp->mDrawable->getPositionAgent(); gGL.color4f(1.0f, 0.0f, 0.0f, 0.8f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv((pos - LLVector3(0.2f, 0.f, 0.f)).mV); gGL.vertex3fv((pos + LLVector3(0.2f, 0.f, 0.f)).mV); @@ -507,7 +507,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) pos = avatarp->mRoot.getWorldPosition(); gGL.color4f(1.0f, 1.0f, 1.0f, 0.8f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv((pos - LLVector3(0.2f, 0.f, 0.f)).mV); gGL.vertex3fv((pos + LLVector3(0.2f, 0.f, 0.f)).mV); @@ -519,7 +519,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) pos = avatarp->mPelvisp->getWorldPosition(); gGL.color4f(0.0f, 0.0f, 1.0f, 0.8f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv((pos - LLVector3(0.2f, 0.f, 0.f)).mV); gGL.vertex3fv((pos + LLVector3(0.2f, 0.f, 0.f)).mV); diff --git a/linden/indra/newview/lldynamictexture.cpp b/linden/indra/newview/lldynamictexture.cpp index 6bcf140..ce7f1ec 100644 --- a/linden/indra/newview/lldynamictexture.cpp +++ b/linden/indra/newview/lldynamictexture.cpp @@ -223,17 +223,18 @@ BOOL LLDynamicTexture::updateAllInstances() glClear(GL_DEPTH_BUFFER_BIT); gDisplaySwapBuffers = FALSE; + + gGL.color4f(1,1,1,1); dynamicTexture->preRender(); // Must be called outside of startRender() - LLVertexBuffer::startRender(); - if (dynamicTexture->render()) { result = TRUE; sNumRenders++; } - LLVertexBuffer::stopRender(); - + gGL.flush(); + LLVertexBuffer::unbind(); + dynamicTexture->postRender(result); } } diff --git a/linden/indra/newview/llface.cpp b/linden/indra/newview/llface.cpp index 1f1febb..4a5e532 100644 --- a/linden/indra/newview/llface.cpp +++ b/linden/indra/newview/llface.cpp @@ -493,7 +493,7 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count) glPolygonOffset(factor, bias); if (sSafeRenderSelect) { - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); if (count) { for (S32 i = offset; i < offset + count; i++) diff --git a/linden/indra/newview/llfasttimerview.cpp b/linden/indra/newview/llfasttimerview.cpp index 372d8fa..047016f 100644 --- a/linden/indra/newview/llfasttimerview.cpp +++ b/linden/indra/newview/llfasttimerview.cpp @@ -978,7 +978,7 @@ void LLFastTimerView::draw() gGL.color4f(0.5f,0.5f,0.5f,1); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2i((S32)bar, graph_rect.mBottom); gGL.vertex2i((S32)bar, graph_rect.mTop); gGL.end(); @@ -1014,7 +1014,7 @@ void LLFastTimerView::draw() } gGL.color4f(col[0], col[1], col[2], alpha); - gGL.begin(GL_LINE_STRIP); + gGL.begin(LLVertexBuffer::LINE_STRIP); for (U32 j = 0; j < LLFastTimer::FTM_HISTORY_NUM; j++) { U64 ticks = ticks_sum[j+1][idx]; diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 253e5b0..890cfd2 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -382,7 +382,7 @@ void LLFloaterAnimPreview::draw() gGL.color3f(1.f, 1.f, 1.f); mAnimPreview->bindTexture(); - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); { gGL.texCoord2f(0.f, 1.f); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); @@ -1068,8 +1068,6 @@ BOOL LLPreviewAnimation::render() { mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; - - gGL.start(); glMatrixMode(GL_PROJECTION); gGL.pushMatrix(); @@ -1092,7 +1090,7 @@ BOOL LLPreviewAnimation::render() glMatrixMode(GL_MODELVIEW); gGL.popMatrix(); - gGL.stop(); + gGL.flush(); LLVector3 target_pos = avatarp->mRoot.getWorldPosition(); @@ -1124,9 +1122,9 @@ BOOL LLPreviewAnimation::render() avatarp->updateMotion(); } - LLVertexBuffer::stopRender(); + LLVertexBuffer::unbind(); avatarp->updateLOD(); - LLVertexBuffer::startRender(); + avatarp->mRoot.updateWorldMatrixChildren(); @@ -1140,6 +1138,7 @@ BOOL LLPreviewAnimation::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } + gGL.color4f(1,1,1,1); return TRUE; } diff --git a/linden/indra/newview/llfloatercolorpicker.cpp b/linden/indra/newview/llfloatercolorpicker.cpp index 1a56597..e72cb1a 100644 --- a/linden/indra/newview/llfloatercolorpicker.cpp +++ b/linden/indra/newview/llfloatercolorpicker.cpp @@ -545,7 +545,7 @@ void LLFloaterColorPicker::draw() { LLGLSNoTexture no_texture; LLGLEnable(GL_CULL_FACE); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(swatch_rect.mLeft, swatch_rect.mTop); diff --git a/linden/indra/newview/llfloaterimagepreview.cpp b/linden/indra/newview/llfloaterimagepreview.cpp index f1f7ff6..a228587 100644 --- a/linden/indra/newview/llfloaterimagepreview.cpp +++ b/linden/indra/newview/llfloaterimagepreview.cpp @@ -260,7 +260,7 @@ void LLFloaterImagePreview::draw() } gGL.color3f(1.f, 1.f, 1.f); - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); { gGL.texCoord2f(mPreviewImageRect.mLeft, mPreviewImageRect.mTop); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); @@ -288,7 +288,7 @@ void LLFloaterImagePreview::draw() else mAvatarPreview->bindTexture(); - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); { gGL.texCoord2f(0.f, 1.f); gGL.vertex2i(PREVIEW_HPAD, PREVIEW_TEXTURE_HEIGHT); @@ -667,8 +667,6 @@ void LLImagePreviewAvatar::setPreviewTarget(const char* joint_name, const char* //----------------------------------------------------------------------------- BOOL LLImagePreviewAvatar::render() { - gGL.start(); - mNeedsUpdate = FALSE; LLVOAvatar* avatarp = mDummyAvatar; @@ -692,7 +690,7 @@ BOOL LLImagePreviewAvatar::render() glMatrixMode(GL_MODELVIEW); gGL.popMatrix(); - gGL.stop(); + gGL.flush(); LLVector3 target_pos = mTargetJoint->getWorldPosition(); LLQuaternion camera_rot = LLQuaternion(mCameraPitch, LLVector3::y_axis) * @@ -710,9 +708,9 @@ BOOL LLImagePreviewAvatar::render() LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / mCameraZoom); LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mWidth, mHeight, FALSE); - LLVertexBuffer::stopRender(); + LLVertexBuffer::unbind(); avatarp->updateLOD(); - LLVertexBuffer::startRender(); + if (avatarp->mDrawable.notNull()) { @@ -725,6 +723,7 @@ BOOL LLImagePreviewAvatar::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } + gGL.color4f(1,1,1,1); return TRUE; } @@ -823,8 +822,6 @@ void LLImagePreviewSculpted::setPreviewTarget(LLImageRaw* imagep, F32 distance) //----------------------------------------------------------------------------- BOOL LLImagePreviewSculpted::render() { - gGL.start(); - mNeedsUpdate = FALSE; LLGLSUIDefault def; @@ -919,8 +916,6 @@ BOOL LLImagePreviewSculpted::render() delete [] normals; } - gGL.stop(); - return TRUE; } diff --git a/linden/indra/newview/llfloatersnapshot.cpp b/linden/indra/newview/llfloatersnapshot.cpp index 20b4510..c36c54d 100644 --- a/linden/indra/newview/llfloatersnapshot.cpp +++ b/linden/indra/newview/llfloatersnapshot.cpp @@ -413,7 +413,7 @@ void LLSnapshotLivePreview::draw() glPushMatrix(); { glTranslatef((F32)rect.mLeft, (F32)rect.mBottom, 0.f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2f(uv_width, uv_height); gGL.vertex2i(rect.getWidth(), rect.getHeight() ); @@ -476,7 +476,7 @@ void LLSnapshotLivePreview::draw() S32 y2 = gViewerWindow->getWindowHeight(); LLGLSNoTexture no_texture; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.color4f(1.f, 1.f, 1.f, 0.f); gGL.vertex2i(x1, y1); @@ -507,7 +507,7 @@ void LLSnapshotLivePreview::draw() LLGLSNoTexture no_texture; gGL.color4f(1.f, 1.f, 1.f, 1.f); LLRect outline_rect = mImageRect[mCurImageIndex]; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.vertex2i(outline_rect.mLeft - BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); gGL.vertex2i(outline_rect.mRight + BORDER_WIDTH, outline_rect.mTop + BORDER_WIDTH); @@ -553,7 +553,7 @@ void LLSnapshotLivePreview::draw() LLRect& rect = mImageRect[old_image_index]; glTranslatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f); glRotatef(-45.f * fall_interp, 0.f, 0.f, 1.f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2f(uv_width, uv_height); gGL.vertex2i(rect.getWidth(), rect.getHeight() ); diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index f63eaf3..4ea38aa 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp @@ -358,7 +358,7 @@ void LLCompass::draw() mBkgndTexture->bind(); gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(width, height); @@ -384,7 +384,7 @@ void LLCompass::draw() mTexture->bind(); gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(1.f, 1.f); gGL.vertex2i(width, height); @@ -428,7 +428,7 @@ void LLHorizontalCompass::draw() mTexture->bind(); gGL.color4f(1.0f, 1.0f, 1.0f, 1.0f ); - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); gGL.texCoord2f(right, 1.f); gGL.vertex2i(width, height); @@ -479,11 +479,11 @@ void LLWind::renderVectors() gGL.pushMatrix(); gGL.translatef((F32)i * region_width_meters/mSize, (F32)j * region_width_meters/mSize, 0.0); gGL.color3f(0,1,0); - gGL.begin(GL_POINTS); + gGL.begin(LLVertexBuffer::POINTS); gGL.vertex3f(0,0,0); gGL.end(); gGL.color3f(1,0,0); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f(x * 0.1f, y * 0.1f ,0.f); gGL.vertex3f(x, y, 0.f); gGL.end(); @@ -532,7 +532,7 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global, gGL.color4f(1.f, 1.f, 0.f, 1.f); // Cheat and give this the same pick-name as land - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f(west, north, nw_bottom); gGL.vertex3f(west, north, nw_top); @@ -549,7 +549,7 @@ void LLViewerParcelMgr::renderRect(const LLVector3d &west_south_bottom_global, gGL.end(); gGL.color4f(1.f, 1.f, 0.f, 0.2f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex3f(west, north, nw_bottom); gGL.vertex3f(west, north, nw_top); @@ -616,7 +616,7 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel ) gGL.color4f(0.f, 1.f, 1.f, 1.f); // Cheat and give this the same pick-name as land - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f(west, north, nw_bottom); gGL.vertex3f(west, north, nw_top); @@ -633,7 +633,7 @@ void LLViewerParcelMgr::renderParcel(LLParcel* parcel ) gGL.end(); gGL.color4f(0.f, 1.f, 1.f, 0.2f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex3f(west, north, nw_bottom); gGL.vertex3f(west, north, nw_top); @@ -786,7 +786,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi if (!has_segments) { has_segments = true; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); } renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, SOUTH_MASK, regionp); } @@ -802,7 +802,7 @@ void LLViewerParcelMgr::renderHighlightSegments(const U8* segments, LLViewerRegi if (!has_segments) { has_segments = true; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); } renderOneSegment(x1, y1, x2, y2, PARCEL_POST_HEIGHT, WEST_MASK, regionp); } @@ -857,7 +857,7 @@ void LLViewerParcelMgr::renderCollisionSegments(U8* segments, BOOL use_pass, LLV LLViewerImage::bindTexture(mBlockedImage); } - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); for (y = 0; y < STRIDE; y++) { @@ -1014,7 +1014,7 @@ void LLViewerObjectList::renderObjectBeacons() LLGLSNoTexture gls_ui_no_texture; S32 last_line_width = -1; - // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width) + // gGL.begin(LLVertexBuffer::LINES); // Always happens in (line_width != last_line_width) for (S32 i = 0; i < mDebugBeacons.count(); i++) { @@ -1031,7 +1031,7 @@ void LLViewerObjectList::renderObjectBeacons() } glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; @@ -1053,7 +1053,7 @@ void LLViewerObjectList::renderObjectBeacons() LLGLDepthTest gls_depth(GL_TRUE); S32 last_line_width = -1; - // gGL.begin(GL_LINES); // Always happens in (line_width != last_line_width) + // gGL.begin(LLVertexBuffer::LINES); // Always happens in (line_width != last_line_width) for (S32 i = 0; i < mDebugBeacons.count(); i++) { @@ -1069,7 +1069,7 @@ void LLViewerObjectList::renderObjectBeacons() } glLineWidth( (F32)line_width ); last_line_width = line_width; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); } const LLVector3 &thisline = debug_beacon.mPositionAgent; diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index abe2a66..92e7fdf 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp @@ -504,7 +504,7 @@ void LLHUDEffectLookAt::render() glPushMatrix(); glTranslatef(target.mV[VX], target.mV[VY], target.mV[VZ]); glScalef(0.3f, 0.3f, 0.3f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { LLColor3 color = (*mAttentions)[mTargetType].mColor; gGL.color3f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]); diff --git a/linden/indra/newview/llhudeffectpointat.cpp b/linden/indra/newview/llhudeffectpointat.cpp index 97e3bd7..d42eeb5 100644 --- a/linden/indra/newview/llhudeffectpointat.cpp +++ b/linden/indra/newview/llhudeffectpointat.cpp @@ -334,7 +334,7 @@ void LLHUDEffectPointAt::render() glPushMatrix(); glTranslatef(target.mV[VX], target.mV[VY], target.mV[VZ]); glScalef(0.3f, 0.3f, 0.3f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.color3f(1.f, 0.f, 0.f); gGL.vertex3f(-1.f, 0.f, 0.f); diff --git a/linden/indra/newview/llhudicon.cpp b/linden/indra/newview/llhudicon.cpp index 22d157c..010e85f 100644 --- a/linden/indra/newview/llhudicon.cpp +++ b/linden/indra/newview/llhudicon.cpp @@ -166,7 +166,7 @@ void LLHUDIcon::renderIcon(BOOL for_select) LLViewerImage::bindTexture(mImagep); } - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2f(0.f, 1.f); gGL.vertex3fv(upper_left.mV); diff --git a/linden/indra/newview/llhudobject.cpp b/linden/indra/newview/llhudobject.cpp index c2525eb..f66501c 100644 --- a/linden/indra/newview/llhudobject.cpp +++ b/linden/indra/newview/llhudobject.cpp @@ -281,6 +281,8 @@ void LLHUDObject::renderAll() hud_objp->render(); } } + + LLVertexBuffer::unbind(); } // static diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp index 92caf8e..f8eddc7 100644 --- a/linden/indra/newview/llhudtext.cpp +++ b/linden/indra/newview/llhudtext.cpp @@ -317,7 +317,7 @@ void LLHUDText::renderText(BOOL for_select) LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]); gGL.color4fv(bg_color.mV); LLUI::setLineWidth(2.0); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { if (outside_width) { diff --git a/linden/indra/newview/lljoystickbutton.cpp b/linden/indra/newview/lljoystickbutton.cpp index 548da07..1978b78 100644 --- a/linden/indra/newview/lljoystickbutton.cpp +++ b/linden/indra/newview/lljoystickbutton.cpp @@ -655,7 +655,7 @@ void LLJoystickCameraRotate::drawRotatedImage( const LLImageGL* image, S32 rotat gGL.color4fv(UI_VERTEX_COLOR.mV); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2fv( uv[ (rotations + 0) % 4]); gGL.vertex2i(width, height ); diff --git a/linden/indra/newview/llmanip.cpp b/linden/indra/newview/llmanip.cpp index 8934266..e0621a3 100644 --- a/linden/indra/newview/llmanip.cpp +++ b/linden/indra/newview/llmanip.cpp @@ -391,7 +391,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) if (draw_x) { gGL.color4f(1.f, 0.f, 0.f, LINE_ALPHA); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f( -region_size, 0.f, 0.f ); gGL.vertex3f( region_size, 0.f, 0.f ); gGL.end(); @@ -400,7 +400,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) if (draw_y) { gGL.color4f(0.f, 1.f, 0.f, LINE_ALPHA); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f( 0.f, -region_size, 0.f ); gGL.vertex3f( 0.f, region_size, 0.f ); gGL.end(); @@ -409,7 +409,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) if (draw_z) { gGL.color4f(0.f, 0.f, 1.f, LINE_ALPHA); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex3f( 0.f, 0.f, -region_size ); gGL.vertex3f( 0.f, 0.f, region_size ); gGL.end(); diff --git a/linden/indra/newview/llmaniprotate.cpp b/linden/indra/newview/llmaniprotate.cpp index 94bbe7d..43a22e5 100644 --- a/linden/indra/newview/llmaniprotate.cpp +++ b/linden/indra/newview/llmaniprotate.cpp @@ -868,7 +868,7 @@ void LLManipRotate::renderSnapGuides() LLVector3 outer_point; LLVector3 text_point; LLQuaternion rot(deg * DEG_TO_RAD, constraint_axis); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { inner_point = (projected_snap_axis * mRadiusMeters * SNAP_GUIDE_INNER_RADIUS * rot) + center; F32 tick_length = 0.f; @@ -1046,7 +1046,7 @@ void LLManipRotate::renderSnapGuides() object_axis = object_axis * SNAP_GUIDE_INNER_RADIUS * mRadiusMeters + center; LLVector3 line_start = center; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv(line_start.mV); gGL.vertex3fv(object_axis.mV); @@ -1054,7 +1054,7 @@ void LLManipRotate::renderSnapGuides() gGL.end(); // draw snap guide arrow - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { LLVector3 arrow_dir; LLVector3 arrow_span = (object_axis - line_start) % getConstraintAxis(); @@ -1074,7 +1074,7 @@ void LLManipRotate::renderSnapGuides() { LLGLDepthTest gls_depth(GL_TRUE); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.vertex3fv(line_start.mV); gGL.vertex3fv(object_axis.mV); @@ -1082,7 +1082,7 @@ void LLManipRotate::renderSnapGuides() gGL.end(); // draw snap guide arrow - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { LLVector3 arrow_dir; LLVector3 arrow_span = (object_axis - line_start) % getConstraintAxis(); diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp index 86bfba9..bb26484 100644 --- a/linden/indra/newview/llmanipscale.cpp +++ b/linden/indra/newview/llmanipscale.cpp @@ -600,7 +600,7 @@ void LLManipScale::renderFaces( const LLBBox& bbox ) { gGL.color4fv( default_normal_color.mV ); LLGLDepthTest gls_depth(GL_FALSE); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { // Face 0 gGL.vertex3f(min.mV[VX], max.mV[VY], max.mV[VZ]); @@ -1534,7 +1534,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) { LLColor4 tick_color = setupSnapGuideRenderPass(pass); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); LLVector3 line_mid = mScaleCenter + (mScaleSnapValue * mScaleDir) + (mSnapGuideDir1 * mSnapRegimeOffset); LLVector3 line_start = line_mid - (mScaleDir * (llmin(mScaleSnapValue, mSnapGuideLength * 0.5f))); LLVector3 line_end = line_mid + (mScaleDir * llmin(max_point_on_scale_line - mScaleSnapValue, mSnapGuideLength * 0.5f)); @@ -1585,7 +1585,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) if (mInSnapRegime) { // draw snap guide line - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); LLVector3 snap_line_center = mScaleCenter + (mScaleSnapValue * mScaleDir); LLVector3 snap_line_start = snap_line_center + (mSnapGuideDir1 * mSnapRegimeOffset); @@ -1599,7 +1599,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) gGL.end(); // draw snap guide arrow - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { //gGLSNoCullFaces.set(); gGL.color4f(1.f, 1.f, 1.f, grid_alpha); @@ -1634,7 +1634,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox) start_tick = -(llmin(ticks_from_scale_center_1, num_ticks_per_side1)); stop_tick = llmin(max_ticks1, num_ticks_per_side1); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); // draw first row of ticks for (S32 i = start_tick; i <= stop_tick; i++) { diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index 7d729a6..ac41068 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp @@ -1253,7 +1253,7 @@ void LLManipTranslate::renderSnapGuides() { LLColor4 line_color = setupSnapGuideRenderPass(pass); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { LLVector3 line_start = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) + (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); LLVector3 line_end = selection_center + (mSnapOffsetMeters * mSnapOffsetAxis) - (translate_axis * (guide_size_meters * 0.5f + offset_nearest_grid_unit)); @@ -1329,7 +1329,7 @@ void LLManipTranslate::renderSnapGuides() LLVector3 line_start = selection_center - mSnapOffsetAxis * mSnapOffsetMeters; LLVector3 line_end = selection_center + mSnapOffsetAxis * mSnapOffsetMeters; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); @@ -1339,7 +1339,7 @@ void LLManipTranslate::renderSnapGuides() gGL.end(); // draw snap guide arrow - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { gGL.color4f(line_color.mV[VX], line_color.mV[VY], line_color.mV[VZ], line_color.mV[VW]); @@ -1594,7 +1594,7 @@ void LLManipTranslate::renderGrid(F32 x, F32 y, F32 size, F32 r, F32 g, F32 b, F for (F32 xx = -size-d; xx < size+d; xx += d) { - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); for (F32 yy = -size-d; yy < size+d; yy += d) { float dx, dy, da; @@ -1640,7 +1640,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, GLuint stencil_mask = 0xFFFFFFFF; //stencil in volumes - gGL.stop(); + gGL.flush(); { glStencilMask(stencil_mask); glClearStencil(1); @@ -1702,7 +1702,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal, glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); } - gGL.start(); + gGL.color4f(1,1,1,1); gGL.pushMatrix(); @@ -1907,7 +1907,7 @@ void LLManipTranslate::renderTranslationHandles() color1.setVec(0.f, 1.f, 0.f, 0.6f); color2.setVec(0.f, 0.f, 1.f, 0.6f); } - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { gGL.color4fv(color1.mV); gGL.vertex3f(0.f, mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f), mPlaneManipOffsetMeters * (-PLANE_TICK_SIZE * 0.25f)); @@ -1922,7 +1922,7 @@ void LLManipTranslate::renderTranslationHandles() gGL.end(); LLUI::setLineWidth(3.0f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.color4f(0.f, 0.f, 0.f, 0.3f); gGL.vertex3f(0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); @@ -1962,7 +1962,7 @@ void LLManipTranslate::renderTranslationHandles() color2.setVec(1.f, 0.f, 0.f, 0.6f); } - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { gGL.color4fv(color1.mV); gGL.vertex3f(mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f), 0.f, mPlaneManipOffsetMeters * (PLANE_TICK_SIZE * 0.25f)); @@ -1977,7 +1977,7 @@ void LLManipTranslate::renderTranslationHandles() gGL.end(); LLUI::setLineWidth(3.0f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.color4f(0.f, 0.f, 0.f, 0.3f); gGL.vertex3f(mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f, 0.f, mPlaneManipOffsetMeters * -PLANE_TICK_SIZE * 0.25f); @@ -2041,7 +2041,7 @@ void LLManipTranslate::renderTranslationHandles() color2.setVec(0.f, 0.8f, 0.f, 0.6f); } - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { gGL.color4fv(color1.mV); gGL.vertex3fv(v0.mV); @@ -2056,7 +2056,7 @@ void LLManipTranslate::renderTranslationHandles() gGL.end(); LLUI::setLineWidth(3.0f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { gGL.color4f(0.f, 0.f, 0.f, 0.3f); LLVector3 v12 = (v1 + v2) * .5f; @@ -2190,7 +2190,7 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ { LLUI::setLineWidth(2.0f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); vec.mV[index] = box_size; gGL.vertex3f(vec.mV[0], vec.mV[1], vec.mV[2]); diff --git a/linden/indra/newview/llnetmap.cpp b/linden/indra/newview/llnetmap.cpp index 9226fac..b6e22d8 100644 --- a/linden/indra/newview/llnetmap.cpp +++ b/linden/indra/newview/llnetmap.cpp @@ -287,7 +287,7 @@ void LLNetMap::draw() // Draw using texture. LLViewerImage::bindTexture(regionp->getLand().getSTexture()); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(left, top); gGL.texCoord2f(0.f, 0.f); @@ -304,7 +304,7 @@ void LLNetMap::draw() if (regionp->getLand().getWaterTexture()) { LLViewerImage::bindTexture(regionp->getLand().getWaterTexture()); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(left, top); gGL.texCoord2f(0.f, 0.f); @@ -354,7 +354,7 @@ void LLNetMap::draw() F32 image_half_width = 0.5f*mObjectMapPixels; F32 image_half_height = 0.5f*mObjectMapPixels; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.f, 1.f); gGL.vertex2f(map_center_agent.mV[VX] - image_half_width, image_half_height + map_center_agent.mV[VY]); gGL.texCoord2f(0.f, 0.f); @@ -463,7 +463,7 @@ void LLNetMap::draw() { gGL.color4fv(gFrustumMapColor.mV); - gGL.begin( GL_TRIANGLES ); + gGL.begin( LLVertexBuffer::TRIANGLES ); gGL.vertex2f( ctr_x, ctr_y ); gGL.vertex2f( ctr_x - half_width_pixels, ctr_y + far_clip_pixels ); gGL.vertex2f( ctr_x + half_width_pixels, ctr_y + far_clip_pixels ); @@ -477,7 +477,7 @@ void LLNetMap::draw() gGL.pushMatrix(); gGL.translatef( ctr_x, ctr_y, 0 ); glRotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); - gGL.begin( GL_TRIANGLES ); + gGL.begin( LLVertexBuffer::TRIANGLES ); gGL.vertex2f( 0, 0 ); gGL.vertex2f( -half_width_pixels, far_clip_pixels ); gGL.vertex2f( half_width_pixels, far_clip_pixels ); diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index f7dd150..7d26f06 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp @@ -5274,7 +5274,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GEQUAL); glAlphaFunc(GL_GREATER, 0.01f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { S32 i = 0; for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) @@ -5295,7 +5295,7 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.flush(); gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); { S32 i = 0; for (S32 seg_num = 0; seg_num < (S32)mSilhouetteSegments.size(); seg_num++) diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp index e91e108..cb115ff 100644 --- a/linden/indra/newview/llspatialpartition.cpp +++ b/linden/indra/newview/llspatialpartition.cpp @@ -1646,7 +1646,7 @@ public: void drawBox(const LLVector3& c, const LLVector3& r) { - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); //left front gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV); gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV); @@ -1665,7 +1665,7 @@ void drawBox(const LLVector3& c, const LLVector3& r) gGL.end(); //bottom - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,-1))).mV); gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,-1))).mV); gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,-1))).mV); @@ -1673,7 +1673,7 @@ void drawBox(const LLVector3& c, const LLVector3& r) gGL.end(); //top - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.vertex3fv((c+r.scaledVec(LLVector3(1,1,1))).mV); gGL.vertex3fv((c+r.scaledVec(LLVector3(-1,1,1))).mV); gGL.vertex3fv((c+r.scaledVec(LLVector3(1,-1,1))).mV); @@ -1688,7 +1688,7 @@ void drawBoxOutline(const LLVector3& pos, const LLVector3& size) LLVector3 v3 = size.scaledVec(LLVector3(-1,-1,1)); LLVector3 v4 = size.scaledVec(LLVector3( 1,-1,1)); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); //top gGL.vertex3fv((pos+v1).mV); @@ -2032,7 +2032,7 @@ void renderOctree(LLSpatialGroup* group) drawBoxOutline(group->mObjectBounds[0], group->mObjectBounds[1]); gGL.flush(); glLineWidth(1.f); - gGL.stop(); + gGL.flush(); for (LLSpatialGroup::element_iter i = group->getData().begin(); i != group->getData().end(); ++i) { LLDrawable* drawable = *i; @@ -2074,7 +2074,7 @@ void renderOctree(LLSpatialGroup* group) } } glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - gGL.start(); + gGL.color4f(1,1,1,1); } } else @@ -2313,7 +2313,7 @@ void renderPoints(LLDrawable* drawablep) LLGLDepthTest depth(GL_FALSE, GL_FALSE); if (drawablep->getNumFaces()) { - gGL.begin(GL_POINTS); + gGL.begin(LLVertexBuffer::POINTS); gGL.color3f(1,1,1); LLVector3 center(drawablep->getPositionGroup()); for (S32 i = 0; i < drawablep->getNumFaces(); i++) @@ -2405,14 +2405,14 @@ public: if (group->mSpatialPartition->mRenderByGroup && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION)) { - gGL.stop(); + gGL.flush(); glPushMatrix(); gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); renderVisibility(group, mCamera); gGLLastMatrix = NULL; glPopMatrix(); - gGL.start(); + gGL.color4f(1,1,1,1); } } } diff --git a/linden/indra/newview/lltexlayer.cpp b/linden/indra/newview/lltexlayer.cpp index 5a0a843..66d9a33 100644 --- a/linden/indra/newview/lltexlayer.cpp +++ b/linden/indra/newview/lltexlayer.cpp @@ -244,8 +244,6 @@ BOOL LLTexLayerSetBuffer::render() BOOL upload_now = (gAgent.mNumPendingQueries == 0 && mNeedsUpload && mTexLayerSet->isLocalTextureDataFinal()); BOOL success = TRUE; - gGL.start(); - // Composite bump if( mBumpTexName ) { @@ -297,8 +295,6 @@ BOOL LLTexLayerSetBuffer::render() glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE ); gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); - gGL.stop(); - // we have valid texture data now mInitialized = TRUE; mNeedsUpdate = FALSE; diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp index acf4a10..2be75c7 100644 --- a/linden/indra/newview/lltexturectrl.cpp +++ b/linden/indra/newview/lltexturectrl.cpp @@ -484,7 +484,7 @@ void LLFloaterTexturePicker::draw() { LLGLSNoTexture no_texture; LLGLEnable(GL_CULL_FACE); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); diff --git a/linden/indra/newview/lltoolbrush.cpp b/linden/indra/newview/lltoolbrush.cpp index 9572440..319a5fd 100644 --- a/linden/indra/newview/lltoolbrush.cpp +++ b/linden/indra/newview/lltoolbrush.cpp @@ -482,7 +482,7 @@ void LLToolBrushLand::renderOverlay(LLSurface& land, const LLVector3& pos_region S32 j = (S32) pos_region.mV[VY]; S32 half_edge = llfloor(LAND_BRUSH_SIZE[mBrushIndex]); - gGL.begin(GL_POINTS); + gGL.begin(LLVertexBuffer::POINTS); for(S32 di = -half_edge; di <= half_edge; di++) { if((i+di) < 0 || (i+di) >= (S32)land.mGridsPerEdge) continue; diff --git a/linden/indra/newview/lltoolmorph.cpp b/linden/indra/newview/lltoolmorph.cpp index 9acf3a0..a18321a 100644 --- a/linden/indra/newview/lltoolmorph.cpp +++ b/linden/indra/newview/lltoolmorph.cpp @@ -163,8 +163,6 @@ void LLVisualParamHint::preRender(BOOL clear_depth) //----------------------------------------------------------------------------- BOOL LLVisualParamHint::render() { - gGL.start(); - LLVisualParamReset::sDirty = TRUE; LLVOAvatar* avatarp = gAgent.getAvatarObject(); @@ -224,7 +222,7 @@ BOOL LLVisualParamHint::render() mVisualParam->getCameraElevation() ); LLVector3 camera_pos = target_joint_pos + (camera_snapshot_offset * avatar_rotation); - gGL.stop(); + gGL.flush(); LLViewerCamera::getInstance()->setAspect((F32)mWidth / (F32)mHeight); LLViewerCamera::getInstance()->setOriginAndLookAt( @@ -241,7 +239,7 @@ BOOL LLVisualParamHint::render() avatarPoolp->renderAvatars(avatarp); // renders only one avatar } avatarp->setVisualParamWeight(mVisualParam, mLastParamWeight); - + gGL.color4f(1,1,1,1); return TRUE; } @@ -258,7 +256,7 @@ void LLVisualParamHint::draw() gGL.color4f(1.f, 1.f, 1.f, 1.f); LLGLSUIDefault gls_ui; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.texCoord2i(0, 1); gGL.vertex2i(0, mHeight); diff --git a/linden/indra/newview/lltracker.cpp b/linden/indra/newview/lltracker.cpp index 9ff2e97..9e4bb09 100644 --- a/linden/indra/newview/lltracker.cpp +++ b/linden/indra/newview/lltracker.cpp @@ -444,7 +444,7 @@ void draw_shockwave(F32 center_z, F32 t, S32 steps, LLColor4 color) F32 y = 0.f; LLColor4 ccol = LLColor4(1,1,1,(1.f-t)*0.25f); - gGL.begin(GL_TRIANGLE_FAN); + gGL.begin(LLVertexBuffer::TRIANGLE_FAN); gGL.color4fv(ccol.mV); gGL.vertex3f(0.f, 0.f, center_z); // make sure circle is complete @@ -534,7 +534,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, an *= 2.f; an += 1.0f+dr; - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.color4fv(col_edge.mV); gGL.vertex3f(-x*a, -y*a, z); gGL.color4fv(col_edge_next.mV); diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index ae23cb5..cdffe33 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -147,9 +147,11 @@ void display_startup() gViewerWindow->setup2DRender(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - gGL.start(); + gGL.color4f(1,1,1,1); gViewerWindow->draw(); - gGL.stop(); + gGL.flush(); + + LLVertexBuffer::unbind(); #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); @@ -199,12 +201,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLGLSDefault gls_default; LLGLDepthTest gls_depth(GL_TRUE, GL_TRUE, GL_LEQUAL); - - // No clue where this is getting unset, but safe enough to reset it here. - //this causes frame stalls, try real hard not to uncomment this line - DaveP - //LLGLState::resetTextureStates(); - + LLVertexBuffer::unbind(); + #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -676,7 +675,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // glTranslatef(0.f, 0.f, -LLViewerCamera::getInstance()->getNear()); // glScalef(LLViewerCamera::getInstance()->getNear() * LLViewerCamera::getInstance()->getAspect() / sinf(LLViewerCamera::getInstance()->getView()), LLViewerCamera::getInstance()->getNear() / sinf(LLViewerCamera::getInstance()->getView()), 1.f); // gGL.color4fv(LLColor4::white.mV); - // gGL.begin(GL_QUADS); + // gGL.begin(LLVertexBuffer::QUADS); // { // gGL.vertex3f(floater_3d_rect.mLeft, floater_3d_rect.mBottom, 0.f); // gGL.vertex3f(floater_3d_rect.mLeft, floater_3d_rect.mTop, 0.f); @@ -910,8 +909,8 @@ void render_ui_and_swap() } { - LLVertexBuffer::startRender(); - gGL.start(); + + gGL.color4f(1,1,1,1); if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { LLFastTimer t(LLFastTimer::FTM_RENDER_UI); @@ -929,7 +928,7 @@ void render_ui_and_swap() LLGLState::checkStates(); #endif } - gGL.stop(); + gGL.flush(); { gViewerWindow->setup2DRender(); @@ -937,7 +936,7 @@ void render_ui_and_swap() gViewerWindow->drawDebugText(); } - LLVertexBuffer::stopRender(); + LLVertexBuffer::unbind(); } glh_set_current_modelview(saved_view); @@ -960,7 +959,7 @@ void render_ui_and_swap_if_needed() void renderCoordinateAxes() { LLGLSNoTexture gls_no_texture; - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.color3f(1.0f, 0.0f, 0.0f); // i direction = X-Axis = red gGL.vertex3f(0.0f, 0.0f, 0.0f); gGL.vertex3f(2.0f, 0.0f, 0.0f); @@ -1013,7 +1012,7 @@ void draw_axes() LLGLSNoTexture gls_no_texture; // A vertical white line at origin LLVector3 v = gAgent.getPositionAgent(); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.color3f(1.0f, 1.0f, 1.0f); gGL.vertex3f(0.0f, 0.0f, 0.0f); gGL.vertex3f(0.0f, 0.0f, 40.0f); @@ -1119,7 +1118,7 @@ void render_ui_2d() void render_disconnected_background() { - gGL.start(); + gGL.color4f(1,1,1,1); if (!gDisconnectedImagep && gDisconnected) { llinfos << "Loading last bitmap..." << llendl; @@ -1192,7 +1191,7 @@ void render_disconnected_background() } glPopMatrix(); } - gGL.stop(); + gGL.flush(); } void display_cleanup() diff --git a/linden/indra/newview/llviewerjoint.cpp b/linden/indra/newview/llviewerjoint.cpp index bea90e6..71f9211 100644 --- a/linden/indra/newview/llviewerjoint.cpp +++ b/linden/indra/newview/llviewerjoint.cpp @@ -148,7 +148,7 @@ void LLViewerJoint::renderSkeleton(BOOL recursive) //---------------------------------------------------------------- if (mComponents & SC_AXES) { - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.color3f( 1.0f, 0.0f, 0.0f ); gGL.vertex3f( 0.0f, 0.0f, 0.0f ); gGL.vertex3f( 0.1f, 0.0f, 0.0f ); @@ -170,7 +170,7 @@ void LLViewerJoint::renderSkeleton(BOOL recursive) { gGL.color3f( 1.0f, 1.0f, 0.0f ); - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); // joint top half glNormal3f(nc, nc, nc); @@ -360,7 +360,7 @@ void LLViewerJoint::drawBone() // render the bone gGL.color3f( 0.5f, 0.5f, 0.0f ); - gGL.begin(GL_TRIANGLES); + gGL.begin(LLVertexBuffer::TRIANGLES); gGL.vertex3f( length, 0.0f, 0.0f); gGL.vertex3f( 0.0f, boneSize, 0.0f); diff --git a/linden/indra/newview/llviewerjointattachment.cpp b/linden/indra/newview/llviewerjointattachment.cpp index ad7d5df..bbab71b 100644 --- a/linden/indra/newview/llviewerjointattachment.cpp +++ b/linden/indra/newview/llviewerjointattachment.cpp @@ -92,7 +92,7 @@ U32 LLViewerJointAttachment::drawShape( F32 pixelArea, BOOL first_pass ) LLGLDisable cull_face(GL_CULL_FACE); gGL.color4f(1.f, 1.f, 1.f, 1.f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); { gGL.vertex3f(-0.1f, 0.1f, 0.f); gGL.vertex3f(-0.1f, -0.1f, 0.f); diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index e9f100e..a9adbcd 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp @@ -1824,7 +1824,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } break; case IM_BUSY_AUTO_RESPONSE: - // fix for JIRA issue VWR-20 submitted 13-JAN-2007 - Paul Churchill if (is_muted) { lldebugs << "Ignoring busy response from " << from_id << llendl; @@ -1832,8 +1831,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } else { - // original code resumes - gIMMgr->addMessage(session_id, from_id, name, message); + // TODO: after LLTrans hits release, get "busy response" into translatable file + snprintf(buffer, sizeof(buffer), "%s (%s): %s", name, "busy response", (message+message_offset)); /* Flawfinder: ignore */ + gIMMgr->addMessage(session_id, from_id, name, buffer); } break; diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 9b1548f..03567b0 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -1206,12 +1206,12 @@ U32 LLViewerObjectList::renderObjectsForSelect(LLCamera &camera, BOOL pick_parce // // Render pass for selected objects // - gGL.start(); + gGL.color4f(1,1,1,1); gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE ); // render pickable ui elements, like names, etc. LLHUDObject::renderAllForSelect(); - gGL.stop(); + gGL.flush(); gRenderForSelect = FALSE; diff --git a/linden/indra/newview/llviewerparceloverlay.cpp b/linden/indra/newview/llviewerparceloverlay.cpp index ad34b6a..7d0b2b4 100644 --- a/linden/indra/newview/llviewerparceloverlay.cpp +++ b/linden/indra/newview/llviewerparceloverlay.cpp @@ -824,7 +824,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () continue; } - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); for (j = 0; j < vertex_per_edge; j++) { @@ -844,7 +844,7 @@ S32 LLViewerParcelOverlay::renderPropertyLines () colorp = mColorArray + BYTES_PER_COLOR * i; vertexp = mVertexArray + FLOATS_PER_VERTEX * i; - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); for (j = 0; j < vertex_per_edge; j++) { diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 563c0e6..4c76b8b 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -2243,7 +2243,7 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid) void LLViewerWindow::drawDebugText() { - gGL.start(); + gGL.color4f(1,1,1,1); gGL.pushMatrix(); { // scale view by UI global scale factor and aspect ratio correction factor @@ -2251,7 +2251,7 @@ void LLViewerWindow::drawDebugText() mDebugText->draw(); } gGL.popMatrix(); - gGL.stop(); + gGL.flush(); } void LLViewerWindow::draw() @@ -5212,7 +5212,7 @@ void LLViewerWindow::drawPickBuffer() const { if (mPickBuffer) { - gGL.start(); + gGL.color4f(1,1,1,1); gGL.pushMatrix(); LLGLDisable no_blend(GL_BLEND); LLGLDisable no_alpha_test(GL_ALPHA_TEST); @@ -5248,7 +5248,7 @@ void LLViewerWindow::drawPickBuffer() const llround((F32)mPickPoint.mY * mDisplayScale.mV[VY] + (F32)(PICK_HALF_WIDTH + mPickOffset.mY) * 10.f), FALSE); gGL.popMatrix(); - gGL.stop(); + gGL.flush(); } } diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 7989704..7de2f9c 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -3965,7 +3965,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLVector3 collide_point = slaved_pos; collide_point.mV[VZ] -= foot_plane_normal.mV[VZ] * (dist_from_plane + COLLISION_TOLERANCE - FOOT_COLLIDE_FUDGE); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); { F32 SQUARE_SIZE = 0.2f; gGL.color4f(1.f, 0.f, 0.f, 1.f); @@ -4138,10 +4138,10 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color) LLGLEnable test(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.f); - gGL.start(); + gGL.color4f(1,1,1,1); gGL.color4ubv(color.mV); mImpostor.bindTexture(); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0,0); gGL.vertex3fv((pos+left-up).mV); gGL.texCoord2f(1,0); @@ -4151,7 +4151,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color) gGL.texCoord2f(0,1); gGL.vertex3fv((pos+left+up).mV); gGL.end(); - gGL.stop(); + gGL.flush(); return 6; } diff --git a/linden/indra/newview/llvoicevisualizer.cpp b/linden/indra/newview/llvoicevisualizer.cpp index 9dcf716..6b2a3e6 100644 --- a/linden/indra/newview/llvoicevisualizer.cpp +++ b/linden/indra/newview/llvoicevisualizer.cpp @@ -222,13 +222,13 @@ void LLVoiceVisualizer::render() //------------------------------------------------------------- gGL.color4fv( LLColor4( 1.0f, 1.0f, 1.0f, DOT_OPACITY ).mV ); - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); gGL.texCoord2i( 0, 0 ); gGL.vertex3fv( bottomLeft.mV ); gGL.texCoord2i( 1, 0 ); gGL.vertex3fv( bottomRight.mV ); gGL.texCoord2i( 0, 1 ); gGL.vertex3fv( topLeft.mV ); gGL.end(); - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); gGL.texCoord2i( 1, 0 ); gGL.vertex3fv( bottomRight.mV ); gGL.texCoord2i( 1, 1 ); gGL.vertex3fv( topRight.mV ); gGL.texCoord2i( 0, 1 ); gGL.vertex3fv( topLeft.mV ); @@ -345,13 +345,13 @@ void LLVoiceVisualizer::render() //--------------------------------------------------- // now, render the mofo //--------------------------------------------------- - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); gGL.texCoord2i( 0, 0 ); gGL.vertex3fv( bottomLeft.mV ); gGL.texCoord2i( 1, 0 ); gGL.vertex3fv( bottomRight.mV ); gGL.texCoord2i( 0, 1 ); gGL.vertex3fv( topLeft.mV ); gGL.end(); - gGL.begin( GL_TRIANGLE_STRIP ); + gGL.begin( LLVertexBuffer::TRIANGLE_STRIP ); gGL.texCoord2i( 1, 0 ); gGL.vertex3fv( bottomRight.mV ); gGL.texCoord2i( 1, 1 ); gGL.vertex3fv( topRight.mV ); gGL.texCoord2i( 0, 1 ); gGL.vertex3fv( topLeft.mV ); diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index fbbd827..710b7e1 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -568,14 +568,14 @@ void LLWebBrowserCtrl::draw() LLGLSUIDefault gls_ui; LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - glPushMatrix(); + gGL.pushMatrix(); { if (mIgnoreUIScale) { glLoadIdentity(); // font system stores true screen origin, need to scale this by UI scale factor // to get render origin for this view (with unit scale) - glTranslatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), + gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]), floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]), LLFontGL::sCurOrigin.mZ); } @@ -588,7 +588,7 @@ void LLWebBrowserCtrl::draw() // draw the browser gGL.blendFunc( GL_ONE, GL_ZERO ); - gGL.begin( GL_QUADS ); + gGL.begin( LLVertexBuffer::QUADS ); { // render using web browser reported width and height, instead of trying to invert GL scale gGL.texCoord2f( max_u, max_v ); @@ -606,7 +606,7 @@ void LLWebBrowserCtrl::draw() gGL.end(); gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); } - glPopMatrix(); + gGL.popMatrix(); // highlight if keyboard focus here. (TODO: this needs some work) if ( mBorder->getVisible() ) diff --git a/linden/indra/newview/llworldmapview.cpp b/linden/indra/newview/llworldmapview.cpp index ccf5903..1cc4921 100644 --- a/linden/indra/newview/llworldmapview.cpp +++ b/linden/indra/newview/llworldmapview.cpp @@ -381,7 +381,7 @@ void LLWorldMapView::draw() glColorMask(TRUE, TRUE, TRUE, FALSE); gGL.color4f(1.f, 1.f, 1.f, layer_alpha); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.0f, 1.0f); gGL.vertex3f(left, top, -1.0f); gGL.texCoord2f(0.0f, 0.0f); @@ -397,7 +397,7 @@ void LLWorldMapView::draw() glColorMask(FALSE, FALSE, FALSE, TRUE); gGL.color4f(1.f, 1.f, 1.f, 1.f); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.0f, 1.0f); gGL.vertex2f(left, top); gGL.texCoord2f(0.0f, 0.0f); @@ -538,7 +538,7 @@ void LLWorldMapView::draw() F32 alpha = sim_alpha * info->mAlpha; gGL.color4f(1.f, 1.0f, 1.0f, alpha); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.f, 1.f); gGL.vertex3f(left, top, 0.f); gGL.texCoord2f(0.f, 0.f); @@ -553,7 +553,7 @@ void LLWorldMapView::draw() { LLViewerImage::bindTexture(overlayimage); gGL.color4f(1.f, 1.f, 1.f, alpha); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.texCoord2f(0.f, 1.f); gGL.vertex3f(left, top, -0.5f); gGL.texCoord2f(0.f, 0.f); @@ -574,7 +574,7 @@ void LLWorldMapView::draw() gGL.color4f(1.f, 1.f, 1.f, 1.f); LLGLSNoTexture gls_no_texture; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex2f(left, top); gGL.vertex2f(left, bottom); gGL.vertex2f(right, bottom); @@ -593,7 +593,7 @@ void LLWorldMapView::draw() gGL.color4f(0.2f, 0.0f, 0.0f, 0.4f); LLGLSNoTexture gls_no_texture; - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex2f(left, top); gGL.vertex2f(left, bottom); gGL.vertex2f(right, bottom); @@ -610,7 +610,7 @@ void LLWorldMapView::draw() LLGLSNoTexture gls_no_texture; gGL.color3f(1.f, 0.f, 0.f); - gGL.begin(GL_LINES); + gGL.begin(LLVertexBuffer::LINES); gGL.vertex2f(left, top); gGL.vertex2f(right, bottom); gGL.vertex2f(left, bottom); @@ -971,7 +971,7 @@ void LLWorldMapView::drawFrustum() // Draw triangle with more alpha in far pixels to make it // fade out in distance. - gGL.begin( GL_TRIANGLES ); + gGL.begin( LLVertexBuffer::TRIANGLES ); gGL.color4f(1.f, 1.f, 1.f, 0.25f); gGL.vertex2f( 0, 0 ); @@ -1181,7 +1181,7 @@ static void drawDot(F32 x_pixels, F32 y_pixels, gGL.color4fv( color.mV ); LLUI::setLineWidth(1.5f); F32 h_bar = relative_z > HEIGHT_THRESHOLD ? top : bottom; // horizontal bar Y - gGL.begin( GL_LINES ); + gGL.begin( LLVertexBuffer::LINES ); gGL.vertex2f(center, top); gGL.vertex2f(left, h_bar); gGL.vertex2f(right, h_bar); diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index c1ad4b3..5ec3310 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -1641,6 +1641,8 @@ void LLPipeline::stateSort(LLCamera& camera, LLCullResult &result) LLFastTimer ftm(LLFastTimer::FTM_STATESORT); LLMemType mt(LLMemType::MTYPE_PIPELINE); + //LLVertexBuffer::unbind(); + grabReferences(result); { @@ -2129,7 +2131,7 @@ void render_hud_elements() glStencilMask(0xFFFFFFFF); glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - gGL.start(); + gGL.color4f(1,1,1,1); if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() @@ -2156,7 +2158,7 @@ void render_hud_elements() { LLHUDText::renderAllHUD(); } - gGL.stop(); + gGL.flush(); } void LLPipeline::renderHighlights() @@ -2273,7 +2275,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } - LLVertexBuffer::startRender(); + //by bao //fake vertex buffer updating @@ -2451,17 +2453,14 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) renderDebug(); - LLVertexBuffer::stopRender(); LLVertexBuffer::unbind(); if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - gGL.start(); // Render debugging beacons. gObjectList.renderObjectBeacons(); LLHUDObject::renderAll(); gObjectList.resetObjectBeacons(); - gGL.stop(); } //HACK: preserve/restore matrices around HUD render @@ -2474,6 +2473,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } + LLVertexBuffer::unbind(); + #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -2509,7 +2510,7 @@ void LLPipeline::renderDebug() assertInitialized(); - gGL.start(); + gGL.color4f(1,1,1,1); gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); @@ -2554,7 +2555,7 @@ void LLPipeline::renderDebug() if (gAgent.getRegion()) { - gGL.begin(GL_POINTS); + gGL.begin(LLVertexBuffer::POINTS); // Draw the composition layer for the region that I'm in. for (x = 0; x <= 260; x++) { @@ -2577,7 +2578,7 @@ void LLPipeline::renderDebug() gGL.end(); } } - gGL.stop(); + gGL.flush(); } void LLPipeline::renderForSelect(std::set& objects) @@ -2594,7 +2595,7 @@ void LLPipeline::renderForSelect(std::set& objects) LLMemType mt(LLMemType::MTYPE_PIPELINE); - LLVertexBuffer::startRender(); + glMatrixMode(GL_MODELVIEW); @@ -2603,6 +2604,8 @@ void LLPipeline::renderForSelect(std::set& objects) LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); disableLights(); + LLVertexBuffer::unbind(); + //for each drawpool #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); @@ -2758,7 +2761,7 @@ void LLPipeline::renderForSelect(std::set& objects) glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); LLVertexBuffer::unbind(); - LLVertexBuffer::stopRender(); + LLVertexBuffer::unbind(); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); } @@ -4494,7 +4497,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); LLFastTimer ftm(LLFastTimer::FTM_RENDER_BLOOM); - gGL.start(); + gGL.color4f(1,1,1,1); LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); LLGLDisable cull(GL_CULL_FACE); @@ -4524,7 +4527,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) LLGLEnable blend(GL_BLEND); gGL.blendFunc(GL_ONE, GL_ONE); tc2.setVec(1,1); - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.color4f(1,1,1,1); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -4543,7 +4546,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } - gGL.stop(); + gGL.flush(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); @@ -4582,7 +4585,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) gGL.color4f(1,1,1,1); gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -4652,7 +4655,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) gGlowProgram.uniform2f("glowDelta", 0, delta); } - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -4686,7 +4689,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); LLGLDisable blend(GL_BLEND); - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.color4f(1,1,1,1); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -4721,7 +4724,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) glEnable(GL_TEXTURE_RECTANGLE_ARB); mScreen.bindTexture(); - gGL.begin(GL_TRIANGLE_STRIP); + gGL.begin(LLVertexBuffer::TRIANGLE_STRIP); gGL.color4f(1,1,1,1); gGL.texCoord2f(tc1.mV[0], tc1.mV[1]); gGL.vertex2f(-1,-1); @@ -4743,7 +4746,7 @@ void LLPipeline::renderBloom(BOOL for_snapshot) gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); }*/ - gGL.stop(); + gGL.flush(); { LLVertexBuffer::unbind(); @@ -5259,15 +5262,15 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLDepthTest depth(GL_FALSE, GL_FALSE); - gGL.start(); + gGL.color4f(1,1,1,1); gGL.color4ub(64,64,64,1); - gGL.begin(GL_QUADS); + gGL.begin(LLVertexBuffer::QUADS); gGL.vertex3fv((pos+left-up).mV); gGL.vertex3fv((pos-left-up).mV); gGL.vertex3fv((pos-left+up).mV); gGL.vertex3fv((pos+left+up).mV); gGL.end(); - gGL.stop(); + gGL.flush(); gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); diff --git a/linden/indra/newview/skins/xui/de/floater_gesture.xml b/linden/indra/newview/skins/xui/de/floater_gesture.xml index b815b7a..bdee3b8 100644 --- a/linden/indra/newview/skins/xui/de/floater_gesture.xml +++ b/linden/indra/newview/skins/xui/de/floater_gesture.xml @@ -1,7 +1,7 @@ - Doppelklicken Sie auf eine Geste, um Animationen und Sound abzuspielen. + Doppelklicken Sie auf eine Geste, um Animationen und Sound abzuspielen. diff --git a/linden/indra/newview/skins/xui/de/floater_joystick.xml b/linden/indra/newview/skins/xui/de/floater_joystick.xml index cabd7bd..837ac7d 100644 --- a/linden/indra/newview/skins/xui/de/floater_joystick.xml +++ b/linden/indra/newview/skins/xui/de/floater_joystick.xml @@ -10,11 +10,14 @@ - - + + Steuermodi: + Avatar + Bauen + Flycam X-Skala diff --git a/linden/indra/newview/skins/xui/de/panel_preferences_graphics1.xml b/linden/indra/newview/skins/xui/de/panel_preferences_graphics1.xml index 802eb0f..ff48982 100644 --- a/linden/indra/newview/skins/xui/de/panel_preferences_graphics1.xml +++ b/linden/indra/newview/skins/xui/de/panel_preferences_graphics1.xml @@ -17,13 +17,14 @@ Wenn deaktiviert, schaltet die Anzeige bei Anmeldung auf Vollbild um. - + Anzeigeauflösung: - + + Aspektverhältnis: - + 4:3 (Standard-CRT) @@ -37,7 +38,7 @@ 16:9 (Widescreen) - + UI-Größe: diff --git a/linden/indra/newview/skins/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/xui/en-us/floater_tools.xml index 5531090..c45ab77 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_tools.xml @@ -156,72 +156,72 @@ left_delta="23" mouse_opaque="true" name="ToolTetrahedron" scale_image="TRUE" tool_tip="Tetrahedron" width="30" />