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/llprimitive/llprimitive.cpp | |
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 'linden/indra/llprimitive/llprimitive.cpp')
-rw-r--r-- | linden/indra/llprimitive/llprimitive.cpp | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/linden/indra/llprimitive/llprimitive.cpp b/linden/indra/llprimitive/llprimitive.cpp index 91d3c4e..a906926 100644 --- a/linden/indra/llprimitive/llprimitive.cpp +++ b/linden/indra/llprimitive/llprimitive.cpp | |||
@@ -113,9 +113,38 @@ const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = FALSE; | |||
113 | 113 | ||
114 | const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e"; | 114 | const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e"; |
115 | 115 | ||
116 | //static | ||
117 | // LEGACY: by default we use the LLVolumeMgr::gVolumeMgr global | ||
118 | // TODO -- eliminate this global from the codebase! | ||
119 | LLVolumeMgr* LLPrimitive::sVolumeManager = NULL; | ||
120 | |||
121 | // static | ||
122 | void LLPrimitive::setVolumeManager( LLVolumeMgr* volume_manager ) | ||
123 | { | ||
124 | if ( !volume_manager || sVolumeManager ) | ||
125 | { | ||
126 | llerrs << "Unable to set LLPrimitive::sVolumeManager to NULL" << llendl; | ||
127 | } | ||
128 | sVolumeManager = volume_manager; | ||
129 | } | ||
130 | |||
131 | // static | ||
132 | bool LLPrimitive::cleanupVolumeManager() | ||
133 | { | ||
134 | BOOL res = FALSE; | ||
135 | if (sVolumeManager) | ||
136 | { | ||
137 | res = sVolumeManager->cleanup(); | ||
138 | delete sVolumeManager; | ||
139 | sVolumeManager = NULL; | ||
140 | } | ||
141 | return res; | ||
142 | } | ||
143 | |||
116 | 144 | ||
117 | //=============================================================== | 145 | //=============================================================== |
118 | LLPrimitive::LLPrimitive() | 146 | LLPrimitive::LLPrimitive() |
147 | : mMiscFlags(0) | ||
119 | { | 148 | { |
120 | mPrimitiveCode = 0; | 149 | mPrimitiveCode = 0; |
121 | 150 | ||
@@ -149,7 +178,7 @@ LLPrimitive::~LLPrimitive() | |||
149 | // Cleanup handled by volume manager | 178 | // Cleanup handled by volume manager |
150 | if (mVolumep) | 179 | if (mVolumep) |
151 | { | 180 | { |
152 | gVolumeMgr->cleanupVolume(mVolumep); | 181 | sVolumeManager->cleanupVolume(mVolumep); |
153 | } | 182 | } |
154 | mVolumep = NULL; | 183 | mVolumep = NULL; |
155 | } | 184 | } |
@@ -162,7 +191,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) | |||
162 | 191 | ||
163 | if (retval) | 192 | if (retval) |
164 | { | 193 | { |
165 | retval->init(p_code); | 194 | retval->init_primitive(p_code); |
166 | } | 195 | } |
167 | else | 196 | else |
168 | { | 197 | { |
@@ -173,7 +202,7 @@ LLPrimitive *LLPrimitive::createPrimitive(LLPCode p_code) | |||
173 | } | 202 | } |
174 | 203 | ||
175 | //=============================================================== | 204 | //=============================================================== |
176 | void LLPrimitive::init(LLPCode p_code) | 205 | void LLPrimitive::init_primitive(LLPCode p_code) |
177 | { | 206 | { |
178 | if (mNumTEs) | 207 | if (mNumTEs) |
179 | { | 208 | { |
@@ -533,6 +562,8 @@ S32 LLPrimitive::setTEGlow(const U8 te, const F32 glow) | |||
533 | 562 | ||
534 | LLPCode LLPrimitive::legacyToPCode(const U8 legacy) | 563 | LLPCode LLPrimitive::legacyToPCode(const U8 legacy) |
535 | { | 564 | { |
565 | // TODO: Should this default to something valid? | ||
566 | // Maybe volume? | ||
536 | LLPCode pcode = 0; | 567 | LLPCode pcode = 0; |
537 | 568 | ||
538 | switch (legacy) | 569 | switch (legacy) |
@@ -621,7 +652,7 @@ LLPCode LLPrimitive::legacyToPCode(const U8 legacy) | |||
621 | pcode = LL_PCODE_TREE_NEW; | 652 | pcode = LL_PCODE_TREE_NEW; |
622 | break; | 653 | break; |
623 | default: | 654 | default: |
624 | llwarns << "Unknown legacy code " << legacy << "!" << llendl; | 655 | llwarns << "Unknown legacy code " << legacy << " [" << (S32)legacy << "]!" << llendl; |
625 | } | 656 | } |
626 | 657 | ||
627 | return pcode; | 658 | return pcode; |
@@ -904,10 +935,10 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai | |||
904 | } | 935 | } |
905 | } | 936 | } |
906 | 937 | ||
907 | volumep = gVolumeMgr->getVolume(volume_params, detail); | 938 | volumep = sVolumeManager->getVolume(volume_params, detail); |
908 | if (volumep == mVolumep) | 939 | if (volumep == mVolumep) |
909 | { | 940 | { |
910 | gVolumeMgr->cleanupVolume( volumep ); // gVolumeMgr->getVolume() creates a reference, but we don't need a second one. | 941 | sVolumeManager->cleanupVolume( volumep ); // LLVolumeMgr::getVolume() creates a reference, but we don't need a second one. |
911 | return TRUE; | 942 | return TRUE; |
912 | } | 943 | } |
913 | } | 944 | } |
@@ -950,7 +981,7 @@ BOOL LLPrimitive::setVolume(const LLVolumeParams &volume_params, const S32 detai | |||
950 | 981 | ||
951 | 982 | ||
952 | // build the new object | 983 | // build the new object |
953 | gVolumeMgr->cleanupVolume(mVolumep); | 984 | sVolumeManager->cleanupVolume(mVolumep); |
954 | mVolumep = volumep; | 985 | mVolumep = volumep; |
955 | 986 | ||
956 | U32 new_face_mask = mVolumep->mFaceMask; | 987 | U32 new_face_mask = mVolumep->mFaceMask; |