From f72b3882c36c83f3f83c9523a82f7d0c5ed519da Mon Sep 17 00:00:00 2001 From: fredb Date: Fri, 28 Apr 2006 18:05:46 +0000 Subject: [PATCH] Redefine the default PLIB loader behavior : don't clear the texture cache after every model load --- simgear/scene/model/model.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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())); -- 2.39.2