]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tileentry.hxx
Start of code to load, manage, and query the navaid database.
[flightgear.git] / src / Scenery / tileentry.hxx
index 8a5ec4c0a1df60a6d238cac29b559f487c64e285..3ccd50f819e0d9fc3cf190faa5f8271cba3609be 100644 (file)
 #endif
 
 #include <GL/glut.h>
-#include <XGL/xgl.h>
+#include <simgear/xgl/xgl.h>
 
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
 
 #include <vector>
 #include STL_STRING
 
-#include <ssg.h>               // plib includes
+#include <plib/ssg.h>          // plib includes
+
+#include <simgear/bucket/newbucket.hxx>
+#include <simgear/math/point3d.hxx>
 
-#include <Bucket/newbucket.hxx>
-#include <Math/mat3.h>
-#include <Math/point3d.hxx>
 #include <Objects/fragment.hxx>
 
-#ifdef FG_HAVE_NATIVE_SGI_COMPILERS
+#if defined( sgi )
 #include <strings.h>
 #endif
 
@@ -85,6 +85,10 @@ public:
     typedef container::iterator FragmentIterator;
     typedef container::const_iterator FragmentConstIterator;
 
+    typedef vector < sgVec3 * > free_vec3_list;
+    typedef vector < sgVec2 * > free_vec2_list;
+    typedef vector < unsigned short * > free_index_list;
+
 public:
     // node list (the per fragment face lists reference this node list)
     point_list nodes;
@@ -107,9 +111,15 @@ public:
     container fragment_list;
 
     // ssg related structures
-    sgVec3 *vtlist;
-    sgVec3 *vnlist;
-    sgVec2 *tclist;
+    // sgVec3 *vtlist;
+    // sgVec3 *vnlist;
+    // sgVec2 *tclist;
+
+    // list of pointers to memory chunks that need to be freed when
+    // tile entry goes away
+    free_vec3_list vec3_ptrs;
+    free_vec2_list vec2_ptrs;
+    free_index_list index_ptrs;
 
     // ssg tree structure for this tile is as follows:
     // ssgRoot(scene)
@@ -161,9 +171,9 @@ public:
     void free_tile();
 
     // Calculate this tile's offset
-    void SetOffset( const Point3D& off)
+    void SetOffset( const Point3D& p)
     {
-       offset = center - off;
+       offset = center - p;
     }
 
     // Return this tile's offset
@@ -202,6 +212,7 @@ public:
        return state == Scheduled_for_cache;
     }
     inline bool is_loaded() const { return state == Loaded; }
+    inline bool is_cached() const { return state == Cached; }
 
     inline void mark_unused() { state = Unused; }
     inline void mark_scheduled_for_use() { state = Scheduled_for_use; }