]> git.mxchange.org Git - simgear.git/commitdiff
Return ReadResult::FILE_NOT_HANDLED for unknown extensions.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 17 Dec 2011 18:08:18 +0000 (19:08 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sat, 17 Dec 2011 18:11:26 +0000 (19:11 +0100)
This fixes a problem with fonts no longer being correctly
loaded as a side effect of the spt meta object loader.
The readObject slot is obviously being called for several
unrelated file extensions. To make sure the search continues,
osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED needs to
be returned in this case.

simgear/scene/tgdb/ReaderWriterSPT.cxx

index 09edea5488997ada1f2fdd9d4940d4a0a5600f22..02c3e1425ce9f360ef6a720fb3cad546571dfa25 100644 (file)
@@ -54,6 +54,10 @@ ReaderWriterSPT::className() const
 osgDB::ReaderWriter::ReadResult
 ReaderWriterSPT::readObject(const std::string& fileName, const osgDB::Options* options) const
 {
+    // We get called with different extensions. To make sure search continues,
+    // we need to return FILE_NOT_HANDLED in this case.
+    if (osgDB::getLowerCaseFileExtension(fileName) != "spt")
+        return ReadResult(osgDB::ReaderWriter::ReadResult::FILE_NOT_HANDLED);
     if (fileName != "state.spt")
         return ReadResult(osgDB::ReaderWriter::ReadResult::FILE_NOT_FOUND);