Added #define OSG_USE_DEPRECATED_GEOMETRY_METHODS usage into code to allow code to compile enen when CMake configuration has set the #define to off in include/osg/Config.
This commit is contained in:
parent
b2fa36f02b
commit
297a8a221b
@ -16,6 +16,8 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Material>
|
||||
#include <osg/MatrixTransform>
|
||||
|
@ -12,7 +12,9 @@
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
// #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
//#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
//#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
//#endif
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/ArrayDispatchers>
|
||||
@ -146,11 +148,11 @@ void Geometry::setFogCoordArray(Array* array)
|
||||
if (_useVertexBufferObjects && array) addVertexBufferObjectIfRequired(array);
|
||||
}
|
||||
|
||||
#define SET_BINDING(array)\
|
||||
#define SET_BINDING(array, ab)\
|
||||
if (!array) \
|
||||
{ \
|
||||
if (ab==BIND_OFF) return; \
|
||||
OSG_NOTICE<<"Warning, can't assign attribute binding as no has been array assigned to set binding for."<<std::endl; \
|
||||
abort(); \
|
||||
return; \
|
||||
} \
|
||||
if (array->getBinding() == static_cast<osg::Array::Binding>(ab)) return; \
|
||||
@ -1095,7 +1097,7 @@ Geometry* osg::createTexturedQuadGeometry(const Vec3& corner,const Vec3& widthVe
|
||||
//
|
||||
void Geometry::setNormalBinding(AttributeBinding ab)
|
||||
{
|
||||
SET_BINDING(_normalArray.get())
|
||||
SET_BINDING(_normalArray.get(), ab)
|
||||
|
||||
dirtyDisplayList();
|
||||
}
|
||||
@ -1107,7 +1109,7 @@ Geometry::AttributeBinding Geometry::getNormalBinding() const
|
||||
|
||||
void Geometry::setColorBinding(AttributeBinding ab)
|
||||
{
|
||||
SET_BINDING(_colorArray.get())
|
||||
SET_BINDING(_colorArray.get(), ab)
|
||||
|
||||
dirtyDisplayList();
|
||||
}
|
||||
@ -1119,7 +1121,7 @@ Geometry::AttributeBinding Geometry::getColorBinding() const
|
||||
|
||||
void Geometry::setSecondaryColorBinding(AttributeBinding ab)
|
||||
{
|
||||
SET_BINDING(_secondaryColorArray.get())
|
||||
SET_BINDING(_secondaryColorArray.get(), ab)
|
||||
|
||||
dirtyDisplayList();
|
||||
}
|
||||
@ -1131,7 +1133,7 @@ Geometry::AttributeBinding Geometry::getSecondaryColorBinding() const
|
||||
|
||||
void Geometry::setFogCoordBinding(AttributeBinding ab)
|
||||
{
|
||||
SET_BINDING(_fogCoordArray.get())
|
||||
SET_BINDING(_fogCoordArray.get(), ab)
|
||||
|
||||
dirtyDisplayList();
|
||||
}
|
||||
|
@ -25,6 +25,9 @@
|
||||
// but you are not forced to do so.
|
||||
//
|
||||
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include <osg/BlendFunc>
|
||||
#include <osg/Billboard>
|
||||
|
@ -12,7 +12,9 @@
|
||||
* Copyright 2003 VR-C
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include "Exception.h"
|
||||
#include "Geometry.h"
|
||||
|
@ -6,6 +6,9 @@
|
||||
* Author(s): Vladimir Vukicevic <vladimir@pobox.com>
|
||||
*
|
||||
*/
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include <osg/TexEnv>
|
||||
#include <osg/CullFace>
|
||||
|
@ -1,6 +1,8 @@
|
||||
// -*-c++-*-
|
||||
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include "ConvertFromPerformer.h"
|
||||
|
||||
@ -907,6 +909,9 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
|
||||
}
|
||||
|
||||
geom->setColorArray(osg_colors);
|
||||
|
||||
// set the color binding type.
|
||||
geom->setColorBinding(_gsetBindMap[bind]);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -916,9 +921,6 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
|
||||
bind == PFGS_PER_PRIM ? geoset->getNumPrims() :
|
||||
bind == PFGS_PER_VERTEX ? nv : 0;
|
||||
|
||||
// set the normal binding type.
|
||||
geom->setColorBinding(_gsetBindMap[bind]);
|
||||
|
||||
// calc the maximum num of vertex from the index list.
|
||||
int cc;
|
||||
if (ilist)
|
||||
@ -942,6 +944,10 @@ osg::Drawable* ConvertFromPerformer::visitGeoSet(osg::Geode* osgGeode,pfGeoSet*
|
||||
|
||||
geom->setColorArray(osg_colors);
|
||||
|
||||
// set the color binding type.
|
||||
geom->setColorBinding(_gsetBindMap[bind]);
|
||||
|
||||
|
||||
if(ilist)
|
||||
{
|
||||
geom->setColorIndices(new osg::UShortArray(nn,ilist));
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include <osg/Node>
|
||||
#include <osg/Geometry>
|
||||
|
||||
|
@ -1,4 +1,6 @@
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Notify>
|
||||
|
Loading…
Reference in New Issue
Block a user