summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-02-03 12:33:32 -0600
committerDave Parks <davep@lindenlab.com>2010-02-03 12:33:32 -0600
commit8e67ecf3dcd5f168806389a1048b2632582feedb (patch)
treef63793ae6b972f6205b07769dd7abc9c91690d71 /indra/newview/llviewerobjectlist.h
parent5d7c376332b090801b503d8dc154bb67771230d8 (diff)
Optimization pass.
-- Further instrumentation of idle update -- Removed mActiveQ from LLPipeline, instead making calm objects static during LLVOVolume::idleUpdate -- Further instrumentation of flexible object update -- Converted LLDynamicArray and LLMap members of LLViewerObjectList to stl counterparts -- Increased number of update bins in LLViewerObjectList from 16 to 128 (objects will be processed every 128 frames instead of every 16, or ~ 90% fewer objects processed per frame) -- Removed unused "renderObjectsForSelect" code. -- Reenabled LOD updates for objects further than 24m from camera
Diffstat (limited to 'indra/newview/llviewerobjectlist.h')
-rw-r--r--indra/newview/llviewerobjectlist.h31
1 files changed, 17 insertions, 14 deletions
diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h
index ace5c5038e..8d3d2c4b44 100644
--- a/indra/newview/llviewerobjectlist.h
+++ b/indra/newview/llviewerobjectlist.h
@@ -38,8 +38,6 @@
// common includes
#include "llstat.h"
-#include "lldarrayptr.h"
-#include "llmap.h" // *TODO: switch to std::map
#include "llstring.h"
// project includes
@@ -50,7 +48,7 @@ class LLNetMap;
class LLDebugBeacon;
const U32 CLOSE_BIN_SIZE = 10;
-const U32 NUM_BINS = 16;
+const U32 NUM_BINS = 128;
// GL name = position in object list + GL_NAME_INDEX_OFFSET so that
// we can have special numbers like zero.
@@ -111,13 +109,12 @@ public:
void updateAvatarVisibility();
// Selection related stuff
- void renderObjectsForSelect(LLCamera &camera, const LLRect& screen_rect, BOOL pick_parcel_wall = FALSE, BOOL render_transparent = TRUE);
void generatePickList(LLCamera &camera);
void renderPickList(const LLRect& screen_rect, BOOL pick_parcel_wall, BOOL render_transparent);
LLViewerObject *getSelectedObject(const U32 object_id);
- inline S32 getNumObjects() { return mObjects.count(); }
+ inline S32 getNumObjects() { return (S32) mObjects.size(); }
void addToMap(LLViewerObject *objectp);
void removeFromMap(LLViewerObject *objectp);
@@ -131,7 +128,7 @@ public:
S32 findReferences(LLDrawable *drawablep) const; // Find references to drawable in all objects, and return value.
- S32 getOrphanParentCount() const { return mOrphanParents.count(); }
+ S32 getOrphanParentCount() const { return (S32) mOrphanParents.size(); }
S32 getOrphanCount() const { return mNumOrphans; }
void orphanize(LLViewerObject *childp, U32 parent_id, U32 ip, U32 port);
void findOrphans(LLViewerObject* objectp, U32 ip, U32 port);
@@ -179,26 +176,28 @@ public:
S32 mNumUnknownKills;
S32 mNumDeadObjects;
protected:
- LLDynamicArray<U64> mOrphanParents; // LocalID/ip,port of orphaned objects
- LLDynamicArray<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
+ std::vector<U64> mOrphanParents; // LocalID/ip,port of orphaned objects
+ std::vector<OrphanInfo> mOrphanChildren; // UUID's of orphaned objects
S32 mNumOrphans;
- LLDynamicArrayPtr<LLPointer<LLViewerObject>, 256> mObjects;
+ typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
+
+ vobj_list_t mObjects;
std::set<LLPointer<LLViewerObject> > mActiveObjects;
- LLDynamicArrayPtr<LLPointer<LLViewerObject> > mMapObjects;
+ vobj_list_t mMapObjects;
typedef std::map<LLUUID, LLPointer<LLViewerObject> > vo_map;
vo_map mDeadObjects; // Need to keep multiple entries per UUID
std::map<LLUUID, LLPointer<LLViewerObject> > mUUIDObjectMap;
- LLDynamicArray<LLDebugBeacon> mDebugBeacons;
+ std::vector<LLDebugBeacon> mDebugBeacons;
S32 mCurLazyUpdateIndex;
static U32 sSimulatorMachineIndex;
- static LLMap<U64, U32> sIPAndPortToIndex;
+ static std::map<U64, U32> sIPAndPortToIndex;
static std::map<U64, LLUUID> sIndexAndLocalIDToUUID;
@@ -260,12 +259,16 @@ inline LLViewerObject *LLViewerObjectList::getObject(const S32 index)
inline void LLViewerObjectList::addToMap(LLViewerObject *objectp)
{
- mMapObjects.put(objectp);
+ mMapObjects.push_back(objectp);
}
inline void LLViewerObjectList::removeFromMap(LLViewerObject *objectp)
{
- mMapObjects.removeObj(objectp);
+ std::vector<LLPointer<LLViewerObject> >::iterator iter = std::find(mMapObjects.begin(), mMapObjects.end(), objectp);
+ if (iter != mMapObjects.end())
+ {
+ mMapObjects.erase(iter);
+ }
}