From Paul Martz, "Some small changes and code cleanup. Biggest change is an improvement to the WriteResult return."
This commit is contained in:
@@ -23,8 +23,6 @@
|
||||
#include <osgDB/ReadFile>
|
||||
|
||||
#include "ExportOptions.h"
|
||||
//#include "DataOutputStream.h"
|
||||
//#include "FltNodeVisitor.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace flt
|
||||
class FltWriteResult : public osgDB::ReaderWriter::WriteResult
|
||||
{
|
||||
public:
|
||||
FltWriteResult( WriteResult::WriteStatus status=WriteResult::FILE_NOT_HANDLED )
|
||||
FltWriteResult( WriteResult::WriteStatus status=WriteResult::FILE_SAVED )
|
||||
: WriteResult( status )
|
||||
{}
|
||||
|
||||
|
||||
@@ -451,11 +451,12 @@ class FLTReaderWriter : public ReaderWriter
|
||||
// must use Node::accept() which requires 'node' to be non-const.
|
||||
// Pretty much requires casting away const.
|
||||
osg::Node* nodeNonConst = const_cast<osg::Node*>( &node );
|
||||
if (!nodeNonConst)
|
||||
return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
nodeNonConst->accept( fnv );
|
||||
fnv.complete( node );
|
||||
|
||||
// FIXME: Error-handling?
|
||||
return WriteResult::FILE_SAVED;
|
||||
return fltOpt->getWriteResult();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -43,7 +43,7 @@ VertexPaletteManager::~VertexPaletteManager()
|
||||
if (_verticesStr.is_open())
|
||||
{
|
||||
osg::notify( osg::WARN ) << "fltexp: VertexPaletteManager destructor has an open temp file." << std::endl;
|
||||
// This should not happen. FltNodeVisitor::complete should close
|
||||
// This should not happen. FltExportVisitor::complete should close
|
||||
// this file before we get to this destructor.
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user