Mercurial > fife-parpg
comparison engine/core/view/camera.h @ 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 | f27880d4c08c |
children | 16c2b3ee59ce |
comparison
equal
deleted
inserted
replaced
421:293e812316c0 | 422:9d94f4676d17 |
---|---|
31 // FIFE includes | 31 // FIFE includes |
32 // These includes are split up in two parts, separated by one empty line | 32 // These includes are split up in two parts, separated by one empty line |
33 // First block: files included from the FIFE root src directory | 33 // First block: files included from the FIFE root src directory |
34 // Second block: files included from the same folder | 34 // Second block: files included from the same folder |
35 #include "model/structures/location.h" | 35 #include "model/structures/location.h" |
36 #include "util/structures/rect.h" | |
36 #include "util/math/matrix.h" | 37 #include "util/math/matrix.h" |
37 #include "util/structures/rect.h" | |
38 | 38 |
39 #include "rendererbase.h" | 39 #include "rendererbase.h" |
40 | 40 |
41 namespace FIFE { | 41 namespace FIFE { |
42 | 42 |
43 typedef Point3D ScreenPoint; | 43 typedef Point3D ScreenPoint; |
44 class Layer; | 44 class Layer; |
45 class Rect; | |
45 class Instance; | 46 class Instance; |
46 class ImagePool; | 47 class ImagePool; |
47 class AnimationPool; | 48 class AnimationPool; |
48 class RenderBackend; | 49 class RenderBackend; |
49 typedef std::map<Layer*, std::vector<Instance*> > t_layer_to_instances; | 50 typedef std::map<Layer*, std::vector<Instance*> > t_layer_to_instances; |
56 class Camera: public IRendererListener, public IRendererContainer { | 57 class Camera: public IRendererListener, public IRendererContainer { |
57 public: | 58 public: |
58 /** Constructor | 59 /** Constructor |
59 * Camera needs to be added to the view. If not done so, it is not rendered. | 60 * Camera needs to be added to the view. If not done so, it is not rendered. |
60 * @param id identifier for the camera | 61 * @param id identifier for the camera |
61 * @param layer layer where camera is bind. Camera is bind to a layer for two reasons: | 62 * @param layer layer where camera is bound. Camera is bound to a layer for two reasons: |
62 * * camera's scaling is done based on cell image dimensions. Cell image is layer based (@see setCellImageDimensions) | 63 * * camera's scaling is done based on cell image dimensions. Cell image is layer based (@see setCellImageDimensions) |
63 * * camera could be bind to a pather, which operates on layer | 64 * * camera could be bound to a pather, which operates on layer |
64 * @param viewport used viewport for the camera. Viewport is measured in pixels in relation to game main screen | 65 * @param viewport used viewport for the camera. Viewport is measured in pixels in relation to game main screen |
65 * @param emc coordinate, where camera is focused on given layer | 66 * @param emc coordinate, where camera is focused on given layer |
66 * @param renderbackend to use with rendering | 67 * @param renderbackend to use with rendering |
67 * @param ipool to use with rendering | 68 * @param ipool to use with rendering |
68 * @param apool to use with rendering | 69 * @param apool to use with rendering |
69 */ | 70 */ |
70 Camera(const std::string& id, | 71 Camera(const std::string& id, |
71 Layer* layer, | 72 Layer* layer, |
72 Rect viewport, | 73 const Rect& viewport, |
73 ExactModelCoordinate emc, | 74 const ExactModelCoordinate& emc, |
74 RenderBackend* renderbackend, | 75 RenderBackend* renderbackend, |
75 ImagePool* ipool, | 76 ImagePool* ipool, |
76 AnimationPool* apool); | 77 AnimationPool* apool); |
77 | 78 |
78 /** Destructor | 79 /** Destructor |