1 // tileentry.cxx -- routines to handle a scenery tile
3 // Written by Curtis Olson, started May 1998.
5 // Copyright (C) 1998 - 2001 Curtis L. Olson - http://www.flightgear.org/~curt
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 # include <simgear_config.h>
26 #include <simgear/scene/model/ModelRegistry.hxx>
28 #include <osgDB/Registry>
29 #include <osgDB/FileNameUtils>
31 #include "TileEntry.hxx"
32 #include "ReaderWriterSTG.hxx"
34 using namespace simgear;
36 ReaderWriterSTG::ReaderWriterSTG()
38 supportsExtension("stg", "SimGear stg database format");
41 ReaderWriterSTG::~ReaderWriterSTG()
45 const char* ReaderWriterSTG::className() const
47 return "STG Database reader";
50 //#define SLOW_PAGER 1
55 osgDB::ReaderWriter::ReadResult
56 ReaderWriterSTG::readNode(const std::string& fileName,
57 const osgDB::ReaderWriter::Options* options) const
59 std::string tileName = osgDB::getNameLessExtension(fileName);
61 osg::Node* result = TileEntry::loadTileByName(tileName, options);
62 // For debugging race conditions
69 return ReadResult::FILE_NOT_HANDLED;