]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/material.h
Migrate from LoadableTypeRegistry to TypeRegistry
[libs/gl.git] / source / materials / material.h
index a04e74585e56c9fbfc9088b27bc9eb4f1ff96c81..2f8f38ab7ce183c40492b3d75f2b11c2904939a6 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef MSP_GL_MATERIAL_H_
 #define MSP_GL_MATERIAL_H_
 
 #ifndef MSP_GL_MATERIAL_H_
 #define MSP_GL_MATERIAL_H_
 
+#include <msp/core/typeregistry.h>
 #include <msp/datafile/collection.h>
 #include <msp/datafile/collection.h>
-#include <msp/datafile/loadabletyperegistry.h>
 #include <msp/datafile/objectloader.h>
 #include "color.h"
 #include "programdata.h"
 #include <msp/datafile/objectloader.h>
 #include "color.h"
 #include "programdata.h"
@@ -64,7 +64,7 @@ public:
                template<typename T>
                struct AddType
                {
                template<typename T>
                struct AddType
                {
-                       static void add(GenericLoader &ldr, const std::string &kw) { ldr.add(kw, &GenericLoader::typed_material<T>); }
+                       void operator()(const std::string &kw, GenericLoader &ldr) const { ldr.add(kw, &GenericLoader::typed_material<T>); }
                };
 
                DataFile::Collection *coll;
                };
 
                DataFile::Collection *coll;
@@ -86,7 +86,7 @@ public:
        };
 
 private:
        };
 
 private:
-       typedef DataFile::LoadableTypeRegistry<GenericLoader, GenericLoader::AddType> MaterialRegistry;
+       typedef TypeRegistry<GenericLoader::AddType, GenericLoader &> MaterialRegistry;
 
 protected:
        const Sampler *sampler;
 
 protected:
        const Sampler *sampler;