Fixed various warnings which were appearing under MacOSX.

This commit is contained in:
Robert Osfield
2002-07-13 21:17:40 +00:00
parent db888b191c
commit 4895b22da1
7 changed files with 47 additions and 54 deletions

View File

@@ -62,7 +62,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph)
// create wireframe view of the model so the user can see
// what parts are being culled away.
osg::StateSet* stateset = new osg::StateSet;
osg::Material* material = new osg::Material;
//osg::Material* material = new osg::Material;
osg::PolygonMode* polymode = new osg::PolygonMode;
polymode->setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE);
stateset->setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE_ON);

View File

@@ -57,7 +57,6 @@ void set2dScene(osg::Group* rootNode)
{
osgText::Text* text;
osg::Geode* geode;
osg::Material* textMaterial;
osg::StateSet* textState;
double xOffset=150;
double yOffset=gFontSize+10;
@@ -213,7 +212,6 @@ void setScene(osg::Group* rootNode)
{
osgText::Text* text;
osg::Geode* geode;
osg::Material* textMaterial;
osg::StateSet* textState;
double xOffset=0;
double yOffset=0;
@@ -232,16 +230,17 @@ void setScene(osg::Group* rootNode)
osgText::Text::BOUNDINGBOX |
osgText::Text::ALIGNMENT );
text->setAlignment(gAlignment);
text->setColor(TEXT_COL_3D);
geode = osgNew osg::Geode();
geode->setName("BitmapFont");
geode->addDrawable( text );
textMaterial = osgNew osg::Material();
textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
textState = osgNew osg::StateSet();
textState->setAttribute(textMaterial );
geode->setStateSet( textState );
// textMaterial = osgNew osg::Material();
// textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
// textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// textState = osgNew osg::StateSet();
// textState->setAttribute(textMaterial );
// geode->setStateSet( textState );
rootNode->addChild(geode);
@@ -259,19 +258,20 @@ void setScene(osg::Group* rootNode)
osgText::Text::BOUNDINGBOX |
osgText::Text::ALIGNMENT );
text->setAlignment(gAlignment);
text->setColor(TEXT_COL_3D);
geode = osgNew osg::Geode();
geode->setName("PixmapFont");
geode->addDrawable( text );
textMaterial = osgNew osg::Material();
textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// textMaterial = osgNew osg::Material();
// textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
// textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// to get antiaA pixmapFonts we have to draw them with blending
osg::BlendFunc *transp= osgNew osg::BlendFunc();
transp->setFunction(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
textState = osgNew osg::StateSet();
textState->setAttribute(textMaterial );
// textState->setAttribute(textMaterial );
textState->setAttribute(transp);
textState->setMode(GL_BLEND,osg::StateAttribute::ON);
textState->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
@@ -293,19 +293,20 @@ void setScene(osg::Group* rootNode)
osgText::Text::BOUNDINGBOX |
osgText::Text::ALIGNMENT );
text->setAlignment(gAlignment);
text->setColor(TEXT_COL_3D);
geode = osgNew osg::Geode();
geode->setName("TextureFont");
geode->addDrawable( text );
textMaterial = osgNew osg::Material();
textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// textMaterial = osgNew osg::Material();
// textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
// textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// to get antiaA pixmapFonts we have to draw them with blending
transp= osgNew osg::BlendFunc();
transp->setFunction(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
textState = osgNew osg::StateSet();
textState->setAttribute(textMaterial );
// textState->setAttribute(textMaterial );
textState->setAttribute(transp);
// textState->setMode(GL_BLEND,osg::StateAttribute::ON);
@@ -330,16 +331,17 @@ void setScene(osg::Group* rootNode)
osgText::Text::BOUNDINGBOX |
osgText::Text::ALIGNMENT );
text->setAlignment(gAlignment);
text->setColor(TEXT_COL_3D);
geode = osgNew osg::Geode();
geode->setName("PolygonFont");
geode->addDrawable( text );
textMaterial = osgNew osg::Material();
textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
textState = osgNew osg::StateSet();
textState->setAttribute(textMaterial );
geode->setStateSet( textState );
// textMaterial = osgNew osg::Material();
// textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
// textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// textState = osgNew osg::StateSet();
// textState->setAttribute(textMaterial );
// geode->setStateSet( textState );
rootNode->addChild(geode);
@@ -359,16 +361,17 @@ void setScene(osg::Group* rootNode)
osgText::Text::BOUNDINGBOX |
osgText::Text::ALIGNMENT );
text->setAlignment(gAlignment);
text->setColor(TEXT_COL_3D);
geode = osgNew osg::Geode();
geode->setName("OutlineFont");
geode->addDrawable( text );
textMaterial = osgNew osg::Material();
textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
textState = osgNew osg::StateSet();
textState->setAttribute(textMaterial );
geode->setStateSet( textState );
// textMaterial = osgNew osg::Material();
// textMaterial->setColorMode( osg::Material::AMBIENT_AND_DIFFUSE);
// textMaterial->setDiffuse( osg::Material::FRONT_AND_BACK,TEXT_COL_3D);
// textState = osgNew osg::StateSet();
// textState->setAttribute(textMaterial );
// geode->setStateSet( textState );
rootNode->addChild(geode);

