- Timestamp:
- 04/05/07 15:38:06 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r2285 r2320 181 181 } 182 182 183 void OgreIlluminationManager::freeAllResources() 184 { 185 std::list<SharedRuns*>::iterator srit = this->sharedRunRoots.begin(); 186 std::list<SharedRuns*>::iterator sritend = this->sharedRunRoots.end(); 187 while(srit != sritend) 188 { 189 (*srit)->freeAllResources(); 190 srit++; 191 } 192 sharedRunRoots.clear(); 193 194 this->sharedRunRoots.clear(); 195 196 this->globalSharedRuns.freeAllResources(); 197 198 std::map<String, OgreSharedRuns*>::iterator lrit = this->perLightRuns.begin(); 199 std::map<String, OgreSharedRuns*>::iterator lritend = this->perLightRuns.end(); 200 201 while(lrit != lritend) 202 { 203 OgreSharedRuns* lightRuns = ((*lrit).second); 204 perLightRuns.erase(lrit); 205 lightRuns->freeAllResources(); 206 delete lightRuns; 207 lrit++; 208 } 209 perLightRuns.clear(); 210 211 std::map<enum GlobalTargetType, GlobalUseRenderTarget*>::iterator grtit = this->globalTargets.begin(); 212 std::map<enum GlobalTargetType, GlobalUseRenderTarget*>::iterator grtitend = this->globalTargets.end(); 213 while(grtit != grtitend) 214 { 215 GlobalUseRenderTarget* rt = (*grtit).second; 216 globalTargets.erase(grtit); 217 delete rt; 218 grtit++; 219 } 220 221 this->pathMapClusters.clear(); 222 this->pathMapEntryPoints.clear(); 223 224 //delete rendertechniquegroups and cloned materials 225 SceneManager::MovableObjectIterator it = Root::getSingleton()._getCurrentSceneManager() 226 ->getMovableObjectIterator("Entity"); 227 while(it.hasMoreElements()) 228 { 229 MovableObject* o = it.getNext(); 230 Entity* e = (Entity*) o; 231 232 if( e->getParentSceneNode() == 0 )//Entity not attached 233 break; 234 235 for(unsigned int s = 0; s < e->getNumSubEntities(); s++) 236 { 237 SubEntity* sube = e->getSubEntity(s); 238 239 Material* mat = sube->getMaterial().getPointer(); 240 241 for(unsigned int t = 0 ; t < mat->getNumTechniques() ; t++) 242 { 243 Technique* tech = mat->getTechnique(t); 244 245 for(unsigned int p = 0; p< tech->getNumPasses(); p++) 246 { 247 Pass* pass = tech->getPass(p); 248 249 std::vector<IllumTechniqueParams*>& techniques = pass->getIllumTechniques(); 250 if( techniques.size() > 0) 251 { 252 OgreTechniqueGroup* tg = (OgreTechniqueGroup*) sube->getRenderTechniqueGroup(); 253 delete tg; 254 sube->setRenderTechniqueGroup(0); 255 } 256 } 257 } 258 259 MaterialManager::getSingleton().remove(mat->getName()); 260 } 261 } 262 263 264 265 266 } 267 183 268 void OgreIlluminationManager::initTechniques(Entity* e) 184 269 {
Note: See TracChangeset
for help on using the changeset viewer.