Detecting them by the underscore at the beginning of the name feels a
little dodgy, but it will do for now.
Mesh *Resources::create_mesh(const string &name)
{
Mesh *Resources::create_mesh(const string &name)
{
+ if(!resource_manager || name[0]=='_')
return 0;
if(RefPtr<IO::Seekable> io = open_raw(name))
return 0;
if(RefPtr<IO::Seekable> io = open_raw(name))
Texture *Resources::create_texture(const string &name)
{
Texture *Resources::create_texture(const string &name)
{
+ bool managed = (resource_manager && name[0]!='_');
+
string ext = FS::extpart(name);
if(ext==".tex")
string ext = FS::extpart(name);
if(ext==".tex")
- return create_generic<Texture, GenericResourceLoader<Texture>>(name);
+ {
+ if(managed)
+ return create_generic<Texture, GenericResourceLoader<Texture>>(name);
+ else
+ return create_generic<Texture>(name);
+ }
if(RefPtr<IO::Seekable> io = open_raw(name))
{
if(RefPtr<IO::Seekable> io = open_raw(name))
{
// Verify that the image is loadable
Graphics::Image image;
// Verify that the image is loadable
Graphics::Image image;
image.load_io(*io);
tex = new Texture2D;
image.load_io(*io);
tex = new Texture2D;
- tex->set_manager(resource_manager);
+ if(managed)
+ {
+ tex->set_manager(resource_manager);
resource_manager->set_resource_location(*tex, *this, name);
resource_manager->set_resource_location(*tex, *this, name);