// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <simgear/scene/model/SGPagedLOD.hxx>
+#include <simgear/math/SGMath.hxx>
#include "SceneryPager.hxx"
#include <algorithm>
#include <functional>
}
void SceneryPager::requestNodeFile(const std::string& fileName, Group* group,
- float priority,
- const FrameStamp* framestamp
-#ifdef FGOSGPAGER25
- , ref_ptr<Referenced>& databaseRequest
+ float priority, const FrameStamp* framestamp,
+ ref_ptr<Referenced>& databaseRequest,
+#if SG_OSG_MIN_VERSION_REQUIRED(2,9,5)
+ const osg::Referenced* options
+#else
+ osgDB::ReaderWriter::Options* options
#endif
- )
+ )
{
simgear::SGPagedLOD *sgplod = dynamic_cast<simgear::SGPagedLOD*>(group);
if(sgplod)
DatabasePager::requestNodeFile(fileName, group, priority, framestamp,
-#ifdef FGOSGPAGER25
databaseRequest,
-#endif
sgplod->getReaderWriterOptions());
else
- DatabasePager::requestNodeFile(fileName, group, priority, framestamp
-#ifdef FGOSGPAGER25
- , databaseRequest
-#endif
- );
+ DatabasePager::requestNodeFile(fileName, group, priority, framestamp,
+ databaseRequest,
+ options);
}
void SceneryPager::queueRequest(const std::string& fileName, Group* group,
float priority, FrameStamp* frameStamp,
-#ifdef FGOSGPAGER25
ref_ptr<Referenced>& databaseRequest,
-#endif
osgDB::ReaderWriter::Options* options)
{
_pagerRequests.push_back(PagerRequest(fileName, group, priority,
frameStamp,
-#ifdef FGOSGPAGER25
databaseRequest,
-#endif
options));
}
bool arePagerRequests = false;
if (!_deleteRequests.empty()) {
areDeleteRequests = true;
-#ifdef FGOSGPAGER25
OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(_fileRequestQueue->_childrenToDeleteListMutex);
ObjectList& deleteList = _fileRequestQueue->_childrenToDeleteList;
-#else
- OpenThreads::ScopedLock<OpenThreads::Mutex>
- lock(_childrenToDeleteListMutex);
- ObjectList& deleteList = _childrenToDeleteList;
-#endif
deleteList.insert(deleteList.end(),
_deleteRequests.begin(),
_deleteRequests.end());
_pagerRequests.clear();
}
if (areDeleteRequests && !arePagerRequests) {
-#ifdef FGOSGPAGER25
_fileRequestQueue->updateBlock();
-#else
- updateDatabasePagerThreadBlock();
-#endif
}
DatabasePager::signalEndFrame();
}