]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tileentry.hxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Scenery / tileentry.hxx
index 0abcebaab0651d2407c4e8feb6f9201e80f7c1b1..fec233e997cf06836089048cf0c5fcccfd4dc4a9 100644 (file)
@@ -182,12 +182,28 @@ private:
      */
     volatile int pending_models;
 
-    ssgBranch* obj_load( const std::string& path,
+    bool obj_load( const std::string& path,
+                        ssgBranch* geometry,
+                        ssgBranch* rwy_lights,
                         ssgVertexArray* gound_lights,
                         bool is_base );
 
     ssgLeaf* gen_lights( ssgVertexArray *lights, int inc, float bright );
 
+    double timestamp;
+
+
+    // this variable tracks the status of the incremental memory freeing.
+    enum {
+        NODES = 0x01,
+        VEC_PTRS = 0x02,
+        TERRA_NODE = 0x04,
+        GROUND_LIGHTS = 0x08,
+        RWY_LIGHTS = 0x10,
+        LIGHTMAPS = 0x20
+    };
+    int free_tracker;
+
 public:
 
     // ADA --->
@@ -202,14 +218,13 @@ public:
     // Destructor
     ~FGTileEntry();
 
-#ifdef WISH_PLIB_WAS_THREADED // but it isn't
-    // Schedule tile to be freed/removed
-    void sched_removal();
-#endif
-
     // Clean up the memory used by this tile and delete the arrays
-    // used by ssg as well as the whole ssg branch
-    void free_tile();
+    // 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();
 
     // Calculate this tile's offset
     void SetOffset( const Point3D& p)
@@ -222,7 +237,7 @@ public:
 
     // 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( const Point3D& p, float vis);
+    void prep_ssg_node( const Point3D& p, sgVec3 up, float vis);
 
     /**
      * Load tile data from a file.
@@ -255,13 +270,26 @@ public:
     /**
      * Add terrain mesh and ground lighting to scene graph.
      */
-    void add_ssg_nodes( ssgBranch* terrain, ssgBranch* ground );
+    void add_ssg_nodes( ssgBranch* terrain_branch,
+                       ssgBranch* gnd_lights_branch,
+                       ssgBranch* rwy_lights_branch );
 
     /**
      * disconnect terrain mesh and ground lighting nodes from scene
      * graph for this tile.
      */
     void disconnect_ssg_nodes();
+
+       
+    /**
+     * return the SSG Transform node for the terrain
+     */
+    inline ssgTransform *get_terra_transform() { return terra_transform; }
+
+    void set_timestamp(double time_ms) { timestamp = time_ms; }
+
+    inline double get_timestamp() const { return timestamp; }
+
 };