]> git.tdb.fi Git - libs/gl.git/commitdiff
Support nested scenes in datafiles
authorMikko Rasa <tdb@tdb.fi>
Wed, 21 Apr 2021 13:43:33 +0000 (16:43 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 21 Apr 2021 13:43:33 +0000 (16:43 +0300)
This was supposed to be added before 7ae4af7.

source/render/scene.cpp
source/render/scene.h

index b8cdc04516191226b76fd9a89f16b65721106b70..c0a4e1c517cb5306de1a073147ae83bbaf33eb5d 100644 (file)
@@ -111,6 +111,7 @@ void Scene::Loader::init()
 {
        add("object", &Loader::object);
        add("object", &Loader::object_tagged);
+       add("scene", &Loader::scene);
 }
 
 void Scene::Loader::object(const string &n)
@@ -128,6 +129,11 @@ void Scene::Loader::object_tagged(const string &n, const string &t)
        obj.owned_data.push_back(inst.release());
 }
 
+void Scene::Loader::scene(const string &n)
+{
+       obj.add(get_collection().get<Scene>(n));
+}
+
 
 DataFile::Loader::ActionMap Scene::GenericLoader::shared_actions;
 
index 305bf62aefd5a2ed3fb4748bf9258772643eb52b..33678b7998900fac18f25cb113f181f5d654e9f3 100644 (file)
@@ -35,6 +35,7 @@ protected:
 
                void object(const std::string &);
                void object_tagged(const std::string &, const std::string &);
+               void scene(const std::string &);
        };
 
 public: