Converted the instance of osgNew and osgDelete back to new and delete as part

of depecating the include/osg/MemoryManager
This commit is contained in:
Robert Osfield
2002-12-16 13:40:58 +00:00
parent de9b0b336a
commit 00cc3a1833
186 changed files with 812 additions and 809 deletions

View File

@@ -103,8 +103,8 @@ class TemplateArray : public Array, public std::vector<T>
Array(ARRAYTYPE,DataSize,DataType),
std::vector<T>(first,last) {}
virtual Object* cloneType() const { return osgNew TemplateArray(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew TemplateArray(*this,copyop); }
virtual Object* cloneType() const { return new TemplateArray(); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateArray(*this,copyop); }
virtual void accept(ArrayVisitor& av) { av.apply(*this); }
virtual void accept(ConstArrayVisitor& av) const { av.apply(*this); }
@@ -164,8 +164,8 @@ class TemplateIndexArray : public IndexArray, public std::vector<T>
IndexArray(ARRAYTYPE,DataSize,DataType),
std::vector<T>(first,last) {}
virtual Object* cloneType() const { return osgNew TemplateIndexArray(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew TemplateIndexArray(*this,copyop); }
virtual Object* cloneType() const { return new TemplateIndexArray(); }
virtual Object* clone(const CopyOp& copyop) const { return new TemplateIndexArray(*this,copyop); }
virtual void accept(ArrayVisitor& av) { av.apply(*this); }
virtual void accept(ConstArrayVisitor& av) const { av.apply(*this); }

View File

@@ -22,7 +22,7 @@ class SG_EXPORT CollectOccludersVisitor : public osg::NodeVisitor, public osg::C
CollectOccludersVisitor();
virtual ~CollectOccludersVisitor();
virtual CollectOccludersVisitor* cloneType() const { return osgNew CollectOccludersVisitor(); }
virtual CollectOccludersVisitor* cloneType() const { return new CollectOccludersVisitor(); }
virtual void reset();

View File

@@ -290,7 +290,7 @@ inline Matrix* CullStack::createOrReuseMatrix(const osg::Matrix& value)
}
// otherwise need to create new matrix.
osg::Matrix* matrix = osgNew Matrix(value);
osg::Matrix* matrix = new Matrix(value);
_reuseMatrixList.push_back(matrix);
++_currentReuseMatrixIndex;
return matrix;

View File

@@ -22,9 +22,9 @@ class SG_EXPORT DrawPixels : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
DrawPixels(const DrawPixels& drawimage,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew DrawPixels(); }
virtual Object* cloneType() const { return new DrawPixels(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawPixels(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawPixels(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawPixels*>(obj)!=NULL; }

View File

@@ -39,19 +39,20 @@
/* Define NULL pointer value */
#ifndef NULL
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void *)0)
#endif
#endif
//#include <osg/MemoryManager>
//#include <new>
//#include <stdlib.h>
#define osgNew new
#define osgDelete delete
#define osgFree free
#define osgMalloc malloc
#ifdef USE_DEPRECATED_API
#define osgNew new
#define osgDelete delete
#define osgFree free
#define osgMalloc malloc
#endif
#endif

View File

@@ -159,9 +159,9 @@ class SG_EXPORT GeoSet : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
GeoSet(const GeoSet& geoset,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew GeoSet(); }
virtual Object* cloneType() const { return new GeoSet(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew GeoSet(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new GeoSet(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const GeoSet*>(obj)!=NULL; }

View File

@@ -24,8 +24,8 @@ class SG_EXPORT Geometry : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Geometry(const Geometry& geometry,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew Geometry(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew Geometry(*this,copyop); }
virtual Object* cloneType() const { return new Geometry(); }
virtual Object* clone(const CopyOp& copyop) const { return new Geometry(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Geometry*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Geometry"; }

View File

@@ -44,8 +44,8 @@ class SG_EXPORT Image : public Object
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
Image(const Image& image,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew Image(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew Image(*this,copyop); }
virtual Object* cloneType() const { return new Image(); }
virtual Object* clone(const CopyOp& copyop) const { return new Image(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Image*>(obj)!=0; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Image"; }

View File

@@ -31,11 +31,11 @@ class SG_EXPORT ImpostorSprite : public Drawable
ImpostorSprite();
/** Clone an object of the same type as an ImpostorSprite.*/
virtual Object* cloneType() const { return osgNew ImpostorSprite(); }
virtual Object* cloneType() const { return new ImpostorSprite(); }
/** Clone on ImpostorSprite just returns a clone of type,
* since it is not appropriate to share data of an ImpostorSprite.*/
virtual Object* clone(const CopyOp&) const { return osgNew ImpostorSprite(); }
virtual Object* clone(const CopyOp&) const { return new ImpostorSprite(); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ImpostorSprite*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "ImpostorSprite"; }

View File

@@ -31,8 +31,8 @@ class SG_EXPORT Matrix : public Object
float a20, float a21, float a22, float a23,
float a30, float a31, float a32, float a33);
virtual Object* cloneType() const { return osgNew Matrix(); } \
virtual Object* clone(const CopyOp&) const { return osgNew Matrix(*this); } \
virtual Object* cloneType() const { return new Matrix(); } \
virtual Object* clone(const CopyOp&) const { return new Matrix(*this); } \
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Matrix*>(obj)!=NULL; } \
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Matrix"; }

View File

@@ -129,8 +129,8 @@ extern SG_EXPORT sMStats m_getMemoryStatistics();
// ---------------------------------------------------------------------------------------------------------------------------------
#define osgNew (m_setOwner (__FILE__,__LINE__),false) ? NULL : new
#define osgDelete (m_setOwner (__FILE__,__LINE__),false) ? m_setOwner("",0) : delete
#define new (m_setOwner (__FILE__,__LINE__),false) ? NULL : new
#define delete (m_setOwner (__FILE__,__LINE__),false) ? m_setOwner("",0) : delete
#define osgMalloc(sz) m_allocator (__FILE__,__LINE__,m_alloc_malloc,sz)
#define osgCalloc(sz) m_allocator (__FILE__,__LINE__,m_alloc_calloc,sz)
#define osgRealloc(ptr,sz) m_reallocator(__FILE__,__LINE__,m_alloc_realloc,sz,ptr)
@@ -138,8 +138,8 @@ extern SG_EXPORT sMStats m_getMemoryStatistics();
#else // OSG_USE_MEMORY_MANAGER
#define osgNew new
#define osgDelete delete
#define new new
#define delete delete
#define osgMalloc(sz) malloc(sz)
#define osgCalloc(sz) calloc(sz)
#define osgRealloc(ptr,sz) realloc(ptr,sz)

View File

@@ -1,6 +1,17 @@
//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield
//Distributed under the terms of the GNU Library General Public License (LGPL)
//as published by the Free Software Foundation.
//C++ header - OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
//
// This file may be distributed and/or modified under the terms of the
// GNU Lesser General Public License (LGPL) version 2.1 as published
// by the Free Software Foundation appearing in the file COPYING included in
// this distribution.
//
// Licensees holding valid OpenSceneGraph Professional Licenses (OSGPL) may use
// this file in accordance with the OpenSceneGraph Professional License
// Agreement provided to you by OpenSceneGraph Professional Services.
//
// See http::/www.openscenegraph.org/licensing.html for details on and pricing
// of the OpenSceneGraph Professional license.
#ifndef OSG_NODE
#define OSG_NODE 1
@@ -23,8 +34,8 @@ class Transform;
* and accept methods. Use when subclassing from Node to make it
* more convinient to define the required pure virtual methods.*/
#define META_Node(library,name) \
virtual osg::Object* cloneType() const { return osgNew name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual osg::Object* cloneType() const { return new name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* className() const { return #name; } \
virtual const char* libraryName() const { return #library; } \
@@ -47,10 +58,10 @@ class SG_EXPORT Node : public Object
Node(const Node&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
/** clone the an object of the same type as the node.*/
virtual Object* cloneType() const { return osgNew Node(); }
virtual Object* cloneType() const { return new Node(); }
/** return a clone of a node, with Object* return type.*/
virtual Object* clone(const CopyOp& copyop) const { return osgNew Node(*this,copyop); }
virtual Object* clone(const CopyOp& copyop) const { return new Node(*this,copyop); }
/** return true if this and obj are of the same kind of object.*/
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Node*>(obj)!=NULL; }

View File

@@ -17,7 +17,7 @@ namespace osg {
* which are required for all Object subclasses.*/
#define META_Object(library,name) \
virtual osg::Object* cloneType() const { return new name (); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; }\
virtual const char* className() const { return #name; }

View File

@@ -172,8 +172,8 @@ class SG_EXPORT DrawArrays : public PrimitiveSet
_first(da._first),
_count(da._count) {}
virtual Object* cloneType() const { return osgNew DrawArrays(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawArrays(*this,copyop); }
virtual Object* cloneType() const { return new DrawArrays(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawArrays(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawArrays*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawArrays"; }
@@ -235,8 +235,8 @@ class SG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorSizei
VectorSizei(firstItr,lastItr),
_first(first) {}
virtual Object* cloneType() const { return osgNew DrawArrayLengths(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawArrayLengths(*this,copyop); }
virtual Object* cloneType() const { return new DrawArrayLengths(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawArrayLengths(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawArrayLengths*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawArrayLengths"; }
@@ -300,8 +300,8 @@ class SG_EXPORT DrawElementsUByte : public PrimitiveSet, public VectorUByte
PrimitiveSet(DrawElementsUBytePrimitiveType,mode),
VectorUByte(first,last) {}
virtual Object* cloneType() const { return osgNew DrawElementsUByte(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUByte(*this,copyop); }
virtual Object* cloneType() const { return new DrawElementsUByte(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUByte(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUByte*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawElementsUByte"; }
@@ -340,8 +340,8 @@ class SG_EXPORT DrawElementsUShort : public PrimitiveSet, public VectorUShort
PrimitiveSet(DrawElementsUShortPrimitiveType,mode),
VectorUShort(first,last) {}
virtual Object* cloneType() const { return osgNew DrawElementsUShort(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUShort(*this,copyop); }
virtual Object* cloneType() const { return new DrawElementsUShort(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUShort(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUShort*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawElementsUShort"; }
@@ -379,8 +379,8 @@ class SG_EXPORT DrawElementsUInt : public PrimitiveSet, public VectorUInt
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
VectorUInt(first,last) {}
virtual Object* cloneType() const { return osgNew DrawElementsUInt(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew DrawElementsUInt(*this,copyop); }
virtual Object* cloneType() const { return new DrawElementsUInt(); }
virtual Object* clone(const CopyOp& copyop) const { return new DrawElementsUInt(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const DrawElementsUInt*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "DrawElementsUInt"; }

View File

@@ -24,8 +24,8 @@ class ConstShapeVisitor;
* the standard pure virtual methods which are required for all Object
* subclasses.*/
#define META_Shape(library,name) \
virtual osg::Object* cloneType() const { return osgNew name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual osg::Object* cloneType() const { return new name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; } \
virtual const char* className() const { return #name; } \

View File

@@ -108,8 +108,8 @@ class SG_EXPORT ShapeDrawable : public Drawable
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
ShapeDrawable(const ShapeDrawable& pg,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew ShapeDrawable(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew ShapeDrawable(*this,copyop); }
virtual Object* cloneType() const { return new ShapeDrawable(); }
virtual Object* clone(const CopyOp& copyop) const { return new ShapeDrawable(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const ShapeDrawable*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "ShapeDrawable"; }

View File

@@ -24,8 +24,8 @@ class StateSet;
* the standard pure virtual methods which are required for all Object
* subclasses.*/
#define META_StateAttribute(library,name,type) \
virtual osg::Object* cloneType() const { return osgNew name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew name (*this,copyop); } \
virtual osg::Object* cloneType() const { return new name(); } \
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new name (*this,copyop); } \
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const name *>(obj)!=NULL; } \
virtual const char* libraryName() const { return #library; } \
virtual const char* className() const { return #name; } \

View File

@@ -30,8 +30,8 @@ class SG_EXPORT StateSet : public Object
StateSet();
StateSet(const StateSet&,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual Object* cloneType() const { return osgNew StateSet(); }
virtual Object* clone(const CopyOp& copyop) const { return osgNew StateSet(*this,copyop); }
virtual Object* cloneType() const { return new StateSet(); }
virtual Object* clone(const CopyOp& copyop) const { return new StateSet(*this,copyop); }
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const StateSet*>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "StateSet"; }

View File

@@ -459,7 +459,7 @@ Starts a TestSuite singleton function
{ \
static osg::ref_ptr<osgUtx::TestSuite> s_suite = 0; \
if ( s_suite == 0 ) { \
s_suite = osgNew osgUtx::TestSuite( #tsuite );
s_suite = new osgUtx::TestSuite( #tsuite );
@@ -468,7 +468,7 @@ Adds a test case to a suite object being created in a TestSuite singleton functi
@see OSGUTX_BEGIN_TESTSUITE, OSGUTX_END_TESTSUITE
*/
#define OSGUTX_ADD_TESTCASE( tfixture, tmethod ) \
s_suite->add( osgNew osgUtx::TestCase_<tfixture>( \
s_suite->add( new osgUtx::TestCase_<tfixture>( \
#tmethod, &tfixture::tmethod ) );
/**

View File

@@ -22,13 +22,6 @@
# endif /* OSGDBSG_LIBRARY */
#else
# define OSGDB_EXPORT
#endif
//#include <osg/MemoryManager>
#define osgNew new
#define osgDelete delete
#define osgFree free
#define osgMalloc malloc
#endif
#endif

View File

@@ -209,7 +209,7 @@ class RegisterDotOsgWrapperProxy
{
if (Registry::instance())
{
_wrapper = osgNew DotOsgWrapper(proto,name,associates,readFunc,writeFunc,readWriteMode);
_wrapper = new DotOsgWrapper(proto,name,associates,readFunc,writeFunc,readWriteMode);
Registry::instance()->addDotOsgWrapper(_wrapper.get());
}
}
@@ -235,7 +235,7 @@ class RegisterReaderWriterProxy
{
if (Registry::instance())
{
_rw = osgNew T;
_rw = new T;
Registry::instance()->addReaderWriter(_rw.get());
}
}

View File

@@ -44,7 +44,7 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
CullVisitor();
virtual ~CullVisitor();
virtual CullVisitor* cloneType() const { return osgNew CullVisitor(); }
virtual CullVisitor* cloneType() const { return new CullVisitor(); }
virtual void reset();
@@ -312,7 +312,7 @@ inline RenderLeaf* CullVisitor::createOrReuseRenderLeaf(osg::Drawable* drawable,
}
// otherwise need to create new renderleaf.
RenderLeaf* renderleaf = osgNew RenderLeaf(drawable,projection,matrix,depth);
RenderLeaf* renderleaf = new RenderLeaf(drawable,projection,matrix,depth);
_reuseRenderLeafList.push_back(renderleaf);
++_currentReuseRenderLeafIndex;
return renderleaf;

View File

@@ -48,8 +48,8 @@ class OSGUTIL_EXPORT RenderBin : public osg::Object
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
RenderBin(const RenderBin& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
virtual osg::Object* cloneType() const { return osgNew RenderBin(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew RenderBin(*this,copyop); } // note only implements a clone of type.
virtual osg::Object* cloneType() const { return new RenderBin(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new RenderBin(*this,copyop); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderBin*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderBin"; }

View File

@@ -71,7 +71,7 @@ class OSGUTIL_EXPORT RenderGraph : public osg::Referenced
~RenderGraph() {}
RenderGraph* cloneType() const { return osgNew RenderGraph; }
RenderGraph* cloneType() const { return new RenderGraph; }
void setUserData(osg::Referenced* obj) { _userData = obj; }
osg::Referenced* getUserData() { return _userData.get(); }
@@ -149,7 +149,7 @@ class OSGUTIL_EXPORT RenderGraph : public osg::Referenced
// create a state group and insert it into the children list
// then return the state group.
RenderGraph* sg = osgNew RenderGraph(this,stateset);
RenderGraph* sg = new RenderGraph(this,stateset);
_children[stateset] = sg;
return sg;
}

View File

@@ -31,8 +31,8 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
RenderStage(const RenderStage& rhs,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
virtual osg::Object* cloneType() const { return osgNew RenderStage(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return osgNew RenderStage(*this,copyop); } // note only implements a clone of type.
virtual osg::Object* cloneType() const { return new RenderStage(); }
virtual osg::Object* clone(const osg::CopyOp& copyop) const { return new RenderStage(*this,copyop); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStage*>(obj)!=0L; }
virtual const char* className() const { return "RenderStage"; }
@@ -99,7 +99,7 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
RenderStageLighting* getRenderStageLighting() const
{
if (!_renderStageLighting.valid()) _renderStageLighting = osgNew RenderStageLighting;
if (!_renderStageLighting.valid()) _renderStageLighting = new RenderStageLighting;
return _renderStageLighting.get();
}

View File

@@ -23,8 +23,8 @@ class OSGUTIL_EXPORT RenderStageLighting : public osg::Object
RenderStageLighting();
virtual osg::Object* cloneType() const { return osgNew RenderStageLighting(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew RenderStageLighting(); } // note only implements a clone of type.
virtual osg::Object* cloneType() const { return new RenderStageLighting(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderStageLighting(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderStageLighting*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderStageLighting"; }

View File

@@ -23,8 +23,8 @@ class OSGUTIL_EXPORT RenderToTextureStage : public RenderStage
RenderToTextureStage();
virtual osg::Object* cloneType() const { return osgNew RenderToTextureStage(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return osgNew RenderToTextureStage(); } // note only implements a clone of type.
virtual osg::Object* cloneType() const { return new RenderToTextureStage(); }
virtual osg::Object* clone(const osg::CopyOp&) const { return new RenderToTextureStage(); } // note only implements a clone of type.
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const RenderToTextureStage*>(obj)!=0L; }
virtual const char* libraryName() const { return "osgUtil"; }
virtual const char* className() const { return "RenderToTextureStage"; }

View File

@@ -55,7 +55,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced
else
{
// ensure that _viewport is always valid.
_viewport = osgNew osg::Viewport;
_viewport = new osg::Viewport;
}
}