- Timestamp:
- 05/28/07 16:30:37 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
r2379 r2397 312 312 OgreTechniqueGroup* group = 0; 313 313 314 bool materialCopied = false; 314 315 for(unsigned int t = 0 ; t < mat->getNumTechniques() ; t++) 315 316 { … … 323 324 if( techniques.size() > 0) 324 325 { 326 bool needMaterialCopy = false; 327 328 std::vector<IllumTechniqueParams*>::iterator it = techniques.begin(); 329 std::vector<IllumTechniqueParams*>::iterator itend = techniques.end(); 330 while(it!=itend) 331 { 332 needMaterialCopy = needMaterialCopy || needMaterialCopyForTechnique(*it); 333 it++; 334 } 335 325 336 if(rend == 0) 326 337 { … … 339 350 sharedruns->updateBounds(); 340 351 } 341 String newMaterialName = mat->getName() + "_clone_" + rend->getName(); 342 Material* newMat = mat->clone(newMaterialName).getPointer(); 343 rend->setMaterialName(newMaterialName); 344 mat = sube->getMaterial().getPointer(); 345 break; 352 353 if(needMaterialCopy) 354 { 355 String newMaterialName = mat->getName() + "_clone_" + rend->getName(); 356 Material* newMat = mat->clone(newMaterialName).getPointer(); 357 rend->setMaterialName(newMaterialName); 358 mat = sube->getMaterial().getPointer(); 359 materialCopied = true; 360 } 361 362 if(materialCopied) 363 break; 346 364 } 347 365 } … … 495 513 } 496 514 } 515 516 bool OgreIlluminationManager::needMaterialCopyForTechnique(IllumTechniqueParams* params) 517 { 518 std::list<RenderTechniqueFactory*>::iterator it = techniqueFactories.begin(); 519 std::list<RenderTechniqueFactory*>::iterator itend = techniqueFactories.end(); 520 521 while(it != itend) 522 { 523 RenderTechniqueFactory* factory = *it; 524 525 if(factory->isType(params->getTypeName())) 526 return factory->needMaterialCopy(params); 527 528 it++; 529 } 530 } 531 497 532 void OgreIlluminationManager::preAllUpdates() 498 533 {
Note: See TracChangeset
for help on using the changeset viewer.