diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/llmath/llvolumemgr.h | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llmath/llvolumemgr.h | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/linden/indra/llmath/llvolumemgr.h b/linden/indra/llmath/llvolumemgr.h index 889bc56..0a2249e 100644 --- a/linden/indra/llmath/llvolumemgr.h +++ b/linden/indra/llmath/llvolumemgr.h | |||
@@ -43,9 +43,6 @@ class LLVolumeLODGroup; | |||
43 | 43 | ||
44 | class LLVolumeLODGroup : public LLThreadSafeRefCount | 44 | class LLVolumeLODGroup : public LLThreadSafeRefCount |
45 | { | 45 | { |
46 | protected: | ||
47 | ~LLVolumeLODGroup(); | ||
48 | |||
49 | public: | 46 | public: |
50 | enum | 47 | enum |
51 | { | 48 | { |
@@ -60,11 +57,19 @@ public: | |||
60 | static F32 getVolumeScaleFromDetail(const S32 detail); | 57 | static F32 getVolumeScaleFromDetail(const S32 detail); |
61 | 58 | ||
62 | LLVolume *getLOD(const S32 detail); | 59 | LLVolume *getLOD(const S32 detail); |
63 | const LLVolumeParams &getParams() const { return mParams; }; | 60 | const LLVolumeParams& getParams() const { return mParams; }; |
64 | 61 | ||
65 | F32 dump(); | 62 | F32 dump(); |
66 | friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup); | 63 | friend std::ostream& operator<<(std::ostream& s, const LLVolumeLODGroup& volgroup); |
67 | 64 | ||
65 | #ifdef DEBUG_VOLUME | ||
66 | S32 getTotalVolumeRefCount() const; | ||
67 | #endif | ||
68 | |||
69 | protected: | ||
70 | virtual ~LLVolumeLODGroup(); | ||
71 | void destroy(); | ||
72 | |||
68 | protected: | 73 | protected: |
69 | LLVolumeParams mParams; | 74 | LLVolumeParams mParams; |
70 | 75 | ||
@@ -77,30 +82,50 @@ protected: | |||
77 | 82 | ||
78 | class LLVolumeMgr | 83 | class LLVolumeMgr |
79 | { | 84 | { |
80 | public: | 85 | //public: |
81 | static void initClass(); | 86 | // static void initClass(); |
82 | static BOOL cleanupClass(); | 87 | // static BOOL cleanupClass(); |
83 | 88 | ||
84 | public: | 89 | public: |
85 | LLVolumeMgr(); | 90 | LLVolumeMgr(); |
86 | ~LLVolumeMgr(); | 91 | virtual ~LLVolumeMgr(); |
87 | BOOL cleanup(); // Cleanup all volumes being managed, returns TRUE if no dangling references | 92 | BOOL cleanup(); // Cleanup all volumes being managed, returns TRUE if no dangling references |
93 | |||
94 | virtual LLVolumeLODGroup* getGroup( const LLVolumeParams& volume_params ) const; | ||
95 | |||
96 | // whatever calls getVolume() never owns the LLVolume* and | ||
97 | // cannot keep references for long since it may be deleted | ||
98 | // later. For best results hold it in an LLPointer<LLVolume>. | ||
88 | LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail); | 99 | LLVolume *getVolume(const LLVolumeParams &volume_params, const S32 detail); |
100 | |||
89 | void cleanupVolume(LLVolume *volumep); | 101 | void cleanupVolume(LLVolume *volumep); |
90 | 102 | ||
91 | void dump(); | 103 | void dump(); |
104 | |||
105 | // manually call this for mutex magic | ||
106 | void useMutex(); | ||
107 | |||
108 | #ifdef DEBUG_VOLUME | ||
109 | S32 getTotalRefCount() const; | ||
110 | S32 getGroupCount() const; | ||
111 | #endif | ||
92 | friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr); | 112 | friend std::ostream& operator<<(std::ostream& s, const LLVolumeMgr& volume_mgr); |
93 | 113 | ||
94 | protected: | 114 | protected: |
115 | virtual LLVolumeLODGroup* createNewGroup(const LLVolumeParams& volume_params); | ||
116 | |||
117 | protected: | ||
95 | typedef std::map<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> volume_lod_group_map_t; | 118 | typedef std::map<const LLVolumeParams*, LLVolumeLODGroup*, LLVolumeParams::compare> volume_lod_group_map_t; |
96 | typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter; | 119 | typedef volume_lod_group_map_t::const_iterator volume_lod_group_map_iter; |
97 | volume_lod_group_map_t mVolumeLODGroups; | 120 | volume_lod_group_map_t mVolumeLODGroups; |
98 | 121 | ||
99 | LLMutex* mDataMutex; | 122 | LLMutex* mDataMutex; |
100 | 123 | ||
101 | // S32 mNumVolumes; | 124 | // We need to be able to disable threadsafe checks to prevent |
125 | // some unit_tests from blocking on failure | ||
126 | bool mThreadSafe; | ||
102 | }; | 127 | }; |
103 | 128 | ||
104 | extern LLVolumeMgr* gVolumeMgr; | 129 | //extern LLVolumeMgr* gVolumeMgr; |
105 | 130 | ||
106 | #endif // LL_LLVOLUMEMGR_H | 131 | #endif // LL_LLVOLUMEMGR_H |