summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerobjectlist.cpp')
-rw-r--r--indra/newview/llviewerobjectlist.cpp80
1 files changed, 39 insertions, 41 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index 49bd5007c4..bfbb701a8e 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -86,7 +86,7 @@
#include <iterator>
extern F32 gMinObjectDistance;
-extern BOOL gAnimateTextures;
+extern bool gAnimateTextures;
#define MAX_CONCURRENT_PHYSICS_REQUESTS 256
@@ -99,8 +99,6 @@ extern LLPipeline gPipeline;
// Statics for object lookup tables.
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
-std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
-std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
LLViewerObjectList::LLViewerObjectList()
{
@@ -109,7 +107,7 @@ LLViewerObjectList::LLViewerObjectList()
mNumDeadObjects = 0;
mNumOrphans = 0;
mNumNewObjects = 0;
- mWasPaused = FALSE;
+ mWasPaused = false;
mNumDeadObjectUpdates = 0;
mNumUnknownUpdates = 0;
}
@@ -138,17 +136,17 @@ void LLViewerObjectList::getUUIDFromLocal(LLUUID &id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
index = sSimulatorMachineIndex++;
- sIPAndPortToIndex[ipport] = index;
+ mIPAndPortToIndex[ipport] = index;
}
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- id = get_if_there(sIndexAndLocalIDToUUID, indexid, LLUUID::null);
+ id = get_if_there(mIndexAndLocalIDToUUID, indexid, LLUUID::null);
}
U64 LLViewerObjectList::getIndex(const U32 local_id,
@@ -157,7 +155,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
@@ -167,7 +165,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
return (((U64)index) << 32) | (U64)local_id;
}
-BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
+bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK;
@@ -177,30 +175,30 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
U32 ip = objectp->getRegion()->getHost().getAddress();
U32 port = objectp->getRegion()->getHost().getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
// LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid);
- if (iter == sIndexAndLocalIDToUUID.end())
+ std::map<U64, LLUUID>::iterator iter = mIndexAndLocalIDToUUID.find(indexid);
+ if (iter == mIndexAndLocalIDToUUID.end())
{
- return FALSE;
+ return false;
}
// Found existing entry
if (iter->second == objectp->getID())
{ // Full UUIDs match, so remove the entry
- sIndexAndLocalIDToUUID.erase(iter);
- return TRUE;
+ mIndexAndLocalIDToUUID.erase(iter);
+ return true;
}
// UUIDs did not match - this would zap a valid entry, so don't erase it
//LL_INFOS() << "Tried to erase entry where id in table ("
// << iter->second << ") did not match object " << object.getID() << LL_ENDL;
}
- return FALSE ;
+ return false ;
}
void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
@@ -210,17 +208,17 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
{
U64 ipport = (((U64)ip) << 32) | (U64)port;
- U32 index = sIPAndPortToIndex[ipport];
+ U32 index = mIPAndPortToIndex[ipport];
if (!index)
{
index = sSimulatorMachineIndex++;
- sIPAndPortToIndex[ipport] = index;
+ mIPAndPortToIndex[ipport] = index;
}
U64 indexid = (((U64)index) << 32) | (U64)local_id;
- sIndexAndLocalIDToUUID[indexid] = id;
+ mIndexAndLocalIDToUUID[indexid] = id;
//LL_INFOS() << "Adding object to table, full ID " << id
// << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
@@ -391,7 +389,7 @@ LLViewerObject* LLViewerObjectList::processObjectUpdateFromCache(LLVOCacheEntry*
else
{
objectp->setLastUpdateType(OUT_FULL_COMPRESSED); //newly cached
- objectp->setLastUpdateCached(TRUE);
+ objectp->setLastUpdateCached(true);
}
LLVOAvatar::cullAvatarsByPixelArea();
@@ -471,7 +469,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
for (i = 0; i < num_objects; i++)
{
- BOOL justCreated = FALSE;
+ bool justCreated = false;
bool update_cache = false; //update object cache if it is a full-update or terse update
if (compressed)
@@ -646,7 +644,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
continue;
}
- justCreated = TRUE;
+ justCreated = true;
mNumNewObjects++;
}
@@ -1318,7 +1316,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
if (objectp->onActiveList())
{
//LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << LL_ENDL;
- objectp->setOnActiveList(FALSE);
+ objectp->setOnActiveList(false);
removeFromActiveList(objectp);
}
@@ -1335,7 +1333,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
}
}
-BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
+bool LLViewerObjectList::killObject(LLViewerObject *objectp)
{
LL_PROFILE_ZONE_SCOPED;
// Don't ever kill gAgentAvatarp, just force it to the agent's region
@@ -1343,7 +1341,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
if ((objectp == gAgentAvatarp) && gAgent.getRegion())
{
objectp->setRegion(gAgent.getRegion());
- return FALSE;
+ return false;
}
// When we're killing objects, all we do is mark them as dead.
@@ -1356,10 +1354,10 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
// so create a pointer to make sure object will stay alive untill markDead() finishes
LLPointer<LLViewerObject> sp(objectp);
sp->markDead(); // does the right thing if object already dead
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLViewerObjectList::killObjects(LLViewerRegion *regionp)
@@ -1379,7 +1377,7 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp)
}
// Have to clean right away because the region is becoming invalid.
- cleanDeadObjects(FALSE);
+ cleanDeadObjects(false);
}
void LLViewerObjectList::killAllObjects()
@@ -1395,7 +1393,7 @@ void LLViewerObjectList::killAllObjects()
llassert((objectp == gAgentAvatarp) || objectp->isDead());
}
- cleanDeadObjects(FALSE);
+ cleanDeadObjects(false);
if(!mObjects.empty())
{
@@ -1416,7 +1414,7 @@ void LLViewerObjectList::killAllObjects()
}
}
-void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
+void LLViewerObjectList::cleanDeadObjects(bool use_timer)
{
if (!mNumDeadObjects)
{
@@ -1480,7 +1478,7 @@ void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
objectp->setListIndex(-1);
- S32 last_index = mActiveObjects.size()-1;
+ S32 last_index = static_cast<S32>(mActiveObjects.size()) - 1;
if (idx != last_index)
{
@@ -1501,7 +1499,7 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
return; // We don't update dead objects!
}
- BOOL active = objectp->isActive();
+ bool active = objectp->isActive();
if (active != objectp->onActiveList())
{
if (active)
@@ -1511,8 +1509,8 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
if (idx <= -1)
{
mActiveObjects.push_back(objectp);
- objectp->setListIndex(mActiveObjects.size()-1);
- objectp->setOnActiveList(TRUE);
+ objectp->setListIndex(static_cast<S32>(mActiveObjects.size()) - 1);
+ objectp->setOnActiveList(true);
}
else
{
@@ -1530,7 +1528,7 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
{
//LL_INFOS() << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << LL_ENDL;
removeFromActiveList(objectp);
- objectp->setOnActiveList(FALSE);
+ objectp->setOnActiveList(false);
}
}
@@ -1804,7 +1802,7 @@ void LLViewerObjectList::renderObjectBounds(const LLVector3 &center)
{
}
-extern BOOL gCubeSnapshot;
+extern bool gCubeSnapshot;
void LLViewerObjectList::addDebugBeacon(const LLVector3 &pos_agent,
const std::string &string,
@@ -1953,7 +1951,7 @@ void LLViewerObjectList::orphanize(LLViewerObject *childp, U32 parent_id, U32 ip
LL_DEBUGS("ORPHANS") << "Orphaning object " << childp->getID() << " with parent " << parent_id << LL_ENDL;
// We're an orphan, flag things appropriately.
- childp->mOrphaned = TRUE;
+ childp->mOrphaned = true;
if (childp->mDrawable.notNull())
{
bool make_invisible = true;
@@ -2026,7 +2024,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
}
U64 parent_info = getIndex(objectp->mLocalID, ip, port);
- BOOL orphans_found = FALSE;
+ bool orphans_found = false;
// Iterate through the orphan list, and set parents of matching children.
for (std::vector<OrphanInfo>::iterator iter = mOrphanChildren.begin(); iter != mOrphanChildren.end(); )
@@ -2058,7 +2056,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
objectp->setChanged(LLXform::MOVED | LLXform::SILHOUETTE);
// Flag the object as no longer orphaned
- childp->mOrphaned = FALSE;
+ childp->mOrphaned = false;
if (childp->mDrawable.notNull())
{
// Make the drawable visible again and set the drawable parent
@@ -2068,10 +2066,10 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port)
}
// Make certain particles, icon and HUD aren't hidden
- childp->hideExtraDisplayItems( FALSE );
+ childp->hideExtraDisplayItems( false );
objectp->addChild(childp);
- orphans_found = TRUE;
+ orphans_found = true;
++iter;
}
else