From: ehofman Date: Sun, 10 Oct 2004 17:49:27 +0000 (+0000) Subject: Frederic: Use display lists for 3d models also. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1697cb3b1a20aa7b6cb85e45838c1807902af664;p=simgear.git Frederic: Use display lists for 3d models also. --- diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index e2059c9f..645b6fc4 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -208,6 +208,19 @@ sgMakeAnimation( ssgBranch * model, } +static void makeDList( ssgBranch *b ) +{ + int nb = b->getNumKids(); + for (int i = 0; igetKid(i); + if (e->isAKindOf(ssgTypeLeaf())) { + ((ssgLeaf*)e)->makeDList(); + } else if (e->isAKindOf(ssgTypeBranch())) { + makeDList( (ssgBranch*)e ); + } + } +} + //////////////////////////////////////////////////////////////////////// @@ -258,6 +271,10 @@ sgLoad3DModel( const string &fg_root, const string &path, throw sg_exception("Failed to load 3D model"); } + if ( model != 0 ) { + makeDList( model ); + } + // Set up the alignment node ssgTransform * alignmainmodel = new ssgTransform; if ( load_panel == 0 )