manager_data = 0;
}
+bool Resource::is_loaded() const
+{
+ return manager ? manager->is_resource_loaded(*this) : true;
+}
+
} // namespace GL
} // namespace Msp
ResourceManager *get_manager() const { return manager; }
void *get_manager_data() const { return manager_data; }
virtual AsyncLoader *load(IO::Seekable &) = 0;
+ virtual bool is_loaded() const;
virtual UInt64 get_data_size() const = 0;
virtual void unload() = 0;
};
}
}
+bool ResourceManager::is_resource_loaded(const Resource &r)
+{
+ ManagedResource *managed = reinterpret_cast<ManagedResource *>(r.get_manager_data());
+ return managed ? managed->state==ManagedResource::LOADED : false;
+}
+
void ResourceManager::resource_used(const Resource &r)
{
ManagedResource *managed = reinterpret_cast<ManagedResource *>(r.get_manager_data());
void *get_data_for_resource(const Resource &);
void set_resource_location(Resource &, DataFile::Collection &, const std::string &);
void load_resource(Resource &);
+ bool is_resource_loaded(const Resource &);
void resource_used(const Resource &);
void remove_resource(Resource &);