Fixed the PagedLOD::removeExpiredChildren() so it only removes the high

res child that has expired and no more.
This commit is contained in:
Robert Osfield
2004-02-01 16:13:07 +00:00
parent 9f81630453
commit 24b710986f

View File

@@ -205,14 +205,11 @@ bool PagedLOD::removeChild( Node *child )
void PagedLOD::removeExpiredChildren(double expiryTime,NodeList& removedChildren)
{
for(unsigned int i=_children.size();i>_numChildrenThatCannotBeExpired;)
if (_children.size()>_numChildrenThatCannotBeExpired)
{
--i;
if (!_perRangeDataList[i]._filename.empty() && _perRangeDataList[i]._timeStamp<expiryTime)
if (!_perRangeDataList[_children.size()-1]._filename.empty() && _perRangeDataList[_children.size()-1]._timeStamp<expiryTime)
{
//std::cout<<"Removing child "<<_children[i].get()<<std::endl;
removedChildren.push_back(_children[i]);
Group::removeChild(_children[i].get());
Group::removeChild(_children[_children.size()-1].get());
}
}
}