summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2013-05-30 21:28:02 +0000
committerMonty Brandenberg <monty@lindenlab.com>2013-05-30 21:28:02 +0000
commitd6d2159bf875884bb060aaf8234478dd1ec478b4 (patch)
tree6873979584b8d269fb250c35219725598cb9b5d6 /indra/newview/llviewerobject.cpp
parent960139aa6f02f90c6102d3c5d5c38b5ebe689f9c (diff)
parentdcfb18373eca7986a73d8b9a1d34970cc0a23ed9 (diff)
Merge. Pull in viewer-release reflecting new release structure.
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewerobject.cpp55
1 files changed, 35 insertions, 20 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index b1a60197a2..064e96e394 100644..100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2135,7 +2135,8 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if (mDrawable->isState(LLDrawable::FORCE_INVISIBLE) && !mOrphaned)
{
// lldebugs << "Clearing force invisible: " << mID << ":" << getPCodeString() << ":" << getPositionAgent() << llendl;
- mDrawable->setState(LLDrawable::CLEAR_INVISIBLE);
+ mDrawable->clearState(LLDrawable::FORCE_INVISIBLE);
+ gPipeline.markRebuild( mDrawable, LLDrawable::REBUILD_ALL, TRUE );
}
}
@@ -2697,24 +2698,33 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
if(ft && (0 == error_code) &&
(object = gObjectList.findObject(ft->mTaskID)))
{
- object->loadTaskInvFile(ft->mFilename);
+ if (object->loadTaskInvFile(ft->mFilename))
+ {
- LLInventoryObject::object_list_t::iterator it = object->mInventory->begin();
- LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
- std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
+ LLInventoryObject::object_list_t::iterator it = object->mInventory->begin();
+ LLInventoryObject::object_list_t::iterator end = object->mInventory->end();
+ std::list<LLUUID>& pending_lst = object->mPendingInventoryItemsIDs;
- for (; it != end && pending_lst.size(); ++it)
- {
- LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
- if(item && item->getType() != LLAssetType::AT_CATEGORY)
+ for (; it != end && pending_lst.size(); ++it)
{
- std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID());
- if (id_it != pending_lst.end())
+ LLViewerInventoryItem* item = dynamic_cast<LLViewerInventoryItem*>(it->get());
+ if(item && item->getType() != LLAssetType::AT_CATEGORY)
{
- pending_lst.erase(id_it);
+ std::list<LLUUID>::iterator id_it = std::find(pending_lst.begin(), pending_lst.begin(), item->getAssetUUID());
+ if (id_it != pending_lst.end())
+ {
+ pending_lst.erase(id_it);
+ }
}
}
}
+ else
+ {
+ // MAINT-2597 - crash when trying to edit a no-mod object
+ // Somehow get an contents inventory response, but with an invalid stream (possibly 0 size?)
+ // Stated repro was specific to no-mod objects so failing without user interaction should be safe.
+ llwarns << "Trying to load invalid task inventory file. Ignoring file contents." << llendl;
+ }
}
else
{
@@ -2726,7 +2736,7 @@ void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code, LLExtS
delete ft;
}
-void LLViewerObject::loadTaskInvFile(const std::string& filename)
+BOOL LLViewerObject::loadTaskInvFile(const std::string& filename)
{
std::string filename_and_local_path = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, filename);
llifstream ifs(filename_and_local_path);
@@ -2773,8 +2783,11 @@ void LLViewerObject::loadTaskInvFile(const std::string& filename)
{
llwarns << "unable to load task inventory: " << filename_and_local_path
<< llendl;
+ return FALSE;
}
doInventoryCallback();
+
+ return TRUE;
}
void LLViewerObject::doInventoryCallback()
@@ -3266,14 +3279,14 @@ void LLViewerObject::boostTexturePriority(BOOL boost_children /* = TRUE */)
S32 tex_count = getNumTEs();
for (i = 0; i < tex_count; i++)
{
- getTEImage(i)->setBoostLevel(LLViewerTexture::BOOST_SELECTED);
+ getTEImage(i)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
}
if (isSculpted() && !isMesh())
{
LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
LLUUID sculpt_id = sculpt_params->getSculptTexture();
- LLViewerTextureManager::getFetchedTexture(sculpt_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLViewerTexture::BOOST_SELECTED);
+ LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED);
}
if (boost_children)
@@ -4016,7 +4029,7 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry)
// if (mDrawable.notNull() && mDrawable->isVisible())
// {
const LLUUID& image_id = getTE(te)->getID();
- mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
// }
}
@@ -4034,15 +4047,15 @@ void LLViewerObject::setTEImage(const U8 te, LLViewerTexture *imagep)
}
}
-
-S32 LLViewerObject::setTETextureCore(const U8 te, const LLUUID& uuid, LLHost host)
+S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image)
{
+ const LLUUID& uuid = image->getID();
S32 retval = 0;
if (uuid != getTE(te)->getID() ||
uuid == LLUUID::null)
{
retval = LLPrimitive::setTETexture(te, uuid);
- mTEImages[te] = LLViewerTextureManager::getFetchedTexture(uuid, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host);
+ mTEImages[te] = image;
setChanged(TEXTURE);
if (mDrawable.notNull())
{
@@ -4065,7 +4078,9 @@ void LLViewerObject::changeTEImage(S32 index, LLViewerTexture* new_image)
S32 LLViewerObject::setTETexture(const U8 te, const LLUUID& uuid)
{
// Invalid host == get from the agent's sim
- return setTETextureCore(te, uuid, LLHost::invalid);
+ LLViewerFetchedTexture *image = LLViewerTextureManager::getFetchedTexture(
+ uuid, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, LLHost::invalid);
+ return setTETextureCore(te,image);
}