Mesh *Resources::create_mesh(const string &name)
{
- if(!resource_manager)
+ if(!resource_manager || name[0]=='_')
return 0;
if(RefPtr<IO::Seekable> io = open_raw(name))
Texture *Resources::create_texture(const string &name)
{
+ bool managed = (resource_manager && name[0]!='_');
+
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))
{
// Verify that the image is loadable
Graphics::Image image;
- if(!resource_manager)
+ if(!managed)
image.load_io(*io);
tex = new Texture2D;
- tex->set_manager(resource_manager);
- if(resource_manager)
+ if(managed)
+ {
+ tex->set_manager(resource_manager);
resource_manager->set_resource_location(*tex, *this, name);
+ }
else
tex->image(image);