+void Resources::set_resource_manager(ResourceManager *m)
+{
+ resource_manager = m;
+}
+
+Material *Resources::create_material(const string &name)
+{
+ if(RefPtr<IO::Seekable> io = open_raw(name))
+ {
+ DataFile::Parser parser(*io, name);
+ Material::GenericLoader ldr(this);
+ ldr.load(parser);
+ return ldr.get_material();
+ }
+
+ return 0;
+}
+
+Mesh *Resources::create_mesh(const string &name)
+{
+ if(!resource_manager)
+ return 0;
+
+ if(RefPtr<IO::Seekable> io = open_raw(name))
+ {
+ RefPtr<Mesh> mesh = new Mesh(resource_manager);
+ resource_manager->set_resource_location(*mesh, *this, name);
+ return mesh.release();
+ }
+
+ return 0;
+}
+