aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerobject.cpp')
-rw-r--r--linden/indra/newview/llviewerobject.cpp262
1 files changed, 171 insertions, 91 deletions
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index 40930e6..a1a971f 100644
--- a/linden/indra/newview/llviewerobject.cpp
+++ b/linden/indra/newview/llviewerobject.cpp
@@ -80,14 +80,12 @@
80#include "llvoground.h" 80#include "llvoground.h"
81#include "llvolume.h" 81#include "llvolume.h"
82#include "llvolumemessage.h" 82#include "llvolumemessage.h"
83#include "llvopart.h"
84#include "llvopartgroup.h" 83#include "llvopartgroup.h"
85#include "llvosky.h" 84#include "llvosky.h"
86#include "llvostars.h" 85#include "llvostars.h"
87#include "llvosurfacepatch.h" 86#include "llvosurfacepatch.h"
88#include "llvotextbubble.h" 87#include "llvotextbubble.h"
89#include "llvotree.h" 88#include "llvotree.h"
90#include "llvotreenew.h"
91#include "llvovolume.h" 89#include "llvovolume.h"
92#include "llvowater.h" 90#include "llvowater.h"
93#include "llworld.h" 91#include "llworld.h"
@@ -125,14 +123,15 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
125 case LL_PCODE_LEGACY_GRASS: 123 case LL_PCODE_LEGACY_GRASS:
126 res = new LLVOGrass(id, pcode, regionp); break; 124 res = new LLVOGrass(id, pcode, regionp); break;
127 case LL_PCODE_LEGACY_PART_SYS: 125 case LL_PCODE_LEGACY_PART_SYS:
128 res = new LLVOPart(id, pcode, regionp); break; 126// llwarns << "Creating old part sys!" << llendl;
127// res = new LLVOPart(id, pcode, regionp); break;
128 res = NULL; break;
129 case LL_PCODE_LEGACY_TREE: 129 case LL_PCODE_LEGACY_TREE:
130 res = new LLVOTree(id, pcode, regionp); break; 130 res = new LLVOTree(id, pcode, regionp); break;
131 case LL_PCODE_TREE_NEW: 131 case LL_PCODE_TREE_NEW:
132 llwarns << "Creating new tree!" << llendl; 132// llwarns << "Creating new tree!" << llendl;
133// res = new LLVOTree(id, pcode, regionp); break; 133// res = new LLVOTree(id, pcode, regionp); break;
134// res = new LLVOTreeNew(id, pcode, regionp); break; 134 res = NULL; break;
135 res = NULL; break;
136 case LL_PCODE_LEGACY_TEXT_BUBBLE: 135 case LL_PCODE_LEGACY_TEXT_BUBBLE:
137 res = new LLVOTextBubble(id, pcode, regionp); break; 136 res = new LLVOTextBubble(id, pcode, regionp); break;
138 case LL_VO_CLOUDS: 137 case LL_VO_CLOUDS:
@@ -173,10 +172,11 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
173 mText(), 172 mText(),
174 mLastInterpUpdateSecs(0.f), 173 mLastInterpUpdateSecs(0.f),
175 mLastMessageUpdateSecs(0.f), 174 mLastMessageUpdateSecs(0.f),
175 mLatestRecvPacketID(0),
176 mData(NULL), 176 mData(NULL),
177 mAudioSourcep(NULL), 177 mAudioSourcep(NULL),
178 mAppAngle(0.f), 178 mAppAngle(0.f),
179 mPixelArea(0.f), 179 mPixelArea(1024.f),
180 mInventory(NULL), 180 mInventory(NULL),
181 mInventorySerialNum(0), 181 mInventorySerialNum(0),
182 mRegionp( regionp ), 182 mRegionp( regionp ),
@@ -188,7 +188,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
188 mOnActiveList(FALSE), 188 mOnActiveList(FALSE),
189 mOnMap(FALSE), 189 mOnMap(FALSE),
190 mStatic(FALSE), 190 mStatic(FALSE),
191 mFaceIndexOffset(0),
192 mNumFaces(0), 191 mNumFaces(0),
193 mLastUpdateFrame(0), 192 mLastUpdateFrame(0),
194 mTimeDilation(1.f), 193 mTimeDilation(1.f),
@@ -368,10 +367,12 @@ void LLViewerObject::dump() const
368 llinfos << "Velocity: " << getVelocity() << llendl; 367 llinfos << "Velocity: " << getVelocity() << llendl;
369 if (mDrawable.notNull() && mDrawable->getNumFaces()) 368 if (mDrawable.notNull() && mDrawable->getNumFaces())
370 { 369 {
371 LLDrawPool *poolp = mDrawable->getFace(0)->getPool(); 370 LLFacePool *poolp = mDrawable->getFace(0)->getPool();
372 llinfos << "Pool: " << poolp << llendl; 371 if (poolp)
373 llinfos << "Pool reference count: " << poolp->mReferences.size() << llendl; 372 {
374 llinfos << "Pool vertex count: " << poolp->getVertexCount() << llendl; 373 llinfos << "Pool: " << poolp << llendl;
374 llinfos << "Pool reference count: " << poolp->mReferences.size() << llendl;
375 }
375 } 376 }
376 //llinfos << "BoxTree Min: " << mDrawable->getBox()->getMin() << llendl; 377 //llinfos << "BoxTree Min: " << mDrawable->getBox()->getMin() << llendl;
377 //llinfos << "BoxTree Max: " << mDrawable->getBox()->getMin() << llendl; 378 //llinfos << "BoxTree Max: " << mDrawable->getBox()->getMin() << llendl;
@@ -423,7 +424,6 @@ void LLViewerObject::initVOClasses()
423 } 424 }
424 llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl; 425 llinfos << "Viewer Object size: " << sizeof(LLViewerObject) << llendl;
425 LLVOGrass::initClass(); 426 LLVOGrass::initClass();
426 LLVOPart::initClass();
427 LLVOWater::initClass(); 427 LLVOWater::initClass();
428 LLVOSky::initClass(); 428 LLVOSky::initClass();
429 LLVOVolume::initClass(); 429 LLVOVolume::initClass();
@@ -615,11 +615,24 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp)
615 return FALSE; 615 return FALSE;
616 } 616 }
617 617
618 LLDrawable* old_parent = mDrawable->mParent;
619
618 mDrawable->mParent = parentp; 620 mDrawable->mParent = parentp;
619 621
620 BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL); 622 BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL);
621 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); 623 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE);
622 gPipeline.markMoved(mDrawable, FALSE); 624 if (old_parent || (parentp && parentp->isActive()))
625 {
626 gPipeline.markMoved(mDrawable, FALSE);
627 }
628 else
629 {
630 mDrawable->updateXform(TRUE);
631 if (!mDrawable->getSpatialGroup())
632 {
633 mDrawable->movePartition();
634 }
635 }
623 636
624 return ret; 637 return ret;
625} 638}
@@ -674,7 +687,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
674 LLVector3 new_acc; 687 LLVector3 new_acc;
675 LLVector3 new_angv; 688 LLVector3 new_angv;
676 LLQuaternion new_rot; 689 LLQuaternion new_rot;
677 LLVector3 new_scale; 690 LLVector3 new_scale = getScale();
678 691
679 U32 parent_id = 0; 692 U32 parent_id = 0;
680 U8 material = 0; 693 U8 material = 0;
@@ -900,13 +913,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
900 // ...new objects that should come in selected need to be added to the selected list 913 // ...new objects that should come in selected need to be added to the selected list
901 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); 914 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
902 915
903 // Set the change flags for scale
904 if (new_scale != getScale())
905 {
906 setChanged(SCALED | SILHOUETTE);
907 setScale(new_scale); // Must follow setting permYouOwner()
908 }
909
910 // Set all name value pairs 916 // Set all name value pairs
911 S32 nv_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_NameValue); 917 S32 nv_size = mesgsys->getSizeFast(_PREHASH_ObjectData, block_num, _PREHASH_NameValue);
912 if (nv_size > 0) 918 if (nv_size > 0)
@@ -952,7 +958,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
952 mText->setOnHUDAttachment(isHUDAttachment()); 958 mText->setOnHUDAttachment(isHUDAttachment());
953 } 959 }
954 960
955 char temp_string[256]; // not MAX_STRING, must hold 255 chars + \0 961 char temp_string[256]; /* Flawfinder: ignore */ // not MAX_STRING, must hold 255 chars + \0
956 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, 256, temp_string, block_num ); 962 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_Text, 256, temp_string, block_num );
957 963
958 LLColor4U coloru; 964 LLColor4U coloru;
@@ -975,7 +981,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
975 mText = NULL; 981 mText = NULL;
976 } 982 }
977 983
978 char media_url[MAX_STRING+1]; 984 char media_url[MAX_STRING+1]; /* Flawfinder: ignore */
979 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_MediaURL, MAX_STRING+1, media_url, block_num); 985 mesgsys->getStringFast(_PREHASH_ObjectData, _PREHASH_MediaURL, MAX_STRING+1, media_url, block_num);
980 //if (media_url[0]) 986 //if (media_url[0])
981 //{ 987 //{
@@ -1419,8 +1425,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1419 // Unpack particle system data 1425 // Unpack particle system data
1420 // 1426 //
1421 if (value & 0x8) 1427 if (value & 0x8)
1428 {
1422 unpackParticleSource(*dp, owner_id); 1429 unpackParticleSource(*dp, owner_id);
1423 1430 }
1431 else
1432 {
1433 deleteParticleSource();
1434 }
1435
1424 // Mark all extra parameters not used 1436 // Mark all extra parameters not used
1425 std::map<U16, ExtraParameter*>::iterator iter; 1437 std::map<U16, ExtraParameter*>::iterator iter;
1426 for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter) 1438 for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
@@ -1484,14 +1496,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1484 1496
1485 // ...new objects that should come in selected need to be added to the selected list 1497 // ...new objects that should come in selected need to be added to the selected list
1486 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0); 1498 mCreateSelected = ((flags & FLAGS_CREATE_SELECTED) != 0);
1487
1488 // Set the change flags for scale
1489 if (new_scale != getScale())
1490 {
1491 setChanged(SCALED | SILHOUETTE);
1492 setScale(new_scale); // Must follow setting permYouOwner()
1493 }
1494
1495 } 1499 }
1496 break; 1500 break;
1497 1501
@@ -1763,6 +1767,23 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1763 // 1767 //
1764 // 1768 //
1765 1769
1770 U32 packet_id = mesgsys->getCurrentRecvPacketID();
1771 if (packet_id < mLatestRecvPacketID &&
1772 mLatestRecvPacketID - packet_id < 65536)
1773 {
1774 //skip application of this message, it's old
1775 return retval;
1776 }
1777
1778 mLatestRecvPacketID = packet_id;
1779
1780 // Set the change flags for scale
1781 if (new_scale != getScale())
1782 {
1783 setChanged(SCALED | SILHOUETTE);
1784 setScale(new_scale); // Must follow setting permYouOwner()
1785 }
1786
1766 // first, let's see if the new position is actually a change 1787 // first, let's see if the new position is actually a change
1767 1788
1768 //static S32 counter = 0; 1789 //static S32 counter = 0;
@@ -1790,14 +1811,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
1790 1811
1791 if (new_rot != mLastRot) 1812 if (new_rot != mLastRot)
1792 { 1813 {
1793 // if (getAngularVelocity().isExactlyZero() || 1814 mLastRot = new_rot;
1794 // new_angv != getAngularVelocity()) 1815 setChanged(ROTATED | SILHOUETTE);
1795 { 1816 setRotation(new_rot);
1796 mLastRot = new_rot; 1817 resetRot();
1797 setChanged(ROTATED | SILHOUETTE);
1798 setRotation(new_rot);
1799 resetRot();
1800 }
1801 } 1818 }
1802 1819
1803 1820
@@ -2048,7 +2065,7 @@ BOOL LLViewerObject::setData(const U8 *datap, const U32 data_size)
2048 { 2065 {
2049 return FALSE; 2066 return FALSE;
2050 } 2067 }
2051 memcpy(mData, datap, data_size); 2068 memcpy(mData, datap, data_size); /* Flawfinder: ignore */
2052 } 2069 }
2053 return TRUE; 2070 return TRUE;
2054} 2071}
@@ -2300,7 +2317,7 @@ void LLViewerObject::requestInventory()
2300struct LLFilenameAndTask 2317struct LLFilenameAndTask
2301{ 2318{
2302 LLUUID mTaskID; 2319 LLUUID mTaskID;
2303 char mFilename[MAX_STRING]; // Just the filename, not the path 2320 char mFilename[MAX_STRING]; /* Flawfinder: ignore */ // Just the filename, not the path
2304#ifdef _DEBUG 2321#ifdef _DEBUG
2305 static S32 sCount; 2322 static S32 sCount;
2306 LLFilenameAndTask() 2323 LLFilenameAndTask()
@@ -2331,41 +2348,45 @@ void LLViewerObject::processTaskInv(LLMessageSystem* msg, void** user_data)
2331 LLUUID task_id; 2348 LLUUID task_id;
2332 msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_TaskID, task_id); 2349 msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_TaskID, task_id);
2333 LLViewerObject* object = gObjectList.findObject(task_id); 2350 LLViewerObject* object = gObjectList.findObject(task_id);
2334 if(object) 2351 if(!object)
2352 {
2353 llwarns << "LLViewerObject::processTaskInv object "
2354 << task_id << " does not exist." << llendl;
2355 return;
2356 }
2357
2358 msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum);
2359 LLFilenameAndTask* ft = new LLFilenameAndTask;
2360 ft->mTaskID = task_id;
2361 msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, ft->mFilename);
2362 if(!ft->mFilename[0])
2335 { 2363 {
2336 msg->getS16Fast(_PREHASH_InventoryData, _PREHASH_Serial, object->mInventorySerialNum); 2364 lldebugs << "Task has no inventory" << llendl;
2337 LLFilenameAndTask* ft = new LLFilenameAndTask; 2365 // mock up some inventory to make a drop target.
2338 ft->mTaskID = task_id; 2366 if(object->mInventory)
2339 msg->getStringFast(_PREHASH_InventoryData, _PREHASH_Filename, MAX_STRING, ft->mFilename);
2340 if(!ft->mFilename[0])
2341 { 2367 {
2342 lldebugs << "Task has no inventory" << llendl; 2368 object->mInventory->clear(); // will deref and delete it
2343 // mock up some inventory to make a drop target.
2344 if(object->mInventory)
2345 {
2346 object->mInventory->clear(); // will deref and delete it
2347 }
2348 else
2349 {
2350 object->mInventory = new InventoryObjectList();
2351 }
2352 LLPointer<LLInventoryObject> obj;
2353 obj = new LLInventoryObject(object->mID, LLUUID::null,
2354 LLAssetType::AT_CATEGORY,
2355 "Contents");
2356 object->mInventory->push_front(obj);
2357 object->doInventoryCallback();
2358 delete ft;
2359 return;
2360 } 2369 }
2361 gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename).c_str(), 2370 else
2362 ft->mFilename, LL_PATH_CACHE, 2371 {
2363 object->mRegionp->getHost(), 2372 object->mInventory = new InventoryObjectList();
2364 TRUE, 2373 }
2365 &LLViewerObject::processTaskInvFile, 2374 LLPointer<LLInventoryObject> obj;
2366 (void**)ft, 2375 obj = new LLInventoryObject(object->mID, LLUUID::null,
2367 LLXferManager::HIGH_PRIORITY); 2376 LLAssetType::AT_CATEGORY,
2377 "Contents");
2378 object->mInventory->push_front(obj);
2379 object->doInventoryCallback();
2380 delete ft;
2381 return;
2368 } 2382 }
2383 gXferManager->requestFile(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ft->mFilename).c_str(),
2384 ft->mFilename, LL_PATH_CACHE,
2385 object->mRegionp->getHost(),
2386 TRUE,
2387 &LLViewerObject::processTaskInvFile,
2388 (void**)ft,
2389 LLXferManager::HIGH_PRIORITY);
2369} 2390}
2370 2391
2371void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code) 2392void LLViewerObject::processTaskInvFile(void** user_data, S32 error_code)
@@ -2395,9 +2416,9 @@ void LLViewerObject::loadTaskInvFile(const char* filename)
2395 llifstream ifs(filename_and_local_path.c_str()); 2416 llifstream ifs(filename_and_local_path.c_str());
2396 if(ifs.good()) 2417 if(ifs.good())
2397 { 2418 {
2398 char buffer[MAX_STRING]; 2419 char buffer[MAX_STRING]; /* Flawfinder: ignore */
2399 // *NOTE: This buffer size is hard coded into scanf() below. 2420 // *NOTE: This buffer size is hard coded into scanf() below.
2400 char keyword[MAX_STRING]; 2421 char keyword[MAX_STRING]; /* Flawfinder: ignore */
2401 if(mInventory) 2422 if(mInventory)
2402 { 2423 {
2403 mInventory->clear(); // will deref and delete it 2424 mInventory->clear(); // will deref and delete it
@@ -2409,7 +2430,7 @@ void LLViewerObject::loadTaskInvFile(const char* filename)
2409 while(ifs.good()) 2430 while(ifs.good())
2410 { 2431 {
2411 ifs.getline(buffer, MAX_STRING); 2432 ifs.getline(buffer, MAX_STRING);
2412 sscanf(buffer, " %254s", keyword); 2433 sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */
2413 if(0 == strcmp("inv_item", keyword)) 2434 if(0 == strcmp("inv_item", keyword))
2414 { 2435 {
2415 LLPointer<LLInventoryObject> inv = new LLViewerInventoryItem; 2436 LLPointer<LLInventoryObject> inv = new LLViewerInventoryItem;
@@ -2590,6 +2611,18 @@ LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& ass
2590 return rv; 2611 return rv;
2591} 2612}
2592 2613
2614void LLViewerObject::updateViewerInventoryAsset(
2615 const LLViewerInventoryItem* item,
2616 const LLUUID& new_asset)
2617{
2618 LLPointer<LLViewerInventoryItem> task_item =
2619 new LLViewerInventoryItem(item);
2620 task_item->setAssetUUID(new_asset);
2621
2622 // do the internal logic
2623 doUpdateInventory(task_item, TASK_INVENTORY_ITEM_KEY, false);
2624}
2625
2593void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent) 2626void LLViewerObject::setPixelAreaAndAngle(LLAgent &agent)
2594{ 2627{
2595 if (getVolume()) 2628 if (getVolume())
@@ -2644,6 +2677,11 @@ BOOL LLViewerObject::updateGeometry(LLDrawable *drawable)
2644 return TRUE; 2677 return TRUE;
2645} 2678}
2646 2679
2680void LLViewerObject::updateFaceSize(S32 idx)
2681{
2682
2683}
2684
2647LLDrawable* LLViewerObject::createDrawable(LLPipeline *pipeline) 2685LLDrawable* LLViewerObject::createDrawable(LLPipeline *pipeline)
2648{ 2686{
2649 return NULL; 2687 return NULL;
@@ -2684,13 +2722,23 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped)
2684void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax) 2722void LLViewerObject::updateSpatialExtents(LLVector3& newMin, LLVector3 &newMax)
2685{ 2723{
2686 LLVector3 center = getRenderPosition(); 2724 LLVector3 center = getRenderPosition();
2687 F32 sz = llmin(mDrawable->getRadius(), 256.f); 2725 LLVector3 size = getScale();
2688 LLVector3 size = LLVector3(sz,sz,sz);
2689 newMin.setVec(center-size); 2726 newMin.setVec(center-size);
2690 newMax.setVec(center+size); 2727 newMax.setVec(center+size);
2691 mDrawable->setPositionGroup((newMin + newMax) * 0.5f); 2728 mDrawable->setPositionGroup((newMin + newMax) * 0.5f);
2692} 2729}
2693 2730
2731F32 LLViewerObject::getBinRadius()
2732{
2733 if (mDrawable.notNull())
2734 {
2735 const LLVector3* ext = mDrawable->getSpatialExtents();
2736 return (ext[1]-ext[0]).magVec();
2737 }
2738
2739 return getScale().magVec();
2740}
2741
2694F32 LLViewerObject::getMaxScale() const 2742F32 LLViewerObject::getMaxScale() const
2695{ 2743{
2696 return llmax(getScale().mV[VX],getScale().mV[VY], getScale().mV[VZ]); 2744 return llmax(getScale().mV[VX],getScale().mV[VY], getScale().mV[VZ]);
@@ -3593,11 +3641,6 @@ S32 LLViewerObject::setTETexGen(const U8 te, const U8 texgen)
3593 { 3641 {
3594 retval = LLPrimitive::setTETexGen(te, texgen); 3642 retval = LLPrimitive::setTETexGen(te, texgen);
3595 setChanged(TEXTURE); 3643 setChanged(TEXTURE);
3596 if (mDrawable.notNull() && retval)
3597 {
3598 gPipeline.markTextured(mDrawable);
3599 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
3600 }
3601 } 3644 }
3602 return retval; 3645 return retval;
3603} 3646}
@@ -3614,11 +3657,6 @@ S32 LLViewerObject::setTEShiny(const U8 te, const U8 shiny)
3614 { 3657 {
3615 retval = LLPrimitive::setTEShiny(te, shiny); 3658 retval = LLPrimitive::setTEShiny(te, shiny);
3616 setChanged(TEXTURE); 3659 setChanged(TEXTURE);
3617 if (mDrawable.notNull() && retval)
3618 {
3619 gPipeline.markTextured(mDrawable);
3620 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
3621 }
3622 } 3660 }
3623 return retval; 3661 return retval;
3624} 3662}
@@ -3763,7 +3801,7 @@ LLViewerImage *LLViewerObject::getTEImage(const U8 face) const
3763 } 3801 }
3764 } 3802 }
3765 3803
3766 llerrs << "Requested invalid face!" << llendl; 3804 llerrs << llformat("Requested Image from invalid face: %d/%d",face,getNumTEs()) << llendl;
3767 3805
3768 return NULL; 3806 return NULL;
3769} 3807}
@@ -3857,6 +3895,11 @@ void LLViewerObject::setCanSelect(BOOL canSelect)
3857 3895
3858void LLViewerObject::setDebugText(const std::string &utf8text) 3896void LLViewerObject::setDebugText(const std::string &utf8text)
3859{ 3897{
3898 if (utf8text.empty() && !mText)
3899 {
3900 return;
3901 }
3902
3860 if (!mText) 3903 if (!mText)
3861 { 3904 {
3862 mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT); 3905 mText = (LLHUDText *)LLHUDObject::addHUDObject(LLHUDObject::LL_HUD_TEXT);
@@ -4045,6 +4088,15 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_
4045 } 4088 }
4046} 4089}
4047 4090
4091void LLViewerObject::deleteParticleSource()
4092{
4093 if (mPartSourcep.notNull())
4094 {
4095 mPartSourcep->setDead();
4096 mPartSourcep = NULL;
4097 }
4098}
4099
4048// virtual 4100// virtual
4049void LLViewerObject::updateDrawable(BOOL force_damped) 4101void LLViewerObject::updateDrawable(BOOL force_damped)
4050{ 4102{
@@ -4577,6 +4629,7 @@ void LLViewerObject::markForUpdate(BOOL priority)
4577void LLViewerObject::setRegion(LLViewerRegion *regionp) 4629void LLViewerObject::setRegion(LLViewerRegion *regionp)
4578{ 4630{
4579 llassert(regionp); 4631 llassert(regionp);
4632 mLatestRecvPacketID = 0;
4580 mRegionp = regionp; 4633 mRegionp = regionp;
4581 setChanged(MOVED | SILHOUETTE); 4634 setChanged(MOVED | SILHOUETTE);
4582 updateDrawable(FALSE); 4635 updateDrawable(FALSE);
@@ -4665,3 +4718,30 @@ void LLViewerObject::resetRot()
4665{ 4718{
4666 mRotTime = 0.0f; 4719 mRotTime = 0.0f;
4667} 4720}
4721
4722U32 LLViewerObject::getPartitionType() const
4723{
4724 return LLPipeline::PARTITION_NONE;
4725}
4726
4727BOOL LLAlphaObject::isParticle()
4728{
4729 return FALSE;
4730}
4731
4732F32 LLAlphaObject::getPartSize(S32 idx)
4733{
4734 return 0.f;
4735}
4736
4737// virtual
4738void LLStaticViewerObject::updateDrawable(BOOL force_damped)
4739{
4740 // Force an immediate rebuild on any update
4741 if (mDrawable.notNull())
4742 {
4743 mDrawable->updateXform(TRUE);
4744 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE);
4745 }
4746 clearChanged(SHIFTED);
4747}