Converted osg::notify to OSG_INFO etc.

This commit is contained in:
Robert Osfield
2010-05-28 17:12:55 +00:00
parent 1f17cae284
commit d413714dd0
3 changed files with 21 additions and 21 deletions

View File

@@ -85,11 +85,11 @@ osgDB::ReaderWriter::ReadResult ReaderWriterDirectX::readNode(const std::string&
std::string fileName = osgDB::findDataFile( file, options );
if (fileName.empty()) return ReadResult::FILE_NOT_FOUND;
osg::notify(osg::INFO) << "ReaderWriterDirectX::readNode(" << fileName << ")\n";
OSG_INFO << "ReaderWriterDirectX::readNode(" << fileName << ")\n";
osgDB::ifstream fin(fileName.c_str());
if (fin.bad()) {
osg::notify(osg::WARN) << "ReaderWriterDirectX failed to read '" << fileName.c_str() << "'\n";
OSG_WARN << "ReaderWriterDirectX failed to read '" << fileName.c_str() << "'\n";
return ReadResult::ERROR_IN_READING_FILE;
}
@@ -104,7 +104,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterDirectX::readNode(std::istream& fin,
{
DX::Object obj;
if (obj.load(fin) == false) {
osg::notify(osg::WARN) << "ReaderWriterDirectX failed to read stream" << std::endl;
OSG_WARN << "ReaderWriterDirectX failed to read stream" << std::endl;
return ReadResult::ERROR_IN_READING_FILE;
}
@@ -131,7 +131,7 @@ osgDB::ReaderWriter::ReadResult ReaderWriterDirectX::readNode(std::istream& fin,
// Convert to osg::Group
osg::Group* group = convertFromDX(obj, switchToLeftHanded, flipTexture, creaseAngle, options);
if (!group) {
osg::notify(osg::WARN) << "ReaderWriterDirectX failed to convert\n";
OSG_WARN << "ReaderWriterDirectX failed to convert\n";
return ReadResult::ERROR_IN_READING_FILE;
}
@@ -291,8 +291,8 @@ osg::Geode* ReaderWriterDirectX::convertFromDX(DX::Mesh & mesh, bool switchToLef
const std::vector<DX::MeshFace> & faces = mesh.getFaces();
if (faces.size() != meshMaterial->faceIndices.size())
{
osg::notify(osg::FATAL)<<"Error: internal error in DirectX .x loader,"<<std::endl;
osg::notify(osg::FATAL)<<" mesh->faces.size() == meshMaterial->faceIndices.size()"<<std::endl;
OSG_FATAL<<"Error: internal error in DirectX .x loader,"<<std::endl;
OSG_FATAL<<" mesh->faces.size() == meshMaterial->faceIndices.size()"<<std::endl;
return NULL;
}
@@ -309,7 +309,7 @@ osg::Geode* ReaderWriterDirectX::convertFromDX(DX::Mesh & mesh, bool switchToLef
if (np != meshNormals->faceNormals[i].size())
{
osg::notify(osg::WARN)<<"DirectX loader: Error, error in normal list."<<std::endl;
OSG_WARN<<"DirectX loader: Error, error in normal list."<<std::endl;
}
osg::Vec3Array* vertexArray = (osg::Vec3Array*) geom->getVertexArray();

View File

@@ -64,11 +64,11 @@ bool Object::load(std::istream& fin)
// read header
char buf[256];
if (fin.getline(buf, sizeof(buf)) == 0) {
osg::notify(osg::WARN) << "Failed to read DirectX header\n";
OSG_WARN << "Failed to read DirectX header\n";
return false;
}
if (strstr(buf, "xof") == 0) {
osg::notify(osg::WARN) << "No 'xof' found in DirectX header\n";
OSG_WARN << "No 'xof' found in DirectX header\n";
return false;
}
@@ -132,7 +132,7 @@ void Object::parseSection(std::istream& fin)
Mesh * mesh = new Mesh(this);
_meshes.push_back(mesh);
mesh->parseMesh(fin);
osg::notify(osg::INFO) << "Mesh " << (token.size()>1?token[1]:"") << endl;
OSG_INFO << "Mesh " << (token.size()>1?token[1]:"") << endl;
}
else if (token[0] == "Material") {
//
@@ -146,14 +146,14 @@ void Object::parseSection(std::istream& fin)
}
parseMaterial(fin, mm);
_globalMaterials.push_back(mm);
osg::notify(osg::INFO) << "Material " << (token.size()>1?token[1]:"") << endl;
OSG_INFO << "Material " << (token.size()>1?token[1]:"") << endl;
}
else if (token[0] == "Frame") {
//parseFrame(fin);
parseSection(fin);
}
else {
osg::notify(osg::DEBUG_INFO) << "!!! Begin section " << token[0] << endl;
OSG_DEBUG << "!!! Begin section " << token[0] << endl;
parseSection(fin);
}
}

View File

@@ -146,7 +146,7 @@ bool Mesh::generateNormals(float /*creaseAngle*/)
}
}
//osg::notify(osg::INFO) << "vertex " << vi << " used by " << polyCount << " faces\n";
//OSG_INFO << "vertex " << vi << " used by " << polyCount << " faces\n";
if (polyCount > 1) {
float polyCountRecip = 1.0f / (float) polyCount;
normal.x *= polyCountRecip;
@@ -207,7 +207,7 @@ void Mesh::parseMesh(std::istream& fin)
if (nVertices != _vertices.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading vertices; " << _vertices.size() << " instead of " << nVertices << endl;
OSG_WARN << "DirectX loader: Error reading vertices; " << _vertices.size() << " instead of " << nVertices << endl;
}
}
else if (nFaces == 0) {
@@ -217,11 +217,11 @@ void Mesh::parseMesh(std::istream& fin)
if (nFaces != _faces.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading mesh; " << _faces.size() << " instead of " << nFaces << endl;
OSG_WARN << "DirectX loader: Error reading mesh; " << _faces.size() << " instead of " << nFaces << endl;
}
}
else
osg::notify(osg::INFO) << "!!! " << buf << endl;
OSG_INFO << "!!! " << buf << endl;
}
}
@@ -281,14 +281,14 @@ void Mesh::parseMeshMaterialList(std::istream& fin)
if (nFaceIndices != _materialList->faceIndices.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading face indices; " << nFaceIndices << " instead of " << _materialList->faceIndices.size() << endl;
OSG_WARN << "DirectX loader: Error reading face indices; " << nFaceIndices << " instead of " << _materialList->faceIndices.size() << endl;
}
}
}
if (nMaterials != _materialList->material.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading material list; " << nMaterials << " instead of " << _materialList->material.size() << endl;
OSG_WARN << "DirectX loader: Error reading material list; " << nMaterials << " instead of " << _materialList->material.size() << endl;
}
}
@@ -322,7 +322,7 @@ void Mesh::parseMeshNormals(std::istream& fin)
if (nNormals != _normals->normals.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading normals; " << nNormals << " instead of " << _normals->normals.size() << endl;
OSG_WARN << "DirectX loader: Error reading normals; " << nNormals << " instead of " << _normals->normals.size() << endl;
}
#define NORMALIZE_NORMALS
@@ -338,7 +338,7 @@ void Mesh::parseMeshNormals(std::istream& fin)
if (nFaceNormals != _normals->faceNormals.size())
{
osg::notify(osg::WARN) << "DirectX loader: Error reading face normals; " << nFaceNormals << " instead of " << _normals->faceNormals.size() << endl;
OSG_WARN << "DirectX loader: Error reading face normals; " << nFaceNormals << " instead of " << _normals->faceNormals.size() << endl;
}
}
}
@@ -374,7 +374,7 @@ void Mesh::readMeshTexCoords(std::istream& fin)
if (nTextureCoords != _textureCoords->size())
{
osg::notify(osg::INFO) << "DirectX loader: Error reading texcoords; " << _textureCoords->size() << " instead of " << nTextureCoords << endl;
OSG_INFO << "DirectX loader: Error reading texcoords; " << _textureCoords->size() << " instead of " << nTextureCoords << endl;
delete _textureCoords;
_textureCoords = 0;
}