From 74a9280c698b4f88a46549923a2d717b82dd7ee2 Mon Sep 17 00:00:00 2001 From: Fawrsk <45524015+Fawrsk@users.noreply.github.com> Date: Tue, 3 Jan 2023 17:08:15 -0400 Subject: SL-18893 Clean up for loops in llappearance to use C++11 range based for loops (#38) --- indra/llappearance/lltexlayer.cpp | 139 ++++++++++++++------------------------ 1 file changed, 49 insertions(+), 90 deletions(-) (limited to 'indra/llappearance/lltexlayer.cpp') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 3430a25536..68a021eb9a 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -241,11 +241,8 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance) { //layer_info_list_t mLayerInfoList; - for (layer_info_list_t::iterator layer_iter = mLayerInfoList.begin(); - layer_iter != mLayerInfoList.end(); - layer_iter++) + for (auto layer_info : mLayerInfoList) { - LLTexLayerInfo *layer_info = *layer_iter; layer_info->createVisualParams(appearance); } } @@ -287,12 +284,10 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) //mID = info->mID; // No ID mLayerList.reserve(info->mLayerInfoList.size()); - for (LLTexLayerSetInfo::layer_info_list_t::const_iterator iter = info->mLayerInfoList.begin(); - iter != info->mLayerInfoList.end(); - iter++) + for (auto layer_info : info->mLayerInfoList) { LLTexLayerInterface *layer = NULL; - if ( (*iter)->isUserSettable() ) + if (layer_info->isUserSettable()) { layer = new LLTexLayerTemplate( this, getAvatarAppearance() ); } @@ -301,7 +296,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) layer = new LLTexLayer(this); } // this is the first time this layer (of either type) is being created - make sure you add the parameters to the avatar appearance - if (!layer->setInfo(*iter, NULL)) + if (!layer->setInfo(layer_info, NULL)) { mInfo = NULL; return FALSE; @@ -348,14 +343,12 @@ BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node) void LLTexLayerSet::deleteCaches() { - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; layer->deleteCaches(); } - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; layer->deleteCaches(); } } @@ -368,9 +361,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mMaskLayerList.size() > 0) { - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->isInvisibleAlphaMask()) { mIsVisible = FALSE; @@ -399,9 +391,8 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mIsVisible) { // composite color layers - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getRenderPass() == LLTexLayer::RP_COLOR) { gGL.flush(); @@ -473,9 +464,8 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S LL_PROFILE_ZONE_SCOPED; memset(data, 255, width * height); - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; layer->gatherAlphaMasks(data, origin_x, origin_y, width, height, bound_target); } @@ -526,9 +516,8 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, if (mMaskLayerList.size() > 0) { gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; gGL.flush(); layer->blendAlphaTexture(x,y,width, height); gGL.flush(); @@ -549,9 +538,8 @@ void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_ BOOL LLTexLayerSet::isMorphValid() const { - for(layer_list_t::const_iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(const auto layer : mLayerList) { - const LLTexLayerInterface* layer = *iter; if (layer && !layer->isMorphValid()) { return FALSE; @@ -562,9 +550,8 @@ BOOL LLTexLayerSet::isMorphValid() const void LLTexLayerSet::invalidateMorphMasks() { - for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer) { layer->invalidateMorphMasks(); @@ -661,14 +648,12 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) /* if ("upper_shirt" == local_texture_name) mLocalTexture = TEX_UPPER_SHIRT; */ mLocalTexture = TEX_NUM_INDICES; - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearance::getDictionary()->getTextures().begin(); - iter != LLAvatarAppearance::getDictionary()->getTextures().end(); - iter++) + for (const auto& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) { - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = dict_pair.second; if (local_texture_name == texture_dict->mName) { - mLocalTexture = iter->first; + mLocalTexture = dict_pair.first; break; } } @@ -735,11 +720,8 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) { BOOL success = TRUE; - for (param_color_info_list_t::iterator color_info_iter = mParamColorInfoList.begin(); - color_info_iter != mParamColorInfoList.end(); - color_info_iter++) + for (auto color_info : mParamColorInfoList) { - LLTexLayerParamColorInfo * color_info = *color_info_iter; LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); if (!param_color->setInfo(color_info, TRUE)) { @@ -749,11 +731,8 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) } } - for (param_alpha_info_list_t::iterator alpha_info_iter = mParamAlphaInfoList.begin(); - alpha_info_iter != mParamAlphaInfoList.end(); - alpha_info_iter++) + for (auto alpha_info : mParamAlphaInfoList) { - LLTexLayerParamAlphaInfo * alpha_info = *alpha_info_iter; LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); if (!param_alpha->setInfo(alpha_info, TRUE)) { @@ -796,15 +775,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab //mID = info->mID; // No ID mParamColorList.reserve(mInfo->mParamColorInfoList.size()); - for (param_color_info_list_t::const_iterator iter = mInfo->mParamColorInfoList.begin(); - iter != mInfo->mParamColorInfoList.end(); - iter++) + for (auto color_info : mInfo->mParamColorInfoList) { LLTexLayerParamColor* param_color; if (!wearable) { param_color = new LLTexLayerParamColor(this); - if (!param_color->setInfo(*iter, TRUE)) + if (!param_color->setInfo(color_info, TRUE)) { mInfo = NULL; return FALSE; @@ -812,7 +789,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } else { - param_color = (LLTexLayerParamColor*)wearable->getVisualParam((*iter)->getID()); + param_color = (LLTexLayerParamColor*)wearable->getVisualParam(color_info->getID()); if (!param_color) { mInfo = NULL; @@ -823,15 +800,13 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); - for (param_alpha_info_list_t::const_iterator iter = mInfo->mParamAlphaInfoList.begin(); - iter != mInfo->mParamAlphaInfoList.end(); - iter++) + for (auto alpha_info : mInfo->mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha; if (!wearable) { param_alpha = new LLTexLayerParamAlpha( this ); - if (!param_alpha->setInfo(*iter, TRUE)) + if (!param_alpha->setInfo(alpha_info, TRUE)) { mInfo = NULL; return FALSE; @@ -839,7 +814,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } else { - param_alpha = (LLTexLayerParamAlpha*) wearable->getVisualParam((*iter)->getID()); + param_alpha = (LLTexLayerParamAlpha*) wearable->getVisualParam(alpha_info->getID()); if (!param_alpha) { mInfo = NULL; @@ -873,12 +848,9 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const if (TEX_INVALID == te) { LLWearableType::EType type = LLWearableType::WT_INVALID; - param_color_list_t::const_iterator color_iter = mParamColorList.begin(); - param_alpha_list_t::const_iterator alpha_iter = mParamAlphaList.begin(); - for (; color_iter != mParamColorList.end(); color_iter++) + for (auto param : mParamColorList) { - LLTexLayerParamColor* param = *color_iter; if (param) { LLWearableType::EType new_type = (LLWearableType::EType)param->getWearableType(); @@ -893,9 +865,8 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const } } - for (; alpha_iter != mParamAlphaList.end(); alpha_iter++) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *alpha_iter; if (param) { LLWearableType::EType new_type = (LLWearableType::EType)param->getWearableType(); @@ -938,18 +909,18 @@ void LLTexLayerInterface::invalidateMorphMasks() LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const { LLViewerVisualParam *result = NULL; - for (param_color_list_t::const_iterator color_iter = mParamColorList.begin(); color_iter != mParamColorList.end() && !result; ++color_iter) + for (auto param : mParamColorList) { - if ((*color_iter)->getID() == index) + if (param->getID() == index) { - result = *color_iter; + result = param; } } - for (param_alpha_list_t::const_iterator alpha_iter = mParamAlphaList.begin(); alpha_iter != mParamAlphaList.end() && !result; ++alpha_iter) + for (auto param : mParamAlphaList) { - if ((*alpha_iter)->getID() == index) + if (param->getID() == index) { - result = *alpha_iter; + result = param; } } @@ -994,10 +965,9 @@ LLTexLayer::~LLTexLayer() //std::for_each(mParamAlphaList.begin(), mParamAlphaList.end(), DeletePointer()); //std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer()); - for( alpha_cache_t::iterator iter = mAlphaCache.begin(); - iter != mAlphaCache.end(); iter++ ) + for(auto& alpha_pair : mAlphaCache) { - U8* alpha_data = iter->second; + U8* alpha_data = alpha_pair.second; ll_aligned_free_32(alpha_data); } @@ -1021,10 +991,8 @@ BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) //static void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color) { - for (param_color_list_t::const_iterator iter = param_list.begin(); - iter != param_list.end(); iter++) + for (const auto param : param_list) { - const LLTexLayerParamColor* param = *iter; LLColor4 param_net = param->getNetColor(); const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)param->getInfo(); switch(info->getOperation()) @@ -1049,10 +1017,8 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL /*virtual*/ void LLTexLayer::deleteCaches() { // Only need to delete caches for alpha params. Color params don't hold extra memory - for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); - iter != mParamAlphaList.end(); iter++ ) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *iter; param->deleteCaches(); } } @@ -1226,9 +1192,8 @@ const U8* LLTexLayer::getAlphaData() const const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (const auto param : mParamAlphaList) { - const LLTexLayerParamAlpha* param = *iter; // MULTI-WEARABLE: verify visual parameters used here F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); @@ -1365,9 +1330,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Accumulate alphas LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); - for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (auto param : mParamAlphaList) { - LLTexLayerParamAlpha* param = *iter; success &= param->render( x, y, width, height ); if (!success && !force_render) { @@ -1441,9 +1405,8 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (param_alpha_list_t::const_iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) + for (const auto param : mParamAlphaList) { - const LLTexLayerParamAlpha* param = *iter; F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); } @@ -1683,12 +1646,10 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const BOOL success = TRUE; updateWearableCache(); - for (wearable_cache_t::const_iterator iter = mWearableCache.begin(); iter!= mWearableCache.end(); iter++) + for (auto wearable : mWearableCache) { - LLWearable* wearable = NULL; LLLocalTextureObject *lto = NULL; LLTexLayer *layer = NULL; - wearable = *iter; if (wearable) { lto = wearable->getLocalTextureObject(mInfo->mLocalTexture); @@ -1785,17 +1746,15 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const //----------------------------------------------------------------------------- LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) { - for (layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for (auto layer : mLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getName() == name) { return layer; } } - for (layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ ) + for (auto layer : mMaskLayerList) { - LLTexLayerInterface* layer = *iter; if (layer->getName() == name) { return layer; @@ -1807,20 +1766,20 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable) { // initialize all texlayers with this texture type for this LTO - for( LLTexLayerSet::layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) + for(auto layer : mLayerList) { - LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter; - if (layer->getInfo()->getLocalTexture() == (S32) tex_index) + LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; + if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) { - lto->addTexLayer(layer, wearable); + lto->addTexLayer(layer_template, wearable); } } - for( LLTexLayerSet::layer_list_t::iterator iter = mMaskLayerList.begin(); iter != mMaskLayerList.end(); iter++ ) + for(auto layer : mMaskLayerList) { - LLTexLayerTemplate* layer = (LLTexLayerTemplate*)*iter; - if (layer->getInfo()->getLocalTexture() == (S32) tex_index) + LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; + if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) { - lto->addTexLayer(layer, wearable); + lto->addTexLayer(layer_template, wearable); } } } -- cgit v1.3 From 7419037ef6e8a5497283278baa8582b264d3aefa Mon Sep 17 00:00:00 2001 From: Fawrsk Date: Tue, 10 Jan 2023 05:43:27 -0400 Subject: SL-18893 Fixes for pull requests #38, #41, and #42 (#46) Eliminate unnecessary copies, and remove uses of auto --- indra/llappearance/llavatarappearance.cpp | 46 +++++++++--------- indra/llappearance/llavatarappearance.h | 2 +- indra/llappearance/llavatarappearancedefines.cpp | 4 +- indra/llappearance/llavatarjoint.cpp | 16 +++---- indra/llappearance/llavatarjointmesh.cpp | 2 +- indra/llappearance/lldriverparam.cpp | 24 +++++----- indra/llappearance/lllocaltextureobject.cpp | 2 +- indra/llappearance/llpolymesh.cpp | 4 +- indra/llappearance/llpolymorph.cpp | 6 +-- indra/llappearance/llpolyskeletaldistortion.cpp | 8 ++-- indra/llappearance/lltexglobalcolor.cpp | 2 +- indra/llappearance/lltexlayer.cpp | 60 ++++++++++++------------ indra/llappearance/lltexlayerparams.cpp | 2 +- indra/llappearance/llwearable.cpp | 18 +++---- indra/llaudio/llaudioengine.cpp | 18 +++---- indra/llcharacter/llanimationstates.cpp | 2 +- indra/llcharacter/llbvhloader.cpp | 2 +- indra/llcharacter/llcharacter.h | 4 +- indra/llcharacter/llgesture.cpp | 2 +- indra/llcharacter/lljoint.cpp | 10 ++-- indra/llcharacter/llkeyframemotion.cpp | 6 +-- indra/llcharacter/llkeyframemotionparam.cpp | 14 +++--- indra/llcharacter/llmotioncontroller.cpp | 6 +-- indra/llcharacter/llpose.cpp | 2 +- indra/llcharacter/llstatemachine.cpp | 18 +++---- 25 files changed, 140 insertions(+), 140 deletions(-) (limited to 'indra/llappearance/lltexlayer.cpp') diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 1f5e6aa98c..89a7c4589b 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -214,7 +214,7 @@ void LLAvatarAppearance::initInstance() mRoot = createAvatarJoint(); mRoot->setName( "mRoot" ); - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -258,7 +258,7 @@ void LLAvatarAppearance::initInstance() //------------------------------------------------------------------------- // associate baked textures with meshes //------------------------------------------------------------------------- - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -266,7 +266,7 @@ void LLAvatarAppearance::initInstance() // Skip it if there's no associated baked texture. if (baked_texture_index == BAKED_NUM_INDICES) continue; - for (auto mesh : mMeshLOD[mesh_index]->mMeshParts) + for (LLAvatarJointMesh* mesh : mMeshLOD[mesh_index]->mMeshParts) { mBakedTextureDatas[(S32)baked_texture_index].mJointMeshes.push_back(mesh); } @@ -290,7 +290,7 @@ LLAvatarAppearance::~LLAvatarAppearance() delete_and_clear(mBakedTextureDatas[i].mTexLayerSet); mBakedTextureDatas[i].mJointMeshes.clear(); - for (auto masked_morph : mBakedTextureDatas[i].mMaskedMorphs) + for (LLMaskedMorph* masked_morph : mBakedTextureDatas[i].mMaskedMorphs) { delete masked_morph; } @@ -305,7 +305,7 @@ LLAvatarAppearance::~LLAvatarAppearance() std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer()); mPolyMeshes.clear(); - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { std::for_each(joint->mMeshParts.begin(), joint->mMeshParts.end(), DeletePointer()); joint->mMeshParts.clear(); @@ -460,7 +460,7 @@ void LLAvatarAppearance::compareJointStateMaps(joint_state_map_t& last_state, if (!last_state.empty() && (last_state != curr_state)) { S32 diff_count = 0; - for (auto& pair : last_state) + for (joint_state_map_t::value_type& pair : last_state) { const std::string& key = pair.first; if (last_state[key] != curr_state[key]) @@ -672,7 +672,7 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent // setup children - for (auto child_info : info->mChildren) + for (LLAvatarBoneInfo* child_info : info->mChildren) { if (!setupBone(child_info, joint, volume_num, joint_num)) { @@ -725,7 +725,7 @@ BOOL LLAvatarAppearance::buildSkeleton(const LLAvatarSkeletonInfo *info) S32 current_joint_num = 0; S32 current_volume_num = 0; - for (auto bone_info : info->mBoneInfoList) + for (LLAvatarBoneInfo* bone_info : info->mBoneInfoList) { if (!setupBone(bone_info, NULL, current_volume_num, current_joint_num)) { @@ -804,9 +804,9 @@ void LLAvatarAppearance::buildCharacter() //------------------------------------------------------------------------- // clear mesh data //------------------------------------------------------------------------- - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { - for (auto mesh : joint->mMeshParts) + for (LLAvatarJointMesh* mesh : joint->mMeshParts) { mesh->setMesh(NULL); } @@ -981,7 +981,7 @@ BOOL LLAvatarAppearance::loadAvatar() } // avatar_lad.xml : - for (auto info : sAvatarXmlInfo->mMorphMaskInfoList) + for (LLAvatarXmlInfo::LLAvatarMorphInfo* info : sAvatarXmlInfo->mMorphMaskInfoList) { EBakedTextureIndex baked = sAvatarDictionary->findBakedByRegionName(info->mRegion); if (baked != BAKED_NUM_INDICES) @@ -1001,7 +1001,7 @@ BOOL LLAvatarAppearance::loadAvatar() loadLayersets(); // avatar_lad.xml : - for (auto info : sAvatarXmlInfo->mDriverInfoList) + for (LLDriverParamInfo* info : sAvatarXmlInfo->mDriverInfoList) { LLDriverParam* driver_param = new LLDriverParam( this ); if (driver_param->setInfo(info)) @@ -1034,7 +1034,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () mRoot->addChild( mSkeleton[0] ); // make meshes children before calling parent version of the function - for (auto joint : mMeshLOD) + for (LLAvatarJoint* joint : mMeshLOD) { joint->mUpdateXform = FALSE; joint->setMeshesToChildren(); @@ -1068,7 +1068,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () // SKELETAL DISTORTIONS { LLAvatarXmlInfo::skeletal_distortion_info_list_t::iterator iter; - for (auto visual_param_info : sAvatarXmlInfo->mSkeletalDistortionInfoList) + for (LLViewerVisualParamInfo* visual_param_info : sAvatarXmlInfo->mSkeletalDistortionInfoList) { LLPolySkeletalDistortionInfo *info = (LLPolySkeletalDistortionInfo*)visual_param_info; LLPolySkeletalDistortion *param = new LLPolySkeletalDistortion(this); @@ -1094,7 +1094,7 @@ BOOL LLAvatarAppearance::loadSkeletonNode () //----------------------------------------------------------------------------- BOOL LLAvatarAppearance::loadMeshNodes() { - for (const auto info : sAvatarXmlInfo->mMeshInfoList) + for (const LLAvatarXmlInfo::LLAvatarMeshInfo* info : sAvatarXmlInfo->mMeshInfoList) { const std::string &type = info->mType; S32 lod = info->mLOD; @@ -1107,7 +1107,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() switch(lod) case 0: mesh = &mHairMesh0; */ - for (const auto& mesh_pair : sAvatarDictionary->getMeshEntries()) + for (const LLAvatarAppearanceDictionary::MeshEntries::value_type& mesh_pair : sAvatarDictionary->getMeshEntries()) { const EMeshIndex mesh_index = mesh_pair.first; const LLAvatarAppearanceDictionary::MeshEntry *mesh_dict = mesh_pair.second; @@ -1178,7 +1178,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() mesh->setMesh( poly_mesh ); mesh->setLOD( info->mMinPixelArea ); - for (const auto& info_pair : info->mPolyMorphTargetInfoList) + for (const LLAvatarXmlInfo::LLAvatarMeshInfo::morph_info_pair_t& info_pair : info->mPolyMorphTargetInfoList) { LLPolyMorphTarget *param = new LLPolyMorphTarget(mesh->getMesh()); if (!param->setInfo((LLPolyMorphTargetInfo*)info_pair.first)) @@ -1211,7 +1211,7 @@ BOOL LLAvatarAppearance::loadMeshNodes() BOOL LLAvatarAppearance::loadLayersets() { BOOL success = TRUE; - for (auto layerset_info : sAvatarXmlInfo->mLayerInfoList) + for (LLTexLayerSetInfo* layerset_info : sAvatarXmlInfo->mLayerInfoList) { if (isSelf()) { @@ -1228,7 +1228,7 @@ BOOL LLAvatarAppearance::loadLayersets() // scan baked textures and associate the layerset with the appropriate one EBakedTextureIndex baked_index = BAKED_NUM_INDICES; - for (const auto& baked_pair : sAvatarDictionary->getBakedTextures()) + for (const LLAvatarAppearanceDictionary::BakedTextures::value_type& baked_pair : sAvatarDictionary->getBakedTextures()) { const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_pair.second; if (layer_set->isBodyRegion(baked_dict->mName)) @@ -1249,7 +1249,7 @@ BOOL LLAvatarAppearance::loadLayersets() } // scan morph masks and let any affected layers know they have an associated morph - for (auto morph : mBakedTextureDatas[baked_index].mMaskedMorphs) + for (LLMaskedMorph* morph : mBakedTextureDatas[baked_index].mMaskedMorphs) { LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer); if (layer) @@ -1692,7 +1692,7 @@ void LLAvatarAppearance::makeJointAliases(LLAvatarBoneInfo *bone_info) boost::char_separator sep(" "); boost::tokenizer > tok(aliases, sep); - for(auto& i : tok) + for(const std::string& i : tok) { if ( mJointAliasMap.find(i) != mJointAliasMap.end() ) { @@ -1713,13 +1713,13 @@ const LLAvatarAppearance::joint_alias_map_t& LLAvatarAppearance::getJointAliases if (mJointAliasMap.empty()) { - for (auto bone_info : sAvatarSkeletonInfo->mBoneInfoList) + for (LLAvatarBoneInfo* bone_info : sAvatarSkeletonInfo->mBoneInfoList) { //LLAvatarBoneInfo *bone_info = *iter; makeJointAliases(bone_info); } - for (auto info : sAvatarXmlInfo->mAttachmentInfoList) + for (LLAvatarXmlInfo::LLAvatarAttachmentInfo* info : sAvatarXmlInfo->mAttachmentInfoList) { std::string bone_name = info->mName; diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h index cb1cbc11a6..e3444efcf6 100644 --- a/indra/llappearance/llavatarappearance.h +++ b/indra/llappearance/llavatarappearance.h @@ -387,7 +387,7 @@ protected: LLAvatarMeshInfo() : mLOD(0), mMinPixelArea(.1f) {} ~LLAvatarMeshInfo() { - for (auto& pair : mPolyMorphTargetInfoList) + for (morph_info_list_t::value_type& pair : mPolyMorphTargetInfoList) { delete pair.first; } diff --git a/indra/llappearance/llavatarappearancedefines.cpp b/indra/llappearance/llavatarappearancedefines.cpp index 5ab3f92b31..8759c387e8 100644 --- a/indra/llappearance/llavatarappearancedefines.cpp +++ b/indra/llappearance/llavatarappearancedefines.cpp @@ -183,14 +183,14 @@ LLAvatarAppearanceDictionary::~LLAvatarAppearanceDictionary() // map it to the baked texture. void LLAvatarAppearanceDictionary::createAssociations() { - for (const auto& baked_pair : mBakedTextures) + for (BakedTextures::value_type& baked_pair : mBakedTextures) { const EBakedTextureIndex baked_index = baked_pair.first; const BakedEntry *dict = baked_pair.second; // For each texture that this baked texture index affects, associate those textures // with this baked texture index. - for (const auto local_texture_index : dict->mLocalTextures) + for (const ETextureIndex local_texture_index : dict->mLocalTextures) { mTextures[local_texture_index]->mIsUsedByBakedTexture = true; mTextures[local_texture_index]->mBakedTextureIndex = baked_index; diff --git a/indra/llappearance/llavatarjoint.cpp b/indra/llappearance/llavatarjoint.cpp index 82050605e1..9300b08b7b 100644 --- a/indra/llappearance/llavatarjoint.cpp +++ b/indra/llappearance/llavatarjoint.cpp @@ -100,7 +100,7 @@ void LLAvatarJoint::setValid( BOOL valid, BOOL recursive ) //---------------------------------------------------------------- if (recursive) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->setValid(valid, TRUE); @@ -131,7 +131,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) if (recursive) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->setVisible(visible, recursive); @@ -141,7 +141,7 @@ void LLAvatarJoint::setVisible(BOOL visible, BOOL recursive) void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pixel_area) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->updateFaceSizes(num_vertices, num_indices, pixel_area); @@ -150,7 +150,7 @@ void LLAvatarJoint::updateFaceSizes(U32 &num_vertices, U32& num_indices, F32 pix void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, bool terse_update) { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->updateFaceData(face, pixel_area, damp_wind, terse_update); @@ -159,7 +159,7 @@ void LLAvatarJoint::updateFaceData(LLFace *face, F32 pixel_area, BOOL damp_wind, void LLAvatarJoint::updateJointGeometry() { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->updateJointGeometry(); @@ -172,7 +172,7 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate) BOOL lod_changed = FALSE; BOOL found_lod = FALSE; - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); F32 jointLOD = joint->getLOD(); @@ -200,7 +200,7 @@ BOOL LLAvatarJoint::updateLOD(F32 pixel_area, BOOL activate) void LLAvatarJoint::dump() { - for (auto child : mChildren) + for (LLJoint* child : mChildren) { LLAvatarJoint* joint = static_cast(child); joint->dump(); @@ -211,7 +211,7 @@ void LLAvatarJoint::dump() void LLAvatarJoint::setMeshesToChildren() { removeAllChildren(); - for (auto mesh : mMeshParts) + for (LLAvatarJointMesh* mesh : mMeshParts) { addChild(mesh); } diff --git a/indra/llappearance/llavatarjointmesh.cpp b/indra/llappearance/llavatarjointmesh.cpp index aa1a216678..ed39f78d28 100644 --- a/indra/llappearance/llavatarjointmesh.cpp +++ b/indra/llappearance/llavatarjointmesh.cpp @@ -379,7 +379,7 @@ void LLAvatarJointMesh::setupJoint(LLAvatarJoint* current_joint) } // depth-first traversal - for (auto joint : current_joint->mChildren) + for (LLJoint* joint : current_joint->mChildren) { LLAvatarJoint* child_joint = (LLAvatarJoint*)joint; setupJoint(child_joint); diff --git a/indra/llappearance/lldriverparam.cpp b/indra/llappearance/lldriverparam.cpp index 7845647281..f46d0324a5 100644 --- a/indra/llappearance/lldriverparam.cpp +++ b/indra/llappearance/lldriverparam.cpp @@ -102,7 +102,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) LLViewerVisualParamInfo::toStream(out); out << "driver" << "\t"; out << mDrivenInfoList.size() << "\t"; - for (auto& driven : mDrivenInfoList) + for (LLDrivenEntryInfo& driven : mDrivenInfoList) { out << driven.mDrivenID << "\t"; } @@ -120,7 +120,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) if(mDriverParam && mDriverParam->getAvatarAppearance()->isSelf() && mDriverParam->getAvatarAppearance()->isValid()) { - for (auto& driven : mDrivenInfoList) + for (LLDrivenEntryInfo& driven : mDrivenInfoList) { LLViewerVisualParam *param = (LLViewerVisualParam*)mDriverParam->getAvatarAppearance()->getVisualParam(driven.mDrivenID); @@ -230,7 +230,7 @@ void LLDriverParam::setWeight(F32 weight) //-------|----|-------|----|-------> driver // | min1 max1 max2 min2 - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { LLDrivenEntry* drivenp = &driven; LLDrivenEntryInfo* info = drivenp->mInfo; @@ -303,7 +303,7 @@ void LLDriverParam::setWeight(F32 weight) F32 LLDriverParam::getTotalDistortion() { F32 sum = 0.f; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum += driven.mParam->getTotalDistortion(); } @@ -317,7 +317,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion() LLVector4a sum; sum.clear(); S32 count = 0; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum.add(driven.mParam->getAvgDistortion()); count++; @@ -331,7 +331,7 @@ const LLVector4a &LLDriverParam::getAvgDistortion() F32 LLDriverParam::getMaxDistortion() { F32 max = 0.f; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { F32 param_max = driven.mParam->getMaxDistortion(); if( param_max > max ) @@ -348,7 +348,7 @@ LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) { LLVector4a sum; sum.clear(); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { sum.add(driven.mParam->getVertexDistortion(index, poly_mesh)); } @@ -359,7 +359,7 @@ const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **pol { mCurrentDistortionParam = NULL; const LLVector4a* v = NULL; - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { v = driven.mParam->getFirstDistortion(index, poly_mesh); if( v ) @@ -441,7 +441,7 @@ void LLDriverParam::setAnimationTarget( F32 target_value) { LLVisualParam::setAnimationTarget(target_value); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { LLDrivenEntry* drivenp = &driven; F32 driven_weight = getDrivenWeight(drivenp, mTargetWeight); @@ -459,7 +459,7 @@ void LLDriverParam::stopAnimating() { LLVisualParam::stopAnimating(); - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { driven.mParam->setAnimating(FALSE); } @@ -469,7 +469,7 @@ void LLDriverParam::stopAnimating() BOOL LLDriverParam::linkDrivenParams(visual_param_mapper mapper, BOOL only_cross_params) { BOOL success = TRUE; - for (auto& driven_info : getInfo()->mDrivenInfoList) + for (LLDrivenEntryInfo& driven_info : getInfo()->mDrivenInfoList) { S32 driven_id = driven_info.mDrivenID; @@ -513,7 +513,7 @@ void LLDriverParam::updateCrossDrivenParams(LLWearableType::EType driven_type) bool needs_update = (getWearableType()==driven_type); // if the driver has a driven entry for the passed-in wearable type, we need to refresh the value - for(auto& driven : mDriven) + for(LLDrivenEntry& driven : mDriven) { if (driven.mParam && driven.mParam->getCrossWearable() && driven.mParam->getWearableType() == driven_type) { diff --git a/indra/llappearance/lllocaltextureobject.cpp b/indra/llappearance/lllocaltextureobject.cpp index b66b51f4e4..ac8a1abb2d 100644 --- a/indra/llappearance/lllocaltextureobject.cpp +++ b/indra/llappearance/lllocaltextureobject.cpp @@ -95,7 +95,7 @@ LLTexLayer* LLLocalTextureObject::getTexLayer(U32 index) const LLTexLayer* LLLocalTextureObject::getTexLayer(const std::string &name) { - for(auto layer : mTexLayers) + for(LLTexLayer* layer : mTexLayers) { if (layer->getName().compare(name) == 0) { diff --git a/indra/llappearance/llpolymesh.cpp b/indra/llappearance/llpolymesh.cpp index d0f0199d61..dab14851c8 100644 --- a/indra/llappearance/llpolymesh.cpp +++ b/indra/llappearance/llpolymesh.cpp @@ -890,7 +890,7 @@ void LLPolyMesh::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; // print each loaded mesh, and it's memory usage - for(const auto& mesh_pair : sGlobalSharedMeshList) + for(const LLPolyMeshSharedDataTable::value_type& mesh_pair : sGlobalSharedMeshList) { const std::string& mesh_name = mesh_pair.first; LLPolyMeshSharedData* mesh = mesh_pair.second; @@ -996,7 +996,7 @@ LLPolyMorphData* LLPolyMesh::getMorphData(const std::string& morph_name) { if (!mSharedData) return NULL; - for (auto morph_data : mSharedData->mMorphData) + for (LLPolyMorphData* morph_data : mSharedData->mMorphData) { if (morph_data->getName() == morph_name) { diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp index 1f83f748a1..ca3ecda8c3 100644 --- a/indra/llappearance/llpolymorph.cpp +++ b/indra/llappearance/llpolymorph.cpp @@ -364,7 +364,7 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) LLAvatarAppearance* avatarp = mMesh->getAvatar(); LLPolyMorphTargetInfo::volume_info_list_t::iterator iter; - for (auto& volume_info : getInfo()->mVolumeInfoList) + for (LLPolyVolumeMorphInfo& volume_info : getInfo()->mVolumeInfoList) { for (S32 i = 0; i < avatarp->mNumCollisionVolumes; i++) { @@ -640,7 +640,7 @@ void LLPolyMorphTarget::apply( ESex avatar_sex ) } // now apply volume changes - for(auto& volume_morph : mVolumeMorphs) + for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs) { LLVector3 scale_delta = volume_morph.mScale * delta_weight; LLVector3 pos_delta = volume_morph.mPos * delta_weight; @@ -733,7 +733,7 @@ void LLPolyMorphTarget::applyMask(U8 *maskTextureData, S32 width, S32 height, S3 void LLPolyMorphTarget::applyVolumeChanges(F32 delta_weight) { // now apply volume changes - for(auto& volume_morph : mVolumeMorphs) + for(LLPolyVolumeMorph& volume_morph : mVolumeMorphs) { LLVector3 scale_delta = volume_morph.mScale * delta_weight; LLVector3 pos_delta = volume_morph.mPos * delta_weight; diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp index e1460b68de..8712cdd286 100644 --- a/indra/llappearance/llpolyskeletaldistortion.cpp +++ b/indra/llappearance/llpolyskeletaldistortion.cpp @@ -144,7 +144,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) setWeight(getDefaultWeight()); LLPolySkeletalDistortionInfo::bone_info_list_t::iterator iter; - for (auto& bone_info : getInfo()->mBoneInfoList) + for (LLPolySkeletalBoneInfo& bone_info : getInfo()->mBoneInfoList) { LLJoint* joint = mAvatar->getJoint(bone_info.mBoneName); if (!joint) @@ -159,7 +159,7 @@ BOOL LLPolySkeletalDistortion::setInfo(LLPolySkeletalDistortionInfo *info) mJointScales[joint] = bone_info.mScaleDeformation; // apply to children that need to inherit it - for (auto joint : joint->mChildren) + for (LLJoint* joint : joint->mChildren) { LLAvatarJoint* child_joint = (LLAvatarJoint*)joint; if (child_joint->inheritScale()) @@ -194,7 +194,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) LLJoint* joint; - for (auto& scale_pair : mJointScales) + for (joint_vec_map_t::value_type& scale_pair : mJointScales) { joint = scale_pair.first; LLVector3 newScale = joint->getScale(); @@ -213,7 +213,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex ) joint->setScale(newScale, true); } - for (auto& offset_pair : mJointOffsets) + for (joint_vec_map_t::value_type& offset_pair : mJointOffsets) { joint = offset_pair.first; LLVector3 newPosition = joint->getPosition(); diff --git a/indra/llappearance/lltexglobalcolor.cpp b/indra/llappearance/lltexglobalcolor.cpp index 611b87a7cf..75815482c9 100644 --- a/indra/llappearance/lltexglobalcolor.cpp +++ b/indra/llappearance/lltexglobalcolor.cpp @@ -55,7 +55,7 @@ BOOL LLTexGlobalColor::setInfo(LLTexGlobalColorInfo *info) //mID = info->mID; // No ID mParamGlobalColorList.reserve(mInfo->mParamColorInfoList.size()); - for (auto color_info : mInfo->mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList) { LLTexParamGlobalColor* param_color = new LLTexParamGlobalColor(this); if (!param_color->setInfo(color_info, TRUE)) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 68a021eb9a..6f23b2e04c 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -241,7 +241,7 @@ BOOL LLTexLayerSetInfo::parseXml(LLXmlTreeNode* node) void LLTexLayerSetInfo::createVisualParams(LLAvatarAppearance *appearance) { //layer_info_list_t mLayerInfoList; - for (auto layer_info : mLayerInfoList) + for (LLTexLayerInfo* layer_info : mLayerInfoList) { layer_info->createVisualParams(appearance); } @@ -284,7 +284,7 @@ BOOL LLTexLayerSet::setInfo(const LLTexLayerSetInfo *info) //mID = info->mID; // No ID mLayerList.reserve(info->mLayerInfoList.size()); - for (auto layer_info : info->mLayerInfoList) + for (LLTexLayerInfo* layer_info : info->mLayerInfoList) { LLTexLayerInterface *layer = NULL; if (layer_info->isUserSettable()) @@ -343,11 +343,11 @@ BOOL LLTexLayerSet::parseData(LLXmlTreeNode* node) void LLTexLayerSet::deleteCaches() { - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { layer->deleteCaches(); } - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { layer->deleteCaches(); } @@ -361,7 +361,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mMaskLayerList.size() > 0) { - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { if (layer->isInvisibleAlphaMask()) { @@ -391,7 +391,7 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* if (mIsVisible) { // composite color layers - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { if (layer->getRenderPass() == LLTexLayer::RP_COLOR) { @@ -464,7 +464,7 @@ void LLTexLayerSet::gatherMorphMaskAlpha(U8 *data, S32 origin_x, S32 origin_y, S LL_PROFILE_ZONE_SCOPED; memset(data, 255, width * height); - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { layer->gatherAlphaMasks(data, origin_x, origin_y, width, height, bound_target); } @@ -516,7 +516,7 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, if (mMaskLayerList.size() > 0) { gGL.setSceneBlendType(LLRender::BT_MULT_ALPHA); - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { gGL.flush(); layer->blendAlphaTexture(x,y,width, height); @@ -538,7 +538,7 @@ void LLTexLayerSet::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_ BOOL LLTexLayerSet::isMorphValid() const { - for(const auto layer : mLayerList) + for(const LLTexLayerInterface* layer : mLayerList) { if (layer && !layer->isMorphValid()) { @@ -550,7 +550,7 @@ BOOL LLTexLayerSet::isMorphValid() const void LLTexLayerSet::invalidateMorphMasks() { - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { if (layer) { @@ -648,7 +648,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) /* if ("upper_shirt" == local_texture_name) mLocalTexture = TEX_UPPER_SHIRT; */ mLocalTexture = TEX_NUM_INDICES; - for (const auto& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) + for (const LLAvatarAppearanceDictionary::Textures::value_type& dict_pair : LLAvatarAppearance::getDictionary()->getTextures()) { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = dict_pair.second; if (local_texture_name == texture_dict->mName) @@ -720,7 +720,7 @@ BOOL LLTexLayerInfo::parseXml(LLXmlTreeNode* node) BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) { BOOL success = TRUE; - for (auto color_info : mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mParamColorInfoList) { LLTexLayerParamColor* param_color = new LLTexLayerParamColor(appearance); if (!param_color->setInfo(color_info, TRUE)) @@ -731,7 +731,7 @@ BOOL LLTexLayerInfo::createVisualParams(LLAvatarAppearance *appearance) } } - for (auto alpha_info : mParamAlphaInfoList) + for (LLTexLayerParamAlphaInfo* alpha_info : mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha = new LLTexLayerParamAlpha(appearance); if (!param_alpha->setInfo(alpha_info, TRUE)) @@ -775,7 +775,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab //mID = info->mID; // No ID mParamColorList.reserve(mInfo->mParamColorInfoList.size()); - for (auto color_info : mInfo->mParamColorInfoList) + for (LLTexLayerParamColorInfo* color_info : mInfo->mParamColorInfoList) { LLTexLayerParamColor* param_color; if (!wearable) @@ -800,7 +800,7 @@ BOOL LLTexLayerInterface::setInfo(const LLTexLayerInfo *info, LLWearable* wearab } mParamAlphaList.reserve(mInfo->mParamAlphaInfoList.size()); - for (auto alpha_info : mInfo->mParamAlphaInfoList) + for (LLTexLayerParamAlphaInfo* alpha_info : mInfo->mParamAlphaInfoList) { LLTexLayerParamAlpha* param_alpha; if (!wearable) @@ -849,7 +849,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const { LLWearableType::EType type = LLWearableType::WT_INVALID; - for (auto param : mParamColorList) + for (LLTexLayerParamColor* param : mParamColorList) { if (param) { @@ -865,7 +865,7 @@ LLWearableType::EType LLTexLayerInterface::getWearableType() const } } - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { if (param) { @@ -909,14 +909,14 @@ void LLTexLayerInterface::invalidateMorphMasks() LLViewerVisualParam* LLTexLayerInterface::getVisualParamPtr(S32 index) const { LLViewerVisualParam *result = NULL; - for (auto param : mParamColorList) + for (LLTexLayerParamColor* param : mParamColorList) { if (param->getID() == index) { result = param; } } - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { if (param->getID() == index) { @@ -965,7 +965,7 @@ LLTexLayer::~LLTexLayer() //std::for_each(mParamAlphaList.begin(), mParamAlphaList.end(), DeletePointer()); //std::for_each(mParamColorList.begin(), mParamColorList.end(), DeletePointer()); - for(auto& alpha_pair : mAlphaCache) + for (alpha_cache_t::value_type& alpha_pair : mAlphaCache) { U8* alpha_data = alpha_pair.second; ll_aligned_free_32(alpha_data); @@ -991,7 +991,7 @@ BOOL LLTexLayer::setInfo(const LLTexLayerInfo* info, LLWearable* wearable ) //static void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LLColor4 &net_color) { - for (const auto param : param_list) + for (const LLTexLayerParamColor* param : param_list) { LLColor4 param_net = param->getNetColor(); const LLTexLayerParamColorInfo *info = (LLTexLayerParamColorInfo *)param->getInfo(); @@ -1017,7 +1017,7 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL /*virtual*/ void LLTexLayer::deleteCaches() { // Only need to delete caches for alpha params. Color params don't hold extra memory - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { param->deleteCaches(); } @@ -1192,7 +1192,7 @@ const U8* LLTexLayer::getAlphaData() const const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (const auto param : mParamAlphaList) + for (const LLTexLayerParamAlpha* param : mParamAlphaList) { // MULTI-WEARABLE: verify visual parameters used here F32 param_weight = param->getWeight(); @@ -1330,7 +1330,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Accumulate alphas LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); - for (auto param : mParamAlphaList) + for (LLTexLayerParamAlpha* param : mParamAlphaList) { success &= param->render( x, y, width, height ); if (!success && !force_render) @@ -1405,7 +1405,7 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC const LLUUID& uuid = getUUID(); alpha_mask_crc.update((U8*)(&uuid.mData), UUID_BYTES); - for (const auto param : mParamAlphaList) + for (const LLTexLayerParamAlpha* param : mParamAlphaList) { F32 param_weight = param->getWeight(); alpha_mask_crc.update((U8*)¶m_weight, sizeof(F32)); @@ -1646,7 +1646,7 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const BOOL success = TRUE; updateWearableCache(); - for (auto wearable : mWearableCache) + for (LLWearable* wearable : mWearableCache) { LLLocalTextureObject *lto = NULL; LLTexLayer *layer = NULL; @@ -1746,14 +1746,14 @@ LLTexLayer* LLTexLayerTemplate::getLayer(U32 i) const //----------------------------------------------------------------------------- LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) { - for (auto layer : mLayerList) + for (LLTexLayerInterface* layer : mLayerList) { if (layer->getName() == name) { return layer; } } - for (auto layer : mMaskLayerList) + for (LLTexLayerInterface* layer : mMaskLayerList) { if (layer->getName() == name) { @@ -1766,7 +1766,7 @@ LLTexLayerInterface* LLTexLayerSet::findLayerByName(const std::string& name) void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearanceDefines::ETextureIndex tex_index, LLWearable *wearable) { // initialize all texlayers with this texture type for this LTO - for(auto layer : mLayerList) + for(LLTexLayerInterface* layer : mLayerList) { LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) @@ -1774,7 +1774,7 @@ void LLTexLayerSet::cloneTemplates(LLLocalTextureObject *lto, LLAvatarAppearance lto->addTexLayer(layer_template, wearable); } } - for(auto layer : mMaskLayerList) + for(LLTexLayerInterface* layer : mMaskLayerList) { LLTexLayerTemplate* layer_template = (LLTexLayerTemplate*)layer; if (layer_template->getInfo()->getLocalTexture() == (S32)tex_index) diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 549b1802a7..a288c8955a 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -103,7 +103,7 @@ void LLTexLayerParamAlpha::getCacheByteCount(S32* gl_bytes) { *gl_bytes = 0; - for (auto instance : sInstances) + for (LLTexLayerParamAlpha* instance : sInstances) { LLGLTexture* tex = instance->mCachedProcessedTexture; if (tex) diff --git a/indra/llappearance/llwearable.cpp b/indra/llappearance/llwearable.cpp index 6889304410..10d668d0af 100644 --- a/indra/llappearance/llwearable.cpp +++ b/indra/llappearance/llwearable.cpp @@ -60,7 +60,7 @@ LLWearable::LLWearable() // virtual LLWearable::~LLWearable() { - for (auto& vp_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { LLVisualParam* vp = vp_pair.second; vp->clearNextParam(); @@ -122,7 +122,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // parameters output_stream << "parameters " << mVisualParamIndexMap.size() << "\n"; - for (auto& vp_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { S32 param_id = vp_pair.first; const LLVisualParam* param = vp_pair.second; @@ -133,7 +133,7 @@ BOOL LLWearable::exportStream( std::ostream& output_stream ) const // texture entries output_stream << "textures " << mTEMap.size() << "\n"; - for (auto& te_pair : mTEMap) + for (const te_map_t::value_type& te_pair : mTEMap) { S32 te = te_pair.first; const LLUUID& image_id = te_pair.second->getID(); @@ -158,7 +158,7 @@ void LLWearable::createVisualParams(LLAvatarAppearance *avatarp) } // resync driver parameters to point to the newly cloned driven parameters - for (auto& param_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& param_pair : mVisualParamIndexMap) { LLVisualParam* param = param_pair.second; LLVisualParam*(LLWearable::*wearable_function)(S32)const = &LLWearable::getVisualParam; @@ -519,7 +519,7 @@ std::vector LLWearable::getLocalTextureListSeq() { std::vector result; - for(auto& te_pair : mTEMap) + for(te_map_t::value_type& te_pair : mTEMap) { LLLocalTextureObject* lto = te_pair.second; result.push_back(lto); @@ -543,7 +543,7 @@ void LLWearable::revertValues() //update saved settings so wearable is no longer dirty // One loop should be necessary here - for (auto& vp_pair : mSavedVisualParamMap) + for (param_map_t::value_type& vp_pair : mSavedVisualParamMap) { S32 id = vp_pair.first; LLVisualParam *param = getVisualParam(id); @@ -562,7 +562,7 @@ void LLWearable::saveValues() { //update saved settings so wearable is no longer dirty mSavedVisualParamMap.clear(); - for (auto& vp_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { S32 id = vp_pair.first; LLVisualParam *wearable_param = vp_pair.second; @@ -680,7 +680,7 @@ LLVisualParam* LLWearable::getVisualParam(S32 index) const void LLWearable::getVisualParams(visual_param_vec_t &list) { // add all visual params to the passed-in vector - for(auto& vp_pair : mVisualParamIndexMap) + for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { list.push_back(vp_pair.second); } @@ -688,7 +688,7 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) void LLWearable::animateParams(F32 delta) { - for(auto& vp_pair : mVisualParamIndexMap) + for(visual_param_index_map_t::value_type& vp_pair : mVisualParamIndexMap) { LLVisualParam *param = (LLVisualParam*)vp_pair.second; param->animate(delta); diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index 19b9903a64..ddc508455f 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -123,14 +123,14 @@ void LLAudioEngine::shutdown() cleanupWind(); // Clean up audio sources - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { delete src_pair.second; } // Clean up audio data - for (data_map::value_type data_pair : mAllData) + for (data_map::value_type& data_pair : mAllData) { delete data_pair.second; } @@ -308,7 +308,7 @@ void LLAudioEngine::idle() updateChannels(); // Update queued sounds (switch to next queued data if the current has finished playing) - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { // This is lame, instead of this I could actually iterate through all the sources // attached to each channel, since only those with active channels @@ -393,7 +393,7 @@ void LLAudioEngine::idle() LLAudioSource *sync_masterp = NULL; LLAudioChannel *master_channelp = NULL; F32 max_sm_priority = -1.f; - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; if (sourcep->isMuted()) @@ -415,7 +415,7 @@ void LLAudioEngine::idle() { // Synchronize loop slaves with their masters // Update queued sounds (switch to next queued data if the current has finished playing) - for (source_map::value_type src_pair : mAllSources) + for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; @@ -1113,7 +1113,7 @@ void LLAudioEngine::startNextTransfer() } - for (data_map::value_type preload_pair : asp->mPreloadMap) + for (data_map::value_type& preload_pair : asp->mPreloadMap) { LLAudioData *adp = preload_pair.second; if (!adp) @@ -1135,7 +1135,7 @@ void LLAudioEngine::startNextTransfer() { max_pri = -1.f; source_map::iterator source_iter; - for (source_map::value_type source_pair : mAllSources) + for (source_map::value_type& source_pair : mAllSources) { asp = source_pair.second; if (!asp) @@ -1164,7 +1164,7 @@ void LLAudioEngine::startNextTransfer() continue; } - for (data_map::value_type preload_pair : asp->mPreloadMap) + for (data_map::value_type& preload_pair : asp->mPreloadMap) { LLAudioData *adp = preload_pair.second; if (!adp) @@ -1601,7 +1601,7 @@ void LLAudioSource::addAudioData(LLAudioData *adp, const bool set_current) bool LLAudioSource::hasPendingPreloads() const { // Check to see if we've got any preloads on deck for this source - for (data_map::value_type preload_pair : mPreloadMap) + for (const data_map::value_type& preload_pair : mPreloadMap) { LLAudioData *adp = preload_pair.second; // note: a bad UUID will forever be !hasDecodedData() diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp index c8709dda19..2e78e30405 100644 --- a/indra/llcharacter/llanimationstates.cpp +++ b/indra/llcharacter/llanimationstates.cpp @@ -379,7 +379,7 @@ LLUUID LLAnimationLibrary::stringToAnimState( const std::string& name, BOOL allo if (true_name) { - for (anim_map_t::value_type anim_pair : mAnimMap) + for (anim_map_t::value_type& anim_pair : mAnimMap) { if (anim_pair.second == true_name) { diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 70f6c0c4c9..47c6d6a7bb 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -156,7 +156,7 @@ LLBVHLoader::LLBVHLoader(const char* buffer, ELoadStatus &loadStatus, S32 &error } // Recognize all names we've been told are legal. - for (std::map::value_type alias_pair : joint_alias_map) + for (std::map::value_type& alias_pair : joint_alias_map) { makeTranslation( alias_pair.first , alias_pair.second ); } diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index bc0c2ec0d3..6d56d59e8c 100644 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -218,7 +218,7 @@ public: S32 getVisualParamCountInGroup(const EVisualParamGroup group) const { S32 rtn = 0; - for (visual_param_index_map_t::value_type index_pair : mVisualParamIndexMap) + for (const visual_param_index_map_t::value_type& index_pair : mVisualParamIndexMap) { if (index_pair.second->getGroup() == group) { @@ -235,7 +235,7 @@ public: } S32 getVisualParamID(LLVisualParam *id) { - for (visual_param_index_map_t::value_type index_pair : mVisualParamIndexMap) + for (visual_param_index_map_t::value_type& index_pair : mVisualParamIndexMap) { if (index_pair.second == id) return index_pair.first; diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index e9a4475707..80717d8d26 100644 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -200,7 +200,7 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin boost::char_separator sep(" "); tokenizer tokens(string, sep); - for(std::string cur_token : tokens) + for(const std::string& cur_token : tokens) { LLGesture* gesture = NULL; diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 282db5c88b..280641a1a5 100644 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -67,7 +67,7 @@ void LLVector3OverrideMap::showJointVector3Overrides( std::ostringstream& os ) c map_type::const_iterator max_it = std::max_element(m_map.begin(), m_map.end(), attachment_map_iter_compare_key); - for (const map_type::value_type pos_pair : m_map) + for (const map_type::value_type& pos_pair : m_map) { const LLVector3& pos = pos_pair.second; os << " " << "[" << pos_pair.first <<": " << pos << "]" << ((pos_pair==(*max_it)) ? "*" : ""); @@ -509,7 +509,7 @@ void LLJoint::getAllAttachmentPosOverrides(S32& num_pos_overrides, std::set& distinct_pos_overrides) const { num_pos_overrides = m_attachmentPosOverrides.count(); - for (LLVector3OverrideMap::map_type::value_type pos_override_pair : m_attachmentPosOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& pos_override_pair : m_attachmentPosOverrides.getMap()) { distinct_pos_overrides.insert(pos_override_pair.second); } @@ -522,7 +522,7 @@ void LLJoint::getAllAttachmentScaleOverrides(S32& num_scale_overrides, std::set& distinct_scale_overrides) const { num_scale_overrides = m_attachmentScaleOverrides.count(); - for (LLVector3OverrideMap::map_type::value_type scale_override_pair : m_attachmentScaleOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& scale_override_pair : m_attachmentScaleOverrides.getMap()) { distinct_scale_overrides.insert(scale_override_pair.second); } @@ -549,7 +549,7 @@ void LLJoint::showAttachmentPosOverrides(const std::string& av_info) const { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " has " << count << " attachment pos overrides" << LL_ENDL; std::set distinct_offsets; - for (LLVector3OverrideMap::map_type::value_type pos_override_pair : m_attachmentPosOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& pos_override_pair : m_attachmentPosOverrides.getMap()) { distinct_offsets.insert(pos_override_pair.second); } @@ -708,7 +708,7 @@ void LLJoint::showAttachmentScaleOverrides(const std::string& av_info) const { LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " has " << count << " attachment scale overrides" << LL_ENDL; std::set distinct_offsets; - for (LLVector3OverrideMap::map_type::value_type scale_override_pair : m_attachmentScaleOverrides.getMap()) + for (const LLVector3OverrideMap::map_type::value_type& scale_override_pair : m_attachmentScaleOverrides.getMap()) { distinct_offsets.insert(scale_override_pair.second); } diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 04c1475161..d82ce23b4b 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1999,7 +1999,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys"); LL_DEBUGS("BVH") << "Joint " << joint_motionp->mJointName << LL_ENDL; - for (RotationCurve::key_map_t::value_type rot_pair : joint_motionp->mRotationCurve.mKeys) + for (RotationCurve::key_map_t::value_type& rot_pair : joint_motionp->mRotationCurve.mKeys) { RotationKey& rot_key = rot_pair.second; U16 time_short = F32_to_U16(rot_key.mTime, 0.f, mJointMotionList->mDuration); @@ -2020,7 +2020,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const } success &= dp.packS32(joint_motionp->mPositionCurve.mNumKeys, "num_pos_keys"); - for (PositionCurve::key_map_t::value_type pos_pair : joint_motionp->mPositionCurve.mKeys) + for (PositionCurve::key_map_t::value_type& pos_pair : joint_motionp->mPositionCurve.mKeys) { PositionKey& pos_key = pos_pair.second; U16 time_short = F32_to_U16(pos_key.mTime, 0.f, mJointMotionList->mDuration); @@ -2394,7 +2394,7 @@ void LLKeyframeDataCache::dumpDiagInfo() LL_INFOS() << "-----------------------------------------------------" << LL_ENDL; // print each loaded mesh, and it's memory usage - for (keyframe_data_map_t::value_type data_pair : sKeyframeDataMap) + for (keyframe_data_map_t::value_type& data_pair : sKeyframeDataMap) { U32 joint_motion_kb; diff --git a/indra/llcharacter/llkeyframemotionparam.cpp b/indra/llcharacter/llkeyframemotionparam.cpp index fce445fee7..c80aabe294 100644 --- a/indra/llcharacter/llkeyframemotionparam.cpp +++ b/indra/llcharacter/llkeyframemotionparam.cpp @@ -64,7 +64,7 @@ LLKeyframeMotionParam::LLKeyframeMotionParam( const LLUUID &id) : LLMotion(id) //----------------------------------------------------------------------------- LLKeyframeMotionParam::~LLKeyframeMotionParam() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -88,7 +88,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch return STATUS_FAILURE; } - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -135,7 +135,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotionParam::onInitialize(LLCharacter *ch //----------------------------------------------------------------------------- BOOL LLKeyframeMotionParam::onActivate() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -156,7 +156,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) F32 weightFactor = 1.f / (F32)mParameterizedMotions.size(); // zero out all pose weights - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -167,7 +167,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) } - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { const std::string& paramName = motion_pair.first; F32* paramValue = (F32 *)mCharacter->getAnimationData(paramName); @@ -270,7 +270,7 @@ BOOL LLKeyframeMotionParam::onUpdate(F32 time, U8* joint_mask) //----------------------------------------------------------------------------- void LLKeyframeMotionParam::onDeactivate() { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) @@ -306,7 +306,7 @@ BOOL LLKeyframeMotionParam::addKeyframeMotion(char *name, const LLUUID &id, char //----------------------------------------------------------------------------- void LLKeyframeMotionParam::setDefaultKeyframeMotion(char *name) { - for (motion_map_t::value_type motion_pair : mParameterizedMotions) + for (motion_map_t::value_type& motion_pair : mParameterizedMotions) { motion_list_t& motionList = motion_pair.second; for (const ParameterizedMotion& paramMotion : motionList) diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index 8716fbff56..96e0d5e8d7 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -1053,7 +1053,7 @@ LLMotion* LLMotionController::findMotion(const LLUUID& id) const void LLMotionController::dumpMotions() { LL_INFOS() << "=====================================" << LL_ENDL; - for (motion_map_t::value_type motion_pair : mAllMotions) + for (motion_map_t::value_type& motion_pair : mAllMotions) { LLUUID id = motion_pair.first; std::string state_string; @@ -1076,7 +1076,7 @@ void LLMotionController::dumpMotions() //----------------------------------------------------------------------------- void LLMotionController::deactivateAllMotions() { - for (motion_map_t::value_type motion_pair : mAllMotions) + for (motion_map_t::value_type& motion_pair : mAllMotions) { LLMotion* motionp = motion_pair.second; deactivateMotionInstance(motionp); @@ -1110,7 +1110,7 @@ void LLMotionController::flushAllMotions() mCharacter->removeAnimationData("Hand Pose"); // restart motions - for (std::vector >::value_type motion_pair : active_motions) + for (std::vector >::value_type& motion_pair : active_motions) { startMotion(motion_pair.first, motion_pair.second); } diff --git a/indra/llcharacter/llpose.cpp b/indra/llcharacter/llpose.cpp index a7156a250b..6f41a0e747 100644 --- a/indra/llcharacter/llpose.cpp +++ b/indra/llcharacter/llpose.cpp @@ -148,7 +148,7 @@ LLJointState* LLPose::findJointState(const std::string &name) void LLPose::setWeight(F32 weight) { joint_map_iterator iter; - for (joint_map_value_type joint_pair : mJointMap) + for (joint_map_value_type& joint_pair : mJointMap) { joint_pair.second->setWeight(weight); } diff --git a/indra/llcharacter/llstatemachine.cpp b/indra/llcharacter/llstatemachine.cpp index 320381e91e..2e8214ffaf 100644 --- a/indra/llcharacter/llstatemachine.cpp +++ b/indra/llcharacter/llstatemachine.cpp @@ -169,7 +169,7 @@ void LLStateDiagram::setDefaultState(LLFSMState& default_state) S32 LLStateDiagram::numDeadendStates() { S32 numDeadends = 0; - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { if (state_pair.second.size() == 0) { @@ -190,7 +190,7 @@ BOOL LLStateDiagram::stateIsValid(LLFSMState& state) LLFSMState* LLStateDiagram::getState(U32 state_id) { - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { if (state_pair.first->getID() == state_id) { @@ -213,13 +213,13 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename) } apr_file_printf(dot_file, "digraph StateMachine {\n\tsize=\"100,100\";\n\tfontsize=40;\n\tlabel=\"Finite State Machine\";\n\torientation=landscape\n\tratio=.77\n"); - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { apr_file_printf(dot_file, "\t\"%s\" [fontsize=28,shape=box]\n", state_pair.first->getName().c_str()); } apr_file_printf(dot_file, "\t\"All States\" [fontsize=30,style=bold,shape=box]\n"); - for (Transitions::value_type transition_pair : mDefaultTransitions) + for (Transitions::value_type& transition_pair : mDefaultTransitions) { apr_file_printf(dot_file, "\t\"All States\" -> \"%s\" [label = \"%s\",fontsize=24];\n", transition_pair.second->getName().c_str(), transition_pair.second->getName().c_str()); @@ -231,11 +231,11 @@ BOOL LLStateDiagram::saveDotFile(const std::string& filename) } - for (StateMap::value_type state_pair : mStates) + for (StateMap::value_type& state_pair : mStates) { LLFSMState *state = state_pair.first; - for (Transitions::value_type transition_pair : state_pair.second) + for (Transitions::value_type& transition_pair : state_pair.second) { std::string state_name = state->getName(); std::string target_name = transition_pair.second->getName(); @@ -258,15 +258,15 @@ std::ostream& operator<<(std::ostream &s, LLStateDiagram &FSM) s << "Default State: " << FSM.mDefaultState->getName() << "\n"; } - for (LLStateDiagram::Transitions::value_type transition_pair : FSM.mDefaultTransitions) + for (LLStateDiagram::Transitions::value_type& transition_pair : FSM.mDefaultTransitions) { s << "Any State -- " << transition_pair.first->getName() << " --> " << transition_pair.second->getName() << "\n"; } - for (LLStateDiagram::StateMap::value_type state_pair : FSM.mStates) + for (LLStateDiagram::StateMap::value_type& state_pair : FSM.mStates) { - for (LLStateDiagram::Transitions::value_type transition_pair : state_pair.second) + for (LLStateDiagram::Transitions::value_type& transition_pair : state_pair.second) { s << state_pair.first->getName() << " -- " << transition_pair.first->getName() << " --> " << transition_pair.second->getName() << "\n"; -- cgit v1.3 From ee0b330b2d6a3433e3bac6ab21cf6cc3e580c605 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 16 May 2023 20:31:29 -0500 Subject: DRTVWR-559 Decruft deprecated OpenGL flags. --- indra/llappearance/lltexlayer.cpp | 13 -- indra/llappearance/lltexlayerparams.cpp | 2 - indra/llrender/CMakeLists.txt | 2 - indra/llrender/llgl.cpp | 26 +--- indra/llrender/llgl.h | 8 +- indra/llrender/llgldbg.cpp | 223 -------------------------------- indra/llrender/llgldbg.h | 34 ----- indra/llrender/llglstates.h | 65 ++-------- indra/llrender/llrender2dutils.cpp | 5 +- indra/llrender/llrender2dutils.h | 2 +- indra/newview/lldrawpoolsimple.cpp | 2 - indra/newview/lldrawpooltree.cpp | 1 - indra/newview/llfloaterimagepreview.cpp | 1 - indra/newview/llhudnametag.cpp | 1 - indra/newview/llhudtext.cpp | 2 - indra/newview/llmaniprotate.cpp | 1 - indra/newview/llmanipscale.cpp | 5 +- indra/newview/llmaniptranslate.cpp | 3 - indra/newview/llmodelpreview.cpp | 4 +- indra/newview/llselectmgr.cpp | 3 - indra/newview/lltracker.cpp | 2 +- indra/newview/llviewerjointmesh.cpp | 1 - indra/newview/llvoavatar.cpp | 10 +- indra/newview/pipeline.cpp | 14 -- 24 files changed, 21 insertions(+), 409 deletions(-) delete mode 100644 indra/llrender/llgldbg.cpp delete mode 100644 indra/llrender/llgldbg.h (limited to 'indra/llappearance/lltexlayer.cpp') diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index e1a3a83841..473fd078cd 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -385,7 +385,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* // clear buffer area to ensure we don't pick up UI elements { gGL.flush(); - LLGLDisable no_alpha(GL_ALPHA_TEST); gAlphaMaskProgram.setMinimumAlpha(0.0f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); @@ -419,7 +418,6 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height, LLRenderTarget* gGL.flush(); gGL.setSceneBlendType(LLRender::BT_REPLACE); - LLGLDisable no_alpha(GL_ALPHA_TEST); gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -510,7 +508,6 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, { // Set the alpha channel to one (clean up after previous blending) gGL.flush(); - LLGLDisable no_alpha(GL_ALPHA_TEST); gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f( 0.f, 0.f, 0.f, 1.f ); @@ -1059,7 +1056,6 @@ void LLTexLayer::calculateTexLayerColor(const param_color_list_t ¶m_list, LL BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bound_target) { - LLGLEnable color_mat(GL_COLOR_MATERIAL); // *TODO: Is this correct? //gPipeline.disableLights(); stop_glerror(); @@ -1146,7 +1142,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou if( tex ) { bool no_alpha_test = getInfo()->mWriteAllChannels; - LLGLDisable alpha_test(no_alpha_test ? GL_ALPHA_TEST : 0); if (no_alpha_test) { gAlphaMaskProgram.setMinimumAlpha(0.f); @@ -1196,7 +1191,6 @@ BOOL LLTexLayer::render(S32 x, S32 y, S32 width, S32 height, LLRenderTarget* bou getInfo()->mStaticImageFileName.empty() && color_specified ) { - LLGLDisable no_alpha(GL_ALPHA_TEST); gAlphaMaskProgram.setMinimumAlpha(0.000f); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1295,7 +1289,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) LLGLTexture* tex = LLTexLayerStaticImageList::getInstance()->getTexture( getInfo()->mStaticImageFileName, getInfo()->mStaticImageIsMask ); if( tex ) { - LLGLSNoAlphaTest gls_no_alpha_test; gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->bind(tex, TRUE); gl_rect_2d_simple_tex( width, height ); @@ -1314,7 +1307,6 @@ BOOL LLTexLayer::blendAlphaTexture(S32 x, S32 y, S32 width, S32 height) LLGLTexture* tex = mLocalTextureObject->getImage(); if (tex) { - LLGLSNoAlphaTest gls_no_alpha_test; gAlphaMaskProgram.setMinimumAlpha(0.f); gGL.getTexUnit(0)->bind(tex); gl_rect_2d_simple_tex( width, height ); @@ -1351,7 +1343,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Note: if the first param is a mulitply, multiply against the current buffer's alpha if( !first_param || !first_param->getMultiplyBlend() ) { - LLGLDisable no_alpha(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); // Clear the alpha @@ -1363,7 +1354,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } // Accumulate alphas - LLGLSNoAlphaTest gls_no_alpha_test; gGL.color4f( 1.f, 1.f, 1.f, 1.f ); for (param_alpha_list_t::iterator iter = mParamAlphaList.begin(); iter != mParamAlphaList.end(); iter++) { @@ -1386,7 +1376,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC LLGLTexture* tex = mLocalTextureObject->getImage(); if( tex && (tex->getComponents() == 4) ) { - LLGLSNoAlphaTest gls_no_alpha_test; LLTexUnit::eTextureAddressMode old_mode = tex->getAddressMode(); gGL.getTexUnit(0)->bind(tex, TRUE); @@ -1406,7 +1395,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC { if( (tex->getComponents() == 4) || (tex->getComponents() == 1) ) { - LLGLSNoAlphaTest gls_no_alpha_test; gGL.getTexUnit(0)->bind(tex, TRUE); gl_rect_2d_simple_tex( width, height ); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -1423,7 +1411,6 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC // Note: we're still using gGL.blendFunc( GL_DST_ALPHA, GL_ZERO ); if ( !is_approx_equal(layer_color.mV[VW], 1.f) ) { - LLGLDisable no_alpha(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4fv(layer_color.mV); gl_rect_2d_simple( width, height ); diff --git a/indra/llappearance/lltexlayerparams.cpp b/indra/llappearance/lltexlayerparams.cpp index 06b4f6c75a..4b537a114f 100644 --- a/indra/llappearance/lltexlayerparams.cpp +++ b/indra/llappearance/lltexlayerparams.cpp @@ -346,7 +346,6 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) mCachedProcessedTexture->setAddressMode(LLTexUnit::TAM_CLAMP); } - LLGLSNoAlphaTest gls_no_alpha_test; gGL.getTexUnit(0)->bind(mCachedProcessedTexture); gl_rect_2d_simple_tex(width, height); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); @@ -363,7 +362,6 @@ BOOL LLTexLayerParamAlpha::render(S32 x, S32 y, S32 width, S32 height) } else { - LLGLDisable no_alpha(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.color4f(0.f, 0.f, 0.f, effective_weight); gl_rect_2d_simple(width, height); diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 92ebdb9490..9454943dc5 100644 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt @@ -18,7 +18,6 @@ set(llrender_SOURCE_FILES llfontgl.cpp llfontregistry.cpp llgl.cpp - llgldbg.cpp llglslshader.cpp llgltexture.cpp llimagegl.cpp @@ -46,7 +45,6 @@ set(llrender_HEADER_FILES llfontbitmapcache.h llfontregistry.h llgl.h - llgldbg.h llglheaders.h llglslshader.h llglstates.h diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 303edddfaf..ae408dae4f 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2454,32 +2454,11 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : mState(state), mWasEnabled(FALSE), mIsEnabled(FALSE) { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - switch (state) - { - case GL_ALPHA_TEST: - case GL_NORMALIZE: - case GL_TEXTURE_GEN_R: - case GL_TEXTURE_GEN_S: - case GL_TEXTURE_GEN_T: - case GL_TEXTURE_GEN_Q: - case GL_LIGHTING: - case GL_COLOR_MATERIAL: - case GL_FOG: - case GL_LINE_STIPPLE: - case GL_POLYGON_STIPPLE: - mState = 0; - break; - } - - stop_glerror(); if (mState) { mWasEnabled = sStateMap[state]; - // we can't actually assert on this as queued changes to state are not reflected by glIsEnabled - //llassert(mWasEnabled == glIsEnabled(state)); setEnabled(enabled); - stop_glerror(); } } @@ -2511,7 +2490,6 @@ void LLGLState::setEnabled(S32 enabled) LLGLState::~LLGLState() { LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; - stop_glerror(); if (mState) { if (gDebugGL) @@ -2544,7 +2522,6 @@ LLGLState::~LLGLState() } } } - stop_glerror(); } //////////////////////////////////////////////////////////////////////////////// @@ -2921,8 +2898,7 @@ void LLGLSyncFence::wait() } LLGLSPipelineSkyBox::LLGLSPipelineSkyBox() -: mAlphaTest(GL_ALPHA_TEST) -, mCullFace(GL_CULL_FACE) +: mCullFace(GL_CULL_FACE) , mSquashClip() { } diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index eb0650d998..4b0fbc0466 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -192,13 +192,13 @@ void clear_glerror(); //disable lighting for rendering hud objects //INCORRECT USAGE - LLGLEnable lighting(GL_LIGHTING); + LLGLEnable blend(GL_BLEND); renderHUD(); - LLGLDisable lighting(GL_LIGHTING); + LLGLDisable blend(GL_BLEND); //CORRECT USAGE { - LLGLEnable lighting(GL_LIGHTING); + LLGLEnable blend(GL_BLEND); renderHUD(); } @@ -206,7 +206,7 @@ void clear_glerror(); is useful: { - LLGLEnable lighting(light_hud ? GL_LIGHTING : 0); + LLGLEnable blend(blend_hud ? GL_GL_BLEND: 0); renderHUD(); } diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp deleted file mode 100644 index 0f1d4ae742..0000000000 --- a/indra/llrender/llgldbg.cpp +++ /dev/null @@ -1,223 +0,0 @@ -/** - * @file llgldbg.cpp - * @brief Definitions for OpenGL debugging support - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// This file sets some global GL parameters, and implements some -// useful functions for GL operations. - -#include "linden_common.h" - -#include "llgldbg.h" - -#include "llgl.h" -#include "llglheaders.h" - - -//------------------------------------------------------------------------ -// cmstr() -//------------------------------------------------------------------------ -const char *cmstr(int i) -{ - switch( i ) - { - case GL_EMISSION: return "GL_EMISSION"; - case GL_AMBIENT: return "GL_AMBIENT"; - case GL_DIFFUSE: return "GL_DIFFUSE"; - case GL_SPECULAR: return "GL_SPECULAR"; - case GL_AMBIENT_AND_DIFFUSE: return "GL_AMBIENT_AND_DIFFUSE"; - } - return "UNKNOWN"; -} - -//------------------------------------------------------------------------ -// facestr() -//------------------------------------------------------------------------ -const char *facestr(int i) -{ - switch( i ) - { - case GL_FRONT: return "GL_FRONT"; - case GL_BACK: return "GL_BACK"; - case GL_FRONT_AND_BACK: return "GL_FRONT_AND_BACK"; - } - return "UNKNOWN"; -} - -//------------------------------------------------------------------------ -// boolstr() -//------------------------------------------------------------------------ -const char *boolstr(int b) -{ - return b ? "GL_TRUE" : "GL_FALSE"; -} - -//------------------------------------------------------------------------ -// fv4() -//------------------------------------------------------------------------ -const char *fv4(F32 *f) -{ - static char str[128]; - sprintf(str, "%8.3f %8.3f %8.3f %8.3f", f[0], f[1], f[2], f[3]); - return str; -} - -//------------------------------------------------------------------------ -// fv3() -//------------------------------------------------------------------------ -const char *fv3(F32 *f) -{ - static char str[128]; /* Flawfinder: ignore */ - snprintf(str, sizeof(str), "%8.3f, %8.3f, %8.3f", f[0], f[1], f[2]); /* Flawfinder: ignore */ - return str; -} - -//------------------------------------------------------------------------ -// fv1() -//------------------------------------------------------------------------ -const char *fv1(F32 *f) -{ - static char str[128]; /* Flawfinder: ignore */ - snprintf(str, sizeof(str), "%8.3f", f[0]); /* Flawfinder: ignore */ - return str; -} - -//------------------------------------------------------------------------ -// llgl_dump() -//------------------------------------------------------------------------ -void llgl_dump() -{ - int i; - F32 fv[16]; - GLboolean b; - - LL_INFOS() << "==========================" << LL_ENDL; - LL_INFOS() << "OpenGL State" << LL_ENDL; - LL_INFOS() << "==========================" << LL_ENDL; - - LL_INFOS() << "-----------------------------------" << LL_ENDL; - LL_INFOS() << "Current Values" << LL_ENDL; - LL_INFOS() << "-----------------------------------" << LL_ENDL; - - glGetFloatv(GL_CURRENT_COLOR, fv); - LL_INFOS() << "GL_CURRENT_COLOR : " << fv4(fv) << LL_ENDL; - - glGetFloatv(GL_CURRENT_NORMAL, fv); - LL_INFOS() << "GL_CURRENT_NORMAL : " << fv3(fv) << LL_ENDL; - - LL_INFOS() << "-----------------------------------" << LL_ENDL; - LL_INFOS() << "Lighting" << LL_ENDL; - LL_INFOS() << "-----------------------------------" << LL_ENDL; - - LL_INFOS() << "GL_LIGHTING : " << boolstr(glIsEnabled(GL_LIGHTING)) << LL_ENDL; - - LL_INFOS() << "GL_COLOR_MATERIAL : " << boolstr(glIsEnabled(GL_COLOR_MATERIAL)) << LL_ENDL; - - glGetIntegerv(GL_COLOR_MATERIAL_PARAMETER, (GLint*)&i); - LL_INFOS() << "GL_COLOR_MATERIAL_PARAMETER: " << cmstr(i) << LL_ENDL; - - glGetIntegerv(GL_COLOR_MATERIAL_FACE, (GLint*)&i); - LL_INFOS() << "GL_COLOR_MATERIAL_FACE : " << facestr(i) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetMaterialfv(GL_FRONT, GL_AMBIENT, fv); - LL_INFOS() << "GL_AMBIENT material : " << fv4(fv) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetMaterialfv(GL_FRONT, GL_DIFFUSE, fv); - LL_INFOS() << "GL_DIFFUSE material : " << fv4(fv) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetMaterialfv(GL_FRONT, GL_SPECULAR, fv); - LL_INFOS() << "GL_SPECULAR material : " << fv4(fv) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetMaterialfv(GL_FRONT, GL_EMISSION, fv); - LL_INFOS() << "GL_EMISSION material : " << fv4(fv) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetMaterialfv(GL_FRONT, GL_SHININESS, fv); - LL_INFOS() << "GL_SHININESS material : " << fv1(fv) << LL_ENDL; - - fv[0] = fv[1] = fv[2] = fv[3] = 12345.6789f; - glGetFloatv(GL_LIGHT_MODEL_AMBIENT, fv); - LL_INFOS() << "GL_LIGHT_MODEL_AMBIENT : " << fv4(fv) << LL_ENDL; - - glGetBooleanv(GL_LIGHT_MODEL_LOCAL_VIEWER, &b); - LL_INFOS() << "GL_LIGHT_MODEL_LOCAL_VIEWER: " << boolstr(b) << LL_ENDL; - - glGetBooleanv(GL_LIGHT_MODEL_TWO_SIDE, &b); - LL_INFOS() << "GL_LIGHT_MODEL_TWO_SIDE : " << boolstr(b) << LL_ENDL; - - for (int l=0; l<8; l++) - { - b = glIsEnabled(GL_LIGHT0+l); - LL_INFOS() << "GL_LIGHT" << l << " : " << boolstr(b) << LL_ENDL; - - if (!b) - continue; - - glGetLightfv(GL_LIGHT0+l, GL_AMBIENT, fv); - LL_INFOS() << " GL_AMBIENT light : " << fv4(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_DIFFUSE, fv); - LL_INFOS() << " GL_DIFFUSE light : " << fv4(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_SPECULAR, fv); - LL_INFOS() << " GL_SPECULAR light : " << fv4(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_POSITION, fv); - LL_INFOS() << " GL_POSITION light : " << fv4(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_CONSTANT_ATTENUATION, fv); - LL_INFOS() << " GL_CONSTANT_ATTENUATION : " << fv1(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_QUADRATIC_ATTENUATION, fv); - LL_INFOS() << " GL_QUADRATIC_ATTENUATION : " << fv1(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_SPOT_DIRECTION, fv); - LL_INFOS() << " GL_SPOT_DIRECTION : " << fv4(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_SPOT_EXPONENT, fv); - LL_INFOS() << " GL_SPOT_EXPONENT : " << fv1(fv) << LL_ENDL; - - glGetLightfv(GL_LIGHT0+l, GL_SPOT_CUTOFF, fv); - LL_INFOS() << " GL_SPOT_CUTOFF : " << fv1(fv) << LL_ENDL; - } - - LL_INFOS() << "-----------------------------------" << LL_ENDL; - LL_INFOS() << "Pixel Operations" << LL_ENDL; - LL_INFOS() << "-----------------------------------" << LL_ENDL; - - LL_INFOS() << "GL_ALPHA_TEST : " << boolstr(glIsEnabled(GL_ALPHA_TEST)) << LL_ENDL; - LL_INFOS() << "GL_DEPTH_TEST : " << boolstr(glIsEnabled(GL_DEPTH_TEST)) << LL_ENDL; - - glGetBooleanv(GL_DEPTH_WRITEMASK, &b); - LL_INFOS() << "GL_DEPTH_WRITEMASK : " << boolstr(b) << LL_ENDL; - - LL_INFOS() << "GL_BLEND : " << boolstr(glIsEnabled(GL_BLEND)) << LL_ENDL; - LL_INFOS() << "GL_DITHER : " << boolstr(glIsEnabled(GL_DITHER)) << LL_ENDL; -} - -// End diff --git a/indra/llrender/llgldbg.h b/indra/llrender/llgldbg.h deleted file mode 100644 index 963579cb82..0000000000 --- a/indra/llrender/llgldbg.h +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @file llgldbg.h - * @brief Definitions for OpenGL debugging support - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLGLDBG_H -#define LL_LLGLDBG_H - -// Dumps the current OpenGL state to the console. -void llgl_dump(); - - -#endif // LL_LLGLDBG_H diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index c46585eab4..930c5e3ed7 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -56,77 +56,44 @@ private: class LLGLSDefault { protected: - LLGLEnable mColorMaterial; - LLGLDisable mAlphaTest, mBlend, mCullFace, mDither, - mLineSmooth, mLineStipple, mNormalize, mPolygonSmooth, - mGLMultisample; + LLGLDisable mBlend, mCullFace; public: LLGLSDefault() : - // Enable - mColorMaterial(GL_COLOR_MATERIAL), // Disable - mAlphaTest(GL_ALPHA_TEST), mBlend(GL_BLEND), - mCullFace(GL_CULL_FACE), - mDither(GL_DITHER), - mLineSmooth(GL_LINE_SMOOTH), - mLineStipple(GL_LINE_STIPPLE), - mNormalize(GL_NORMALIZE), - mPolygonSmooth(GL_POLYGON_SMOOTH), - mGLMultisample(GL_MULTISAMPLE) + mCullFace(GL_CULL_FACE) { } }; class LLGLSObjectSelect { protected: - LLGLDisable mBlend, mAlphaTest; + LLGLDisable mBlend; LLGLEnable mCullFace; public: LLGLSObjectSelect() : mBlend(GL_BLEND), - mAlphaTest(GL_ALPHA_TEST), mCullFace(GL_CULL_FACE) { } }; -class LLGLSObjectSelectAlpha -{ -protected: - LLGLEnable mAlphaTest; -public: - LLGLSObjectSelectAlpha() - : mAlphaTest(GL_ALPHA_TEST) - {} -}; - //---------------------------------------------------------------------------- class LLGLSUIDefault { protected: - LLGLEnable mBlend, mAlphaTest; + LLGLEnable mBlend; LLGLDisable mCullFace; LLGLDepthTest mDepthTest; public: LLGLSUIDefault() - : mBlend(GL_BLEND), mAlphaTest(GL_ALPHA_TEST), + : mBlend(GL_BLEND), mCullFace(GL_CULL_FACE), mDepthTest(GL_FALSE, GL_TRUE, GL_LEQUAL) {} }; -class LLGLSNoAlphaTest // : public LLGLSUIDefault -{ -protected: - LLGLDisable mAlphaTest; -public: - LLGLSNoAlphaTest() - : mAlphaTest(GL_ALPHA_TEST) - {} -}; - //---------------------------------------------------------------------------- class LLGLSPipeline @@ -144,11 +111,10 @@ public: class LLGLSPipelineAlpha // : public LLGLSPipeline { protected: - LLGLEnable mBlend, mAlphaTest; + LLGLEnable mBlend; public: LLGLSPipelineAlpha() - : mBlend(GL_BLEND), - mAlphaTest(GL_ALPHA_TEST) + : mBlend(GL_BLEND) { } }; @@ -162,20 +128,9 @@ public: {} }; -class LLGLSPipelineAvatar -{ -protected: - LLGLEnable mNormalize; -public: - LLGLSPipelineAvatar() - : mNormalize(GL_NORMALIZE) - {} -}; - class LLGLSPipelineSkyBox { protected: - LLGLDisable mAlphaTest; LLGLDisable mCullFace; LLGLSquashToFarClip mSquashClip; public: @@ -201,13 +156,11 @@ public: class LLGLSTracker { protected: - LLGLEnable mCullFace, mBlend, mAlphaTest; + LLGLEnable mCullFace, mBlend; public: LLGLSTracker() : mCullFace(GL_CULL_FACE), - mBlend(GL_BLEND), - mAlphaTest(GL_ALPHA_TEST) - + mBlend(GL_BLEND) { } }; diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp index 2d6f3c9469..52869406d2 100644 --- a/indra/llrender/llrender2dutils.cpp +++ b/indra/llrender/llrender2dutils.cpp @@ -712,11 +712,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre } } -void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase ) +void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color) { - // Stippled line - LLGLEnable stipple(GL_LINE_STIPPLE); - gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]); gGL.flush(); diff --git a/indra/llrender/llrender2dutils.h b/indra/llrender/llrender2dutils.h index 206e68f084..135738c3ba 100644 --- a/indra/llrender/llrender2dutils.h +++ b/indra/llrender/llrender2dutils.h @@ -79,7 +79,7 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 border_width, S32 border_height, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true); void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTexture* image, const LLColor4 &color, BOOL solid_color = FALSE, const LLRectf& uv_rect = LLRectf(0.f, 1.f, 1.f, 0.f), const LLRectf& scale_rect = LLRectf(0.f, 1.f, 1.f, 0.f), bool scale_inner = true); -void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color, F32 phase = 0.f ); +void gl_line_3d( const LLVector3& start, const LLVector3& end, const LLColor4& color); void gl_rect_2d_simple_tex( S32 width, S32 height ); diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 3cc101b325..a89c9d4561 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -79,7 +79,6 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass) LLGLSLShader* shader = &gDeferredEmissiveProgram; LLGLEnable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); gGL.flush(); /// Get rid of z-fighting with non-glow pass. LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL); @@ -132,7 +131,6 @@ void LLDrawPoolSimple::renderDeferred(S32 pass) { LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SIMPLE_DEFERRED); LLGLDisable blend(GL_BLEND); - LLGLDisable alpha_test(GL_ALPHA_TEST); //render static setup_simple_shader(&gDeferredDiffuseProgram); diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 57146c432a..9dcbc48697 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -71,7 +71,6 @@ void LLDrawPoolTree::renderDeferred(S32 pass) return; } - LLGLState test(GL_ALPHA_TEST, 0); gGL.getTexUnit(sDiffTex)->bindFast(mTexturep); mTexturep->addTextureStats(1024.f * 1024.f); // <=== keep Linden tree textures at full res diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index 6b0ba44624..ba0f97e2e1 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -251,7 +251,6 @@ void LLFloaterImagePreview::draw() if (selected <= 0) { gl_rect_2d_checkerboard(mPreviewRect); - LLGLDisable gls_alpha(GL_ALPHA_TEST); if(mImagep.notNull()) { diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 0408cfc659..26fc899eb5 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -258,7 +258,6 @@ void LLHUDNameTag::renderText(BOOL for_select) } LLGLState gls_blend(GL_BLEND, for_select ? FALSE : TRUE); - LLGLState gls_alpha(GL_ALPHA_TEST, for_select ? FALSE : TRUE); LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); F32 alpha_factor = 1.f; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 22dca07096..0b0de18534 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -117,7 +117,6 @@ void LLHUDText::renderText() gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); LLGLState gls_blend(GL_BLEND, TRUE); - LLGLState gls_alpha(GL_ALPHA_TEST, TRUE); LLColor4 shadow_color(0.f, 0.f, 0.f, 1.f); F32 alpha_factor = 1.f; @@ -575,7 +574,6 @@ void LLHUDText::renderAllHUD() LLGLState::checkStates(); { - LLGLEnable color_mat(GL_COLOR_MATERIAL); LLGLDepthTest depth(GL_FALSE, GL_FALSE); VisibleTextObjectIterator text_it; diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 6b9543d433..886abfb132 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -118,7 +118,6 @@ void LLManipRotate::render() gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep); LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); - LLGLEnable gls_alpha_test(GL_ALPHA_TEST); // You can rotate if you can move LLViewerObject* first_object = mObjectSelection->getFirstMoveableObject(TRUE); diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index c15f1da26b..6f685d4e62 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -212,7 +212,6 @@ void LLManipScale::render() gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest gls_depth(GL_TRUE); LLGLEnable gl_blend(GL_BLEND); - LLGLEnable gls_alpha_test(GL_ALPHA_TEST); LLBBox bbox = LLSelectMgr::getInstance()->getBBoxOfSelection(); if( canAffectSelection() ) @@ -1317,11 +1316,11 @@ void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) { LLGLDepthTest gls_depth(GL_TRUE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.5f) ); + gl_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.5f) ); } { LLGLDepthTest gls_depth(GL_FALSE); - gl_stippled_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.25f) ); + gl_line_3d( guideline_start, guideline_end, LLColor4(1.f, 1.f, 1.f, 0.25f) ); } } diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 91f1af8f28..cafb3fef67 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1537,7 +1537,6 @@ void LLManipTranslate::renderSnapGuides() } { - LLGLDisable alpha_test(GL_ALPHA_TEST); //draw black overlay gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); renderGrid(u,v,tiles,0.0f, 0.0f, 0.0f,a*0.16f); @@ -1558,7 +1557,6 @@ void LLManipTranslate::renderSnapGuides() { LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE, GL_GREATER); - LLGLEnable stipple(GL_LINE_STIPPLE); gGL.flush(); switch (mManipPart) @@ -2182,7 +2180,6 @@ void LLManipTranslate::renderArrow(S32 which_arrow, S32 selected_arrow, F32 box_ { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable gls_blend(GL_BLEND); - LLGLEnable gls_color_material(GL_COLOR_MATERIAL); for (S32 pass = 1; pass <= 2; pass++) { diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index 7ae48eef8c..5f910d95c2 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -3096,7 +3096,7 @@ BOOL LLModelPreview::render() S32 width = getWidth(); S32 height = getHeight(); - LLGLSUIDefault def; // GL_BLEND, GL_ALPHA_TEST, GL_CULL_FACE, depth test + LLGLSUIDefault def; LLGLDisable no_blend(GL_BLEND); LLGLEnable cull(GL_CULL_FACE); LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color @@ -3301,8 +3301,6 @@ BOOL LLModelPreview::render() gGL.pushMatrix(); gGL.color4fv(PREVIEW_EDGE_COL.mV); - LLGLEnable normalize(GL_NORMALIZE); - if (!mBaseModel.empty() && mVertexBuffer[5].empty()) { genBuffers(-1, skin_weight); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 71dcc56197..dca341e5a2 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6288,9 +6288,6 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) auto renderMeshSelection_f = [fogCfx, wireframe_selection](LLSelectNode* node, LLViewerObject* objectp, LLColor4 hlColor) { - //Need to because crash on ATI 3800 (and similar cards) MAINT-5018 - LLGLDisable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE : 0); - LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; if (shader) diff --git a/indra/newview/lltracker.cpp b/indra/newview/lltracker.cpp index ab4ad5817b..4c55ea1fc6 100644 --- a/indra/newview/lltracker.cpp +++ b/indra/newview/lltracker.cpp @@ -588,7 +588,7 @@ void LLTracker::renderBeacon(LLVector3d pos_global, LLVector3 pos_agent = gAgent.getPosAgentFromGlobal(pos_global); - LLGLSTracker gls_tracker; // default+ CULL_FACE + LIGHTING + GL_BLEND + GL_ALPHA_TEST + LLGLSTracker gls_tracker; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDisable cull_face(GL_CULL_FACE); LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp index 5ce8f4023d..5d46c695b7 100644 --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -39,7 +39,6 @@ #include "lldrawpoolbump.h" #include "lldynamictexture.h" #include "llface.h" -#include "llgldbg.h" #include "llglheaders.h" #include "llviewertexlayer.h" #include "llviewercamera.h" diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index af65588709..341ef57d8c 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5112,9 +5112,6 @@ U32 LLVOAvatar::renderSkinned() // render all geometry attached to the skeleton //-------------------------------------------------------------------- - bool should_alpha_mask = shouldAlphaMask(); - LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - BOOL first_pass = TRUE; if (!LLDrawPoolAvatar::sSkipOpaque) { @@ -5164,7 +5161,6 @@ U32 LLVOAvatar::renderSkinned() if (!LLDrawPoolAvatar::sSkipTransparent || LLPipeline::sImpostorRender) { LLGLState blend(GL_BLEND, !mIsDummy); - LLGLState test(GL_ALPHA_TEST, !mIsDummy); num_indices += renderTransparent(first_pass); } @@ -5242,9 +5238,6 @@ U32 LLVOAvatar::renderRigid() return 0; } - bool should_alpha_mask = shouldAlphaMask(); - LLGLState test(GL_ALPHA_TEST, should_alpha_mask); - if (isTextureVisible(TEX_EYES_BAKED) || (getOverallAppearance() == AOA_JELLYDOLL && !isControlAvatar()) || isUIAvatar()) { LLViewerJoint* eyeball_left = getViewerJoint(MESH_ID_EYEBALL_LEFT); @@ -5308,8 +5301,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel) gGL.flush(); } { - LLGLEnable test(GL_ALPHA_TEST); - gGL.flush(); + gGL.flush(); gGL.color4ubv(color.mV); gGL.getTexUnit(diffuse_channel)->bind(&mImpostor); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 99deae309d..7f1db9b61e 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -63,7 +63,6 @@ #include "llfeaturemanager.h" #include "llfloatertelehub.h" #include "llfloaterreg.h" -#include "llgldbg.h" #include "llhudmanager.h" #include "llhudnametag.h" #include "llhudtext.h" @@ -2428,7 +2427,6 @@ void LLPipeline::doOcclusion(LLCamera& camera) gGL.setColorMask(false, false); LLGLDisable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLDepthTest depth(GL_TRUE, GL_FALSE); @@ -3742,7 +3740,6 @@ void render_hud_elements() if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { - LLGLEnable multisample(LLPipeline::RenderFSAASamples > 0 ? GL_MULTISAMPLE : 0); gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() // Draw the tracking overlays @@ -3777,7 +3774,6 @@ void LLPipeline::renderHighlights() // Render highlighted faces. LLGLSPipelineAlpha gls_pipeline_alpha; LLColor4 color(1.f, 1.f, 1.f, 0.5f); - LLGLEnable color_mat(GL_COLOR_MATERIAL); disableLights(); if ((LLViewerShaderMgr::instance()->getShaderLevel(LLViewerShaderMgr::SHADER_INTERFACE) > 0)) @@ -3947,8 +3943,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera, bool do_occlusion) } } - LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE : 0); - LLVertexBuffer::unbind(); LLGLState::checkStates(); @@ -4055,8 +4049,6 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) LLGLEnable cull(GL_CULL_FACE); - LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE : 0); - calcNearbyLights(camera); setupHWLights(); @@ -7140,7 +7132,6 @@ void LLPipeline::generateGlow(LLRenderTarget* src) { LLGLEnable blend_on(GL_BLEND); - LLGLEnable test(GL_ALPHA_TEST); gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA); @@ -7559,8 +7550,6 @@ void LLPipeline::renderFinalize() enableLightsFullbright(); - LLGLDisable test(GL_ALPHA_TEST); - gGL.setColorMask(true, true); glClearColor(0, 0, 0, 0); @@ -7971,8 +7960,6 @@ void LLPipeline::renderDeferredLighting() LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("deferred"); LLViewerCamera *camera = LLViewerCamera::getInstance(); - LLGLEnable multisample(RenderFSAASamples > 0 ? GL_MULTISAMPLE : 0); - if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_HUD)) { gPipeline.toggleRenderType(LLPipeline::RENDER_TYPE_HUD); @@ -8133,7 +8120,6 @@ void LLPipeline::renderDeferredLighting() { LLGLDepthTest depth(GL_FALSE); LLGLDisable blend(GL_BLEND); - LLGLDisable test(GL_ALPHA_TEST); // full screen blit mScreenTriangleVB->setBuffer(); -- cgit v1.3