diff 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
line wrap: on
line diff
--- a/engine/core/view/camera.h	Thu Feb 11 04:18:42 2010 +0000
+++ b/engine/core/view/camera.h	Fri Feb 12 06:34:50 2010 +0000
@@ -33,8 +33,8 @@
 // First block: files included from the FIFE root src directory
 // Second block: files included from the same folder
 #include "model/structures/location.h"
+#include "util/structures/rect.h"
 #include "util/math/matrix.h"
-#include "util/structures/rect.h"
 
 #include "rendererbase.h"
 
@@ -42,6 +42,7 @@
 
 	typedef Point3D ScreenPoint;
 	class Layer;
+	class Rect;
 	class Instance;
 	class ImagePool;
 	class AnimationPool;
@@ -58,9 +59,9 @@
 		/** Constructor
 		 * Camera needs to be added to the view. If not done so, it is not rendered.
 		 * @param id identifier for the camera
-		 * @param layer layer where camera is bind. Camera is bind to a layer for two reasons:
+		 * @param layer layer where camera is bound. Camera is bound to a layer for two reasons:
 		 *   * camera's scaling is done based on cell image dimensions. Cell image is layer based (@see setCellImageDimensions)
-		 *   * camera could be bind to a pather, which operates on layer
+		 *   * camera could be bound to a pather, which operates on layer
 		 * @param viewport used viewport for the camera. Viewport is measured in pixels in relation to game main screen
 		 * @param emc coordinate, where camera is focused on given layer
 		 * @param renderbackend to use with rendering
@@ -69,8 +70,8 @@
 		 */
 		Camera(const std::string& id,
 			Layer* layer,
-			Rect viewport,
-			ExactModelCoordinate emc,
+			const Rect& viewport,
+			const ExactModelCoordinate& emc,
 			RenderBackend* renderbackend,
 			ImagePool* ipool,
 			AnimationPool* apool);