View File

@@ -45,9 +45,6 @@ void Geometry::drawImmediateMode(State& state)
if (!_vertexArray.valid()) return;
// set up the vertex arrays.
// glEnableClientState( GL_VERTEX_ARRAY );
// glVertexPointer(3,GL_FLOAT,0,_vertexArray->dataPointer());
state.setVertexPointer(3,GL_FLOAT,0,_vertexArray->dataPointer());
// set up texture coordinates.
@@ -55,16 +52,9 @@ void Geometry::drawImmediateMode(State& state)
{
Array* array = _texCoordList[i].get();
if (array)
{
// glEnableClientState( GL_TEXTURE_COORD_ARRAY );
// glTexCoordPointer(array->dataSize(),array->dataType(),0,array->dataPointer());
state.setTexCoordPointer(i,array->dataSize(),array->dataType(),0,array->dataPointer());
}
else
{
// glDisableClientState( GL_TEXTURE_COORD_ARRAY );
state.disableTexCoordPointer(i);
}
}
@@ -75,22 +65,18 @@ void Geometry::drawImmediateMode(State& state)
switch (_normalBinding)
{
case(BIND_OFF):
// glDisableClientState( GL_NORMAL_ARRAY );
state.disableNormalPointer();
break;
case(BIND_OVERALL):
// glDisableClientState( GL_NORMAL_ARRAY );
state.disableNormalPointer();
if (normalPointer) glNormal3fv(reinterpret_cast<const GLfloat*>(normalPointer));
break;
case(BIND_PER_PRIMITIVE):
// glDisableClientState( GL_NORMAL_ARRAY );
state.disableNormalPointer();
break;
case(BIND_PER_VERTEX):
// glEnableClientState( GL_NORMAL_ARRAY );
// if (normalPointer) glNormalPointer(GL_FLOAT,0,normalPointer);
if (normalPointer) state.setNormalPointer(GL_FLOAT,0,normalPointer);
else state.disableNormalPointer();
break;
}
@@ -124,17 +110,17 @@ void Geometry::drawImmediateMode(State& state)
colorStride = 16;
break;
}
default:
break;
}
}
switch (_colorBinding)
{
case(BIND_OFF):
// glDisableClientState( GL_COLOR_ARRAY );
state.disableColorPointer();
break;
case(BIND_OVERALL):
// glDisableClientState( GL_COLOR_ARRAY );
state.disableColorPointer();
if (colorPointer)
{
@@ -149,17 +135,17 @@ void Geometry::drawImmediateMode(State& state)
case(Array::Vec4ArrayType):
glColor4fv(reinterpret_cast<const GLfloat*>(colorPointer));
break;
default:
break;
}
}
break;
case(BIND_PER_PRIMITIVE):
// glDisableClientState( GL_COLOR_ARRAY );
state.disableColorPointer();
break;
case(BIND_PER_VERTEX):
// glEnableClientState( GL_COLOR_ARRAY );
// if (colorPointer) glColorPointer(_colorArray->dataSize(),_colorArray->dataType(),0,colorPointer);
if (colorPointer) state.setColorPointer(_colorArray->dataSize(),_colorArray->dataType(),0,colorPointer);
else state.disableColorPointer();
}
@@ -186,6 +172,8 @@ void Geometry::drawImmediateMode(State& state)
case(Array::Vec4ArrayType):
glColor4fv(reinterpret_cast<const GLfloat*>(colorPointer));
break;
default:
break;
}
colorPointer += colorStride;
}

View File

@@ -287,10 +287,7 @@ bool ShadowVolumeOccluder::computeOccluder(const NodePath& nodePath,const Convex
return true;
}
else
{
return false;
}
return false;
}
bool ShadowVolumeOccluder::contains(const std::vector<Vec3>& vertices)

View File

@@ -94,7 +94,7 @@ bool Output::getUniqueIDForObject(const osg::Object* obj,std::string& uniqueID)
bool Output::createUniqueIDForObject(const osg::Object* obj,std::string& uniqueID)
{
char str[256];
sprintf(str,"%s_%i",obj->className(),_objectToUniqueIDMap.size());
sprintf(str,"%s_%i",obj->className(),(unsigned int)_objectToUniqueIDMap.size());
uniqueID = str;
return true;
}

View File

@@ -73,6 +73,8 @@ void DynGeoSet::append(DynGeoSet* source)
binding = osg::GeoSet::BIND_OFF; \
list.clear(); } \
break; \
default: \
break; \
}
DynGeoSet::DynGeoSet():osg::GeoSet()
@@ -214,6 +216,7 @@ void DynGeoSet::addToGeometry(osg::Geometry* geom)
case(osg::GeoSet::TRIANGLES):mode = osg::Primitive::TRIANGLES; break;
case(osg::GeoSet::QUADS):mode = osg::Primitive::QUADS; break;
case(osg::GeoSet::POLYGON):mode = osg::Primitive::POLYGON; break;
default: mode = osg::Primitive::POLYGON;
}

View File

@@ -156,6 +156,8 @@ void Tesselator::retesselatePolygons(osg::Geometry& geom)
}
break;
}
default:
break;
}
endContour();