Various warning fixes

This commit is contained in:
Robert Osfield
2008-10-27 13:09:43 +00:00
parent e062524cb4
commit b28612bce2
21 changed files with 77 additions and 143 deletions

View File

@@ -169,7 +169,6 @@ namespace osg
protected:
FBOExtensions(unsigned int contextID);
private:
bool _supported;
};

View File

@@ -206,7 +206,7 @@ class OSG_EXPORT Texture2DArray : public Texture
virtual void computeInternalFormat() const;
void allocateMipmap(State& state) const;
void applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLenum inInternalFormat, GLsizei& numMipmapLevels) const;
void applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLint inInternalFormat, GLsizei& numMipmapLevels) const;
/**
* Use std::vector to encapsulate referenced pointers to images of different layers.

View File

@@ -184,11 +184,11 @@ class OSGSHADOW_EXPORT ParallelSplitShadowMap : public ShadowTechnique
osg::ref_ptr<osg::Light> _userLight;
osg::ref_ptr<FragmentShaderGenerator> _FragmentShaderGenerator;
bool _GLSL_shadow_filtered;
SplitCalcMode _SplitCalcMode;
bool _GLSL_shadow_filtered;
SplitCalcMode _SplitCalcMode;
osg::Uniform* _ambientBiasUniform;
osg::Vec2d _ambientBias;
osg::Uniform* _ambientBiasUniform;
osg::Vec2d _ambientBias;
};
}

View File

@@ -179,6 +179,11 @@ class OSGSHADOW_EXPORT ViewDependentShadowTechnique
*/
OpenThreads::Mutex _mutex;
/**
Dirty flag tells this instance to update its resources
*/
bool _dirty;
/**
View's CullVisitor associated with this ViewData instance
*/
@@ -189,10 +194,6 @@ class OSGSHADOW_EXPORT ViewDependentShadowTechnique
*/
osg::observer_ptr< ViewDependentShadowTechnique > _st;
/**
Dirty flag tells this instance to update its resources
*/
bool _dirty;
};
/**

View File

@@ -44,6 +44,8 @@ void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,c
case(KEYBOARD_MOUSE_BINDING):
addKeyboardMouseBinding(option,explanation);
break;
default:
break;
}
}

View File

@@ -41,8 +41,7 @@ FBOExtensions* FBOExtensions::instance(unsigned contextID, bool createIfNotInita
#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name))
FBOExtensions::FBOExtensions(unsigned int contextID)
: _supported(false),
glBindRenderbufferEXT(0),
: glBindRenderbufferEXT(0),
glGenRenderbuffersEXT(0),
glDeleteRenderbuffersEXT(0),
glRenderbufferStorageEXT(0),
@@ -58,7 +57,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
glFramebufferTextureLayerEXT(0),
glFramebufferRenderbufferEXT(0),
glGenerateMipmapEXT(0),
glBlitFramebufferEXT(0)
glBlitFramebufferEXT(0),
_supported(false)
{
if (!isGLExtensionSupported(contextID, "GL_EXT_framebuffer_object"))
return;
@@ -661,7 +661,6 @@ FrameBufferObject::~FrameBufferObject()
void FrameBufferObject::setAttachment(BufferComponent attachment_point, const FrameBufferAttachment &attachment)
{
GLenum gl_attachment = convertBufferComponentToGLenum(attachment_point);
_attachments[attachment_point] = attachment;
updateDrawBuffers();
@@ -687,8 +686,6 @@ void FrameBufferObject::updateDrawBuffers()
// create textures and mipmaps before we bind the frame buffer object
for (AttachmentMap::const_iterator i=_attachments.begin(); i!=_attachments.end(); ++i)
{
const FrameBufferAttachment &fa = i->second;
// setup draw buffers based on the attachment definition
if (i->first >= Camera::COLOR_BUFFER0 && i->first <= Camera::COLOR_BUFFER15)
_drawBuffers.push_back(convertBufferComponentToGLenum(i->first));

View File

@@ -211,7 +211,7 @@ int ImageSequence::imageIndex(double time)
if (time<0.0) return 0;
int index = int(time/_timePerImage);
if (index>=_images.size()) return _images.size()-1;
if (index>=int(_images.size())) return int(_images.size())-1;
return index;
}
@@ -296,9 +296,9 @@ void ImageSequence::update(osg::NodeVisitor* nv)
int index = int(time/_timePerImage);
// osg::notify(osg::NOTICE)<<"time= "<<time<<" _timePerImage="<<_timePerImage<<" index="<<index<<" _length="<<_length<<std::endl;
if (index>=_images.size()) index = _images.size()-1;
if (index>=int(_images.size())) index = int(_images.size())-1;
if (index>=0 && index<_images.size())
if (index>=0 && index<int(_images.size()))
{
if (pruneOldImages)
@@ -316,7 +316,7 @@ void ImageSequence::update(osg::NodeVisitor* nv)
if (_previousAppliedImageIndex!=index)
{
if (_previousAppliedImageIndex >= 0 &&
_previousAppliedImageIndex<_images.size() &&
_previousAppliedImageIndex<int(_images.size()) &&
pruneOldImages)
{
_images[_previousAppliedImageIndex] = 0;
@@ -336,19 +336,19 @@ void ImageSequence::update(osg::NodeVisitor* nv)
double preLoadTime = time + osg::minimum(irh->getPreLoadTime()*_timeMultiplier, _length);
int startLoadIndex = int(time/_timePerImage);
if (startLoadIndex>=_images.size()) startLoadIndex = _images.size()-1;
if (startLoadIndex>=int(_images.size())) startLoadIndex = int(_images.size())-1;
if (startLoadIndex<0) startLoadIndex = 0;
int endLoadIndex = int(preLoadTime/_timePerImage);
if (endLoadIndex>=_fileNames.size())
if (endLoadIndex>=int(_fileNames.size()))
{
if (looping)
{
endLoadIndex -= _fileNames.size();
endLoadIndex -= int(_fileNames.size());
}
else
{
endLoadIndex = _fileNames.size()-1;
endLoadIndex = int(_fileNames.size())-1;
}
}
if (endLoadIndex<0) endLoadIndex = 0;
@@ -357,9 +357,9 @@ void ImageSequence::update(osg::NodeVisitor* nv)
if (endLoadIndex<startLoadIndex)
{
for(int i=startLoadIndex; i<_fileNames.size(); ++i)
for(int i=startLoadIndex; i<int(_fileNames.size()); ++i)
{
if ((i>=_images.size() || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
if ((i>=int(_images.size()) || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
{
_filesRequested.insert(_fileNames[i]);
irh->requestImageFile(_fileNames[i], this, i, requestTime, fs);
@@ -369,7 +369,7 @@ void ImageSequence::update(osg::NodeVisitor* nv)
for(int i=0; i<=endLoadIndex; ++i)
{
if ((i>=_images.size() || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
if ((i>=int(_images.size()) || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
{
_filesRequested.insert(_fileNames[i]);
irh->requestImageFile(_fileNames[i], this, i, requestTime, fs);
@@ -381,7 +381,7 @@ void ImageSequence::update(osg::NodeVisitor* nv)
{
for(int i=startLoadIndex; i<=endLoadIndex; ++i)
{
if ((i>=_images.size() || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
if ((i>=int(_images.size()) || !_images[i]) && _filesRequested.count(_fileNames[i])==0)
{
_filesRequested.insert(_fileNames[i]);
irh->requestImageFile(_fileNames[i], this, i, requestTime, fs);

View File

@@ -761,7 +761,7 @@ bool KdTree::intersect(const osg::Vec3& start, const osg::Vec3& end, LineSegment
return false;
}
int numIntersectionsBefore = intersections.size();
unsigned int numIntersectionsBefore = intersections.size();
IntersectKdTree intersector(*_vertices,
_kdNodes,
@@ -785,8 +785,8 @@ KdTreeBuilder::KdTreeBuilder():
KdTreeBuilder::KdTreeBuilder(const KdTreeBuilder& rhs):
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
_kdTreePrototype(rhs._kdTreePrototype),
_buildOptions(rhs._buildOptions)
_buildOptions(rhs._buildOptions),
_kdTreePrototype(rhs._kdTreePrototype)
{
}

View File

@@ -1470,7 +1470,6 @@ void PrimitiveShapeVisitor::apply(const Sphere& sphere)
_functor.begin(GL_QUAD_STRIP);
float angle = 0.0f;
float texCoord = 0.0f;
for(unsigned int topi=0;
topi<numSegments;
@@ -1609,7 +1608,6 @@ void PrimitiveShapeVisitor::apply(const Cone& cone)
float topz=cone.getHeight()+cone.getBaseOffset();
float topr=0.0f;
float topv=1.0f;
float basez=topz-hDelta;
float baser=rDelta;
float angle;
@@ -1759,14 +1757,6 @@ void PrimitiveShapeVisitor::apply(const Capsule& capsule)
numSegments = MIN_NUM_SEGMENTS;
}
float angleDelta = 2.0f*osg::PI/(float)numSegments;
float r = capsule.getRadius();
float h = capsule.getHeight();
float basez = -h*0.5f;
float topz = h*0.5f;
// capsule body
createCylinderBody(numSegments, capsule.getRadius(), capsule.getHeight(), matrix);

View File

@@ -368,14 +368,14 @@ Texture::Texture():
_borderColor(0.0, 0.0, 0.0, 0.0),
_borderWidth(0),
_internalFormatMode(USE_IMAGE_DATA_FORMAT),
_internalFormatType(NORMALIZED),
_internalFormat(0),
_sourceFormat(0),
_sourceType(0),
_use_shadow_comparison(false),
_shadow_compare_func(LEQUAL),
_shadow_texture_mode(LUMINANCE),
_shadow_ambient(0),
_internalFormatType(NORMALIZED)
_shadow_ambient(0)
{
}
@@ -394,14 +394,14 @@ Texture::Texture(const Texture& text,const CopyOp& copyop):
_borderColor(text._borderColor),
_borderWidth(text._borderWidth),
_internalFormatMode(text._internalFormatMode),
_internalFormatType(text._internalFormatType),
_internalFormat(text._internalFormat),
_sourceFormat(text._sourceFormat),
_sourceType(text._sourceType),
_use_shadow_comparison(text._use_shadow_comparison),
_shadow_compare_func(text._shadow_compare_func),
_shadow_texture_mode(text._shadow_texture_mode),
_shadow_ambient(text._shadow_ambient),
_internalFormatType(text._internalFormatType)
_shadow_ambient(text._shadow_ambient)
{
}
@@ -1469,6 +1469,8 @@ void Texture::mipmapAfterTexImage(State& state, GenerateMipmapMode beforeResult)
case GENERATE_MIPMAP_TEX_PARAMETER:
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_FALSE);
break;
case GENERATE_MIPMAP_NONE:
break;
}
}

View File

@@ -352,7 +352,7 @@ void Texture2DArray::apply(State& state) const
}
}
void Texture2DArray::applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLenum inInternalFormat, GLsizei& numMipmapLevels) const
void Texture2DArray::applyTexImage2DArray_subload(State& state, Image* image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLint inInternalFormat, GLsizei& numMipmapLevels) const
{
// if we don't have a valid image we can't create a texture!
if (!imagesValid())
@@ -387,7 +387,9 @@ void Texture2DArray::applyTexImage2DArray_subload(State& state, Image* image, GL
image->ensureValidSizeForTexturing(extensions->max2DSize());
// image size or format has changed, this is not allowed, hence return
if (image->s()!=inwidth || image->t()!=inheight || image->getInternalTextureFormat()!=inInternalFormat )
if (image->s()!=inwidth ||
image->t()!=inheight ||
image->getInternalTextureFormat()!=inInternalFormat )
{
notify(WARN)<<"Warning: Texture2DArray::applyTexImage2DArray_subload(..) given image do have wrong dimension or internal format."<<std::endl;
return;

View File

@@ -484,7 +484,6 @@ void Texture3D::allocateMipmap(State& state) const
if (textureObject && _textureWidth != 0 && _textureHeight != 0 && _textureDepth != 0)
{
const Extensions* extensions = getExtensions(contextID,true);
const Texture::Extensions* texExtensions = Texture::getExtensions(contextID,true);
// bind texture
textureObject->bind();

View File

@@ -1470,7 +1470,7 @@ public:
}
std::string _marker;
unsigned int _numPagedLODsMarked;
int _numPagedLODsMarked;
};
void DatabasePager::removeExpiredSubgraphs(const osg::FrameStamp& frameStamp)
@@ -1550,8 +1550,7 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
}
}
unsigned int inactivePLOD = _inactivePagedLODList.size();
unsigned int activePLOD = _activePagedLODList.size();
int inactivePLOD = _inactivePagedLODList.size();
PagedLODList& pagedLODList = _inactivePagedLODList;
@@ -1632,8 +1631,8 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
}
unsigned int numRemoved = 0;
unsigned int numToRemove = markerVistor._numPagedLODsMarked;
int numRemoved = 0;
int numToRemove = markerVistor._numPagedLODsMarked;
// osg::notify(osg::NOTICE)<<"Children to remove "<<childrenRemoved.size()<<" numToRemove="<<numToRemove<<std::endl;
@@ -1686,10 +1685,6 @@ void DatabasePager::capped_removeExpiredSubgraphs(const osg::FrameStamp& frameSt
if (s_total_max_stage_c<time_c) s_total_max_stage_c = time_c;
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"active="<<_activePagedLODList.size()<<" inactive="<<_inactivePagedLODList.size()<<" overall = "<<osg::Timer::instance()->delta_m(startTick,end_c_Tick)<<
" A="<<time_a<<" avg="<<s_total_time_stage_a/s_total_iter_stage_a<<" max = "<<s_total_max_stage_a<<
" B="<<time_b<<" avg="<<s_total_time_stage_b/s_total_iter_stage_b<<" max = "<<s_total_max_stage_b<<

View File

@@ -26,8 +26,8 @@ using namespace osgShadow;
MinimalShadowMap::MinimalShadowMap():
BaseClass(),
_minLightMargin( 0 ),
_maxFarPlane( FLT_MAX ),
_minLightMargin( 0 ),
_shadowReceivingCoarseBoundAccuracy( BOUNDING_BOX )
{

View File

@@ -242,9 +242,9 @@ ParallelSplitShadowMap::ParallelSplitShadowMap(osg::Geode** gr, int icountplanes
_split_min_near_dist(ZNEAR_MIN_FROM_LIGHT_SOURCE),
_move_vcam_behind_rcam_factor(MOVE_VIRTUAL_CAMERA_BEHIND_REAL_CAMERA_FACTOR),
_userLight(NULL),
_ambientBias(0.1,0.3),
_GLSL_shadow_filtered(true),
_ambientBiasUniform(NULL),
_GLSL_shadow_filtered(true)
_ambientBias(0.1,0.3)
{
_displayTexturesGroupingNode = gr;
_number_of_splits = icountplanes;
@@ -255,22 +255,23 @@ ParallelSplitShadowMap::ParallelSplitShadowMap(osg::Geode** gr, int icountplanes
}
ParallelSplitShadowMap::ParallelSplitShadowMap(const ParallelSplitShadowMap& copy, const osg::CopyOp& copyop):
ShadowTechnique(copy,copyop),
_textureUnitOffset(copy._textureUnitOffset),
_debug_color_in_GLSL(copy._debug_color_in_GLSL),
_user_polgyonOffset_set(copy._user_polgyonOffset_set),
_resolution(copy._resolution),
_isSetMaxFarDistance(copy._isSetMaxFarDistance),
_split_min_near_dist(copy._split_min_near_dist),
_SplitCalcMode(copy._SplitCalcMode),
_number_of_splits(copy._number_of_splits),
_polgyonOffset(copy._polgyonOffset),
_setMaxFarDistance(copy._setMaxFarDistance),
_move_vcam_behind_rcam_factor(copy._move_vcam_behind_rcam_factor),
_userLight(copy._userLight),
_ambientBias(copy._ambientBias),
_GLSL_shadow_filtered(copy._GLSL_shadow_filtered),
_FragmentShaderGenerator(copy._FragmentShaderGenerator)
ShadowTechnique(copy,copyop),
_textureUnitOffset(copy._textureUnitOffset),
_number_of_splits(copy._number_of_splits),
_debug_color_in_GLSL(copy._debug_color_in_GLSL),
_polgyonOffset(copy._polgyonOffset),
_user_polgyonOffset_set(copy._user_polgyonOffset_set),
_resolution(copy._resolution),
_setMaxFarDistance(copy._setMaxFarDistance),
_isSetMaxFarDistance(copy._isSetMaxFarDistance),
_split_min_near_dist(copy._split_min_near_dist),
_move_vcam_behind_rcam_factor(copy._move_vcam_behind_rcam_factor),
_userLight(copy._userLight),
_FragmentShaderGenerator(copy._FragmentShaderGenerator),
_GLSL_shadow_filtered(copy._GLSL_shadow_filtered),
_SplitCalcMode(copy._SplitCalcMode),
_ambientBiasUniform(NULL),
_ambientBias(copy._ambientBias)
{
}
@@ -529,7 +530,7 @@ void ParallelSplitShadowMap::init(){
#else
pssmShadowSplitTexture._debug_camera->attach(osg::Camera::COLOR_BUFFER, pssmShadowSplitTexture._debug_texture.get());
#endif
osg::StateSet* stateset = pssmShadowSplitTexture._debug_camera->getOrCreateStateSet();
// osg::StateSet* stateset = pssmShadowSplitTexture._debug_camera->getOrCreateStateSet();
pssmShadowSplitTexture._debug_stateset = new osg::StateSet;
pssmShadowSplitTexture._debug_stateset->setTextureAttributeAndModes(pssmShadowSplitTexture._debug_textureUnit,pssmShadowSplitTexture._debug_texture.get(),osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);
@@ -631,7 +632,7 @@ void ParallelSplitShadowMap::cull(osgUtil::CullVisitor& cv){
{
// do traversal of shadow receiving scene which does need to be decorated by the shadow map
unsigned int iMaxSplit = _PSSMShadowSplitTextureMap.size();
//unsigned int iMaxSplit = _PSSMShadowSplitTextureMap.size();
for (PSSMShadowSplitTextureMap::iterator it=_PSSMShadowSplitTextureMap.begin();it!=_PSSMShadowSplitTextureMap.end();it++)
{
@@ -774,7 +775,7 @@ void ParallelSplitShadowMap::calculateFrustumCorners(
//////////////////////////////////////////////////////////////////////////
/// CALCULATE SPLIT
double maxFar = camFar;
double minNear = camNear;
// double minNear = camNear;
double camNearFar_Dist = maxFar - camNear;
if ( _SplitCalcMode == SPLIT_LINEAR ) {
camFar = camNear + (camNearFar_Dist) * ((double)(pssmShadowSplitTexture._splitID+1))/((double)(_number_of_splits));

View File

@@ -83,9 +83,9 @@ static const char fragmentShaderSource_debugHUD[] =
ShadowMap::ShadowMap():
_baseTextureUnit(0),
_shadowTextureUnit(1),
_polyOffset(1.0,1.0),
_ambientBias(0.5f,0.5f),
_textureSize(1024,1024),
_polyOffset(1.0,1.0)
_textureSize(1024,1024)
{
}
@@ -93,9 +93,9 @@ ShadowMap::ShadowMap(const ShadowMap& copy, const osg::CopyOp& copyop):
ShadowTechnique(copy,copyop),
_baseTextureUnit(copy._baseTextureUnit),
_shadowTextureUnit(copy._shadowTextureUnit),
_polyOffset(copy._polyOffset),
_ambientBias(copy._ambientBias),
_textureSize(copy._textureSize),
_polyOffset(copy._polyOffset)
_textureSize(copy._textureSize)
{
}
@@ -546,8 +546,8 @@ public:
}
}
unsigned _stage;
osg::ref_ptr< osg::Texture2D > _texture;
unsigned _stage;
};
////////////////////////////////////////////////////////////////////////////////
osg::ref_ptr<osg::Camera> ShadowMap::makeDebugHUD()

View File

@@ -600,7 +600,7 @@ const osg::Light* StandardShadowMap::ViewData::selectLight
osgUtil::PositionalStateContainer::AttrMatrixList& aml =
rs->getPositionalStateContainer()->getAttrMatrixList();
osg::RefMatrix* matrix;
osg::RefMatrix* matrix = 0;
for(osgUtil::PositionalStateContainer::AttrMatrixList::iterator itr = aml.begin();
itr != aml.end();

View File

@@ -106,8 +106,8 @@ RenderStage::RenderStage(const RenderStage& rhs,const osg::CopyOp& copyop):
_face(rhs._face),
_imageReadPixelFormat(rhs._imageReadPixelFormat),
_imageReadPixelDataType(rhs._imageReadPixelDataType),
_renderStageLighting(rhs._renderStageLighting),
_disableFboAfterRender(rhs._disableFboAfterRender)
_disableFboAfterRender(rhs._disableFboAfterRender),
_renderStageLighting(rhs._renderStageLighting)
{
_stage = this;
}

View File

@@ -34,10 +34,10 @@
using namespace osgUtil;
SceneGraphBuilder::SceneGraphBuilder():
_statesetAssigned(false),
_normal(0.0f,0.0f,1.0f),
_color(1.0f,1.0f,1.0f,1.0f),
_texCoord(0.f,0.0f,0.0f,1.0f),
_statesetAssigned(false)
_texCoord(0.f,0.0f,0.0f,1.0f)
{
}

View File

@@ -1138,8 +1138,6 @@ void SceneView::draw()
double separation = _displaySettings->getSplitStereoHorizontalSeparation();
double left_half_width = (getViewport()->width()-separation)/2.0;
double right_half_begin = (getViewport()->width()+separation)/2.0;
double right_half_width = getViewport()->width()-right_half_begin;
clearArea(static_cast<int>(getViewport()->x()+left_half_width),
static_cast<int>(getViewport()->y()),
@@ -1190,8 +1188,6 @@ void SceneView::draw()
double separation = _displaySettings->getSplitStereoVerticalSeparation();
double bottom_half_height = (getViewport()->height()-separation)/2.0;
double top_half_begin = (getViewport()->height()+separation)/2.0;
double top_half_height = getViewport()->height()-top_half_begin;
clearArea(static_cast<int>(getViewport()->x()),
static_cast<int>(getViewport()->y()+bottom_half_height),

View File

@@ -600,56 +600,6 @@ void Tessellator::reduceArray(osg::Array * cold, const unsigned int nnu)
}
}
static unsigned int _computeNumberOfPrimitives(const osg::Geometry& geom)
{
unsigned int totalNumberOfPrimitives = 0;
for(Geometry::PrimitiveSetList::const_iterator itr=geom.getPrimitiveSetList().begin();
itr!=geom.getPrimitiveSetList().end();
++itr)
{
const PrimitiveSet* primitiveset = itr->get();
GLenum mode=primitiveset->getMode();
unsigned int primLength;
switch(mode)
{
case(GL_POINTS): primLength=1; break;
case(GL_LINES): primLength=2; break;
case(GL_TRIANGLES): primLength=3; break;
case(GL_QUADS): primLength=4; break;
default: primLength=0; break; // compute later when =0.
}
// draw primitives by the more flexible "slow" path,
// sending OpenGL glBegin/glVertex.../glEnd().
switch(primitiveset->getType())
{
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
{
const DrawArrayLengths* drawArrayLengths = static_cast<const DrawArrayLengths*>(primitiveset);
for(DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr)
{
if (primLength==0) totalNumberOfPrimitives += 1;
else totalNumberOfPrimitives += *primItr/primLength; // Dec 2003 - increment not set
}
break;
}
default:
{
if (primLength==0) totalNumberOfPrimitives += 1;
else totalNumberOfPrimitives += primitiveset->getNumIndices()/primLength;
}
}
}
return totalNumberOfPrimitives;
}
//
void Tessellator::collectTessellation(osg::Geometry &geom, unsigned int originalIndex)
{
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geom.getVertexArray());