X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fscene.cpp;h=e6c62e802f8c9672fafce477d3eae50c9f2efaac;hp=ef1f246bac0c4f61b2ec5dc3bf402bf32067f10d;hb=8bc776f177c7cf9d0c6fd9590273f086d38c23ca;hpb=573ea4e5602c4321cc1d75daf9ed0beed5cde280 diff --git a/source/scene.cpp b/source/scene.cpp index ef1f246b..e6c62e80 100644 --- a/source/scene.cpp +++ b/source/scene.cpp @@ -75,16 +75,37 @@ bool Scene::frustum_cull(const Renderable &renderable) const Scene::Loader::Loader(Scene &s, Collection &c): - DataFile::CollectionObjectLoader(s, &c) + DataFile::CollectionObjectLoader(s, &c), + content(0) +{ + init(); +} + +Scene::Loader::Loader(Scene &s, Collection &c, ContentMap &m): + DataFile::CollectionObjectLoader(s, &c), + content(&m) +{ + init(); +} + +void Scene::Loader::init() { add("object", &Loader::object); + add("object", &Loader::object_tagged); } void Scene::Loader::object(const string &n) +{ + object_tagged(n, string()); +} + +void Scene::Loader::object_tagged(const string &n, const string &t) { RefPtr anob = new AnimatedObject(get_collection().get(n)); load_sub(*anob); obj.add(*anob); + if(content && !t.empty()) + (*content)[t] = anob.get(); obj.owned_data.push_back(anob.release()); }