X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmetascene.cc;h=fd4569b17beaa9b888a2277660952d3951ebb324;hp=66be3ef6f19cc0b7c5bf7939d97181b9918e087b;hb=d29eba477666f0753170d9ad549a4715ce071d04;hpb=8512530474f0e0827447b6c81302120592f0e297 diff --git a/src/metascene.cc b/src/metascene.cc index 66be3ef..fd4569b 100644 --- a/src/metascene.cc +++ b/src/metascene.cc @@ -1,3 +1,13 @@ +/*! \file + * \brief Metascene implementation + * + * Loading starts at `MetaScene::load`, which calls `ts_load` (libtreestore) + * to load the metascene description tree into memory. Then `proc_node` is + * called at the root to recursively process the tree. `scenefile` nodes are + * handed over to `proc_scenefile`, which will trigger scene loading for any + * nodes with a `file` attribute. Scene loading is handled by requesting the + * filename from the scene resource manager, which is of type [SceneSet](\ref SceneSet). + */ #include #include #include @@ -42,7 +52,6 @@ MetaScene::~MetaScene() delete music; } - bool MetaScene::load(const char *fname) { struct ts_node *root = ts_load(fname); @@ -165,6 +174,9 @@ struct SceneData { std::vector mtledit; }; +/*! Processes a `scenefile` node. And kicks off scene loading (if necessary) by + * calling `SceneSet::get`. + */ static bool proc_scenefile(MetaScene *mscn, struct ts_node *node) { const char *fname = ts_get_attr_str(node, "file"); @@ -218,7 +230,7 @@ static bool proc_scenefile(MetaScene *mscn, struct ts_node *node) fname = namebuf; } - // material edits + // material edits are kept in a list to be applied when the scene has been loaded struct ts_node *child = node->child_list; while(child) { MaterialEdit medit;