center( Point3D( 0.0 ) ),
tile_bucket( b ),
terra_transform( new ssgTransform ),
- terra_range( new ssgRangeSelector )
+ terra_range( new ssgRangeSelector ),
+ loaded(false)
{
nodes.clear();
<< " texture coordinate arrays" );
for ( i = 0; i < (int)vec3_ptrs.size(); ++i ) {
-#if defined(macintosh) || defined(_MSC_VER)
delete [] vec3_ptrs[i]; //that's the correct version
-#else
- delete vec3_ptrs[i];
-#endif
}
vec3_ptrs.clear();
for ( i = 0; i < (int)vec2_ptrs.size(); ++i ) {
-#if defined(macintosh) || defined(_MSC_VER)
delete [] vec2_ptrs[i]; //that's the correct version
-#else
- delete vec2_ptrs[i];
-#endif
}
vec2_ptrs.clear();
// Update the ssg transform node for this tile so it can be
// properly drawn relative to our (0,0,0) point
void FGTileEntry::prep_ssg_node( const Point3D& p, float vis) {
+ if ( !loaded ) return;
+
SetOffset( p );
// #define USE_UP_AND_COMING_PLIB_FEATURE
void
-FGTileEntry::load( SGPath& tile_path, bool is_base )
+FGTileEntry::load( const SGPath& base, bool is_base )
{
// a cheesy hack (to be fixed later)
extern ssgBranch *terrain;
string index_str = tile_bucket.gen_index_str();
+ SGPath tile_path = base;
// Generate name of file to load.
tile_path.append( tile_bucket.gen_base_path() );
SGPath basename = tile_path;
ground->addKid( lights_transform );
}
/* end of ground light section */
+
+ loaded = true;
}
// want based on lighting conditions.
ssgSelector *lights_brightness;
+ /**
+ * Indicates this tile has been loaded from a file.
+ * Note that this may be set asynchronously by another thread.
+ */
+ volatile bool loaded;
+
ssgBranch* obj_load( const std::string& path,
ssgVertexArray* lights, bool is_base );
* @param is_base is this a base terrain object for which we should generate
* random ground light points
*/
- void load( SGPath& base, bool is_base );
+ void load( const SGPath& base, bool is_base );
};