131 if (drawpt.
x < cv.
x || drawpt.
x > cv.
x + cv.
w ||
132 drawpt.
y < cv.
y || drawpt.
y > cv.
y + cv.
h) {
138 std::stringstream sts;
Abstract interface for all the renderbackends.
void setLayerCoordinates(const ModelCoordinate &coordinates)
Sets "cell precise" layer coordinates to this location.
std::vector< RenderItem * > RenderList
T h
Height of the rectangle.
void setLayer(Layer *layer)
Sets layer where this location is pointing to.
void setColor(uint8_t r, uint8_t g, uint8_t b)
Changes the used color.
void setMapCoordinates(const ExactModelCoordinate &coordinates)
Sets map coordinates to this location.
Interface to class owning the renderers Used to get correct subclass of renderer in scripting side (v...
virtual Image * getAsImage(const std::string &text)=0
Gets given text as Image The rsulting image is pooled, so it's not that time critical.
static Logger _log(LM_AUDIO)
virtual void setColor(uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
Set the color the text should be rendered in.
void render(Camera *cam, Layer *layer, RenderList &instances)
This method is called by the view to ask renderer to draw its rendering aspect based on given paramet...
virtual RendererBase * getRenderer(const std::string &renderername)=0
Returns renderer with given name.
Camera describes properties of a view port shown in the main screen Main screen can have multiple cam...
virtual SDL_Color getColor() const =0
Get the color the text was rendered in.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this location.
uint32_t getHeight() const
const Rect & getViewPort() const
Gets the viewport for camera in pixel coordinates.
static bool Equal(T _val1, T _val2)
Base class for all view renderers View renderer renders one aspect of the view shown on screen...
double getZoom() const
Gets camera zoom.
virtual void setEnabled(bool enabled)
Enables renderer.
uint32_t getWidth() const
RendererBase * clone()
Makes copy of this renderer.
virtual void render(const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)=0
Renders itself to the current render target (main screen or attached destination image) at the rectan...
ScreenPoint toScreenCoordinates(const ExactModelCoordinate &map_coords)
Transforms given point from map coordinates to screen coordinates.
ExactModelCoordinate toMapCoordinates(ScreenPoint screen_coords, bool z_calculated=true)
Transforms given point from screen coordinates to map coordinates.
virtual ~CoordinateRenderer()
Destructor.
T w
Width of the rectangle.
CoordinateRenderer(RenderBackend *renderbackend, int32_t position)
Constructor.
ExactModelCoordinate getMapCoordinates() const
Gets map coordinates set to this location.
static CoordinateRenderer * getInstance(IRendererContainer *cnt)
Gets instance for interface access.