Converted osg::notify to OSG_INFO etc.

This commit is contained in:
Robert Osfield
2010-05-28 16:39:42 +00:00
parent ecaa239288
commit 9b9bde0d2a
4 changed files with 30 additions and 30 deletions

View File

@@ -72,12 +72,12 @@ void FreeTypeFont::setFontResolution(const osgText::FontResolution& fontSize)
if ((unsigned int)(width+2*margin) > _facade->getTextureWidthHint() ||
(unsigned int)(width+2*margin) > _facade->getTextureHeightHint())
{
osg::notify(osg::WARN)<<"Warning: FreeTypeFont::setSize("<<width<<","<<height<<") sizes too large,"<<std::endl;
OSG_WARN<<"Warning: FreeTypeFont::setSize("<<width<<","<<height<<") sizes too large,"<<std::endl;
width = _facade->getTextureWidthHint()-2*margin;
height = _facade->getTextureHeightHint()-2*margin;
osg::notify(osg::WARN)<<" sizes capped ("<<width<<","<<height<<") to fit int current glyph texture size."<<std::endl;
OSG_WARN<<" sizes capped ("<<width<<","<<height<<") to fit int current glyph texture size."<<std::endl;
}
FT_Error error = FT_Set_Pixel_Sizes( _face, /* handle to face object */
@@ -86,7 +86,7 @@ void FreeTypeFont::setFontResolution(const osgText::FontResolution& fontSize)
if (error)
{
osg::notify(osg::WARN)<<"FT_Set_Pixel_Sizes() - error 0x"<<std::hex<<error<<std::dec<<std::endl;
OSG_WARN<<"FT_Set_Pixel_Sizes() - error 0x"<<std::hex<<error<<std::dec<<std::endl;
}
else
{
@@ -119,7 +119,7 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(const osgText::FontResolution& font
FT_Error error = FT_Load_Char( _face, charindex, FT_LOAD_RENDER|FT_LOAD_NO_BITMAP|_flags );
if (error)
{
osg::notify(osg::WARN) << "FT_Load_Char(...) error 0x"<<std::hex<<error<<std::dec<<std::endl;
OSG_WARN << "FT_Load_Char(...) error 0x"<<std::hex<<error<<std::dec<<std::endl;
return 0;
}
@@ -180,7 +180,7 @@ osgText::Font::Glyph* FreeTypeFont::getGlyph(const osgText::FontResolution& font
break;
default:
osg::notify(osg::WARN) << "FT_Load_Char(...) returned bitmap with unknown pixel_mode " << glyphslot->bitmap.pixel_mode << std::endl;
OSG_WARN << "FT_Load_Char(...) returned bitmap with unknown pixel_mode " << glyphslot->bitmap.pixel_mode << std::endl;
}
@@ -224,7 +224,7 @@ osg::Vec2 FreeTypeFont::getKerning(const osgText::FontResolution& fontRes, unsig
if (error)
{
osg::notify(osg::WARN) << "FT_Get_Kerning(...) returned error code " <<std::hex<<error<<std::dec<< std::endl;
OSG_WARN << "FT_Get_Kerning(...) returned error code " <<std::hex<<error<<std::dec<< std::endl;
return osg::Vec2(0.0f,0.0f);
}

View File

@@ -216,7 +216,7 @@ void FreeTypeFont3D::init()
FT_Error _error = FT_Set_Pixel_Sizes(_face, 32, 32);
if (_error)
{
osg::notify(osg::NOTICE) << "FreeTypeFont3D: set pixel sizes failed ..." << std::endl;
OSG_NOTICE << "FreeTypeFont3D: set pixel sizes failed ..." << std::endl;
return;
}
@@ -226,13 +226,13 @@ void FreeTypeFont3D::init()
_error = FT_Load_Glyph( _face, glyphIndex, FT_LOAD_DEFAULT );
if (_error)
{
osg::notify(osg::NOTICE) << "FreeTypeFont3D: initial glyph load failed ..." << std::endl;
OSG_NOTICE << "FreeTypeFont3D: initial glyph load failed ..." << std::endl;
return;
}
if (_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
{
osg::notify(osg::NOTICE) << "FreeTypeFont3D: not a vector font" << std::endl;
OSG_NOTICE << "FreeTypeFont3D: not a vector font" << std::endl;
return;
}
@@ -250,7 +250,7 @@ void FreeTypeFont3D::init()
_error = FT_Outline_Decompose(&outline,&funcs,&char3d);
if (_error)
{
osg::notify(osg::NOTICE) << "FreeTypeFont3D: - outline decompose failed ..." << std::endl;
OSG_NOTICE << "FreeTypeFont3D: - outline decompose failed ..." << std::endl;
return;
}
@@ -328,12 +328,12 @@ osgText::Font3D::Glyph3D * FreeTypeFont3D::getGlyph(unsigned int charcode)
FT_Error error = FT_Load_Char( _face, charindex, FT_LOAD_DEFAULT|_flags );
if (error)
{
osg::notify(osg::WARN) << "FT_Load_Char(...) error 0x"<<std::hex<<error<<std::dec<<std::endl;
OSG_WARN << "FT_Load_Char(...) error 0x"<<std::hex<<error<<std::dec<<std::endl;
return 0;
}
if (_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE)
{
osg::notify(osg::WARN) << "FreeTypeFont3D::getGlyph : not a vector font" << std::endl;
OSG_WARN << "FreeTypeFont3D::getGlyph : not a vector font" << std::endl;
return 0;
}
@@ -353,7 +353,7 @@ osgText::Font3D::Glyph3D * FreeTypeFont3D::getGlyph(unsigned int charcode)
FT_Error _error = FT_Outline_Decompose(&outline, &funcs, &char3d);
if (_error)
{
osg::notify(osg::WARN) << "FreeTypeFont3D::getGlyph : - outline decompose failed ..." << std::endl;
OSG_WARN << "FreeTypeFont3D::getGlyph : - outline decompose failed ..." << std::endl;
return 0;
}
@@ -513,7 +513,7 @@ osg::Vec2 FreeTypeFont3D::getKerning(unsigned int leftcharcode,unsigned int righ
if (error)
{
osg::notify(osg::WARN) << "FT_Get_Kerning(...) returned error code " <<std::hex<<error<<std::dec<< std::endl;
OSG_WARN << "FT_Get_Kerning(...) returned error code " <<std::hex<<error<<std::dec<< std::endl;
return osg::Vec2(0.0f,0.0f);
}

View File

@@ -24,11 +24,11 @@
FreeTypeLibrary::FreeTypeLibrary()
{
osg::notify(osg::INFO) << "FreeTypeLibrary::FreeTypeLibrary()" << std::endl;
OSG_INFO << "FreeTypeLibrary::FreeTypeLibrary()" << std::endl;
FT_Error error = FT_Init_FreeType( &_ftlibrary );
if (error)
{
osg::notify(osg::WARN)<<"Warning: an error occurred during FT_Init_FreeType(..) initialisation, error code = "<<std::hex<<error<<std::dec<<std::endl;
OSG_WARN<<"Warning: an error occurred during FT_Init_FreeType(..) initialisation, error code = "<<std::hex<<error<<std::dec<<std::endl;
}
}
@@ -74,20 +74,20 @@ bool FreeTypeLibrary::getFace(const std::string& fontfile,unsigned int index, FT
FT_Error error = FT_New_Face( _ftlibrary, fontfile.c_str(), index, &face );
if (error == FT_Err_Unknown_File_Format)
{
osg::notify(osg::WARN)<<" .... the font file could be opened and read, but it appears"<<std::endl;
osg::notify(osg::WARN)<<" .... that its font format is unsupported"<<std::endl;
OSG_WARN<<" .... the font file could be opened and read, but it appears"<<std::endl;
OSG_WARN<<" .... that its font format is unsupported"<<std::endl;
return false;
}
else if (error)
{
osg::notify(osg::WARN)<<" .... another error code means that the font file could not"<<std::endl;
osg::notify(osg::WARN)<<" .... be opened, read or simply that it is broken.."<<std::endl;
OSG_WARN<<" .... another error code means that the font file could not"<<std::endl;
OSG_WARN<<" .... be opened, read or simply that it is broken.."<<std::endl;
return false;
}
#ifdef PRINT_OUT_FONT_DETAILS
osg::notify(osg::NOTICE)<<"Face"<<face<<std::endl;
OSG_NOTICE<<"Face"<<face<<std::endl;
unsigned int count = FT_Get_Sfnt_Name_Count(face);
for(unsigned int i=0; i<count; ++i)
{
@@ -96,10 +96,10 @@ bool FreeTypeLibrary::getFace(const std::string& fontfile,unsigned int index, FT
std::string name((char*)names.string, (char*)names.string + names.string_len);
osg::notify(osg::NOTICE)<<"names "<<name<<std::endl;
OSG_NOTICE<<"names "<<name<<std::endl;
}
osg::notify(osg::NOTICE)<<std::endl;
OSG_NOTICE<<std::endl;
#endif
//
@@ -127,7 +127,7 @@ FT_Byte* FreeTypeLibrary::getFace(std::istream& fontstream, unsigned int index,
fontstream.read(reinterpret_cast<char*>(buffer), length);
if (!fontstream || (static_cast<std::streampos>(fontstream.gcount()) != length))
{
osg::notify(osg::WARN)<<" .... the font file could not be read from its stream"<<std::endl;
OSG_WARN<<" .... the font file could not be read from its stream"<<std::endl;
return 0;
}
args.flags = FT_OPEN_MEMORY;
@@ -138,14 +138,14 @@ FT_Byte* FreeTypeLibrary::getFace(std::istream& fontstream, unsigned int index,
if (error == FT_Err_Unknown_File_Format)
{
osg::notify(osg::WARN)<<" .... the font file could be opened and read, but it appears"<<std::endl;
osg::notify(osg::WARN)<<" .... that its font format is unsupported"<<std::endl;
OSG_WARN<<" .... the font file could be opened and read, but it appears"<<std::endl;
OSG_WARN<<" .... that its font format is unsupported"<<std::endl;
return 0;
}
else if (error)
{
osg::notify(osg::WARN)<<" .... another error code means that the font file could not"<<std::endl;
osg::notify(osg::WARN)<<" .... be opened, read or simply that it is broken..."<<std::endl;
OSG_WARN<<" .... another error code means that the font file could not"<<std::endl;
OSG_WARN<<" .... be opened, read or simply that it is broken..."<<std::endl;
return 0;
}

View File

@@ -62,7 +62,7 @@ class ReaderWriterFreeType : public osgDB::ReaderWriter
FreeTypeLibrary* freeTypeLibrary = FreeTypeLibrary::instance();
if (!freeTypeLibrary)
{
osg::notify(osg::WARN)<<"Warning:: cannot create freetype font after freetype library has been deleted."<<std::endl;
OSG_WARN<<"Warning:: cannot create freetype font after freetype library has been deleted."<<std::endl;
return ReadResult::ERROR_IN_READING_FILE;
}
@@ -77,7 +77,7 @@ class ReaderWriterFreeType : public osgDB::ReaderWriter
FreeTypeLibrary* freeTypeLibrary = FreeTypeLibrary::instance();
if (!freeTypeLibrary)
{
osg::notify(osg::WARN)<<"Warning:: cannot create freetype font after freetype library has been deleted."<<std::endl;
OSG_WARN<<"Warning:: cannot create freetype font after freetype library has been deleted."<<std::endl;
return ReadResult::ERROR_IN_READING_FILE;
}