[osg-submissions] Bug in osgPlugins logo display solved
Mathieu MARACHE
mathieu.marache at gmail.com
Tue Jun 3 06:36:30 PDT 2008
Hi,
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.
8<----------------
Index: src/osgPlugins/logo/ReaderWriterLOGO.cpp
===================================================================
--- src/osgPlugins/logo/ReaderWriterLOGO.cpp (révision 8402)
+++ src/osgPlugins/logo/ReaderWriterLOGO.cpp (copie de travail)
@@ -98,8 +98,8 @@
{
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 @@
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; }
@@ -209,8 +211,15 @@
if (fileName.empty())
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;
unsigned int screen = 0;
----------------->8
HTH
--
Mathieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080603/fde270c9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReaderWriterLOGO.cpp
Type: text/x-c++src
Size: 10449 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080603/fde270c9/attachment-0001.cpp>
More information about the osg-submissions
mailing list