X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fexman.cc;h=28f3700c80aad471881484467e282ce2a7bdb686;hp=d93c2ff66d95bf5f89f31913a13fd97908e4f4bf;hb=b75b6703809abf0dc02f2e557ba73e9efbefa4d1;hpb=82a1d96d9a18e94ccdc13b4bda0c470e81e70768 diff --git a/src/exman.cc b/src/exman.cc index d93c2ff..28f3700 100644 --- a/src/exman.cc +++ b/src/exman.cc @@ -12,6 +12,11 @@ ExhibitManager::ExhibitManager() ExhibitManager::~ExhibitManager() { + clear(); +} + +void ExhibitManager::clear() +{ int num = (int)items.size(); for(int i=0; imatch_node(amatch))) { - error_log("regexp \"%s\" didn't match any nodes\n", amatch ? amatch : ""); + error_log("ExhibitManager::load: regexp \"%s\" didn't match any nodes\n", + amatch ? amatch : ""); continue; } @@ -76,6 +82,16 @@ bool ExhibitManager::load(MetaScene *mscn, const char *fname) return true; } +ExSelection ExhibitManager::select(const Ray &ray) const +{ + return ExSelection(); // TODO +} + +ExSelection ExhibitManager::select(const Sphere &sph) const +{ + return ExSelection(); // TODO +} + void ExhibitManager::update(float dt) { int num = items.size(); @@ -84,11 +100,23 @@ void ExhibitManager::update(float dt) } } +void ExhibitManager::draw() const +{ + int num = items.size(); + for(int i=0; ipre_draw(); + items[i]->draw(); + items[i]->post_draw(); + } +} + static Exhibit *create_exhibit(const char *type) { if(strcmp(type, "static") == 0) { + debug_log("creating static exhibit\n"); return new Exhibit; } else if(strcmp(type, "blobs") == 0) { + debug_log("creating blobs exhibit\n"); return new BlobExhibit; } error_log("unknown exhibit type: %s\n", type);