From 8f7527ede0b4caca8d68aa01fefafbc022ab1a3f Mon Sep 17 00:00:00 2001 From: frohlich Date: Tue, 19 May 2009 05:30:16 +0000 Subject: [PATCH] Restore the special capability of the btg reader to read compressed files. Modified Files: scene/tgdb/SGReaderWriterBTG.cxx scene/tgdb/SGReaderWriterBTG.hxx --- simgear/scene/tgdb/SGReaderWriterBTG.cxx | 9 +++++++++ simgear/scene/tgdb/SGReaderWriterBTG.hxx | 1 + 2 files changed, 10 insertions(+) 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; -- 2.39.5