#ifndef MSP_GL_SCENE_H_
#define MSP_GL_SCENE_H_
-#include <vector>
+#include <map>
#include <msp/core/typeregistry.h>
#include <msp/datafile/objectloader.h>
#include "matrix.h"
#include "renderable.h"
-#include "vector.h"
namespace Msp {
namespace GL {
private:
ContentMap *content;
+ unsigned inst_counter;
public:
- Loader(Scene &, Collection &);
- Loader(Scene &, Collection &, ContentMap &);
+ Loader(Scene &s, Collection &c): Loader(s, c, 0) { }
+ Loader(Scene &s, Collection &c, ContentMap &m) : Loader(s, c, &m) { }
private:
- void init();
+ Loader(Scene &, Collection &, ContentMap *);
void object(const std::string &);
void object_tagged(const std::string &, const std::string &);
GenericLoader(DataFile::Collection &);
~GenericLoader();
- Scene *get_scene() { Scene *s = scene; scene = 0; return s; }
+ Scene *get_object() { Scene *s = scene; scene = 0; return s; }
private:
virtual void init_actions();
typedef TypeRegistry<GenericLoader::CreateScene, GenericLoader &> SceneRegistry;
protected:
- // XXX If a loaded renderable is removed from the scene it needs to be removed from here as well
- std::vector<Renderable *> owned_data;
mutable Matrix culling_matrix;
mutable Vector4 frustum_edges[6];
Scene(const Scene &);
Scene &operator=(const Scene &);
public:
- virtual ~Scene();
+ virtual ~Scene() { }
virtual void add(Renderable &) = 0;
virtual void remove(Renderable &) = 0;