Redefine the default PLIB loader behavior : don't clear the texture cache after every model load

This commit is contained in:
fredb
2006-04-28 18:05:46 +00:00
parent ea47a2973c
commit f72b3882c3

View File

@@ -234,6 +234,12 @@ static void makeDList( ssgBranch *b, const set<ssgBranch *> &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()));