From acfdcf2b1deeb04698174c78e8cb22b093445bb1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:44 -0500 Subject: Second Life viewer sources 1.20.3 --- linden/indra/newview/app_settings/colors_base.xml | 2 +- linden/indra/newview/app_settings/settings.xml | 11 --- linden/indra/newview/llappviewer.cpp | 102 +++++++++---------- linden/indra/newview/llcubemap.cpp | 70 +++++++++++-- linden/indra/newview/llcylinder.cpp | 1 - linden/indra/newview/lldrawable.cpp | 7 +- linden/indra/newview/lldrawpool.cpp | 29 +----- linden/indra/newview/lldrawpool.h | 5 - linden/indra/newview/lldrawpoolalpha.cpp | 17 +--- linden/indra/newview/lldrawpoolavatar.cpp | 32 +----- linden/indra/newview/lldrawpoolbump.cpp | 40 +------- linden/indra/newview/lldrawpoolground.cpp | 3 - linden/indra/newview/lldrawpoolsimple.cpp | 11 +-- linden/indra/newview/lldrawpoolsky.cpp | 10 -- linden/indra/newview/lldrawpoolterrain.cpp | 108 +++++---------------- linden/indra/newview/lldrawpooltree.cpp | 13 +-- linden/indra/newview/lldrawpoolwater.cpp | 33 +------ linden/indra/newview/lldrawpoolwlsky.cpp | 11 +-- linden/indra/newview/llface.cpp | 67 +++---------- linden/indra/newview/llface.h | 2 +- linden/indra/newview/llflexibleobject.cpp | 18 +++- linden/indra/newview/llflexibleobject.h | 2 +- linden/indra/newview/llfloateranimpreview.cpp | 1 - linden/indra/newview/llfloaterauction.cpp | 3 +- linden/indra/newview/llfloaterhud.cpp | 26 ++--- linden/indra/newview/llfloaterhud.h | 2 +- linden/indra/newview/llmemoryview.cpp | 2 + linden/indra/newview/llpanellogin.cpp | 1 + linden/indra/newview/llpostprocess.cpp | 3 - linden/indra/newview/llspatialpartition.cpp | 21 ++-- linden/indra/newview/llviewerdisplay.cpp | 13 ++- linden/indra/newview/llviewerjointmesh.cpp | 29 ++---- linden/indra/newview/llviewerkeyboard.cpp | 22 +++-- linden/indra/newview/llvotree.cpp | 6 +- linden/indra/newview/llvovolume.cpp | 12 ++- linden/indra/newview/llvowlsky.cpp | 33 ++----- linden/indra/newview/llwebbrowserctrl.cpp | 30 +++++- linden/indra/newview/llwebbrowserctrl.h | 8 ++ linden/indra/newview/mozilla-theme/classic.jar | Bin 281793 -> 190670 bytes linden/indra/newview/pipeline.cpp | 58 ++++++----- linden/indra/newview/pipeline.h | 3 +- linden/indra/newview/releasenotes.txt | 24 +++++ .../skins/xui/de/floater_active_speakers.xml | 2 +- linden/indra/newview/skins/xui/de/menu_viewer.xml | 2 +- .../skins/xui/de/panel_preferences_general.xml | 10 +- linden/indra/newview/skins/xui/en-us/alerts.xml | 17 ++++ .../newview/skins/xui/en-us/floater_world_map.xml | 8 +- .../skins/xui/es/panel_preferences_general.xml | 14 ++- .../skins/xui/fr/panel_preferences_general.xml | 8 +- .../skins/xui/ja/panel_preferences_general.xml | 10 +- .../skins/xui/ko/panel_preferences_general.xml | 10 +- .../indra/newview/skins/xui/ko/panel_toolbar.xml | 7 +- .../skins/xui/zh/panel_preferences_general.xml | 8 +- 53 files changed, 413 insertions(+), 574 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/colors_base.xml b/linden/indra/newview/app_settings/colors_base.xml index d793116..42b119c 100644 --- a/linden/indra/newview/app_settings/colors_base.xml +++ b/linden/indra/newview/app_settings/colors_base.xml @@ -48,7 +48,7 @@ - + diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 63d429f..7be1db3 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -9759,17 +9759,6 @@ 0 - AlertedUnsupportedHardware - - Comment - Toggle that lets us tell the user he's on old hardware only once - Persist - 1 - Type - Boolean - Value - 0 - RenderFastAlpha Comment diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 7c71e46..4a9a158 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -64,6 +64,7 @@ #include "llurldispatcher.h" #include "llurlhistory.h" #include "llfirstuse.h" +#include "llglimmediate.h" #include "llweb.h" #include "llsecondlifeurls.h" @@ -409,10 +410,11 @@ static void settings_to_globals() static void settings_modify() { LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); - LLVOAvatar::sUseImpostors = FALSE; //gSavedSettings.getBOOL("RenderUseImpostors"); + LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4] - + gGL.setClever(gSavedSettings.getBOOL("RenderUseCleverUI")); + #if LL_VECTORIZE if (gSysCPU.hasAltivec()) { @@ -767,15 +769,6 @@ bool LLAppViewer::init() return 1; } -#if LL_DARWIN - // Display the release notes for the current version - if(!gHideLinks && gCurrentVersion != gLastRunVersion) - { - // Current version and last run version don't match exactly. Display the release notes. - DisplayReleaseNotes(); - } -#endif - // // Initialize the window // @@ -814,51 +807,55 @@ bool LLAppViewer::init() return 0; } - // alert the user if they are using unsupported hardware - if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) - { - bool unsupported = false; - LLString::format_map_t args; - LLString minSpecs; + + bool unsupported = false; + LLString::format_map_t args; + LLString minSpecs; - // get cpu data from xml - std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount")); - S32 minCPU = 0; - minCPUString >> minCPU; - - // get RAM data from XML - std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount")); - U64 minRAM = 0; - minRAMString >> minRAM; - minRAM = minRAM * 1024 * 1024; - - if(!LLFeatureManager::getInstance()->isGPUSupported()) - { - minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU"); - minSpecs += "\n"; - unsupported = true; - } - if(gSysCPU.getMhz() < minCPU) - { - minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU"); - minSpecs += "\n"; - unsupported = true; - } - if(gSysMemory.getPhysicalMemoryClamped() < minRAM) - { - minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM"); - minSpecs += "\n"; - unsupported = true; - } + // get cpu data from xml + std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount")); + S32 minCPU = 0; + minCPUString >> minCPU; + + // get RAM data from XML + std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount")); + U64 minRAM = 0; + minRAMString >> minRAM; + minRAM = minRAM * 1024 * 1024; + + if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN) + { + minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU"); + minSpecs += "\n"; + unsupported = true; + } + if(gSysCPU.getMhz() < minCPU) + { + minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU"); + minSpecs += "\n"; + unsupported = true; + } + if(gSysMemory.getPhysicalMemoryClamped() < minRAM) + { + minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM"); + minSpecs += "\n"; + unsupported = true; + } - if(unsupported) + if (LLFeatureManager::getInstance()->getGPUClass() == GPU_CLASS_UNKNOWN) + { + gViewerWindow->alertXml("UnknownGPU"); + } + + if(unsupported) + { + if(!gSavedSettings.controlExists("WarnUnsupportedHardware") + || gSavedSettings.getBOOL("WarnUnsupportedHardware")) { args["MINSPECS"] = minSpecs; gViewerWindow->alertXml("UnsupportedHardware", args ); - - // turn off flag - gSavedSettings.setBOOL("AlertedUnsupportedHardware", TRUE); } + } // Save the current version to the prefs file @@ -1445,10 +1442,13 @@ void LLAppViewer::loadSettingsFromDirectory(ELLPath path_index) LLString full_settings_path = gDirUtilp->getExpandedFilename(path_index, settings_file); - if(settings_name == sGlobalSettingsName) + if(settings_name == sGlobalSettingsName + && path_index == LL_PATH_USER_SETTINGS) { // The non-persistent setting, ClientSettingsFile, specifies a // custom name to use for the global settings file. + // Only apply this setting if this method is setting the 'Global' + // settings from the user_settings path. std::string custom_path; if(gSettings[sGlobalSettingsName]->controlExists("ClientSettingsFile")) { diff --git a/linden/indra/newview/llcubemap.cpp b/linden/indra/newview/llcubemap.cpp index e11f058..31937ba 100644 --- a/linden/indra/newview/llcubemap.cpp +++ b/linden/indra/newview/llcubemap.cpp @@ -185,12 +185,19 @@ void LLCubeMap::bind() ) { // We assume that if they have cube mapping, they have multitexturing. - glActiveTextureARB(GL_TEXTURE0_ARB + mTextureStage); + if (mTextureStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + mTextureStage); + } glEnable(GL_TEXTURE_CUBE_MAP_ARB); glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, mImages[0]->getTexName()); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_CUBE_MAP_ARB, GL_TEXTURE_MIN_FILTER, (use_cube_mipmaps? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR)); + if (mTextureStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } else { @@ -212,9 +219,17 @@ void LLCubeMap::enableTexture(S32 stage) //&& LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap") ) { - glActiveTextureARB(GL_TEXTURE0_ARB + stage); // NOTE: leaves texture stage set + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + stage); + } glEnable(GL_TEXTURE_CUBE_MAP_ARB); + + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } } @@ -223,7 +238,10 @@ void LLCubeMap::enableTextureCoords(S32 stage) mTextureCoordStage = stage; if (gGLManager.mHasCubeMap && stage >= 0) { - glActiveTextureARB(GL_TEXTURE0_ARB + stage); // NOTE: leaves texture stage set + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + stage); + } glEnable(GL_TEXTURE_GEN_R); glEnable(GL_TEXTURE_GEN_S); @@ -233,7 +251,10 @@ void LLCubeMap::enableTextureCoords(S32 stage) glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); - glActiveTextureARB(GL_TEXTURE0_ARB); + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } } @@ -249,9 +270,16 @@ void LLCubeMap::disableTexture(void) //&& LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap") ) { - glActiveTextureARB(GL_TEXTURE0_ARB + mTextureStage); + if (mTextureStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + mTextureStage); + } glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, 0); glDisable(GL_TEXTURE_CUBE_MAP_ARB); + if (mTextureStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } } @@ -259,17 +287,28 @@ void LLCubeMap::disableTextureCoords(void) { if (gGLManager.mHasCubeMap && mTextureCoordStage >= 0) { - glActiveTextureARB(GL_TEXTURE0_ARB + mTextureCoordStage); + if (mTextureCoordStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB + mTextureCoordStage); + } glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); glDisable(GL_TEXTURE_GEN_R); + if (mTextureCoordStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } } void LLCubeMap::setMatrix(S32 stage) { mMatrixStage = stage; - glActiveTextureARB(GL_TEXTURE0_ARB+stage); + + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB+stage); + } LLVector3 x(LLVector3d(gGLModelView+0)); LLVector3 y(LLVector3d(gGLModelView+4)); @@ -284,16 +323,27 @@ void LLCubeMap::setMatrix(S32 stage) glPushMatrix(); glLoadMatrixf((F32 *)trans.mMatrix); glMatrixMode(GL_MODELVIEW); - glActiveTextureARB(GL_TEXTURE0_ARB); + + if (stage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } void LLCubeMap::restoreMatrix() { - glActiveTextureARB(GL_TEXTURE0_ARB+mMatrixStage); + if (mMatrixStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB+mMatrixStage); + } glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); - glActiveTextureARB(GL_TEXTURE0_ARB); + + if (mMatrixStage > 0) + { + glActiveTextureARB(GL_TEXTURE0_ARB); + } } LLVector3 LLCubeMap::map(U8 side, U16 v_val, U16 h_val) const diff --git a/linden/indra/newview/llcylinder.cpp b/linden/indra/newview/llcylinder.cpp index 9b146a3..c05a380 100644 --- a/linden/indra/newview/llcylinder.cpp +++ b/linden/indra/newview/llcylinder.cpp @@ -255,7 +255,6 @@ void LLCone::render(S32 level_of_detail) // center object at 0 glTranslatef(0.f, 0.f, - height / 2.0f); - LLVertexBuffer::unbind(); drawSide(level_of_detail); drawBottom(level_of_detail); diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp index 3a2841d..d2b2a99 100644 --- a/linden/indra/newview/lldrawable.cpp +++ b/linden/indra/newview/lldrawable.cpp @@ -1188,10 +1188,11 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* LLVector3 center = (mExtents[0] + mExtents[1]) * 0.5f; LLVector3 size = (mExtents[1]-mExtents[0]) * 0.5f; - if (camera_in.AABBInFrustumNoFarClip(center, size) && - AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist)) + if (LLPipeline::sImpostorRender || + (camera_in.AABBInFrustumNoFarClip(center, size) && + AABBSphereIntersect(mExtents[0], mExtents[1], camera_in.getOrigin(), camera_in.mFrustumCornerDist))) { - if (LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA) + if (!LLPipeline::sImpostorRender && LLPipeline::calcPixelArea(center, size, camera_in) < FORCE_INVISIBLE_AREA) { return; } diff --git a/linden/indra/newview/lldrawpool.cpp b/linden/indra/newview/lldrawpool.cpp index 409439a..c579c68 100644 --- a/linden/indra/newview/lldrawpool.cpp +++ b/linden/indra/newview/lldrawpool.cpp @@ -115,7 +115,6 @@ LLDrawPool::LLDrawPool(const U32 type) sNumDrawPools++; mId = sNumDrawPools; mVertexShaderLevel = 0; - mIndicesDrawn = 0; } LLDrawPool::~LLDrawPool() @@ -136,24 +135,6 @@ void LLDrawPool::beginRenderPass( S32 pass ) //virtual void LLDrawPool::endRenderPass( S32 pass ) { - glDisableClientState ( GL_TEXTURE_COORD_ARRAY ); - glDisableClientState ( GL_COLOR_ARRAY ); - glDisableClientState ( GL_NORMAL_ARRAY ); -} - -U32 LLDrawPool::getTrianglesDrawn() const -{ - return mIndicesDrawn / 3; -} - -void LLDrawPool::resetTrianglesDrawn() -{ - mIndicesDrawn = 0; -} - -void LLDrawPool::addIndicesDrawn(const U32 indices) -{ - mIndicesDrawn += indices; } //============================= @@ -224,7 +205,7 @@ void LLFacePool::drawLoop() { if (!mDrawFace.empty()) { - mIndicesDrawn += drawLoop(mDrawFace); + drawLoop(mDrawFace); } } @@ -382,10 +363,6 @@ void LLRenderPass::renderTexture(U32 type, U32 mask) void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture) { -#if !LL_RELEASE_FOR_DOWNLOAD - LLGLState::checkClientArrays(mask); -#endif - for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i) { LLDrawInfo* pparams = *i; @@ -436,9 +413,7 @@ void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) if (params.mVertexBuffer.notNull()) { params.mVertexBuffer->setBuffer(mask); - U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); + params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount/3); } diff --git a/linden/indra/newview/lldrawpool.h b/linden/indra/newview/lldrawpool.h index bb354e3..3c80aef 100644 --- a/linden/indra/newview/lldrawpool.h +++ b/linden/indra/newview/lldrawpool.h @@ -90,15 +90,10 @@ public: virtual BOOL isFacePool() { return FALSE; } virtual void resetDrawOrders() = 0; - U32 getTrianglesDrawn() const; - void resetTrianglesDrawn(); - void addIndicesDrawn(const U32 indices); - protected: S32 mVertexShaderLevel; S32 mId; U32 mType; // Type of draw pool - S32 mIndicesDrawn; }; class LLRenderPass : public LLDrawPool diff --git a/linden/indra/newview/lldrawpoolalpha.cpp b/linden/indra/newview/lldrawpoolalpha.cpp index cc2600e..ddde578 100644 --- a/linden/indra/newview/lldrawpoolalpha.cpp +++ b/linden/indra/newview/lldrawpoolalpha.cpp @@ -77,9 +77,6 @@ void LLDrawPoolAlpha::prerender() void LLDrawPoolAlpha::beginRenderPass(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_ALPHA); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); if (LLPipeline::sUnderWaterRender) { @@ -128,8 +125,6 @@ void LLDrawPoolAlpha::render(S32 pass) { glUseProgramObjectARB(0); } - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); glColor4f(1,0,0,1); LLViewerImage::sSmokeImagep->addTextureStats(1024.f*1024.f); @@ -141,10 +136,6 @@ void LLDrawPoolAlpha::render(S32 pass) void LLDrawPoolAlpha::renderAlpha(U32 mask) { -#if !LL_RELEASE_FOR_DOWNLOAD - LLGLState::checkClientArrays(mask); -#endif - for (LLCullResult::sg_list_t::iterator i = gPipeline.beginAlphaGroups(); i != gPipeline.endAlphaGroups(); ++i) { LLSpatialGroup* group = *i; @@ -182,9 +173,7 @@ void LLDrawPoolAlpha::renderAlphaHighlight(U32 mask) LLRenderPass::applyModelMatrix(params); params.mVertexBuffer->setBuffer(mask); - U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); + params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount/3); } } @@ -303,9 +292,7 @@ void LLDrawPoolAlpha::renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask } params.mVertexBuffer->setBuffer(mask); - U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); + params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount/3); if (params.mTextureMatrix && texture && params.mTexture.notNull()) diff --git a/linden/indra/newview/lldrawpoolavatar.cpp b/linden/indra/newview/lldrawpoolavatar.cpp index b461757..8e3341a 100644 --- a/linden/indra/newview/lldrawpoolavatar.cpp +++ b/linden/indra/newview/lldrawpoolavatar.cpp @@ -216,13 +216,11 @@ void LLDrawPoolAvatar::beginFootShadow() } gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolAvatar::endFootShadow() { gPipeline.enableLightsDynamic(); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolAvatar::beginRigid() @@ -247,16 +245,11 @@ void LLDrawPoolAvatar::beginRigid() { sVertexProgram = NULL; } - - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolAvatar::endRigid() { sShaderLevel = mVertexShaderLevel; - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); if (sVertexProgram != NULL) { sVertexProgram->unbind(); @@ -265,9 +258,6 @@ void LLDrawPoolAvatar::endRigid() void LLDrawPoolAvatar::beginSkinned() { - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - if (sShaderLevel > 0) { if (LLPipeline::sUnderWaterRender) @@ -295,8 +285,7 @@ void LLDrawPoolAvatar::beginSkinned() if (sShaderLevel > 0) // for hardware blending { sRenderingSkinned = TRUE; - glClientActiveTextureARB(GL_TEXTURE1_ARB); - + sVertexProgram->bind(); if (sShaderLevel >= SHADER_LEVEL_CLOTH) { @@ -331,7 +320,6 @@ void LLDrawPoolAvatar::endSkinned() sRenderingSkinned = FALSE; sVertexProgram->disableTexture(LLShaderMgr::BUMP_MAP); glActiveTextureARB(GL_TEXTURE0_ARB); - glClientActiveTextureARB(GL_TEXTURE0_ARB); disable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); if (sShaderLevel >= SHADER_LEVEL_BUMP) { @@ -356,10 +344,6 @@ void LLDrawPoolAvatar::endSkinned() } glActiveTextureARB(GL_TEXTURE0_ARB); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } @@ -438,7 +422,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) } else if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS)) { - mIndicesDrawn += avatarp->renderFootShadows(); + avatarp->renderFootShadows(); } return; } @@ -451,7 +435,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) if (pass == 1) { // render rigid meshes (eyeballs) first - mIndicesDrawn += avatarp->renderRigid(); + avatarp->renderRigid(); return; } @@ -548,7 +532,7 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass) color.setColor(1.0f, 1.0f, 1.0f, 1.0f); } - mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); } } @@ -609,9 +593,6 @@ void LLDrawPoolAvatar::renderForSelect() return; } - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); sVertexProgram = &gAvatarPickProgram; if (sShaderLevel > 0) { @@ -624,13 +605,12 @@ void LLDrawPoolAvatar::renderForSelect() if ((sShaderLevel > 0) && !gUseGLPick) // for hardware blending { - glClientActiveTextureARB(GL_TEXTURE0_ARB); sRenderingSkinned = TRUE; sVertexProgram->bind(); enable_vertex_weighting(sVertexProgram->mAttribute[LLShaderMgr::AVATAR_WEIGHT]); } - mIndicesDrawn += avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); + avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE); // if we're in software-blending, remember to set the fence _after_ we draw so we wait till this rendering is done if ((sShaderLevel > 0) && !gUseGLPick) @@ -645,8 +625,6 @@ void LLDrawPoolAvatar::renderForSelect() // restore texture mode glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } //----------------------------------------------------------------------------- diff --git a/linden/indra/newview/lldrawpoolbump.cpp b/linden/indra/newview/lldrawpoolbump.cpp index 2345406..7e8b9d6 100644 --- a/linden/indra/newview/lldrawpoolbump.cpp +++ b/linden/indra/newview/lldrawpoolbump.cpp @@ -316,12 +316,8 @@ void LLDrawPoolBump::beginShiny(bool invisible) mShiny = TRUE; sVertexMask = VERTEX_MASK_SHINY; // Second pass: environment map - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); if (!invisible && mVertexShaderLevel > 1) { - glEnableClientState(GL_TEXTURE_COORD_ARRAY); sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; } @@ -456,13 +452,7 @@ void LLDrawPoolBump::endShiny(bool invisible) LLImageGL::unbindTexture(0, GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - if (!invisible && mVertexShaderLevel > 1) - { - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - } - + diffuse_channel = -1; cube_channel = 0; mShiny = FALSE; @@ -479,10 +469,6 @@ void LLDrawPoolBump::beginFullbrightShiny() sVertexMask = VERTEX_MASK_SHINY | LLVertexBuffer::MAP_TEXCOORD; // Second pass: environment map - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (LLPipeline::sUnderWaterRender) { @@ -564,9 +550,6 @@ void LLDrawPoolBump::endFullbrightShiny() LLImageGL::unbindTexture(0, GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); diffuse_channel = -1; cube_channel = 0; @@ -607,9 +590,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL applyModelMatrix(params); params.mVertexBuffer->setBuffer(mask); - U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); + params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount/3); } } @@ -670,8 +651,6 @@ void LLDrawPoolBump::beginBump() // TEXTURE UNIT 0 // Output.rgb = texture at texture coord 0 glActiveTextureARB(GL_TEXTURE0_ARB); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); @@ -686,8 +665,6 @@ void LLDrawPoolBump::beginBump() // TEXTURE UNIT 1 glActiveTextureARB(GL_TEXTURE1_ARB); - glClientActiveTextureARB(GL_TEXTURE1_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_2D); // Texture unit 1 @@ -752,15 +729,11 @@ void LLDrawPoolBump::endBump() // Disable texture unit 1 glActiveTextureARB(GL_TEXTURE1_ARB); - glClientActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); // Texture unit 1 - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // Disable texture unit 0 glActiveTextureARB(GL_TEXTURE0_ARB); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); gGL.blendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); @@ -1091,10 +1064,6 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerImage *src_vi, LLIma void LLDrawPoolBump::renderBump(U32 type, U32 mask) { -#if !LL_RELEASE_FOR_DOWNLOAD - LLGLState::checkClientArrays(mask); -#endif - LLCullResult::drawinfo_list_t::iterator begin = gPipeline.beginRenderMap(type); LLCullResult::drawinfo_list_t::iterator end = gPipeline.endRenderMap(type); @@ -1178,11 +1147,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) } params.mVertexBuffer->setBuffer(mask); - U16* indices_pointer = (U16*) params.mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount, - GL_UNSIGNED_SHORT, indices_pointer+params.mOffset); + params.mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset); gPipeline.addTrianglesDrawn(params.mCount/3); - if (params.mTextureMatrix) { if (mShiny) diff --git a/linden/indra/newview/lldrawpoolground.cpp b/linden/indra/newview/lldrawpoolground.cpp index a1c5a99..03b8a0c 100644 --- a/linden/indra/newview/lldrawpoolground.cpp +++ b/linden/indra/newview/lldrawpoolground.cpp @@ -68,9 +68,6 @@ void LLDrawPoolGround::render(S32 pass) return; } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - LLGLSPipelineSkyBox gls_skybox; LLImageGL::unbindTexture(0, GL_TEXTURE_2D); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); diff --git a/linden/indra/newview/lldrawpoolsimple.cpp b/linden/indra/newview/lldrawpoolsimple.cpp index cdb22bf..330ac57 100644 --- a/linden/indra/newview/lldrawpoolsimple.cpp +++ b/linden/indra/newview/lldrawpoolsimple.cpp @@ -65,13 +65,10 @@ void LLDrawPoolGlow::render(S32 pass) gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); LLGLDepthTest depth(GL_TRUE, GL_FALSE); glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE); renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -101,10 +98,6 @@ void LLDrawPoolSimple::prerender() void LLDrawPoolSimple::beginRenderPass(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); if (LLPipeline::sUnderWaterRender) { @@ -136,7 +129,6 @@ void LLDrawPoolSimple::endRenderPass(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_SIMPLE); LLRenderPass::endRenderPass(pass); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); if (mVertexShaderLevel > 0){ @@ -177,7 +169,6 @@ void LLDrawPoolSimple::render(S32 pass) } LLFastTimer t(LLFastTimer::FTM_RENDER_FULLBRIGHT); U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR; - glDisableClientState(GL_NORMAL_ARRAY); renderTexture(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask); } diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp index ac5c389..e06bb6d 100644 --- a/linden/indra/newview/lldrawpoolsky.cpp +++ b/linden/indra/newview/lldrawpoolsky.cpp @@ -113,10 +113,6 @@ void LLDrawPoolSky::render(S32 pass) LLVector3 origin = LLViewerCamera::getInstance()->getOrigin(); glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - S32 face_count = (S32)mDrawFace.size(); for (S32 i = 0; i < llmin(6, face_count); ++i) @@ -160,8 +156,6 @@ void LLDrawPoolSky::render(S32 pass) // renderHeavenlyBody(1, hbfaces[1]); } - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glPopMatrix(); } @@ -184,8 +178,6 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled face.renderIndexed(); } - - mIndicesDrawn += face.getIndicesCount(); } void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face) @@ -198,7 +190,6 @@ void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face) LLColor4 color(mHB[hb]->getInterpColor()); LLOverrideFaceColor override(this, color); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } @@ -215,7 +206,6 @@ void LLDrawPoolSky::renderSunHalo(LLFace* face) LLOverrideFaceColor override(this, color); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } diff --git a/linden/indra/newview/lldrawpoolterrain.cpp b/linden/indra/newview/lldrawpoolterrain.cpp index 1d43698..fdb27f9 100644 --- a/linden/indra/newview/lldrawpoolterrain.cpp +++ b/linden/indra/newview/lldrawpoolterrain.cpp @@ -217,14 +217,6 @@ void LLDrawPoolTerrain::render(S32 pass) void LLDrawPoolTerrain::renderFullShader() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - - if (gPipeline.getLightingDetail() >= 2) - { - glEnableClientState(GL_COLOR_ARRAY); - } - // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); @@ -247,10 +239,8 @@ void LLDrawPoolTerrain::renderFullShader() // S32 detail0 = sShader->enableTexture(LLShaderMgr::TERRAIN_DETAIL0); LLViewerImage::bindTexture(detail_texture0p,detail0); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -269,9 +259,7 @@ void LLDrawPoolTerrain::renderFullShader() LLViewerImage::bindTexture(detail_texture1p,detail1); /// ALPHA TEXTURE COORDS 0: - glClientActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); @@ -283,9 +271,7 @@ void LLDrawPoolTerrain::renderFullShader() glEnable(GL_TEXTURE_2D); /// ALPHA TEXTURE COORDS 1: - glClientActiveTextureARB(GL_TEXTURE2_ARB); glActiveTextureARB(GL_TEXTURE2_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glTranslatef(-2.f, 0.f, 0.f); @@ -298,9 +284,7 @@ void LLDrawPoolTerrain::renderFullShader() LLViewerImage::bindTexture(detail_texture3p,detail3); /// ALPHA TEXTURE COORDS 2: - glClientActiveTextureARB(GL_TEXTURE3_ARB); glActiveTextureARB(GL_TEXTURE3_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glTranslatef(-1.f, 0.f, 0.f); @@ -323,7 +307,6 @@ void LLDrawPoolTerrain::renderFullShader() sShader->disableTexture(LLShaderMgr::TERRAIN_DETAIL3); LLImageGL::unbindTexture(alpha_ramp, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE4_ARB); glActiveTextureARB(GL_TEXTURE4_ARB); glDisable(GL_TEXTURE_2D); // Texture unit 4 glDisable(GL_TEXTURE_GEN_S); @@ -333,10 +316,8 @@ void LLDrawPoolTerrain::renderFullShader() glMatrixMode(GL_MODELVIEW); LLImageGL::unbindTexture(detail3, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE3_ARB); glActiveTextureARB(GL_TEXTURE3_ARB); glDisable(GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); glMatrixMode(GL_TEXTURE); @@ -344,10 +325,8 @@ void LLDrawPoolTerrain::renderFullShader() glMatrixMode(GL_MODELVIEW); LLImageGL::unbindTexture(detail2, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE2_ARB); glActiveTextureARB(GL_TEXTURE2_ARB); glDisable(GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); glMatrixMode(GL_TEXTURE); @@ -355,10 +334,8 @@ void LLDrawPoolTerrain::renderFullShader() glMatrixMode(GL_MODELVIEW); LLImageGL::unbindTexture(detail1, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); glMatrixMode(GL_TEXTURE); @@ -369,7 +346,6 @@ void LLDrawPoolTerrain::renderFullShader() // Restore Texture Unit 0 defaults LLImageGL::unbindTexture(detail0, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_GEN_S); @@ -377,14 +353,11 @@ void LLDrawPoolTerrain::renderFullShader() glMatrixMode(GL_TEXTURE); glLoadIdentity(); glMatrixMode(GL_MODELVIEW); - - // Restore non Texture Unit specific defaults - glDisableClientState(GL_NORMAL_ARRAY); } void LLDrawPoolTerrain::renderFull4TU() { - glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); // Hack! Get the region that this draw pool is rendering from! @@ -434,9 +407,8 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 1: Generate alpha ramp for detail0/detail1 transition // - glActiveTextureARB(GL_TEXTURE1_ARB); LLViewerImage::bindTexture(m2DAlphaRampImagep,1); - + glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 1 glClientActiveTextureARB(GL_TEXTURE1_ARB); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -454,8 +426,8 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 2: Interpolate detail1 with existing based on ramp // - glActiveTextureARB(GL_TEXTURE2_ARB); LLViewerImage::bindTexture(detail_texture1p,2); + glActiveTextureARB(GL_TEXTURE2_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 2 glClientActiveTextureARB(GL_TEXTURE2_ARB); @@ -480,8 +452,8 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 3: Modulate with primary (vertex) color for lighting // - glActiveTextureARB(GL_TEXTURE3_ARB); LLViewerImage::bindTexture(detail_texture1p,3); // bind any texture + glActiveTextureARB(GL_TEXTURE3_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 3 glClientActiveTextureARB(GL_TEXTURE3_ARB); @@ -494,6 +466,7 @@ void LLDrawPoolTerrain::renderFull4TU() glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PRIMARY_COLOR_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_ARB, GL_SRC_COLOR); + glActiveTextureARB(GL_TEXTURE0_ARB); // GL_BLEND disabled by default drawLoop(); @@ -524,9 +497,8 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 1: Generate alpha ramp for detail2/detail3 transition // - glActiveTextureARB(GL_TEXTURE1_ARB); LLViewerImage::bindTexture(m2DAlphaRampImagep,1); - + glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 1 glClientActiveTextureARB(GL_TEXTURE1_ARB); @@ -551,8 +523,8 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 2: Interpolate detail2 with existing based on ramp // - glActiveTextureARB(GL_TEXTURE2_ARB); LLViewerImage::bindTexture(detail_texture2p,2); + glActiveTextureARB(GL_TEXTURE2_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 2 glClientActiveTextureARB(GL_TEXTURE2_ARB); @@ -578,9 +550,9 @@ void LLDrawPoolTerrain::renderFull4TU() // // Stage 3: Generate alpha ramp for detail1/detail2 transition // - glActiveTextureARB(GL_TEXTURE3_ARB); LLViewerImage::bindTexture(m2DAlphaRampImagep,3); - + glActiveTextureARB(GL_TEXTURE3_ARB); + glEnable(GL_TEXTURE_2D); // Texture unit 3 glClientActiveTextureARB(GL_TEXTURE3_ARB); @@ -603,7 +575,7 @@ void LLDrawPoolTerrain::renderFull4TU() glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); - + glActiveTextureARB(GL_TEXTURE0_ARB); { LLGLEnable blend(GL_BLEND); drawLoop(); @@ -611,6 +583,7 @@ void LLDrawPoolTerrain::renderFull4TU() // Disable multitexture LLImageGL::unbindTexture(3, GL_TEXTURE_2D); + glActiveTextureARB(GL_TEXTURE3_ARB); glClientActiveTextureARB(GL_TEXTURE3_ARB); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); // Texture unit 3 @@ -619,6 +592,7 @@ void LLDrawPoolTerrain::renderFull4TU() glMatrixMode(GL_MODELVIEW); LLImageGL::unbindTexture(2, GL_TEXTURE_2D); + glActiveTextureARB(GL_TEXTURE2_ARB); glClientActiveTextureARB(GL_TEXTURE2_ARB); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); // Texture unit 2 @@ -629,6 +603,7 @@ void LLDrawPoolTerrain::renderFull4TU() glMatrixMode(GL_MODELVIEW); LLImageGL::unbindTexture(1, GL_TEXTURE_2D); + glActiveTextureARB(GL_TEXTURE1_ARB); glClientActiveTextureARB(GL_TEXTURE1_ARB); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); // Texture unit 1 @@ -642,6 +617,7 @@ void LLDrawPoolTerrain::renderFull4TU() //---------------------------------------------------------------------------- // Restore Texture Unit 0 defaults + glActiveTextureARB(GL_TEXTURE0_ARB); LLImageGL::unbindTexture(0, GL_TEXTURE_2D); glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); @@ -658,9 +634,6 @@ void LLDrawPoolTerrain::renderFull4TU() void LLDrawPoolTerrain::renderFull2TU() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); @@ -687,9 +660,6 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 0: Render detail 0 into base // LLViewerImage::bindTexture(detail_texture0p,0); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -715,12 +685,10 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 0: Generate alpha ramp for detail0/detail1 transition // LLViewerImage::bindTexture(m2DAlphaRampImagep,0); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - + glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - + // Care about alpha only glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); @@ -736,10 +704,8 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 1: Write detail1 // LLViewerImage::bindTexture(detail_texture1p,1); // Texture unit 1 + glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 1 - glClientActiveTextureARB(GL_TEXTURE1_ARB); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -758,6 +724,7 @@ void LLDrawPoolTerrain::renderFull2TU() glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); + glActiveTextureARB(GL_TEXTURE0_ARB); { LLGLEnable blend(GL_BLEND); drawLoop(); @@ -769,14 +736,11 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 0: Generate alpha ramp for detail1/detail2 transition // LLViewerImage::bindTexture(m2DAlphaRampImagep,0); - glClientActiveTextureARB(GL_TEXTURE0_ARB); // Set the texture matrix glMatrixMode(GL_TEXTURE); glLoadIdentity(); glTranslatef(-1.f, 0.f, 0.f); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - // Care about alpha only glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); @@ -793,9 +757,7 @@ void LLDrawPoolTerrain::renderFull2TU() LLViewerImage::bindTexture(detail_texture2p,1); glEnable(GL_TEXTURE_2D); // Texture unit 1 - glClientActiveTextureARB(GL_TEXTURE1_ARB); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -826,14 +788,11 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 0: Generate alpha ramp for detail2/detail3 transition // LLViewerImage::bindTexture(m2DAlphaRampImagep,0); - glClientActiveTextureARB(GL_TEXTURE0_ARB); // Set the texture matrix glMatrixMode(GL_TEXTURE); glLoadIdentity(); glTranslatef(-2.f, 0.f, 0.f); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - // Care about alpha only glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_REPLACE); @@ -847,10 +806,8 @@ void LLDrawPoolTerrain::renderFull2TU() // Stage 1: Write detail3 LLViewerImage::bindTexture(detail_texture3p,1); + glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 1 - glClientActiveTextureARB(GL_TEXTURE1_ARB); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -869,6 +826,7 @@ void LLDrawPoolTerrain::renderFull2TU() glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); + glActiveTextureARB(GL_TEXTURE0_ARB); { LLGLEnable blend(GL_BLEND); drawLoop(); @@ -879,8 +837,7 @@ void LLDrawPoolTerrain::renderFull2TU() // Disable multitexture LLImageGL::unbindTexture(1, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE1_ARB); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); // Texture unit 1 glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); @@ -891,9 +848,9 @@ void LLDrawPoolTerrain::renderFull2TU() //---------------------------------------------------------------------------- // Restore Texture Unit 0 defaults + glActiveTextureARB(GL_TEXTURE0_ARB); LLImageGL::unbindTexture(0, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); @@ -902,16 +859,12 @@ void LLDrawPoolTerrain::renderFull2TU() glMatrixMode(GL_MODELVIEW); // Restore non Texture Unit specific defaults - glDisableClientState(GL_NORMAL_ARRAY); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } void LLDrawPoolTerrain::renderSimple() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - LLVector4 tp0, tp1; //---------------------------------------------------------------------------- @@ -923,14 +876,12 @@ void LLDrawPoolTerrain::renderSimple() glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); // Texture unit 2 - glClientActiveTextureARB(GL_TEXTURE0_ARB); - + LLVector3 origin_agent = mDrawFace[0]->getDrawable()->getVObj()->getRegion()->getOriginAgent(); F32 tscale = 1.f/256.f; tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f)); tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f)); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR); @@ -952,7 +903,6 @@ void LLDrawPoolTerrain::renderSimple() // Restore Texture Unit 0 defaults LLImageGL::unbindTexture(0, GL_TEXTURE_2D); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glDisable(GL_TEXTURE_GEN_S); glDisable(GL_TEXTURE_GEN_T); @@ -961,7 +911,6 @@ void LLDrawPoolTerrain::renderSimple() glMatrixMode(GL_MODELVIEW); // Restore non Texture Unit specific defaults - glDisableClientState(GL_NORMAL_ARRAY); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } @@ -986,14 +935,8 @@ void LLDrawPoolTerrain::renderOwnership() LLViewerParcelOverlay *overlayp = regionp->getParcelOverlay(); LLImageGL *texturep = overlayp->getTexture(); - glEnableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - LLViewerImage::bindTexture(texturep); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - // *NOTE: Because the region is 256 meters wide, but has 257 pixels, the // texture coordinates for pixel 256x256 is not 1,1. This makes the // ownership map not line up with the selection. We address this with @@ -1014,9 +957,6 @@ void LLDrawPoolTerrain::renderOwnership() glMatrixMode(GL_TEXTURE); glPopMatrix(); glMatrixMode(GL_MODELVIEW); - - // Restore non Texture Unit specific defaults - glDisableClientState(GL_NORMAL_ARRAY); } diff --git a/linden/indra/newview/lldrawpooltree.cpp b/linden/indra/newview/lldrawpooltree.cpp index fd1ca8e..fd0a83c 100644 --- a/linden/indra/newview/lldrawpooltree.cpp +++ b/linden/indra/newview/lldrawpooltree.cpp @@ -67,9 +67,6 @@ void LLDrawPoolTree::prerender() void LLDrawPoolTree::beginRenderPass(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_TREES); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); glAlphaFunc(GL_GREATER, 0.5f); if (LLPipeline::sUnderWaterRender) @@ -110,9 +107,7 @@ void LLDrawPoolTree::endRenderPass(S32 pass) { LLFastTimer t(LLFastTimer::FTM_RENDER_TREES); glAlphaFunc(GL_GREATER, 0.01f); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - + if (gPipeline.canUseWindLightShadersOnObjects()) { shader->unbind(); @@ -126,9 +121,6 @@ void LLDrawPoolTree::renderForSelect() return; } - glEnableClientState (GL_VERTEX_ARRAY); - glEnableClientState (GL_TEXTURE_COORD_ARRAY); - LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); LLGLSObjectSelectAlpha gls_alpha; @@ -155,7 +147,6 @@ void LLDrawPoolTree::renderForSelect() gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisableClientState (GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolTree::renderTree(BOOL selecting) @@ -278,8 +269,6 @@ void LLDrawPoolTree::renderTree(BOOL selecting) //glPopMatrix(); } } - - addIndicesDrawn(indices_drawn); } BOOL LLDrawPoolTree::verify() const diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp index 922a5d8..231d0e1 100644 --- a/linden/indra/newview/lldrawpoolwater.cpp +++ b/linden/indra/newview/lldrawpoolwater.cpp @@ -163,17 +163,11 @@ void LLDrawPoolWater::render(S32 pass) LLGLDisable cullFace(GL_CULL_FACE); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - // Set up second pass first - glActiveTextureARB(GL_TEXTURE1_ARB); mWaterImagep->addTextureStats(1024.f*1024.f); mWaterImagep->bind(1); - - glClientActiveTextureARB(GL_TEXTURE1_ARB); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glActiveTextureARB(GL_TEXTURE1_ARB); + glEnable(GL_TEXTURE_2D); // Texture unit 1 LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis(); @@ -215,7 +209,6 @@ void LLDrawPoolWater::render(S32 pass) glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB); glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glClearStencil(1); @@ -234,11 +227,9 @@ void LLDrawPoolWater::render(S32 pass) } face->bindTexture(); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } // Now, disable texture coord generation on texture state 1 - glClientActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB); glDisable(GL_TEXTURE_2D); // Texture unit 1 glDisable(GL_TEXTURE_GEN_S); //texture unit 1 @@ -246,11 +237,9 @@ void LLDrawPoolWater::render(S32 pass) LLImageGL::unbindTexture(1, GL_TEXTURE_2D); // Disable texture coordinate and color arrays - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); LLImageGL::unbindTexture(0, GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); stop_glerror(); if (gSky.mVOSkyp->getCubeMap()) @@ -284,7 +273,6 @@ void LLDrawPoolWater::render(S32 pass) if (face->getGeomCount() > 0) { face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } } @@ -310,9 +298,6 @@ void LLDrawPoolWater::render(S32 pass) renderReflection(refl_face); } - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } @@ -338,16 +323,10 @@ void LLDrawPoolWater::renderReflection(LLFace* face) LLGLSNoFog noFog; - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - LLViewerImage::bindTexture(mHBTex[dr]); LLOverrideFaceColor override(this, face->getFaceColor().mV); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolWater::shade() @@ -361,10 +340,6 @@ void LLDrawPoolWater::shade() return; } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - LLGLDisable blend(GL_BLEND); LLColor3 light_diffuse(0,0,0); @@ -562,8 +537,6 @@ void LLDrawPoolWater::shade() face->renderIndexed(); } } - - mIndicesDrawn += face->getIndicesCount(); } } @@ -576,8 +549,6 @@ void LLDrawPoolWater::shade() shader->unbind(); glActiveTextureARB(GL_TEXTURE0_ARB); - glClientActiveTextureARB(GL_TEXTURE0_ARB); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); glEnable(GL_TEXTURE_2D); glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE); diff --git a/linden/indra/newview/lldrawpoolwlsky.cpp b/linden/indra/newview/lldrawpoolwlsky.cpp index d18f0de..e10cd0a 100644 --- a/linden/indra/newview/lldrawpoolwlsky.cpp +++ b/linden/indra/newview/lldrawpoolwlsky.cpp @@ -159,9 +159,7 @@ void LLDrawPoolWLSky::renderStars(void) const // combiners blending below requires something to be bound // and we might as well only bind once. //LLGLEnable gl_texture_2d(GL_TEXTURE_2D); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - + gPipeline.disableLights(); if (!LLPipeline::sReflectionRender) @@ -224,9 +222,6 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const void LLDrawPoolWLSky::renderHeavenlyBodies() { - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); LLGLSPipelineSkyBox gls_skybox; LLGLEnable blend_on(GL_BLEND); gPipeline.disableLights(); @@ -240,7 +235,6 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLColor4 color(gSky.mVOSkyp->getSun().getInterpColor()); LLFacePool::LLOverrideFaceColor color_override(this, color); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } #endif @@ -264,10 +258,7 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLFacePool::LLOverrideFaceColor color_override(this, color); face->renderIndexed(); - mIndicesDrawn += face->getIndicesCount(); } - - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } void LLDrawPoolWLSky::render(S32 pass) diff --git a/linden/indra/newview/llface.cpp b/linden/indra/newview/llface.cpp index 0c8de14..f480d8d 100644 --- a/linden/indra/newview/llface.cpp +++ b/linden/indra/newview/llface.cpp @@ -263,8 +263,14 @@ void LLFace::setDrawable(LLDrawable *drawable) void LLFace::setSize(const S32 num_vertices, const S32 num_indices) { - mGeomCount = num_vertices; - mIndicesCount = num_indices; + if (mGeomCount != num_vertices || + mIndicesCount != num_indices) + { + mGeomCount = num_vertices; + mIndicesCount = num_indices; + mVertexBuffer = NULL; + mLastVertexBuffer = NULL; + } } //============================================================================ @@ -368,8 +374,6 @@ void LLFace::renderForSelect(U32 data_mask) #if !LL_RELEASE_FOR_DOWNLOAD LLGLState::checkClientArrays(data_mask); #endif - U16* indicesp = (U16*) mVertexBuffer->getIndicesPointer() + mIndicesIndex; - if (gPickFaces && mTEOffset != -1) { // mask off high 4 bits (16 total possible faces) @@ -386,40 +390,26 @@ void LLFace::renderForSelect(U32 data_mask) { glPushMatrix(); glMultMatrixf((float*) mDrawablep->getRegion()->mRenderMatrix.mMatrix); - glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp); + mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex); glPopMatrix(); } else { - glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp); + mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex); } } else { glPushMatrix(); glMultMatrixf((float*)getRenderMatrix().mMatrix); - glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp); - glPopMatrix(); - } - } - else if (mGeomCount > 0) - { - if (isState(GLOBAL)) - { - glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount); - } - else - { - glPushMatrix(); - glMultMatrixf((float*)getRenderMatrix().mMatrix); - glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount); + mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex); glPopMatrix(); } } } } -void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 offset, const S32 count) +void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color) { if(mDrawablep.isNull() || mVertexBuffer.isNull()) { @@ -443,27 +433,12 @@ void LLFace::renderSelected(LLImageGL *imagep, const LLColor4& color, const S32 glMultMatrixf((GLfloat*)mDrawablep->getRegion()->mRenderMatrix.mMatrix); } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD); #if !LL_RELEASE_FOR_DOWNLOAD LLGLState::checkClientArrays(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_TEXCOORD); #endif - U16* indicesp = ((U16*) mVertexBuffer->getIndicesPointer()) + mIndicesIndex; - - if (count) - { - glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, indicesp + offset); - } - else - { - glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, indicesp); - } - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - + mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, mIndicesCount, mIndicesIndex); + glPopMatrix(); } } @@ -542,8 +517,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count) } else { - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_VERTEX_ARRAY); llassert(mGeomIndex >= 0); if (count) { @@ -568,7 +541,6 @@ void LLFace::renderSelectedUV(const S32 offset, const S32 count) glDrawArrays(GL_TRIANGLES, mGeomIndex, mGeomCount); } } - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } glDisable(GL_POLYGON_OFFSET_FILL); @@ -1251,16 +1223,7 @@ S32 LLFace::pushVertices(const U16* index_array) const { if (mIndicesCount) { - if (mGeomCount <= gGLManager.mGLMaxVertexRange && - mIndicesCount <= (U32) gGLManager.mGLMaxIndexRange) - { - glDrawRangeElements(GL_TRIANGLES, mGeomIndex, mGeomIndex + mGeomCount-1, mIndicesCount, - GL_UNSIGNED_SHORT, index_array + mIndicesIndex); - } - else - { - glDrawElements(GL_TRIANGLES, mIndicesCount, GL_UNSIGNED_SHORT, index_array+mIndicesIndex); - } + mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, mGeomIndex, mGeomIndex+mGeomCount-1, mIndicesCount, mIndicesIndex); gPipeline.addTrianglesDrawn(mIndicesCount/3); } diff --git a/linden/indra/newview/llface.h b/linden/indra/newview/llface.h index 4454bd6..f04d221 100644 --- a/linden/indra/newview/llface.h +++ b/linden/indra/newview/llface.h @@ -167,7 +167,7 @@ public: void renderSelectedUV(const S32 offset = 0, const S32 count = 0); void renderForSelect(U32 data_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD); - void renderSelected(LLImageGL *image, const LLColor4 &color, const S32 offset = 0, const S32 count = 0); + void renderSelected(LLImageGL *image, const LLColor4 &color); F32 getKey() const { return mDistance; } diff --git a/linden/indra/newview/llflexibleobject.cpp b/linden/indra/newview/llflexibleobject.cpp index fe7fafa..ec49c1a 100644 --- a/linden/indra/newview/llflexibleobject.cpp +++ b/linden/indra/newview/llflexibleobject.cpp @@ -195,7 +195,7 @@ void LLVolumeImplFlexible::remapSections(LLFlexibleObjectSection *source, S32 so //----------------------------------------------------------------------------- -void LLVolumeImplFlexible::setAttributesOfAllSections() +void LLVolumeImplFlexible::setAttributesOfAllSections(LLVector3* inScale) { LLVector2 bottom_scale, top_scale; F32 begin_rot = 0, end_rot = 0; @@ -215,8 +215,16 @@ void LLVolumeImplFlexible::setAttributesOfAllSections() S32 num_sections = 1 << mSimulateRes; - LLVector3 scale = mVO->mDrawable->getScale(); - + LLVector3 scale; + if (inScale == (LLVector3*)NULL) + { + scale = mVO->mDrawable->getScale(); + } + else + { + scale = *inScale; + } + mSection[0].mPosition = getAnchorPosition(); mSection[0].mDirection = LLVector3::z_axis * getFrameRotation(); mSection[0].mdPosition = mSection[0].mDirection; @@ -297,7 +305,7 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6 new_res = mRenderRes; } - if (!mInitialized || (mSimulateRes != new_res)) + if (!mInitialized) { mSimulateRes = new_res; setAttributesOfAllSections(); @@ -644,7 +652,7 @@ void LLVolumeImplFlexible::doFlexibleRebuild() void LLVolumeImplFlexible::onSetScale(const LLVector3& scale, BOOL damped) { - setAttributesOfAllSections(); + setAttributesOfAllSections((LLVector3*) &scale); } BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) diff --git a/linden/indra/newview/llflexibleobject.h b/linden/indra/newview/llflexibleobject.h index f6e68fc..843a8f8 100644 --- a/linden/indra/newview/llflexibleobject.h +++ b/linden/indra/newview/llflexibleobject.h @@ -138,7 +138,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface //-------------------------------------- // private methods //-------------------------------------- - void setAttributesOfAllSections (); + void setAttributesOfAllSections (LLVector3* inScale = NULL); void remapSections(LLFlexibleObjectSection *source, S32 source_sections, LLFlexibleObjectSection *dest, S32 dest_sections); diff --git a/linden/indra/newview/llfloateranimpreview.cpp b/linden/indra/newview/llfloateranimpreview.cpp index 6892b8d..1ea0495 100644 --- a/linden/indra/newview/llfloateranimpreview.cpp +++ b/linden/indra/newview/llfloateranimpreview.cpp @@ -293,7 +293,6 @@ BOOL LLFloaterAnimPreview::postBuild() mAnimPreview = NULL; mMotionID.setNull(); childSetValue("bad_animation_text", getString("failed_to_initialize")); - setEnabled(FALSE); } } else diff --git a/linden/indra/newview/llfloaterauction.cpp b/linden/indra/newview/llfloaterauction.cpp index 6b1c3e0..7affff6 100644 --- a/linden/indra/newview/llfloaterauction.cpp +++ b/linden/indra/newview/llfloaterauction.cpp @@ -53,6 +53,7 @@ #include "llviewerdisplay.h" #include "llviewercontrol.h" #include "llui.h" +#include "llglimmediate.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -153,7 +154,7 @@ void LLFloaterAuction::draw() } { LLGLSUIDefault gls_ui; - glColor3f(1.f, 1.f, 1.f); + gGL.color3f(1.f, 1.f, 1.f); gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), diff --git a/linden/indra/newview/llfloaterhud.cpp b/linden/indra/newview/llfloaterhud.cpp index 2f192f7..d93e36a 100644 --- a/linden/indra/newview/llfloaterhud.cpp +++ b/linden/indra/newview/llfloaterhud.cpp @@ -51,16 +51,20 @@ LLFloaterHUD::LLFloaterHUD() : LLFloater("floater_hud"), mWebBrowser(0) { + // Create floater from its XML definition + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml"); + // Don't grab the focus as it will impede performing in-world actions // while using the HUD - setAutoFocus(FALSE); + setIsChrome(TRUE); + + // Chrome doesn't show the window title by default, but here we + // want to show it. + setTitleVisible(true); // Opaque background since we never get the focus setBackgroundOpaque(TRUE); - // Create floater from its XML definition - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_hud.xml"); - // Position floater based on saved location LLRect saved_position_rect = gSavedSettings.getRect("FloaterHUDRect"); reshape(saved_position_rect.getWidth(), saved_position_rect.getHeight(), FALSE); @@ -69,12 +73,14 @@ LLFloaterHUD::LLFloaterHUD() mWebBrowser = getChild("floater_hud_browser" ); if (mWebBrowser) { - // Always refresh the browser - mWebBrowser->setAlwaysRefresh(true); - // Open links in internal browser mWebBrowser->setOpenInExternalBrowser(false); + // This is a "chrome" floater, so we don't want anything to + // take focus (as the user needs to be able to walk with + // arrow keys during tutorial). + mWebBrowser->setTakeFocusOnClick(false); + LLString language(gSavedSettings.getString("Language")); if(language == "default") { @@ -132,9 +138,3 @@ void LLFloaterHUD::close() { if (sInstance) sInstance->close(); } - -void LLFloaterHUD::onFocusReceived() -{ - // Never get the focus - setFocus(FALSE); -} diff --git a/linden/indra/newview/llfloaterhud.h b/linden/indra/newview/llfloaterhud.h index bd60d7b..95c0f8d 100644 --- a/linden/indra/newview/llfloaterhud.h +++ b/linden/indra/newview/llfloaterhud.h @@ -58,7 +58,7 @@ protected: LLWebBrowserCtrl* mWebBrowser; ///< the actual web browser control LLFloaterHUD(); ///< default constructor - virtual void onFocusReceived(); ///< called when we get the focus + private: static LLFloaterHUD* sInstance; }; diff --git a/linden/indra/newview/llmemoryview.cpp b/linden/indra/newview/llmemoryview.cpp index c7a929d..a19328a 100644 --- a/linden/indra/newview/llmemoryview.cpp +++ b/linden/indra/newview/llmemoryview.cpp @@ -121,6 +121,8 @@ static const struct mtv_display_info mtv_display_table[] = { LLMemType::MTYPE_VERTEX_DATA, "Vertex Buffer", &LLColor4::blue3 }, { LLMemType::MTYPE_AVATAR, "Avatar", &LLColor4::purple1 }, { LLMemType::MTYPE_REGIONS, "Regions", &LLColor4::blue1 }, + { LLMemType::MTYPE_VOLUME, "Volume", &LLColor4::pink1 }, + { LLMemType::MTYPE_PRIMITIVE, "Profile", &LLColor4::pink2 }, { LLMemType::MTYPE_TEMP1, "Temp1", &LLColor4::red1 }, { LLMemType::MTYPE_TEMP2, "Temp2", &LLColor4::magenta1 }, { LLMemType::MTYPE_TEMP3, "Temp3", &LLColor4::red2 }, diff --git a/linden/indra/newview/llpanellogin.cpp b/linden/indra/newview/llpanellogin.cpp index f403271..9fcd73d 100644 --- a/linden/indra/newview/llpanellogin.cpp +++ b/linden/indra/newview/llpanellogin.cpp @@ -951,6 +951,7 @@ void LLPanelLogin::loadLoginPage() { LLAppViewer::instance()->resetURIs(); gGridChoice = (EGridInfo)grid_index; + gSavedSettings.setString("GridChoice", gGridInfo[gGridChoice].mLabel); gViewerWindow->setMenuBackgroundColor(false, !LLAppViewer::instance()->isInProductionGrid()); gLoginMenuBarView->setBackgroundColor(gMenuBarView->getBackgroundColor()); diff --git a/linden/indra/newview/llpostprocess.cpp b/linden/indra/newview/llpostprocess.cpp index 11a211a..c72b8ae 100644 --- a/linden/indra/newview/llpostprocess.cpp +++ b/linden/indra/newview/llpostprocess.cpp @@ -215,7 +215,6 @@ void LLPostProcess::applyColorFilterShader(void) { gPostColorFilterProgram.bind(); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_RECTANGLE_ARB); @@ -258,7 +257,6 @@ void LLPostProcess::applyNightVisionShader(void) { gPostNightVisionProgram.bind(); - glClientActiveTextureARB(GL_TEXTURE0_ARB); glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_RECTANGLE_ARB); @@ -266,7 +264,6 @@ void LLPostProcess::applyNightVisionShader(void) glBindTexture(GL_TEXTURE_RECTANGLE_ARB, sceneRenderTexture); glUniform1iARB(nightVisionUniforms["RenderTexture"], 0); - glClientActiveTextureARB(GL_TEXTURE1_ARB); glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); diff --git a/linden/indra/newview/llspatialpartition.cpp b/linden/indra/newview/llspatialpartition.cpp index 7d715be..c378aad 100644 --- a/linden/indra/newview/llspatialpartition.cpp +++ b/linden/indra/newview/llspatialpartition.cpp @@ -1906,9 +1906,8 @@ void pushVerts(LLDrawInfo* params, U32 mask) { LLRenderPass::applyModelMatrix(*params); params->mVertexBuffer->setBuffer(mask); - U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount, - GL_UNSIGNED_SHORT, indicesp+params->mOffset); + params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES, + params->mStart, params->mEnd, params->mCount, params->mOffset); } void pushVerts(LLSpatialGroup* group, U32 mask) @@ -1932,13 +1931,11 @@ void pushVerts(LLFace* face, U32 mask) if (buffer) { buffer->setBuffer(mask); - U16* indicesp = (U16*) buffer->getIndicesPointer(); U16 start = face->getGeomStart(); U16 end = start + face->getGeomCount()-1; U32 count = face->getIndicesCount(); U16 offset = face->getIndicesStart(); - - glDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp + offset); + buffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); } } @@ -1948,9 +1945,7 @@ void pushBufferVerts(LLVertexBuffer* buffer, U32 mask) if (buffer) { buffer->setBuffer(mask); - U16* indicesp = (U16*) buffer->getIndicesPointer(); - glDrawRangeElements(GL_TRIANGLES, 0, buffer->getRequestedVerts(), buffer->getRequestedIndices(), - GL_UNSIGNED_SHORT, indicesp); + buffer->drawRange(LLVertexBuffer::TRIANGLES, 0, buffer->getRequestedVerts()-1, buffer->getRequestedIndices(), 0); } } @@ -1999,9 +1994,8 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask) LLRenderPass::applyModelMatrix(*params); glColor4f(colors[col].mV[0], colors[col].mV[1], colors[col].mV[2], 0.5f); params->mVertexBuffer->setBuffer(mask); - U16* indicesp = (U16*) params->mVertexBuffer->getIndicesPointer(); - glDrawRangeElements(params->mParticle ? GL_POINTS : GL_TRIANGLES, params->mStart, params->mEnd, params->mCount, - GL_UNSIGNED_SHORT, indicesp+params->mOffset); + params->mVertexBuffer->drawRange(params->mParticle ? LLVertexBuffer::POINTS : LLVertexBuffer::TRIANGLES, + params->mStart, params->mEnd, params->mCount, params->mOffset); col = (col+1)%col_count; } } @@ -2070,8 +2064,7 @@ void renderOctree(LLSpatialGroup* group) face->mVertexBuffer->setBuffer(LLVertexBuffer::MAP_VERTEX); //drawBox((face->mExtents[0] + face->mExtents[1])*0.5f, // (face->mExtents[1]-face->mExtents[0])*0.5f); - glDrawElements(GL_TRIANGLES, face->getIndicesCount(), GL_UNSIGNED_SHORT, - ((U16*) face->mVertexBuffer->getIndicesPointer())+face->getIndicesStart()); + face->mVertexBuffer->draw(LLVertexBuffer::TRIANGLES, face->getIndicesCount(), face->getIndicesStart()); } } diff --git a/linden/indra/newview/llviewerdisplay.cpp b/linden/indra/newview/llviewerdisplay.cpp index b4d6f27..72e3d5c 100644 --- a/linden/indra/newview/llviewerdisplay.cpp +++ b/linden/indra/newview/llviewerdisplay.cpp @@ -886,6 +886,11 @@ void render_ui_and_swap() LLGLState::checkStates(); #endif + glPushMatrix(); + glLoadMatrixd(gGLLastModelView); + glh::matrix4f saved_view = glh_get_current_modelview(); + glh_set_current_modelview(glh_copy_matrix(gGLLastModelView)); + { BOOL to_texture = gPipeline.canUseVertexShaders() && LLPipeline::sRenderGlow && @@ -936,6 +941,9 @@ void render_ui_and_swap() LLVertexBuffer::stopRender(); } + + glh_set_current_modelview(saved_view); + glPopMatrix(); } void render_ui_and_swap_if_needed() @@ -1030,11 +1038,6 @@ void render_ui_3d() // so 3d elements requiring Z buffer are moved to LLDrawPoolHUD // - // Render selections - //glDisableClientState(GL_COLOR_ARRAY); - //glDisableClientState(GL_TEXTURE_COORD_ARRAY); - //glDisableClientState(GL_NORMAL_ARRAY); - ///////////////////////////////////////////////////////////// // // Render 2.5D elements (2D elements in the world) diff --git a/linden/indra/newview/llviewerjointmesh.cpp b/linden/indra/newview/llviewerjointmesh.cpp index b87d564..4a0f0b8 100644 --- a/linden/indra/newview/llviewerjointmesh.cpp +++ b/linden/indra/newview/llviewerjointmesh.cpp @@ -501,21 +501,6 @@ int compare_int(const void *a, const void *b) else return 0; } -void llDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) -{ - if (end-start+1 > (U32) gGLManager.mGLMaxVertexRange || - count > gGLManager.mGLMaxIndexRange) - { - glDrawElements(mode,count,type,indices); - } - else - { - glDrawRangeElements(mode,start,end,count,type,indices); - } - - gPipeline.addTrianglesDrawn(count/3); -} - //-------------------------------------------------------------------- // LLViewerJointMesh::drawShape() //-------------------------------------------------------------------- @@ -626,7 +611,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass) U32 start = mMesh->mFaceVertexOffset; U32 end = start + mMesh->mFaceVertexCount - 1; U32 count = mMesh->mFaceIndexCount; - U16* indicesp = ((U16*) mFace->mVertexBuffer->getIndicesPointer()) + mMesh->mFaceIndexOffset; + U32 offset = mMesh->mFaceIndexOffset; if (mMesh->hasWeights()) { @@ -636,23 +621,21 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass) { uploadJointMatrices(); } - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); - } - else - { - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); } + + mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); } else { glPushMatrix(); LLMatrix4 jointToWorld = getWorldMatrix(); glMultMatrixf((GLfloat*)jointToWorld.mMatrix); - llDrawRangeElements(GL_TRIANGLES, start, end, count, GL_UNSIGNED_SHORT, indicesp); + mFace->mVertexBuffer->drawRange(LLVertexBuffer::TRIANGLES, start, end, count, offset); glPopMatrix(); } + gPipeline.addTrianglesDrawn(count/3); - triangle_count += mMesh->mFaceIndexCount; + triangle_count += count; if (mTestImageName) { diff --git a/linden/indra/newview/llviewerkeyboard.cpp b/linden/indra/newview/llviewerkeyboard.cpp index 1c5d870..0d927ae 100644 --- a/linden/indra/newview/llviewerkeyboard.cpp +++ b/linden/indra/newview/llviewerkeyboard.cpp @@ -88,8 +88,6 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m { if (KEYSTATE_UP == s) { - // Releasing a walk-key resets the double-tap timer - gAgent.mDoubleTapRunTimer.reset(); if (gAgent.mDoubleTapRunMode == mode && gAgent.getRunning() && !gAgent.getAlwaysRun()) @@ -98,17 +96,23 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m gAgent.clearRunning(); gAgent.sendWalkRun(gAgent.getRunning()); } - gAgent.mDoubleTapRunMode = mode; } else if (gAllowTapTapHoldRun && KEYSTATE_DOWN == s && - gAgent.mDoubleTapRunMode == mode && - gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME) + !gAgent.getRunning()) { - // Same walk-key was pushed again quickly; this is a double-tap - // so engage temporary running. - gAgent.setRunning(); - gAgent.sendWalkRun(gAgent.getRunning()); + if (gAgent.mDoubleTapRunMode == mode && + gAgent.mDoubleTapRunTimer.getElapsedTimeF32() < NUDGE_TIME) + { + // Same walk-key was pushed again quickly; this is a + // double-tap so engage temporary running. + gAgent.setRunning(); + gAgent.sendWalkRun(gAgent.getRunning()); + } + + // Pressing any walk-key resets the double-tap timer + gAgent.mDoubleTapRunTimer.reset(); + gAgent.mDoubleTapRunMode = mode; } } diff --git a/linden/indra/newview/llvotree.cpp b/linden/indra/newview/llvotree.cpp index a55afe1..993c2a0 100644 --- a/linden/indra/newview/llvotree.cpp +++ b/linden/indra/newview/llvotree.cpp @@ -821,7 +821,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, sLODIndexCount[trunk_LOD], GL_UNSIGNED_SHORT, indicesp + sLODIndexOffset[trunk_LOD]); - + gPipeline.addTrianglesDrawn(LEAF_INDICES/3); stop_glerror(); ret += sLODIndexCount[trunk_LOD]; } @@ -871,7 +871,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); - + gPipeline.addTrianglesDrawn(LEAF_INDICES/3); stop_glerror(); ret += LEAF_INDICES; } @@ -896,7 +896,7 @@ U32 LLVOTree::drawBranchPipeline(LLMatrix4& matrix, U16* indicesp, S32 trunk_LOD glLoadMatrixf((F32*) scale_mat.mMatrix); glDrawElements(GL_TRIANGLES, LEAF_INDICES, GL_UNSIGNED_SHORT, indicesp); - + gPipeline.addTrianglesDrawn(LEAF_INDICES/3); stop_glerror(); ret += LEAF_INDICES; diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp index 4b357e2..188c277 100644 --- a/linden/indra/newview/llvovolume.cpp +++ b/linden/indra/newview/llvovolume.cpp @@ -762,7 +762,7 @@ void LLVOVolume::sculpt() return; LLPointer raw_image = new LLImageRaw(); - mSculptTexture->readBackRaw(discard_level, raw_image, FALSE); + BOOL is_valid = mSculptTexture->readBackRaw(discard_level, raw_image, FALSE); sculpt_height = raw_image->getHeight(); sculpt_width = raw_image->getWidth(); @@ -770,6 +770,16 @@ void LLVOVolume::sculpt() sculpt_components = raw_image->getComponents(); sculpt_data = raw_image->getData(); + if(is_valid) + { + is_valid = mSculptTexture->isValidForSculpt(discard_level, sculpt_width, sculpt_height, sculpt_components) ; + } + if(!is_valid) + { + sculpt_width = 0 ; + sculpt_height = 0 ; + } + llassert_always(raw_image->getDataSize() >= sculpt_height * sculpt_width * sculpt_components); getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); diff --git a/linden/indra/newview/llvowlsky.cpp b/linden/indra/newview/llvowlsky.cpp index 30d1397..159603e 100644 --- a/linden/indra/newview/llvowlsky.cpp +++ b/linden/indra/newview/llvowlsky.cpp @@ -484,17 +484,12 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) void LLVOWLSky::drawStars(void) { - glEnableClientState(GL_COLOR_ARRAY); - // render the stars as a sphere centered at viewer camera if (mStarsVerts.notNull()) { mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK); - U16* indicesp = (U16*) mStarsVerts->getIndicesPointer(); - glDrawElements(GL_POINTS, getStarsNumIndices(), GL_UNSIGNED_SHORT, indicesp); + mStarsVerts->draw(LLVertexBuffer::POINTS, getStarsNumIndices(), 0); } - - glDisableClientState(GL_COLOR_ARRAY); } void LLVOWLSky::drawDome(void) @@ -507,19 +502,8 @@ void LLVOWLSky::drawDome(void) LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK; - - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - + #if DOME_SLICES - //mFanVerts->setBuffer(data_mask); - //glDrawRangeElements( - // GL_TRIANGLES, - // 0, getFanNumVerts()-1, getFanNumIndices(), - // GL_UNSIGNED_SHORT, - // mFanVerts->getIndicesPointer()); - - //gPipeline.addTrianglesDrawn(getFanNumIndices()/3); - std::vector< LLPointer >::const_iterator strips_vbo_iter, end_strips; end_strips = mStripsVerts.end(); for(strips_vbo_iter = mStripsVerts.begin(); strips_vbo_iter != end_strips; ++strips_vbo_iter) @@ -528,13 +512,10 @@ void LLVOWLSky::drawDome(void) strips_segment->setBuffer(data_mask); - glDrawRangeElements( - //GL_TRIANGLES, - GL_TRIANGLE_STRIP, - 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), - GL_UNSIGNED_SHORT, - strips_segment->getIndicesPointer()); - + strips_segment->drawRange( + LLVertexBuffer::TRIANGLE_STRIP, + 0, strips_segment->getRequestedVerts()-1, strips_segment->getRequestedIndices(), + 0); gPipeline.addTrianglesDrawn(strips_segment->getRequestedIndices() - 2); } @@ -547,8 +528,6 @@ void LLVOWLSky::drawDome(void) mStripsVerts->getIndicesPointer()); #endif - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - LLVertexBuffer::unbind(); } diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index a9c1ec8..fbbd827 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -71,7 +71,8 @@ LLWebBrowserCtrl::LLWebBrowserCtrl( const std::string& name, const LLRect& rect mIgnoreUIScale( true ), mAlwaysRefresh( false ), mExternalUrl( "" ), - mMediaSource( 0 ) + mMediaSource( 0 ), + mTakeFocusOnClick( true ) { S32 screen_width = mIgnoreUIScale ? llround((F32)getRect().getWidth() * LLUI::sGLScaleFactor.mV[VX]) : getRect().getWidth(); @@ -161,6 +162,13 @@ void LLWebBrowserCtrl::setBorderVisible( BOOL border_visible ) }; //////////////////////////////////////////////////////////////////////////////// +// +void LLWebBrowserCtrl::setTakeFocusOnClick( bool take_focus ) +{ + mTakeFocusOnClick = take_focus; +} + +//////////////////////////////////////////////////////////////////////////////// // set flag that forces the embedded browser to open links in the external system browser void LLWebBrowserCtrl::setOpenInExternalBrowser( bool valIn ) { @@ -209,7 +217,17 @@ BOOL LLWebBrowserCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) convertInputCoords(x, y); if (mMediaSource) + { mMediaSource->mouseUp(x, y); + + // *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup, + // in addition to the onFocusReceived() call below. Undo this. JC + if (!mTakeFocusOnClick) + { + mMediaSource->focus(false); + gViewerWindow->focusClient(); + } + } gViewerWindow->setMouseCapture( NULL ); @@ -227,7 +245,10 @@ BOOL LLWebBrowserCtrl::handleMouseDown( S32 x, S32 y, MASK mask ) gViewerWindow->setMouseCapture( this ); - setFocus( TRUE ); + if (mTakeFocusOnClick) + { + setFocus( TRUE ); + } return TRUE; } @@ -243,7 +264,10 @@ BOOL LLWebBrowserCtrl::handleDoubleClick( S32 x, S32 y, MASK mask ) gViewerWindow->setMouseCapture( this ); - setFocus( TRUE ); + if (mTakeFocusOnClick) + { + setFocus( TRUE ); + } return TRUE; } diff --git a/linden/indra/newview/llwebbrowserctrl.h b/linden/indra/newview/llwebbrowserctrl.h index f7c9647..e1b5357 100644 --- a/linden/indra/newview/llwebbrowserctrl.h +++ b/linden/indra/newview/llwebbrowserctrl.h @@ -182,6 +182,12 @@ class LLWebBrowserCtrl : void setBorderVisible( BOOL border_visible ); + // For the tutorial window, we don't want to take focus on clicks, + // as the examples include how to move around with the arrow + // keys. Thus we keep focus on the app by setting this false. + // Defaults to true. + void setTakeFocusOnClick( bool take_focus ); + static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); // handle mouse related methods @@ -263,6 +269,7 @@ class LLWebBrowserCtrl : private: static void onClickLinkExternalTarget( S32 option, void* userdata ); + LLWebBrowserCtrlEventEmitter< LLWebBrowserCtrlObserver > mEventEmitter; const S32 mTextureDepthBytes; int mEmbeddedBrowserWindowId; @@ -278,6 +285,7 @@ class LLWebBrowserCtrl : bool mIgnoreUIScale; bool mAlwaysRefresh; LLMediaBase* mMediaSource; + bool mTakeFocusOnClick; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/linden/indra/newview/mozilla-theme/classic.jar b/linden/indra/newview/mozilla-theme/classic.jar index f9c03eb..0f33170 100644 Binary files a/linden/indra/newview/mozilla-theme/classic.jar and b/linden/indra/newview/mozilla-theme/classic.jar differ diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 5f45e26..92a9811 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -168,7 +168,7 @@ glh::matrix4f glh_get_current_projection() return glh_copy_matrix(gGLProjection); } -void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst) +void glh_copy_matrix(const glh::matrix4f& src, GLdouble* dst) { for (U32 i = 0; i < 16; i++) { @@ -176,7 +176,7 @@ void glh_copy_matrix(glh::matrix4f& src, GLdouble* dst) } } -void glh_set_current_modelview(glh::matrix4f& mat) +void glh_set_current_modelview(const glh::matrix4f& mat) { glh_copy_matrix(mat, gGLModelView); } @@ -2144,9 +2144,9 @@ void render_hud_elements() LLViewerParcelMgr::getInstance()->renderParcelCollision(); // Render debugging beacons. - gObjectList.renderObjectBeacons(); - LLHUDObject::renderAll(); - gObjectList.resetObjectBeacons(); + //gObjectList.renderObjectBeacons(); + //LLHUDObject::renderAll(); + //gObjectList.resetObjectBeacons(); } else if (gForceRenderLandFence) { @@ -2253,11 +2253,11 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) // // - glEnableClientState(GL_VERTEX_ARRAY); - stop_glerror(); gFrameStats.start(LLFrameStats::RENDER_SYNC); + glEnableClientState(GL_VERTEX_ARRAY); + // Do verification of GL state #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); @@ -2377,10 +2377,10 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) break; } - p->resetTrianglesDrawn(); p->render(i); } poolp->endRenderPass(i); + LLVertexBuffer::unbind(); #ifndef LL_RELEASE_FOR_DOWNLOAD # if LL_DEBUG_GL GLint depth; @@ -2413,6 +2413,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) } } + LLVertexBuffer::unbind(); #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -2452,6 +2453,15 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) 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 if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) @@ -2472,15 +2482,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) void LLPipeline::renderGeomDeferred() { - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); gDeferredDiffuseProgram.bind(); gPipeline.renderObjects(LLRenderPass::PASS_SIMPLE, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL, TRUE); gDeferredDiffuseProgram.unbind(); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } void LLPipeline::addTrianglesDrawn(S32 count) @@ -2506,11 +2510,6 @@ void LLPipeline::renderDebug() gGL.start(); - // Disable all client state - //glDisableClientState(GL_TEXTURE_COORD_ARRAY); - //glDisableClientState(GL_NORMAL_ARRAY); - //glDisableClientState(GL_COLOR_ARRAY); - gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); @@ -2603,8 +2602,6 @@ void LLPipeline::renderForSelect(std::set& objects) LLGLDepthTest gls_depth(GL_TRUE,GL_TRUE); disableLights(); - glEnableClientState ( GL_VERTEX_ARRAY ); - //for each drawpool #ifndef LL_RELEASE_FOR_DOWNLOAD LLGLState::checkStates(); @@ -2619,7 +2616,7 @@ void LLPipeline::renderForSelect(std::set& objects) { LLFacePool* face_pool = (LLFacePool*) poolp; face_pool->renderForSelect(); - + LLVertexBuffer::unbind(); gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); @@ -2635,7 +2632,6 @@ void LLPipeline::renderForSelect(std::set& objects) } } - glEnableClientState(GL_TEXTURE_COORD_ARRAY); LLGLEnable alpha_test(GL_ALPHA_TEST); if (gPickTransparent) { @@ -2759,10 +2755,10 @@ void LLPipeline::renderForSelect(std::set& objects) } glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glDisableClientState( GL_TEXTURE_COORD_ARRAY ); + LLVertexBuffer::unbind(); LLVertexBuffer::stopRender(); - + glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); } @@ -4866,6 +4862,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) { if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate) { +#ifndef LL_RELEASE_FOR_DOWNLOAD + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); + LLGLState::checkClientArrays(); +#endif + LLCamera camera = camera_in; camera.setFar(camera.getFar()*0.87654321f); LLPipeline::sReflectionRender = TRUE; @@ -5052,6 +5054,12 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; LLViewerCamera::getInstance()->setUserClipPlane(LLPlane(-pnorm, -pd)); LLPipeline::sUseOcclusion = occlusion; + +#ifndef LL_RELEASE_FOR_DOWNLOAD + LLGLState::checkStates(); + LLGLState::checkTextureChannels(); + LLGLState::checkClientArrays(); +#endif } } diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h index a2a404f..9896a4a 100644 --- a/linden/indra/newview/pipeline.h +++ b/linden/indra/newview/pipeline.h @@ -67,8 +67,9 @@ BOOL compute_min_max(LLMatrix4& box, LLVector2& min, LLVector2& max); // Shouldn bool LLRayAABB(const LLVector3 ¢er, const LLVector3 &size, const LLVector3& origin, const LLVector3& dir, LLVector3 &coord, F32 epsilon = 0); BOOL LLLineSegmentAABB(const LLVector3& start, const LLVector3& end, const LLVector3& center, const LLVector3& size); BOOL setup_hud_matrices(BOOL for_select); +glh::matrix4f glh_copy_matrix(GLdouble* src); glh::matrix4f glh_get_current_modelview(); -void glh_set_current_modelview(glh::matrix4f& mat); +void glh_set_current_modelview(const glh::matrix4f& mat); glh::matrix4f glh_get_current_projection(); void glh_set_current_projection(glh::matrix4f& mat); glh::matrix4f gl_ortho(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat znear, GLfloat zfar); diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index 040c1da..0243fd7 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt @@ -1,3 +1,27 @@ +Release Notes for Second Life 1.20(3) April 23th, 2008 +===================================== +Fixes: +* Fixed: removed mac release notes dialog from LLAppviewer::init +* Fixed: Scrollbar channel missing in 1.20 +* Fixed: VWR-5080: Certain color combinations hard on visually impaired (and the not-visually-impaired) +* Fixed: VWR-2404: lossless texture compression on small textures not lossless +* Fixed: Window opens large, then small, then large on startup +* Fixed: Imposters sometimes render without attachments +* Fixed: VWR-380: Resized Flexible Prims Render Improperly +* Fixed: Yellow edit outline detached from selected prim +* Language tweaks to World Map UI +* Fixed: Help > Tutorial makes the world disappear +* Fixed: Help > Tutorial kills the keyboard. +* Fixed: VWR-5869: Broken BVH Animation upload causes dialog / interface error, and crash. +* Fixed: VWR-6275: Character runs when not supposed to. +* Fix for vibrating name tags. +* Fixed issue with mozilla scrollbars +* Fixed: Background and Foreground color are the same in all scroll lists + +Localization Fixes: +* Fixed: main Toolbar will not match to its Korean localization xml +* Fixed: erroneous German translation for Active Speakers + Release Notes for Second Life 1.20(2) April 18th, 2008 ===================================== Changes: diff --git a/linden/indra/newview/skins/xui/de/floater_active_speakers.xml b/linden/indra/newview/skins/xui/de/floater_active_speakers.xml index 88c3e15..9ec58c1 100644 --- a/linden/indra/newview/skins/xui/de/floater_active_speakers.xml +++ b/linden/indra/newview/skins/xui/de/floater_active_speakers.xml @@ -1,5 +1,5 @@ - + diff --git a/linden/indra/newview/skins/xui/de/menu_viewer.xml b/linden/indra/newview/skins/xui/de/menu_viewer.xml index d72e7b7..d4a569c 100644 --- a/linden/indra/newview/skins/xui/de/menu_viewer.xml +++ b/linden/indra/newview/skins/xui/de/menu_viewer.xml @@ -77,7 +77,7 @@ - + diff --git a/linden/indra/newview/skins/xui/de/panel_preferences_general.xml b/linden/indra/newview/skins/xui/de/panel_preferences_general.xml index 635f43e..b7779b6 100644 --- a/linden/indra/newview/skins/xui/de/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/de/panel_preferences_general.xml @@ -86,22 +86,22 @@ 汉语/漢語 (Chinesisch) - Beta - Deutsch + Deutsch - Beta - Français (Französisch) + Français (Französisch) - Beta - 日本語 (Japanisch) + 日本語 (Japanisch) - Beta - 한국어 (Koreanisch) + 한국어 (Koreanisch) - Beta Português (Portugiesisch) - Beta - Español (Spanisch) + Español (Spanisch) - Beta diff --git a/linden/indra/newview/skins/xui/en-us/alerts.xml b/linden/indra/newview/skins/xui/en-us/alerts.xml index d0ee7f0..b36a4ea 100644 --- a/linden/indra/newview/skins/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/xui/en-us/alerts.xml @@ -1032,6 +1032,9 @@ If you continue to have problems, please visit: http://www.secondlife.com/suppor MINSPECS Do you wish to visit [_URL] for more information? + + Ignore unsupported hardware + @@ -1067,6 +1070,20 @@ Do you wish to visit [_URL] for more information? 510 + + + +Your system contains a graphics card that is unknown to us at this time. +This is often the case with new hardware we haven't had a chance to +test. Second Life will most likely run properly, but you may need to +adjust your graphics settings to something more appropriate. +(Edit->Preferences->Graphics). + + + Ignore unknown graphics card + + + Display settings have been set to recommended levels diff --git a/linden/indra/newview/skins/xui/en-us/floater_world_map.xml b/linden/indra/newview/skins/xui/en-us/floater_world_map.xml index b8341f2..4e26986 100644 --- a/linden/indra/newview/skins/xui/en-us/floater_world_map.xml +++ b/linden/indra/newview/skins/xui/en-us/floater_world_map.xml @@ -149,20 +149,20 @@ image_name="map_track_16.tga" left="1013" mouse_opaque="true" name="avatar_icon" width="16" /> - My Friends + Online Friends - My Landmarks + Landmarks - Deutsch (German) + Deutsch (Alemán) - Beta + + + Français (Francés) - Beta - 日本語 (Japanese) + 日本語 (Japonés) - Beta - 한국어 (Korean) + 한국어 (Coreano) - Beta - Chino + 汉语/漢語 (Chino) - Beta + + + Español - Beta diff --git a/linden/indra/newview/skins/xui/fr/panel_preferences_general.xml b/linden/indra/newview/skins/xui/fr/panel_preferences_general.xml index c17fd3b..acf89cd 100644 --- a/linden/indra/newview/skins/xui/fr/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/fr/panel_preferences_general.xml @@ -70,16 +70,16 @@ Anglais - Deutsch (German) + Deutsch (German) - Beta - 日本語 (Japanese) + 日本語 (Japanese) - Beta - 한국어 (Korean) + 한국어 (Korean) - Beta - Chinois + Chinois - Beta diff --git a/linden/indra/newview/skins/xui/ja/panel_preferences_general.xml b/linden/indra/newview/skins/xui/ja/panel_preferences_general.xml index e5deeb3..5017f37 100644 --- a/linden/indra/newview/skins/xui/ja/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/ja/panel_preferences_general.xml @@ -92,22 +92,22 @@ 汉语/漢語(中国語) – ベータ - Deutsch (ドイツ語) + Deutsch (ドイツ語) – ベータ - Français (フランス語) + Français (フランス語) – ベータ - 日本語 + 日本語 – ベータ - 한국어 (韓国語) + 한국어 (韓国語) – ベータ Português (ポルトガル語) – ベータ - Español (スペイン語) + Español (スペイン語) – ベータ diff --git a/linden/indra/newview/skins/xui/ko/panel_preferences_general.xml b/linden/indra/newview/skins/xui/ko/panel_preferences_general.xml index 15e1e31..9c02484 100644 --- a/linden/indra/newview/skins/xui/ko/panel_preferences_general.xml +++ b/linden/indra/newview/skins/xui/ko/panel_preferences_general.xml @@ -87,22 +87,22 @@ 汉语/漢語(중국어) - 베타 - Deutsch (독일어) + Deutsch (독일어) - 베타 - Français (불어) + Français (불어) - 베타 - 日本語 (일본어) + 日本語 (일본어) - 베타 - 한국어 + 한국어 - 베타 Português(포르투갈어) - 베타 - Español (스페인어) + Español (스페인어) - 베타 diff --git a/linden/indra/newview/skins/xui/ko/panel_toolbar.xml b/linden/indra/newview/skins/xui/ko/panel_toolbar.xml index 1a61390..1c92f88 100644 --- a/linden/indra/newview/skins/xui/ko/panel_toolbar.xml +++ b/linden/indra/newview/skins/xui/ko/panel_toolbar.xml @@ -1,9 +1,7 @@ -