78 FL_WARN(
_log,
"No cellgrid assigned to layer, cannot draw grid");
85 const std::vector<std::vector<Cell*> >& cells = cache->
getCells();
86 std::vector<std::vector<Cell*> >::const_iterator it = cells.begin();
87 for (; it != cells.end(); ++it) {
88 std::vector<Cell*>::const_iterator cit = (*it).begin();
89 for (; cit != (*it).end(); ++cit) {
93 if (sp.x < cv.
x || sp.x > cv.
x + cv.
w ||
94 sp.y < cv.
y || sp.y > cv.
y + cv.
h) {
98 std::vector<ExactModelCoordinate> vertices;
99 cg->
getVertices(vertices, (*cit)->getLayerCoordinates());
100 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
101 int32_t halfind = vertices.size() / 2;
103 Point pt1(firstpt.
x, firstpt.
y);
106 for (; it != vertices.end(); it++) {
123 RenderList::const_iterator instance_it = instances.begin();
124 for (;instance_it != instances.end(); ++instance_it) {
125 Instance* instance = (*instance_it)->instance;
129 std::vector<ExactModelCoordinate> vertices;
131 std::vector<ExactModelCoordinate>::const_iterator it = vertices.begin();
132 int32_t halfind = vertices.size() / 2;
134 Point pt1(firstpt.
x, firstpt.
y);
137 for (; it != vertices.end(); it++) {
#define FL_WARN(logger, msg)
Abstract interface for all the renderbackends.
SDL_Color m_color
currently used color
std::vector< RenderItem * > RenderList
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...
T h
Height of the rectangle.
void setColor(uint8_t r, uint8_t g, uint8_t b)
Changes the used color.
A CellCache is an abstract depiction of one or a few layers and contains additional information...
BlockingInfoRenderer(RenderBackend *renderbackend, int32_t position)
Constructor.
CellCache * getCellCache()
Returns the CellCache of this layer.
Interface to class owning the renderers Used to get correct subclass of renderer in scripting side (v...
static Logger _log(LM_AUDIO)
static BlockingInfoRenderer * getInstance(IRendererContainer *cnt)
Gets instance for interface access.
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...
Location & getLocationRef()
Gets reference of current location of instance.
virtual void getVertices(std::vector< ExactModelCoordinate > &vtx, const ModelCoordinate &cell)=0
Fills given point vector with vertices from selected cell.
RenderBackend * m_renderbackend
PointType2D< int32_t > Point
Base class for all view renderers View renderer renders one aspect of the view shown on screen...
Object * getObject()
Gets object where this instance is instantiated from.
virtual ~BlockingInfoRenderer()
Destructor.
virtual void drawLine(const Point &p1, const Point &p2, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
Draws line between given points with given RGBA.
virtual void setEnabled(bool enabled)
Enables renderer.
bool isBlocking() const
Gets if object blocks movement.
const Rect & getViewPort() const
Gets the viewport for camera in pixel coordinates.
CellGrid * getCellGrid() const
Get the Cellgrid.
ScreenPoint toScreenCoordinates(const ExactModelCoordinate &map_coords)
Transforms given point from map coordinates to screen coordinates.
DoublePoint intPt2doublePt(Point pt)
Convert from 2D int32_t point to 2D double point.
const std::vector< std::vector< Cell * > > & getCells()
Returns all cells of this CellCache.
ModelCoordinate getLayerCoordinates() const
Gets cell precision layer coordinates set to this location.
RendererBase * clone()
Makes copy of this renderer.
bool isBlocking() const
Gets if instance blocks movement.
ExactModelCoordinate toMapCoordinates(const ModelCoordinate &layer_coords)
Transforms given point from layer coordinates to map coordinates.
T w
Width of the rectangle.
An Instance is an "instantiation" of an Object at a Location.