From: John Tsiombikas Date: Fri, 24 Feb 2017 09:53:04 +0000 (+0200) Subject: forgot to add the new files X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=commitdiff_plain;h=bfceaade5df3177a3e213fe20bc3811b2f78ac98;hp=cddee551d9bc9ec58e15aeb673f7e8fcf3c163ce forgot to add the new files --- diff --git a/src/exman.cc b/src/exman.cc new file mode 100644 index 0000000..e0ededc --- /dev/null +++ b/src/exman.cc @@ -0,0 +1,42 @@ +#include "exman.h" +#include "exhibit.h" +#include "blob_exhibit.h" + +static Exhibit *create_exhibit(const char *type); + +ExhibitManager::ExhibitManager() +{ +} + +ExhibitManager::~ExhibitManager() +{ + int num = (int)items.size(); + for(int i=0; iname, "exhibits") != 0) { + ts_free_tree(root); + error_log("failed to load exhibits\n"); + return false; + } + + ts_free_tree(root); + return true; +} + + +static Exhibit *create_exhibit(const char *type) +{ + if(strcmp(type, "static") == 0) { + return new Exhibit; + } else if(strcmp(type, "blobs") == 0) { + return new BlobExhibit; + } + return 0; +} diff --git a/src/exman.h b/src/exman.h new file mode 100644 index 0000000..5c627e6 --- /dev/null +++ b/src/exman.h @@ -0,0 +1,22 @@ +#ifndef EXMAN_H_ +#define EXMAN_H_ + +#include +#include "exhibit.h" +#include "metascene.h" + +class ExhibitManager { +private: + std::vector items; + +public: + ExhibitManager(); + ~ExhibitManager(); + + bool load(const MetaScene *mscn, const char *fname); + + ExSelection select(const Ray &ray) const; + ExSelection select(const Sphere &sph) const; +}; + +#endif // EXMAN_H_