From: Mikko Rasa Date: Wed, 21 Apr 2021 13:43:33 +0000 (+0300) Subject: Support nested scenes in datafiles X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fea2752a8abb1de5cc89addc92b804d9ff4fc89a;p=libs%2Fgl.git Support nested scenes in datafiles This was supposed to be added before 7ae4af7. --- diff --git a/source/render/scene.cpp b/source/render/scene.cpp index b8cdc045..c0a4e1c5 100644 --- a/source/render/scene.cpp +++ b/source/render/scene.cpp @@ -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(n)); +} + DataFile::Loader::ActionMap Scene::GenericLoader::shared_actions; diff --git a/source/render/scene.h b/source/render/scene.h index 305bf62a..33678b79 100644 --- a/source/render/scene.h +++ b/source/render/scene.h @@ -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: