Changeset 10606 for OpenSceneGraph/trunk/src/osg/Texture.cpp
- Timestamp:
- 10/06/09 15:42:12 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osg/Texture.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osg/Texture.cpp
r10601 r10606 91 91 if (_set) 92 92 { 93 // remove self from original set 94 _set->remove(this); 95 96 // get the new set for the new profile 97 _set = _set->getParent()->getTextureObjectSet(_profile); 98 99 // register self with new set. 100 _set->addToBack(this); 93 _set->moveToSet(this, _set->getParent()->getTextureObjectSet(_profile)); 101 94 } 102 95 } … … 384 377 addToBack(to.get()); 385 378 386 //osg::notify(osg::NOTICE)<<"Reusing orhpahned TextureObject, _numOfTextureObjects="<<_numOfTextureObjects<<std::endl;379 osg::notify(osg::NOTICE)<<"Reusing orhpahned TextureObject, _numOfTextureObjects="<<_numOfTextureObjects<<std::endl; 387 380 388 381 return to.release(); … … 423 416 { 424 417 original_texture->setTextureObject(_contextID,0); 425 //osg::notify(osg::NOTICE)<<"TextureObjectSet="<<this<<": Reusing an active TextureObject "<<to.get()<<" _numOfTextureObjects="<<_numOfTextureObjects<<" width="<<_profile._width<<" height="<<_profile._height<<std::endl;418 osg::notify(osg::NOTICE)<<"TextureObjectSet="<<this<<": Reusing an active TextureObject "<<to.get()<<" _numOfTextureObjects="<<_numOfTextureObjects<<" width="<<_profile._width<<" height="<<_profile._height<<std::endl; 426 419 } 427 420 else 428 421 { 429 //osg::notify(osg::NOTICE)<<"Reusing a recently orphaned active TextureObject "<<to.get()<<std::endl;422 osg::notify(osg::NOTICE)<<"Reusing a recently orphaned active TextureObject "<<to.get()<<std::endl; 430 423 } 431 424 … … 454 447 addToBack(to); 455 448 456 //osg::notify(osg::NOTICE)<<"Created new TextureObject, _numOfTextureObjects "<<_numOfTextureObjects<<std::endl;449 osg::notify(osg::NOTICE)<<"Created new TextureObject, _numOfTextureObjects "<<_numOfTextureObjects<<std::endl; 457 450 458 451 return to; … … 601 594 to->_next = 0; 602 595 to->_previous = 0; 596 } 597 598 void Texture::TextureObjectSet::moveToSet(TextureObject* to, TextureObjectSet* set) 599 { 600 if (set==this) return; 601 if (!set) return; 602 603 // remove 'to' from original set 604 --_numOfTextureObjects; 605 remove(to); 606 607 // register 'to' with new set. 608 to->_set = set; 609 ++set->_numOfTextureObjects; 610 set->addToBack(to); 603 611 } 604 612
