From Csaba Halasz, "here is another division by zero fix, this should be simpler ;)

It caused problem if the stats display was popped up before the pager
had anything to do."
This commit is contained in:
Robert Osfield 2009-03-23 15:47:01 +00:00
parent 00ee3b0a20
commit 988c69bba3

View File

@ -328,7 +328,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
double getMaximumTimeToMergeTile() const { return _maximumTimeToMergeTile; }
/** Get the average time between the first request for a tile to be loaded and the time of its merge into the main scene graph.*/
double getAverageTimeToMergeTiles() const { return _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges); }
double getAverageTimeToMergeTiles() const { return (_numTilesMerges > 0) ? _totalTimeToMergeTiles/static_cast<double>(_numTilesMerges) : 0; }
/** Reset the Stats variables.*/
void resetStats();