diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index cae2718c..9d0ae8c5 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -226,6 +226,7 @@ static void makeDList( ssgBranch *b, const set &ignore ) for (int i = 0; igetKid(i); if (e->isAKindOf(ssgTypeLeaf())) { + if( ((ssgLeaf*)e)->getNumVertices() > 0) ((ssgLeaf*)e)->makeDList(); } else if (e->isAKindOf(ssgTypeBranch()) && ignore.find((ssgBranch *)e) == ignore.end()) { makeDList( (ssgBranch*)e, ignore ); @@ -321,6 +322,17 @@ sgLoad3DModel( const string &fg_root, const string &path, model->addKid(align); } + if ( load_panel ) { + // Load panels + vector panel_nodes = props.getChildren("panel"); + for (i = 0; i < panel_nodes.size(); i++) { + SG_LOG(SG_INPUT, SG_DEBUG, "Loading a panel"); + ssgEntity * panel = load_panel(panel_nodes[i]); + if (panel_nodes[i]->hasValue("name")) + panel->setName((char *)panel_nodes[i]->getStringValue("name")); + model->addKid(panel); + } + } // Load animations set ignore_branches; vector animation_nodes = props.getChildren("animation"); @@ -338,17 +350,6 @@ sgLoad3DModel( const string &fg_root, const string &path, } #endif - if ( load_panel ) { - // Load panels - vector panel_nodes = props.getChildren("panel"); - for (i = 0; i < panel_nodes.size(); i++) { - SG_LOG(SG_INPUT, SG_DEBUG, "Loading a panel"); - ssgEntity * panel = load_panel(panel_nodes[i]); - if (panel_nodes[i]->hasValue("name")) - panel->setName((char *)panel_nodes[i]->getStringValue("name")); - model->addKid(panel); - } - } return alignmainmodel; } diff --git a/simgear/scene/sky/newcloud.cxx b/simgear/scene/sky/newcloud.cxx index 7607113c..a527b792 100644 --- a/simgear/scene/sky/newcloud.cxx +++ b/simgear/scene/sky/newcloud.cxx @@ -48,6 +48,7 @@ bool SGNewCloud::useAnisotropic = true; SGBbCache *SGNewCloud::cldCache = 0; static bool texturesLoaded = false; static float minx, maxx, miny, maxy, minz, maxz; +static int cloudIdCounter = 1; float SGNewCloud::nearRadius = 3500.0f; bool SGNewCloud::lowQuality = false; @@ -64,7 +65,7 @@ void SGNewCloud::init(void) { pauseLength = 0.0f; last_step = -1.0f; familly = CLFamilly_nn; - cloudId = (int) this; + cloudId = ++cloudIdCounter; sgSetVec3(center, 0.0f, 0.0f, 0.0f); sgSetVec3(cloudpos, 0.0f, 0.0f, 0.0f); radius = 0.0f;