22 #ifndef FIFE_VIEW_CAMERA_H
23 #define FIFE_VIEW_CAMERA_H
36 #include "model/structures/location.h"
37 #include "util/structures/rect.h"
38 #include "util/math/matrix.h"
39 #include "video/animation.h"
41 #include "rendererbase.h"
45 typedef Point3D ScreenPoint;
51 typedef std::map<Layer*, RenderList > t_layer_to_instances;
77 Camera(
const std::string&
id,
88 const std::string&
getId()
const {
return m_id; }
92 void setId(
const std::string&
id) { m_id = id; }
250 void getMatchingInstances(Location& loc, std::list<Instance*>& instances,
bool use_exactcoordinates=
false);
306 void setOverlayColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
347 friend class MapObserver;
348 void addLayer(
Layer* layer);
349 void removeLayer(
Layer* layer);
350 void updateMap(
Map* map);
360 void updateMatrices();
368 void updateReferenceScale();
372 void updateRenderLists();
376 void cacheUpdate(
Layer* layer);
388 void renderOverlay();
405 uint32_t m_screen_cell_width;
406 uint32_t m_screen_cell_height;
407 double m_reference_scale;
411 std::map<Layer*, Point> m_image_dimensions;
415 std::map<std::string, RendererBase*> m_renderers;
416 std::list<RendererBase*> m_pipeline;
422 t_layer_to_instances m_layer_to_instances;
424 std::map<Layer*,LayerCache*> m_cache;
425 MapObserver* m_map_observer;
431 std::vector<float> m_light_colors;
437 SDL_Color m_overlay_color;
442 uint32_t m_start_time;
int32_t getOverlayImage()
void setOverlayImage(int32_t id, bool fill=false)
Instance * getAttached() const
void setOverlayColor(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
DoublePoint3D toVirtualScreenCoordinates(const ExactModelCoordinate &map_coords)
void resetLightingColor()
void setTilt(double tilt)
void resetOverlayAnimation()
void setId(const std::string &id)
void attach(Instance *instance)
Point3D getZOffset(Layer *layer)
std::vector< uint8_t > getOverlayColor()
void setRotation(double rotation)
void onRendererEnabledChanged(RendererBase *renderer)
Camera(const std::string &id, Layer *layer, const Rect &viewport, RenderBackend *renderbackend)
RendererBase * getRenderer(const std::string &name)
void addRenderer(RendererBase *renderer)
const Rect & getViewPort() const
void onRendererPipelinePositionChanged(RendererBase *renderer)
void setLocation(const Location &location)
void setLightingColor(float red, float green, float blue)
Location & getLocationRef()
AnimationPtr getOverlayAnimation()
const std::string & getId() const
Point getCellImageDimensions()
ScreenPoint toScreenCoordinates(const ExactModelCoordinate &map_coords)
void getMatchingInstances(ScreenPoint screen_coords, Layer &layer, std::list< Instance * > &instances, uint8_t alpha=0)
Location getLocation() const
void calculateZValue(ScreenPoint &screen_coords)
ExactModelCoordinate toMapCoordinates(ScreenPoint screen_coords, bool z_calculated=true)
double getReferenceScale() const
void setOverlayAnimation(AnimationPtr anim, bool fill=false)
Point3D getOrigin() const
void setCellImageDimensions(uint32_t width, uint32_t height)
void setViewPort(const Rect &viewport)
void setEnabled(bool enabled)
std::vector< float > getLightingColor()
double getRotation() const
void setZoom(double zoom)