From Mathieu Marache, "I have made the logo plugin work again (a simple copy and paste problem) and added the path of the logo file (if not empty) to the data file path in order to be able to find images relatively."

This commit is contained in:
Robert Osfield 2008-06-06 14:59:17 +00:00
parent b6a0f3d8d0
commit c2a4825afa

View File

@ -98,8 +98,8 @@ class Logos: public osg::Drawable
{ {
vx = viewport->x(); vx = viewport->x();
vy = viewport->y(); vy = viewport->y();
vx = viewport->width(); vw = viewport->width();
vy = viewport->height(); vh = viewport->height();
} }
glMatrixMode( GL_PROJECTION ); glMatrixMode( GL_PROJECTION );
@ -161,6 +161,8 @@ class Logos: public osg::Drawable
osg::Image *image = osgDB::readImageFile( name.c_str() ); osg::Image *image = osgDB::readImageFile( name.c_str() );
if( image != NULL ) if( image != NULL )
logos[pos].push_back( image ); logos[pos].push_back( image );
else
osg::notify(osg::WARN)<< "Logos::addLogo image file not found : " << name << ".\n";
} }
osg::Viewport *getViewport() { return viewport; } osg::Viewport *getViewport() { return viewport; }
@ -209,7 +211,14 @@ class LOGOReaderWriter : public osgDB::ReaderWriter
if (fileName.empty()) if (fileName.empty())
return ReadResult::FILE_NOT_FOUND; return ReadResult::FILE_NOT_FOUND;
osg::notify(osg::INFO)<< "ReaderWriterLOGO::readNode( "<<fileName.c_str()<<" )\n"; osg::notify(osg::INFO)<< "ReaderWriterLOGO::readNode( "<<fileName.c_str()<<" )\n";
std::string filePath = osgDB::getFilePath(fileName);
if (!filePath.empty()) {
osg::notify(osg::DEBUG_INFO)<< "Adding : " << filePath << " to the file data path\n";
osgDB::getDataFilePathList().push_back(filePath);
}
osg::Geode *geode = new osg::Geode; osg::Geode *geode = new osg::Geode;