]> git.mxchange.org Git - simgear.git/blob - simgear/scene/util/OptionsReadFileCallback.cxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / util / OptionsReadFileCallback.cxx
1 // Copyright (C) 2012 Mathias Froehlich
2 //
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License as
5 // published by the Free Software Foundation; either version 2 of the
6 // License, or (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 //
17
18 #ifdef HAVE_CONFIG_H
19 #  include <simgear_config.h>
20 #endif
21
22 #include "OptionsReadFileCallback.hxx"
23
24 #include <osgDB/Registry>
25
26 namespace simgear {
27
28 OptionsReadFileCallback::~OptionsReadFileCallback()
29 {
30 }
31
32 osgDB::ReaderWriter::ReadResult
33 OptionsReadFileCallback::openArchive(const std::string& name, osgDB::ReaderWriter::ArchiveStatus status,
34                                 unsigned int indexBlockSizeHint, const osgDB::Options* options)
35 {
36     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
37     if (callback)
38         return callback->openArchive(name, status, indexBlockSizeHint, options);
39     else
40         return osgDB::ReadFileCallback::openArchive(name, status, indexBlockSizeHint, options);
41 }
42
43 osgDB::ReaderWriter::ReadResult
44 OptionsReadFileCallback::readObject(const std::string& name, const osgDB::Options* options)
45 {
46     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
47     if (callback)
48         return callback->readObject(name, options);
49     else
50         return osgDB::ReadFileCallback::readObject(name, options);
51 }
52
53 osgDB::ReaderWriter::ReadResult
54 OptionsReadFileCallback::readImage(const std::string& name, const osgDB::Options* options)
55 {
56     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
57     if (callback)
58         return callback->readImage(name, options);
59     else
60         return osgDB::ReadFileCallback::readImage(name, options);
61 }
62
63 osgDB::ReaderWriter::ReadResult
64 OptionsReadFileCallback::readHeightField(const std::string& name, const osgDB::Options* options)
65 {
66     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
67     if (callback)
68         return callback->readHeightField(name, options);
69     else
70         return osgDB::ReadFileCallback::readHeightField(name, options);
71 }
72
73 osgDB::ReaderWriter::ReadResult
74 OptionsReadFileCallback::readNode(const std::string& name, const osgDB::Options* options)
75 {
76     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
77     if (callback)
78         return callback->readNode(name, options);
79     else
80         return osgDB::ReadFileCallback::readNode(name, options);
81 }
82
83 osgDB::ReaderWriter::ReadResult
84 OptionsReadFileCallback::readShader(const std::string& name, const osgDB::Options* options)
85 {
86     osgDB::ReadFileCallback* callback = osgDB::Registry::instance()->getReadFileCallback();
87     if (callback)
88         return callback->readShader(name, options);
89     else
90         return osgDB::ReadFileCallback::readShader(name, options);
91 }
92
93 }