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();
vy = viewport->y();
vx = viewport->width();
vy = viewport->height();
vw = viewport->width();
vh = viewport->height();
}
glMatrixMode( GL_PROJECTION );
@ -161,6 +161,8 @@ class Logos: public osg::Drawable
osg::Image *image = osgDB::readImageFile( name.c_str() );
if( image != NULL )
logos[pos].push_back( image );
else
osg::notify(osg::WARN)<< "Logos::addLogo image file not found : " << name << ".\n";
}
osg::Viewport *getViewport() { return viewport; }
@ -211,6 +213,13 @@ class LOGOReaderWriter : public osgDB::ReaderWriter
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;
unsigned int screen = 0;