From f664f7a2018f9442b0f828bb8e50d2b1d0cb7717 Mon Sep 17 00:00:00 2001 From: fredb Date: Sat, 29 Apr 2006 08:09:51 +0000 Subject: [PATCH] Fix the initial texture path problem. Loaders are setting the one given to ssgLoad as the default one behind our back :-( --- simgear/scene/model/model.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index edb91f27..7900114b 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -234,12 +234,13 @@ static void makeDList( ssgBranch *b, const set &ignore ) } } -class sgLoaderOptions : public ssgLoaderOptions { +class SGLoaderOptions : public ssgLoaderOptions { public: + SGLoaderOptions() { ssgSetCurrentOptions( this ); } // Install our own loader options at startup void endLoad() {} // Avoid clearing the texture cache after every model load }; -static sgLoaderOptions loaderOptions; +static SGLoaderOptions loaderOptions; //////////////////////////////////////////////////////////////////////// @@ -286,7 +287,7 @@ sgLoad3DModel( const string &fg_root, const string &path, texturepath = texturepath.dir(); ssgTexturePath((char *)texturepath.c_str()); - model = (ssgBranch *)ssgLoad((char *)modelpath.c_str(), &loaderOptions); + model = (ssgBranch *)ssgLoad((char *)modelpath.c_str()); if (model == 0) throw sg_io_exception("Failed to load 3D model", sg_location(modelpath.str())); -- 2.39.5