From acfdcf2b1deeb04698174c78e8cb22b093445bb1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:44 -0500 Subject: Second Life viewer sources 1.20.3 --- linden/indra/llmath/llvolumemgr.h | 46 +++++++++++++-------------------------- 1 file changed, 15 insertions(+), 31 deletions(-) (limited to 'linden/indra/llmath/llvolumemgr.h') diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h index 0a2249e..8f107f6 100644 --- a/linden/indra/llmath/llvolumemgr.h +++ b/linden/indra/llmath/llvolumemgr.h @@ -41,8 +41,10 @@ class LLVolumeParams; class LLVolumeLODGroup; -class LLVolumeLODGroup : public LLThreadSafeRefCount +class LLVolumeLODGroup { + LOG_CLASS(LLVolumeLODGroup); + public: enum { @@ -50,29 +52,25 @@ public: }; LLVolumeLODGroup(const LLVolumeParams ¶ms); + ~LLVolumeLODGroup(); - BOOL derefLOD(LLVolume *volumep); static S32 getDetailFromTan(const F32 tan_angle); static void getDetailProximity(const F32 tan_angle, F32 &to_lower, F32& to_higher); static F32 getVolumeScaleFromDetail(const S32 detail); - LLVolume *getLOD(const S32 detail); - const LLVolumeParams& getParams() const { return mParams; }; + LLVolume* getLODVolume(const S32 detail); + BOOL derefLOD(LLVolume *volumep); + S32 getNumRefs() const { return mRefs; } + + const LLVolumeParams* getVolumeParams() const { return &mVolumeParams; }; F32 dump(); friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup); -#ifdef DEBUG_VOLUME - S32 getTotalVolumeRefCount() const; -#endif - protected: - virtual ~LLVolumeLODGroup(); - void destroy(); - -protected: - LLVolumeParams mParams; + LLVolumeParams mVolumeParams; + S32 mRefs; S32 mLODRefs[NUM_LODS]; LLPointer mVolumeLODs[NUM_LODS]; static F32 mDetailThresholds[NUM_LODS]; @@ -82,10 +80,6 @@ protected: class LLVolumeMgr { -//public: -// static void initClass(); -// static BOOL cleanupClass(); - public: LLVolumeMgr(); virtual ~LLVolumeMgr(); @@ -96,36 +90,26 @@ public: // whatever calls getVolume() never owns the LLVolume* and // cannot keep references for long since it may be deleted // later. For best results hold it in an LLPointer. - LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail); - - void cleanupVolume(LLVolume *volumep); + LLVolume *refVolume(const LLVolumeParams &volume_params, const S32 detail); + void unrefVolume(LLVolume *volumep); void dump(); // manually call this for mutex magic void useMutex(); -#ifdef DEBUG_VOLUME - S32 getTotalRefCount() const; - S32 getGroupCount() const; -#endif friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr); protected: + void insertGroup(LLVolumeLODGroup* volgroup); + // Overridden in llphysics/abstract/utils/llphysicsvolumemanager.h virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params); protected: typedef std::map volume_lod_group_map_t; - typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter; volume_lod_group_map_t mVolumeLODGroups; LLMutex* mDataMutex; - - // We need to be able to disable threadsafe checks to prevent - // some unit_tests from blocking on failure - bool mThreadSafe; }; -//extern LLVolumeMgr* gVolumeMgr; - #endif // LL_LLVOLUMEMGR_H -- cgit v1.1