class resource_load_error: public std::runtime_error
{
public:
+ resource_load_error(const std::string &, const std::string &);
resource_load_error(const std::string &, const std::exception &);
virtual ~resource_load_error() throw() { }
};
LOAD_MANUALLY
};
+ struct ResourceLocation
+ {
+ DataFile::Collection *collection;
+ std::string name;
+
+ ResourceLocation();
+ ResourceLocation(DataFile::Collection &, const std::string &);
+ };
+
private:
struct ManagedResource
{
};
Resource *resource;
- DataFile::Collection *collection;
- std::string name;
+ ResourceLocation location;
IO::Seekable *io;
Resource::AsyncLoader *loader;
State state;
void add_resource(Resource &);
void *get_data_for_resource(const Resource &);
void set_resource_location(Resource &, DataFile::Collection &, const std::string &);
+ void set_resource_location(Resource &, const ResourceLocation &);
+ const ResourceLocation *get_resource_location(const Resource &) const;
void load_resource(Resource &);
- bool is_resource_loaded(const Resource &);
+ bool is_resource_loaded(const Resource &) const;
void resource_used(const Resource &);
void remove_resource(Resource &);