Fixes to the Impostor implementation.

This commit is contained in:
Robert Osfield
2003-04-09 21:53:09 +00:00
parent 3dc180f3fd
commit 2166f9b701
4 changed files with 31 additions and 7 deletions

View File

@@ -163,6 +163,8 @@ ImpostorSpriteManager::ImpostorSpriteManager():
_alphafunc = new osg::AlphaFunc;
_alphafunc->setFunction( AlphaFunc::GREATER, 0.000f );
_reuseStateSetIndex = 0;
}
@@ -305,3 +307,18 @@ ImpostorSprite* ImpostorSpriteManager::createOrReuseImpostorSprite(int s,int t,i
}
StateSet* ImpostorSpriteManager::createOrReuseStateSet()
{
if (_reuseStateSetIndex<_stateSetList.size())
{
return _stateSetList[_reuseStateSetIndex++].get();
}
_stateSetList.push_back(new StateSet);
_reuseStateSetIndex=_stateSetList.size();
return _stateSetList.back().get();
}
void ImpostorSpriteManager::reset()
{
_reuseStateSetIndex = 0;
}