It's better to load all meshes first so the geometry can be seen.
static void unbind();
+ virtual int get_load_priority() const { return 1; }
virtual Resource::AsyncLoader *load(IO::Seekable &, const Resources * = 0);
virtual UInt64 get_data_size() const;
virtual void unload();
void set_manager(ResourceManager *);
ResourceManager *get_manager() const { return manager; }
void *get_manager_data() const { return manager_data; }
+ virtual int get_load_priority() const { return 0; }
virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) = 0;
virtual bool is_loaded() const;
virtual UInt64 get_data_size() const = 0;
if(async_loads)
{
managed.state = ManagedResource::LOAD_QUEUED;
- queue.push_back(&managed);
+ LoadQueue::iterator i;
+ for(i=queue.begin(); (i!=queue.end() && (*i)->load_priority>=managed.load_priority); ++i) ;
+ queue.insert(i, &managed);
}
else
{
ResourceManager::ManagedResource::ManagedResource(Resource &r):
resource(&r),
+ load_priority(r.get_load_priority()),
io(0),
loader(0),
state(NOT_LOADED),
Resource *resource;
ResourceLocation location;
+ bool load_priority;
IO::Seekable *io;
Resource::AsyncLoader *loader;
State state;