diff options
author | Palmer Truelson <palmer@lindenlab.com> | 2010-02-12 21:05:09 -0800 |
---|---|---|
committer | Palmer Truelson <palmer@lindenlab.com> | 2010-02-12 21:05:09 -0800 |
commit | 660c3b182c12ce0842334127782abc7c3cfba860 (patch) | |
tree | 4c81eec10c77b407ccbdba6d1887d2c471325097 /indra/llrender/llrender.cpp | |
parent | 6499aee37ca89ba5d35c6f30d0dc7c8c9c72865d (diff) | |
parent | 651b14fcae01b089522f3672bbf35bfbe7268aac (diff) |
merge
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 106 |
1 files changed, 3 insertions, 103 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index d2dc1104a8..595b8577ff 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -49,9 +49,6 @@ F64 gGLLastProjection[16]; F64 gGLProjection[16]; S32 gGLViewport[4]; -U32 LLRender::sUICalls = 0; -U32 LLRender::sUIVerts = 0; - static const U32 LL_NUM_TEXTURE_LAYERS = 16; static GLenum sGLTextureType[] = @@ -258,9 +255,10 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) return false ; } + gGL.flush(); + if ((mCurrTexture != texture->getTexName()) || forceBind) { - gGL.flush(); activate(); enable(texture->getTarget()); mCurrTexture = texture->getTexName(); @@ -447,8 +445,6 @@ void LLTexUnit::setTextureBlendType(eTextureBlendType type) return; } - gGL.flush(); - activate(); mCurrBlendType = type; S32 scale_amount = 1; @@ -763,7 +759,6 @@ LLRender::LLRender() mCurrAlphaFunc = CF_DEFAULT; mCurrAlphaFuncVal = 0.01f; - mCurrSceneBlendType = BT_ALPHA; } LLRender::~LLRender() @@ -826,80 +821,6 @@ void LLRender::popMatrix() glPopMatrix(); } -void LLRender::translateUI(F32 x, F32 y, F32 z) -{ - if (mUIOffset.empty()) - { - llerrs << "Need to push a UI translation frame before offsetting" << llendl; - } - - mUIOffset.front().mV[0] += x; - mUIOffset.front().mV[1] += y; - mUIOffset.front().mV[2] += z; -} - -void LLRender::scaleUI(F32 x, F32 y, F32 z) -{ - if (mUIScale.empty()) - { - llerrs << "Need to push a UI transformation frame before scaling." << llendl; - } - - mUIScale.front().scaleVec(LLVector3(x,y,z)); -} - -void LLRender::pushUIMatrix() -{ - mUIOffset.push_front(mUIOffset.front()); - if (mUIScale.empty()) - { - mUIScale.push_front(LLVector3(1,1,1)); - } - else - { - mUIScale.push_front(mUIScale.front()); - } -} - -void LLRender::popUIMatrix() -{ - if (mUIOffset.empty()) - { - llerrs << "UI offset stack blown." << llendl; - } - mUIOffset.pop_front(); - mUIScale.pop_front(); -} - -LLVector3 LLRender::getUITranslation() -{ - if (mUIOffset.empty()) - { - llerrs << "UI offset stack empty." << llendl; - } - return mUIOffset.front(); -} - -LLVector3 LLRender::getUIScale() -{ - if (mUIScale.empty()) - { - llerrs << "UI scale stack empty." << llendl; - } - return mUIScale.front(); -} - - -void LLRender::loadUIIdentity() -{ - if (mUIOffset.empty()) - { - llerrs << "Need to push UI translation frame before clearing offset." << llendl; - } - mUIOffset.front().setVec(0,0,0); - mUIScale.front().setVec(1,1,1); -} - void LLRender::setColorMask(bool writeColor, bool writeAlpha) { setColorMask(writeColor, writeColor, writeColor, writeAlpha); @@ -922,11 +843,6 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB void LLRender::setSceneBlendType(eBlendType type) { - if (mCurrSceneBlendType == type) - { - return; - } - flush(); switch (type) { @@ -955,7 +871,6 @@ void LLRender::setSceneBlendType(eBlendType type) llerrs << "Unknown Scene Blend Type: " << type << llendl; break; } - mCurrSceneBlendType = type; } void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) @@ -1097,12 +1012,6 @@ void LLRender::flush() } #endif - if (!mUIOffset.empty()) - { - sUICalls++; - sUIVerts += mCount; - } - mBuffer->setBuffer(immediate_mask); mBuffer->drawArrays(mMode, 0, mCount); @@ -1122,16 +1031,7 @@ void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z) return; } - if (mUIOffset.empty()) - { - mVerticesp[mCount] = LLVector3(x,y,z); - } - else - { - LLVector3 vert = (LLVector3(x,y,z)+mUIOffset.front()).scaledVec(mUIScale.front()); - mVerticesp[mCount] = vert; - } - + mVerticesp[mCount] = LLVector3(x,y,z); mCount++; if (mCount < 4096) { |