Converted frequently occuring setting lookups to LLCachedControl

Added LLObjectList::getAvatar(LLUUID) for type-safe and quicker lookup
Added F32 overload to LLSD because using F64 needlessly is silly.
   (And its lack of F32 overload caused issues with LLCachedControl<F32>)
This commit is contained in:
unknown
2010-10-07 21:36:13 -05:00
parent 49e4959bf5
commit fe9a3d2ba2
41 changed files with 365 additions and 209 deletions

View File

@@ -127,6 +127,7 @@ void LLViewerObjectList::destroy()
mDeadObjects.clear();
mMapObjects.clear();
mUUIDObjectMap.clear();
mUUIDAvatarMap.clear();
}
@@ -727,7 +728,8 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
}
}
if (gSavedSettings.getBOOL("FreezeTime"))
static LLCachedControl<bool> freeze_time("FreezeTime",0);
if (freeze_time)
{
for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin();
iter != idle_list.end(); iter++)
@@ -853,6 +855,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
// Remove from object map so noone can look it up.
mUUIDObjectMap.erase(objectp->mID);
mUUIDAvatarMap.erase(objectp->mID);//No need to be careful here.
//if (objectp->getRegion())
//{
@@ -1364,6 +1367,12 @@ LLViewerObject *LLViewerObjectList::createObjectViewer(const LLPCode pcode, LLVi
}
mUUIDObjectMap[fullid] = objectp;
if(objectp->isAvatar())
{
LLVOAvatar *pAvatar = dynamic_cast<LLVOAvatar*>(objectp);
if(pAvatar)
mUUIDAvatarMap[fullid] = pAvatar;
}
mObjects.put(objectp);
@@ -1398,6 +1407,12 @@ LLViewerObject *LLViewerObjectList::createObject(const LLPCode pcode, LLViewerRe
}
mUUIDObjectMap[fullid] = objectp;
if(objectp->isAvatar())
{
LLVOAvatar *pAvatar = dynamic_cast<LLVOAvatar*>(objectp);
if(pAvatar)
mUUIDAvatarMap[fullid] = pAvatar;
}
setUUIDAndLocal(fullid,
local_id,
gMessageSystem->getSenderIP(),