]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resourcemanager.h
Delay opening the resource file until loading actually starts
[libs/gl.git] / source / resourcemanager.h
index f5ccac3bbf9a212eefe8611a865bb25a059737b2..244c67ec29cc5acda96ea303bddda0f7583cf1ee 100644 (file)
@@ -26,12 +26,20 @@ public:
 private:
        struct ManagedResource
        {
+               enum ResourceState
+               {
+                       NOT_LOADED,
+                       LOAD_QUEUED,
+                       LOADING,
+                       LOADED
+               };
+
                Resource *resource;
                DataFile::Collection *collection;
                std::string name;
                IO::Seekable *io;
                Resource::AsyncLoader *loader;
-               bool loaded;
+               ResourceState state;
                unsigned last_used;
                UInt64 data_size;
                std::vector<ResourceWatcher *> watchers;