comparison engine/core/model/structures/map.i @ 422:9d94f4676d17

Moved the management of cameras into the Map class. The View class no longer exists since it now serves no purpose. The engine class itself holds the renderers and these get passed to each map that is loaded and then passed to each camera on each map. This change makes it possible for multiple maps to be loaded at the same time with the same camera id without a name clash. fixes[t:342]
author vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 12 Feb 2010 06:34:50 +0000
parents 7e5717105212
children c9113e23b004
comparison
equal deleted inserted replaced
421:293e812316c0 422:9d94f4676d17
26 26
27 %include "util/base/utilbase.i" 27 %include "util/base/utilbase.i"
28 28
29 namespace FIFE { 29 namespace FIFE {
30 class Layer; 30 class Layer;
31 class Camera;
31 } 32 }
32 33
33 namespace std { 34 namespace std {
34 %template(LayerList) list<FIFE::Layer*>; 35 %template(LayerList) list<FIFE::Layer*>;
36 %template(CameraVector) std::vector<FIFE::Camera*>;
35 } 37 }
36 38
37 namespace FIFE { 39 namespace FIFE {
38 40
39 class Layer; 41 class Layer;
40 class Map; 42 class Map;
43 class Rect;
41 44
42 %feature("director") MapChangeListener; 45 %feature("director") MapChangeListener;
43 class MapChangeListener { 46 class MapChangeListener {
44 public: 47 public:
45 virtual ~MapChangeListener() {}; 48 virtual ~MapChangeListener() {};
49 }; 52 };
50 53
51 class Map : public ResourceClass { 54 class Map : public ResourceClass {
52 public: 55 public:
53 56
54 Map(const std::string& identifier, TimeProvider* tp_master=NULL); 57 Map(const std::string& identifier, RenderBackend* renderbackend, const std::vector<RendererBase*>& renderers, ImagePool* imagepool, AnimationPool* animpool, TimeProvider* tp_master=NULL);
55 ~Map(); 58 ~Map();
56 59
57 const std::string& getId() const; 60 const std::string& getId() const;
58 void setId(const std::string& id); 61 void setId(const std::string& id);
59 62
71 74
72 void addChangeListener(MapChangeListener* listener); 75 void addChangeListener(MapChangeListener* listener);
73 void removeChangeListener(MapChangeListener* listener); 76 void removeChangeListener(MapChangeListener* listener);
74 bool isChanged(); 77 bool isChanged();
75 std::vector<Layer*>& getChangedLayers(); 78 std::vector<Layer*>& getChangedLayers();
79 Camera* addCamera(const std::string& id, Layer *layer, const Rect& viewport, const ExactModelCoordinate& emc);
80 void removeCamera(const std::string& id);
81 Camera* getCamera(const std::string& id);
82 std::vector<Camera*>& getCameras();
76 }; 83 };
77 } 84 }