1
0
Fork 0

Frederic: Add display list support without changing plib.

This commit is contained in:
ehofman 2004-10-10 17:41:11 +00:00
parent e6c6c666c2
commit f61014c2ea
2 changed files with 20 additions and 0 deletions

View file

@ -982,6 +982,19 @@ FGTileEntry::load( const string_list &path_list, bool is_base )
}
}
void
FGTileEntry::makeDList( ssgBranch *b )
{
int nb = b->getNumKids();
for (int i = 0; i<nb; i++) {
ssgEntity *e = b->getKid(i);
if (e->isAKindOf(ssgTypeLeaf())) {
((ssgLeaf*)e)->makeDList();
} else if (e->isAKindOf(ssgTypeBranch())) {
makeDList( (ssgBranch*)e );
}
}
}
void
FGTileEntry::add_ssg_nodes( ssgBranch *terrain_branch,
@ -992,6 +1005,8 @@ FGTileEntry::add_ssg_nodes( ssgBranch *terrain_branch,
{
// bump up the ref count so we can remove this later without
// having ssg try to free the memory.
makeDList( terra_transform );
terra_transform->ref();
terrain_branch->addKid( terra_transform );

View file

@ -259,6 +259,11 @@ public:
*/
inline SGBucket get_tile_bucket() const { return tile_bucket; }
/**
* Apply ssgLeaf::makeDList to all leaf of a branch
*/
void makeDList( ssgBranch *b );
/**
* Add terrain mesh and ground lighting to scene graph.
*/