Refinements to SwitchLayer and WhiteListTileLoadedCallback

This commit is contained in:
Robert Osfield 2008-09-11 14:28:42 +00:00
parent 2be243deda
commit e1930d127e
3 changed files with 6 additions and 5 deletions

View File

@ -429,9 +429,9 @@ class OSGTERRAIN_EXPORT CompositeLayer : public Layer
std::string getCompoundName(unsigned int i) const;
void setLayer(unsigned int i, Layer* layer) { _layers[i].layer = layer; }
Layer* getLayer(unsigned int i) { return _layers[i].layer.get(); }
const Layer* getLayer(unsigned int i) const { return _layers[i].layer.get(); }
void setLayer(unsigned int i, Layer* layer) { if (i>=_layers.size()) _layers.resize(i+1); _layers[i].layer = layer; }
Layer* getLayer(unsigned int i) { return i<_layers.size() ? _layers[i].layer.get() : 0; }
const Layer* getLayer(unsigned int i) const { return i<_layers.size() ? _layers[i].layer.get() : 0; }
void addLayer(const std::string& compoundname);
void addLayer(const std::string& setname, const std::string& filename);

View File

@ -643,6 +643,6 @@ SwitchLayer::SwitchLayer():
SwitchLayer::SwitchLayer(const SwitchLayer& switchLayer,const osg::CopyOp& copyop):
CompositeLayer(switchLayer,copyop),
_activeLayer(-1)
_activeLayer(switchLayer._activeLayer)
{
}

View File

@ -220,6 +220,7 @@ osg::BoundingSphere TerrainTile::computeBound() const
return bs;
}
/////////////////////////////////////////////////////////////////////////////////
//
// WhiteListTileLoadedCallback
@ -227,7 +228,7 @@ osg::BoundingSphere TerrainTile::computeBound() const
WhiteListTileLoadedCallback::WhiteListTileLoadedCallback()
{
_minumumNumberOfLayers = 0;
_replaceSwitchLayer = true;
_replaceSwitchLayer = false;
_allowAll = false;
}