diff options
author | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:44 -0500 |
commit | acfdcf2b1deeb04698174c78e8cb22b093445bb1 (patch) | |
tree | 811293650bcf81d01ea7c54d7c2cf263110aa329 /linden/indra/llprimitive/llprimitive.cpp | |
parent | Second Life viewer sources 1.20.2 (diff) | |
download | meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.zip meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.gz meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.bz2 meta-impy-acfdcf2b1deeb04698174c78e8cb22b093445bb1.tar.xz |
Second Life viewer sources 1.20.3
Diffstat (limited to 'linden/indra/llprimitive/llprimitive.cpp')
-rw-r--r-- | linden/indra/llprimitive/llprimitive.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index a906926..3ddf92e 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "linden_common.h" | 32 | #include "linden_common.h" |
33 | 33 | ||
34 | #include "material_codes.h" | 34 | #include "material_codes.h" |
35 | #include "llmemtype.h" | ||
35 | #include "llerror.h" | 36 | #include "llerror.h" |
36 | #include "message.h" | 37 | #include "message.h" |
37 | #include "llprimitive.h" | 38 | #include "llprimitive.h" |
@@ -178,7 +179,7 @@ LLPrimitive::~LLPrimitive() | |||
178 | // Cleanup handled by volume manager | 179 | // Cleanup handled by volume manager |
179 | if (mVolumep) | 180 | if (mVolumep) |
180 | { | 181 | { |
181 | sVolumeManager->cleanupVolume(mVolumep); | 182 | sVolumeManager->unrefVolume(mVolumep); |
182 | } | 183 | } |
183 | mVolumep = NULL; | 184 | mVolumep = NULL; |
184 | } | 185 | } |
@@ -187,6 +188,7 @@ LLPrimitive::~LLPrimitive() | |||
187 | // static | 188 | // static |
188 | LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) | 189 | LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) |
189 | { | 190 | { |
191 | LLMemType m1(LLMemType::MTYPE_PRIMITIVE); | ||
190 | LLPrimitive *retval = new LLPrimitive(); | 192 | LLPrimitive *retval = new LLPrimitive(); |
191 | 193 | ||
192 | if (retval) | 194 | if (retval) |
@@ -204,6 +206,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) | |||
204 | //=============================================================== | 206 | //=============================================================== |
205 | void LLPrimitive::init_primitive(LLPCode p_code) | 207 | void LLPrimitive::init_primitive(LLPCode p_code) |
206 | { | 208 | { |
209 | LLMemType m1(LLMemType::MTYPE_PRIMITIVE); | ||
207 | if (mNumTEs) | 210 | if (mNumTEs) |
208 | { | 211 | { |
209 | if (mTextureList) | 212 | if (mTextureList) |
@@ -246,6 +249,7 @@ void LLPrimitive::setNumTEs(const U8 num_tes) | |||
246 | // Right now, we don't try and preserve entries when the number of faces | 249 | // Right now, we don't try and preserve entries when the number of faces |
247 | // changes. | 250 | // changes. |
248 | 251 | ||
252 | LLMemType m1(LLMemType::MTYPE_PRIMITIVE); | ||
249 | if (num_tes) | 253 | if (num_tes) |
250 | { | 254 | { |
251 | LLTextureEntry *new_tes; | 255 | LLTextureEntry *new_tes; |
@@ -914,6 +918,7 @@ S32 face_index_from_id(LLFaceID face_ID, const std::vector<LLProfile::Face>& fac | |||
914 | 918 | ||
915 | BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) | 919 | BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume) |
916 | { | 920 | { |
921 | LLMemType m1(LLMemType::MTYPE_VOLUME); | ||
917 | LLVolume *volumep; | 922 | LLVolume *volumep; |
918 | if (unique_volume) | 923 | if (unique_volume) |
919 | { | 924 | { |
@@ -935,10 +940,10 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai | |||
935 | } | 940 | } |
936 | } | 941 | } |
937 | 942 | ||
938 | volumep = sVolumeManager->getVolume(volume_params, detail); | 943 | volumep = sVolumeManager->refVolume(volume_params, detail); |
939 | if (volumep == mVolumep) | 944 | if (volumep == mVolumep) |
940 | { | 945 | { |
941 | sVolumeManager->cleanupVolume( volumep ); // LLVolumeMgr::getVolume() creates a reference, but we don't need a second one. | 946 | sVolumeManager->unrefVolume( volumep ); // LLVolumeMgr::refVolume() creates a reference, but we don't need a second one. |
942 | return TRUE; | 947 | return TRUE; |
943 | } | 948 | } |
944 | } | 949 | } |
@@ -981,7 +986,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai | |||
981 | 986 | ||
982 | 987 | ||
983 | // build the new object | 988 | // build the new object |
984 | sVolumeManager->cleanupVolume(mVolumep); | 989 | sVolumeManager->unrefVolume(mVolumep); |
985 | mVolumep = volumep; | 990 | mVolumep = volumep; |
986 | 991 | ||
987 | U32 new_face_mask = mVolumep->mFaceMask; | 992 | U32 new_face_mask = mVolumep->mFaceMask; |