Added new osg::TextureBase, osg::Texture1D, osg::Texture2D, and osg::Texture3D
classes, and changed osg::Texture and osg::TextureCubeMap so that they now derive from osg::TextureBase.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Node>
|
||||
#include <osg/StateSet>
|
||||
#include <osg/TextureBase>
|
||||
#include <osg/Texture>
|
||||
#include <osg/Drawable>
|
||||
#include <osg/Array>
|
||||
@@ -48,26 +49,42 @@ StateAttribute* CopyOp::operator() (const StateAttribute* attr) const
|
||||
{
|
||||
if (attr && _flags&DEEP_COPY_STATEATTRIBUTES)
|
||||
{
|
||||
const Texture* text = dynamic_cast<const Texture*>(attr);
|
||||
if (text)
|
||||
const TextureBase* textbase = dynamic_cast<const TextureBase*>(attr);
|
||||
if (textbase)
|
||||
{
|
||||
return operator()(text);
|
||||
return operator()(textbase);
|
||||
}
|
||||
else
|
||||
{
|
||||
// const Texture* text = dynamic_cast<const Texture*>(attr);
|
||||
// if (text)
|
||||
// {
|
||||
// return operator()(text);
|
||||
// }
|
||||
// else
|
||||
return dynamic_cast<StateAttribute*>(attr->clone(*this));
|
||||
}
|
||||
else
|
||||
return dynamic_cast<StateAttribute*>(attr->clone(*this));
|
||||
}
|
||||
else
|
||||
return const_cast<StateAttribute*>(attr);
|
||||
}
|
||||
|
||||
Texture* CopyOp::operator() (const Texture* text) const
|
||||
TextureBase* CopyOp::operator() (const TextureBase* text) const
|
||||
{
|
||||
if (text && _flags&DEEP_COPY_TEXTURES)
|
||||
return dynamic_cast<Texture*>(text->clone(*this));
|
||||
return dynamic_cast<TextureBase*>(text->clone(*this));
|
||||
else
|
||||
return const_cast<Texture*>(text);
|
||||
return const_cast<TextureBase*>(text);
|
||||
}
|
||||
|
||||
// Texture* CopyOp::operator() (const Texture* text) const
|
||||
// {
|
||||
// if (text && _flags&DEEP_COPY_TEXTURES)
|
||||
// return dynamic_cast<Texture*>(text->clone(*this));
|
||||
// else
|
||||
// return const_cast<Texture*>(text);
|
||||
// }
|
||||
|
||||
Image* CopyOp::operator() (const Image* image) const
|
||||
{
|
||||
if (image && _flags&DEEP_COPY_IMAGES)
|
||||
|
||||
Reference in New Issue
Block a user