]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resourcemanager.cpp
Pass the resource collection to async loaders
[libs/gl.git] / source / resourcemanager.cpp
index 733cfaff8c4c37ba5ae1ffbd605ceb3f8d6a58df..481e9a176b00b038b04f412f2c841448ba46dad9 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/strings/format.h>
 #include <msp/time/utils.h>
 #include "resourcemanager.h"
+#include "resources.h"
 #include "resourcewatcher.h"
 
 using namespace std;
@@ -283,7 +284,8 @@ void ResourceManager::ManagedResource::start_loading()
        if(!io)
                throw resource_load_error(location.name, "open failed");
 
-       loader = resource->load(*io);
+       const Resources *res = dynamic_cast<Resources *>(location.collection);
+       loader = resource->load(*io, res);
        if(!loader)
        {
                delete io;