bool ExhibitManager::load(MetaScene *mscn, const char *fname)
{
+ info_log("ExhibitManager::load(%s)\n", fname);
+
struct ts_node *root = ts_load(fname);
if(!root || strcmp(root->name, "exhibits") != 0) {
ts_free_tree(root);
const char *voice = ts_get_attr_str(node, "voiceover");
if(desc || voice) {
ExData exd;
+ exd.type = EXDATA_INFO;
if(desc) {
char *fixed_desc = new char[strlen(desc) + 1];
ExSelection ExhibitManager::select(const Sphere &sph) const
{
- ExSelection sel;
- if(!items.empty()) {
- sel.ex = items[0];
- sel.selsphere = sph;
- sel.validmask = EXSEL_SPHERE;
+ int nitems = items.size();
+ for(int i=0; i<nitems; i++) {
+ ExSelection sel = items[i]->select(sph);
+ if(sel) {
+ return sel;
+ }
}
- return sel; // TODO
+ return ExSelection();
}
// TODO optimize
}
}
+Exhibit *ExhibitManager::unstash_exhibit()
+{
+ if(stashed.empty()) {
+ return 0;
+ }
+
+ Exhibit *ex = stashed[0];
+ stashed.erase(stashed.begin());
+ return ex;
+}
+
void ExhibitManager::update(float dt)
{
int num = items.size();