From 41ca92c67c75d86e8053ae45725d36ca3ac7e742 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 25 Mar 2013 18:27:07 -0500 Subject: NORSPEC-54 Potential fix for crashing on all sorts of random operations. --- indra/newview/lllocalbitmaps.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 97ba5b634a..6f213e018a 100644 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -372,10 +372,12 @@ std::vector LLLocalBitmap::prepUpdateObjects(LLUUID old_id) std::vector obj_list; LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id); - for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(); face_iterator++) + U32 ch = LLRender::DIFFUSE_MAP; + + for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(ch); face_iterator++) { // getting an object from a face - LLFace* face_to_object = (*old_texture->getFaceList())[face_iterator]; + LLFace* face_to_object = (*old_texture->getFaceList(ch))[face_iterator]; if(face_to_object) { -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/newview/lllocalbitmaps.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/lllocalbitmaps.cpp (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From c3804fd041bc606cb20af615f6f030365202bedc Mon Sep 17 00:00:00 2001 From: Serpentu Date: Fri, 24 May 2013 11:47:06 -0400 Subject: MATBUG-8: fix local texture support for normal and specular maps --- indra/newview/lllocalbitmaps.cpp | 69 +++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 15 deletions(-) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 1f2b9904eb..724c7cca0f 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -58,6 +58,8 @@ #include "lltexlayerparams.h" #include "llvovolume.h" #include "llnotificationsutil.h" +#include "pipeline.h" +#include "llmaterialmgr.h" /*=======================================*/ /* Formal declarations, constants, etc. */ @@ -339,7 +341,12 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) return; } - updateUserPrims(old_id, new_id); + // processing updates per channel; makes the process scalable. + // the only actual difference is in SetTE* call i.e. SetTETexture, SetTENormal, etc. + updateUserPrims(old_id, new_id, LLRender::DIFFUSE_MAP); + updateUserPrims(old_id, new_id, LLRender::NORMAL_MAP); + updateUserPrims(old_id, new_id, LLRender::SPECULAR_MAP); + updateUserSculpts(old_id, new_id); // isn't there supposed to be an IMG_DEFAULT_SCULPT or something? // default safeguard image for layers @@ -367,17 +374,15 @@ void LLLocalBitmap::replaceIDs(LLUUID old_id, LLUUID new_id) // this function sorts the faces from a getFaceList[getNumFaces] into a list of objects // in order to prevent multiple sendTEUpdate calls per object during updateUserPrims -std::vector LLLocalBitmap::prepUpdateObjects(LLUUID old_id) +std::vector LLLocalBitmap::prepUpdateObjects(LLUUID old_id, U32 channel) { std::vector obj_list; LLViewerFetchedTexture* old_texture = gTextureList.findImage(old_id); - - U32 ch = LLRender::DIFFUSE_MAP; - - for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(ch); face_iterator++) + + for(U32 face_iterator = 0; face_iterator < old_texture->getNumFaces(channel); face_iterator++) { // getting an object from a face - LLFace* face_to_object = (*old_texture->getFaceList(ch))[face_iterator]; + LLFace* face_to_object = (*old_texture->getFaceList(channel))[face_iterator]; if(face_to_object) { @@ -418,9 +423,9 @@ std::vector LLLocalBitmap::prepUpdateObjects(LLUUID old_id) return obj_list; } -void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id) +void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id, U32 channel) { - std::vector objectlist = prepUpdateObjects(old_id); + std::vector objectlist = prepUpdateObjects(old_id, channel); for(std::vector::iterator object_iterator = objectlist.begin(); object_iterator != objectlist.end(); object_iterator++) @@ -429,7 +434,8 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id) if(object) { - bool update_obj = false; + bool update_tex = false; + bool update_mat = false; S32 num_faces = object->getNumFaces(); for (U8 face_iter = 0; face_iter < num_faces; face_iter++) @@ -437,20 +443,53 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id) if (object->mDrawable) { LLFace* face = object->mDrawable->getFace(face_iter); - if (face && face->getTexture() && face->getTexture()->getID() == old_id) + if (face && face->getTexture(channel) && face->getTexture(channel)->getID() == old_id) { - object->setTEImage(face_iter, LLViewerTextureManager::getFetchedTexture( - new_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)); + // these things differ per channel, unless there already is a universal + // texture setting function to setTE that takes channel as a param? + // p.s.: switch for now, might become if - if an extra test is needed to verify before touching normalmap/specmap + switch(channel) + { + case LLRender::DIFFUSE_MAP: + { + object->setTETexture(face_iter, new_id); + update_tex = true; + break; + } + + case LLRender::NORMAL_MAP: + { + object->setTENormalMap(face_iter, new_id); + update_mat = true; + update_tex = true; + break; + } + + case LLRender::SPECULAR_MAP: + { + object->setTESpecularMap(face_iter, new_id); + update_mat = true; + update_tex = true; + break; + } + } + // end switch - update_obj = true; } } } - if (update_obj) + if (update_tex) { object->sendTEUpdate(); } + + if (update_mat) + { // i had to make LLLocalBitmap friend of LLVOVolume for this, + // i realize it might seem somewhat hacky, but it's also simple. + // will gladly accept a better solution though. + object->mDrawable->getVOVolume()->mFaceMappingChanged = TRUE; + } } } -- cgit v1.2.3 From ad89d26dc676dc090e58a3457d62bccbd7dc7e21 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 24 May 2013 12:55:52 -0400 Subject: norspec-107: remove the need for a friend declaration in local textures --- indra/newview/lllocalbitmaps.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra/newview/lllocalbitmaps.cpp') diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp index 724c7cca0f..2d9385390b 100755 --- a/indra/newview/lllocalbitmaps.cpp +++ b/indra/newview/lllocalbitmaps.cpp @@ -485,10 +485,8 @@ void LLLocalBitmap::updateUserPrims(LLUUID old_id, LLUUID new_id, U32 channel) } if (update_mat) - { // i had to make LLLocalBitmap friend of LLVOVolume for this, - // i realize it might seem somewhat hacky, but it's also simple. - // will gladly accept a better solution though. - object->mDrawable->getVOVolume()->mFaceMappingChanged = TRUE; + { + object->mDrawable->getVOVolume()->faceMappingChanged(); } } } -- cgit v1.2.3