From: frohlich Date: Tue, 19 May 2009 05:30:16 +0000 (+0000) Subject: Restore the special capability of the btg reader to read compressed files. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8f7527ede0b4caca8d68aa01fefafbc022ab1a3f;p=simgear.git Restore the special capability of the btg reader to read compressed files. Modified Files: scene/tgdb/SGReaderWriterBTG.cxx scene/tgdb/SGReaderWriterBTG.hxx --- diff --git a/simgear/scene/tgdb/SGReaderWriterBTG.cxx b/simgear/scene/tgdb/SGReaderWriterBTG.cxx index 1fa3e981..90341f96 100644 --- a/simgear/scene/tgdb/SGReaderWriterBTG.cxx +++ b/simgear/scene/tgdb/SGReaderWriterBTG.cxx @@ -45,6 +45,15 @@ const char* SGReaderWriterBTG::className() const return "BTG Database reader"; } +bool +SGReaderWriterBTG::acceptsExtension(const std::string& extension) const +{ + std::string lowercase_ext = osgDB::convertToLowerCase(extension); + if (lowercase_ext == "gz") + return true; + return osgDB::ReaderWriter::acceptsExtension(extension); +} + osgDB::ReaderWriter::ReadResult SGReaderWriterBTG::readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const diff --git a/simgear/scene/tgdb/SGReaderWriterBTG.hxx b/simgear/scene/tgdb/SGReaderWriterBTG.hxx index ca5f4a73..a28ea7eb 100644 --- a/simgear/scene/tgdb/SGReaderWriterBTG.hxx +++ b/simgear/scene/tgdb/SGReaderWriterBTG.hxx @@ -28,6 +28,7 @@ public: virtual const char* className() const; + virtual bool acceptsExtension(const std::string& /*extension*/) const; virtual ReadResult readNode(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const;