From: fredb Date: Fri, 28 Apr 2006 18:05:46 +0000 (+0000) Subject: Redefine the default PLIB loader behavior : don't clear the texture cache after every... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f72b3882c36c83f3f83c9523a82f7d0c5ed519da;p=simgear.git Redefine the default PLIB loader behavior : don't clear the texture cache after every model load --- diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index 6d42025d..edb91f27 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -234,6 +234,12 @@ static void makeDList( ssgBranch *b, const set &ignore ) } } +class sgLoaderOptions : public ssgLoaderOptions { +public: + void endLoad() {} // Avoid clearing the texture cache after every model load +}; + +static sgLoaderOptions loaderOptions; //////////////////////////////////////////////////////////////////////// @@ -280,7 +286,7 @@ sgLoad3DModel( const string &fg_root, const string &path, texturepath = texturepath.dir(); ssgTexturePath((char *)texturepath.c_str()); - model = (ssgBranch *)ssgLoad((char *)modelpath.c_str()); + model = (ssgBranch *)ssgLoad((char *)modelpath.c_str(), &loaderOptions); if (model == 0) throw sg_io_exception("Failed to load 3D model", sg_location(modelpath.str()));