From: ehofman Date: Mon, 22 Aug 2005 17:44:35 +0000 (+0000) Subject: Harald JOHNSEN: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=68eb7031e2dce999d112d0164fa28d4b8d66922e;p=simgear.git Harald JOHNSEN: - model.cxx : load the 2.5D panels before the animations so that the panels can be used in animations his solve the problem of 2.5D panels visible outside of the aircraft (one can add a null animation to put the panel at the top of the aircraft graph so it is drawn first) and this adds the possibility to have billboarded/popup panels. - newcloud.cxx : removed 'this' pointer cast for amd64 compiler. --- 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;