X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Ftgdb%2FTileEntry.hxx;h=5fc6982765a57397bb7343b7683d7209c2c95ba0;hb=2cc2a857a2cc2daff30601e0f8f697c768dd5b30;hp=4ebc993f1935d60567b6c46d5379d06a8481bb55;hpb=367f1813dea1e24d6f7e7eb3ecbcfa87cb98a5d1;p=simgear.git diff --git a/simgear/scene/tgdb/TileEntry.hxx b/simgear/scene/tgdb/TileEntry.hxx index 4ebc993f..5fc69827 100644 --- a/simgear/scene/tgdb/TileEntry.hxx +++ b/simgear/scene/tgdb/TileEntry.hxx @@ -32,12 +32,11 @@ #include #include -#include STL_STRING +#include #include #include #include -#include #include #include @@ -48,8 +47,8 @@ #include #endif -SG_USING_STD(string); -SG_USING_STD(vector); +using std::string; +using std::vector; namespace simgear { @@ -73,6 +72,9 @@ private: // pointer to ssg range selector for this tile osg::ref_ptr _node; + // Reference to DatabaseRequest object set and used by the + // osgDB::DatabasePager. + osg::ref_ptr _databaseRequest; static bool obj_load( const std::string& path, osg::Group* geometry, @@ -88,22 +90,6 @@ private: */ bool is_inner_ring; - /** - * this variable tracks the status of the incremental memory - * freeing. - */ - enum { - NODES = 0x01, - VEC_PTRS = 0x02, - TERRA_NODE = 0x04, - GROUND_LIGHTS = 0x08, - VASI_LIGHTS = 0x10, - RWY_LIGHTS = 0x20, - TAXI_LIGHTS = 0x40, - LIGHTMAPS = 0x80 - }; - int free_tracker; - static ModelLoadHelper *_modelLoader; public: @@ -116,14 +102,6 @@ public: static void setModelLoadHelper(ModelLoadHelper *m) { _modelLoader=m; } - // Clean up the memory used by this tile and delete the arrays - // used by ssg as well as the whole ssg branch. This does a - // partial clean up and exits so we can spread the load across - // multiple frames. Returns false if work remaining to be done, - // true if dynamically allocated memory used by this tile is - // completely freed. - bool free_tile(); - // Update the ssg transform node for this tile so it can be // properly drawn relative to our (0,0,0) point void prep_ssg_node(float vis); @@ -131,8 +109,8 @@ public: /** * Transition to OSG database pager */ - static osg::Node* loadTileByName(const std::string& index_str, - const osgDB::ReaderWriter::Options*); + static osg::Node* loadTileByFileName(const std::string& index_str, + const osgDB::ReaderWriter::Options*); /** * Return true if the tile entry is loaded, otherwise return false * indicating that the loading thread is still working on this. @@ -169,6 +147,13 @@ public: inline bool get_inner_ring() const { return is_inner_ring; } inline void set_inner_ring( bool val ) { is_inner_ring = val; } + + // Get the ref_ptr to the DatabaseRequest object, in order to pass + // this to the pager. + osg::ref_ptr& getDatabaseRequest() + { + return _databaseRequest; + } }; class ModelLoadHelper {