Changeset 2320 for GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Timestamp:
- 04/05/07 15:38:06 (18 years ago)
- Location:
- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src
- Files:
-
- 17 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 { -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
r2265 r2320 1 1 #include "..\include\OgreSharedRuns.h" 2 2 #include "OgreIlluminationManager.h" 3 4 void OgreSharedRuns::freeAllResources() 5 { 6 if(child1 != 0)//node 7 { 8 child1->freeAllResources(); 9 child2->freeAllResources(); 10 } 11 else //leaf 12 { 13 std::map<RenderingRunType, RenderingRun*>::iterator it = sharedRuns.begin(); 14 std::map<RenderingRunType, RenderingRun*>::iterator itend = sharedRuns.end(); 15 while(it != itend) 16 { 17 RenderingRun* rr = (*it).second; 18 rr->freeAllResources(); 19 // sharedRuns.erase(it); 20 delete rr->asOgreRenderingRun(); 21 ++it; 22 } 23 sharedRuns.clear(); 24 } 25 } 3 26 4 27 void OgreSharedRuns::runChanged(RenderingRunType runType, RenderingRun* run) -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreTechniqueGroup.cpp
r790 r2320 1 1 #include "OgreTechniqueGroup.h" 2 2 3 4 OgreTechniqueGroup::~OgreTechniqueGroup() 5 { 6 std::vector<OgreRenderTechnique*>::iterator it = renderTechniques.begin(); 7 std::vector<OgreRenderTechnique*>::iterator itend = renderTechniques.end(); 8 while(it != itend) 9 { 10 OgreRenderTechnique* rt = *it; 11 delete rt; 12 it++; 13 } 14 renderTechniques.clear(); 15 } 3 16 4 17 void OgreTechniqueGroup::addRenderTechnique(RenderTechnique* technique) -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
r2265 r2320 56 56 OgreCausticCasterRenderTechnique::~OgreCausticCasterRenderTechnique() 57 57 { 58 58 MaterialManager::getSingleton().remove(causticMapMaterialName); 59 59 } 60 60 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreFireRenderTechnique.cpp
r1055 r2320 68 68 mrt->update(); 69 69 sm->setFindVisibleObjects(true); 70 } 71 72 FireRenderTarget::~FireRenderTarget() 73 { 74 TextureManager::getSingleton().remove("ILLUM_FIRE_COLOR_TEXTURE"); 75 TextureManager::getSingleton().remove("ILLUM_FIRE_HEAT_TEXTURE"); 70 76 } 71 77 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCausticCubeMapRenderingRun.cpp
r1688 r2320 97 97 return true; 98 98 } 99 100 void OgreCausticCubeMapRenderingRun::freeAllResources() 101 { 102 TextureManager::getSingleton().remove(name); 103 TextureManager::getSingleton().remove(name + "_BLURED"); 104 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 105 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_BLURED" + "_CAMERA"); 106 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp
r2192 r2320 132 132 } 133 133 134 void OgreChildPSystemRenderingRun::freeAllResources() 135 { 136 TextureManager::getSingleton().remove(name); 137 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 138 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp
r2265 r2320 243 243 return true; 244 244 } 245 246 void OgreCubeMapRenderingRun::freeAllResources() 247 { 248 TextureManager::getSingleton().remove(name); 249 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 250 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
r2297 r2320 391 391 } 392 392 393 void OgreDepthShadowMapRenderingRun::freeAllResources() 394 { 395 TextureManager::getSingleton().remove(name); 396 TextureManager::getSingleton().remove(blurredname); 397 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 398 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreFocusingMapRenderingRun.cpp
r2265 r2320 124 124 } 125 125 126 void OgreFocusingMapRenderingRun::freeAllResources() 127 { 128 TextureManager::getSingleton().remove(name); 129 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 130 } 126 131 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp
r1987 r2320 255 255 } 256 256 257 void OgreLightVolumeRenderingRun::freeAllResources() 258 { 259 TextureManager::getSingleton().remove(name); 260 TextureManager::getSingleton().remove(name + "NoBlur"); 261 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 262 } 263 257 264 258 265 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMEntryPointMapRenderingRun.cpp
r2200 r2320 86 86 } 87 87 88 void OgrePMEntryPointMapRenderingRun::freeAllResources() 89 { 90 TextureManager::getSingleton().remove(name); 91 TextureManager::getSingleton().remove(name + "_CL"); 92 } 88 93 94 95 -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp
r2249 r2320 170 170 } 171 171 172 void OgrePMWeightComputeRenderingRun::freeAllResources() 173 { 174 TextureManager::getSingleton().remove(name); 175 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 172 176 177 TextureManager::getSingleton().remove(name + "_ALL"); 178 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_ALL" + "_CAMERA"); 179 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhaseTextureRenderingRun.cpp
r1425 r2320 46 46 renderFullscreenQuad(materialName, rt); 47 47 } 48 49 void OgrePhaseTextureRenderingRun::freeAllResources() 50 { 51 TextureManager::getSingleton().remove(name); 52 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 53 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
r1722 r2320 152 152 fpParams->setNamedConstant("lastCenter",center); 153 153 } 154 154 155 void OgrePhotonMapRenderingRun::freeAllResources() 156 { 157 TextureManager::getSingleton().remove(name); 158 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 159 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreReducedCubeMapRenderingRun.cpp
r2055 r2320 105 105 106 106 } 107 108 void OgreReducedCubeMapRenderingRun::freeAllResources() 109 { 110 TextureManager::getSingleton().remove(name); 111 Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA"); 112 } -
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
r2302 r2320 65 65 } 66 66 67 void OgreSceneCameraDepthRenderingRun::freeAllResources() 68 { 69 TextureManager::getSingleton().remove(name); 70 }
Note: See TracChangeset
for help on using the changeset viewer.