Updated pfb loader to load pfb files into osg. Still broken for loading osg
files into Performer, however.
This commit is contained in:
parent
06dafa487e
commit
d66bfdbbc5
@ -1,6 +1,8 @@
|
||||
#!smake
|
||||
include ../../../Make/makedefs
|
||||
|
||||
CFILES = \
|
||||
|
||||
C++FILES = \
|
||||
ConvertFromPerformer.cpp\
|
||||
ConvertToPerformer.cpp\
|
||||
@ -8,16 +10,26 @@ C++FILES = \
|
||||
|
||||
LIB = ../../../lib/osgPlugins/osgdb_pfb.so
|
||||
|
||||
#LIBS = -u __ucmpdi2 -lgcc -losg -losgDB ${PFLIBS}
|
||||
LIBS = -losg -losgDB ${PFLIBS}
|
||||
LIBS = \
|
||||
/usr/lib/Performer/Static/libpfdb/libpfpfb.a\
|
||||
/usr/lib/Performer/Static/libpfdu.a\
|
||||
/usr/lib/Performer/Static/libpfutil.a\
|
||||
/usr/lib/Performer/Static/libpf.a\
|
||||
-losg -losgDB
|
||||
|
||||
TARGET_LOADER_FILES = osgPlugins/osgdb_pfb.so
|
||||
|
||||
C++FLAGS += -I../../../include
|
||||
C++FLAGS += -g -I../../../include
|
||||
|
||||
LDFLAGS += -L../../../lib -L/usr/X11R6/lib
|
||||
LDFLAGS += -g -L../../../lib -L/usr/X11R6/lib
|
||||
|
||||
PREREQUISITES = preq
|
||||
|
||||
include ../../../Make/makerules
|
||||
|
||||
|
||||
preq :
|
||||
[ -f /usr/lib/blah ] || exit 1
|
||||
|
||||
|
||||
|
||||
|
@ -13,6 +13,11 @@
|
||||
#include <Performer/pfdu.h>
|
||||
#include <Performer/pr/pfTexture.h>
|
||||
|
||||
extern "C" {
|
||||
extern pfNode *pfdLoadFile_pfb( const char *);
|
||||
extern int pfdStoreFile_pfb( pfNode *, const char *);
|
||||
}
|
||||
|
||||
class ReaderWriterPFB : public osgDB::ReaderWriter
|
||||
{
|
||||
|
||||
@ -67,13 +72,12 @@ class ReaderWriterPFB : public osgDB::ReaderWriter
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual osg::Node* readNode(const std::string& fileName)
|
||||
virtual osg::Node* readNode(const std::string& fileName, const osgDB::ReaderWriter::Options*)
|
||||
{
|
||||
osg::notify(osg::INFO)<< "ReaderWriterPFB::readNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
initPerformer();
|
||||
|
||||
pfNode* root = pfdLoadFile(fileName.c_str());
|
||||
pfNode* root = pfdLoadFile_pfb(fileName.c_str());
|
||||
|
||||
ConvertFromPerformer converter;
|
||||
return converter.convert(root);
|
||||
@ -82,16 +86,13 @@ class ReaderWriterPFB : public osgDB::ReaderWriter
|
||||
|
||||
virtual bool writeNode(const osg::Node& node,const std::string& fileName)
|
||||
{
|
||||
|
||||
osg::notify(osg::INFO)<< "ReaderWriterPFB::writeNode( "<<fileName.c_str()<<" )\n";
|
||||
|
||||
initPerformer();
|
||||
|
||||
ConvertToPerformer converter;
|
||||
pfNode* root = converter.convert(&node);
|
||||
if (root)
|
||||
{
|
||||
return pfdStoreFile(root,fileName.c_str())!=0;
|
||||
return pfdStoreFile_pfb(root,fileName.c_str())!=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user