2007-10-23 19:08:04 +00:00
|
|
|
#ifndef RENDERER_H_
|
|
|
|
#define RENDERER_H_
|
|
|
|
|
|
|
|
#include "Rectangle.h"
|
|
|
|
#include "Polygon.h"
|
|
|
|
#include "EditManager.h"
|
|
|
|
#include "Level.h"
|
2007-12-14 02:47:03 +00:00
|
|
|
#include "Room.h"
|
|
|
|
#include "PlayerStart.h"
|
2008-02-08 21:21:01 +00:00
|
|
|
#include "Portal.h"
|
2008-02-15 11:01:04 +00:00
|
|
|
#include "LevelEdge.h"
|
2007-10-23 19:08:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Renderer {
|
|
|
|
private:
|
|
|
|
EditManager *editManager;
|
|
|
|
|
|
|
|
void drawGrid(const Rectangle &rect, float scale);
|
2007-12-24 00:04:02 +00:00
|
|
|
|
|
|
|
protected:
|
2007-10-23 19:08:04 +00:00
|
|
|
void fillPolygon(const Polygon &polygon);
|
2008-02-20 13:51:04 +00:00
|
|
|
void drawPolygon(const Polygon &polygon);
|
2008-02-09 12:21:00 +00:00
|
|
|
void fillCircle(const Vertex &m, float r, int n = 64);
|
2008-02-08 21:21:01 +00:00
|
|
|
void drawCircle(const Vertex &m, float r, int n = 64);
|
2008-02-15 19:10:04 +00:00
|
|
|
void drawCircleDotted(const Vertex &m, float r, int n = 64, int d = 8, float rot = 0);
|
2007-12-14 02:47:03 +00:00
|
|
|
void drawCross(const Vertex &m, float r);
|
|
|
|
|
2008-02-18 20:22:05 +00:00
|
|
|
void renderObject(const LevelObject &object, bool selected, bool hovered, float scale);
|
2007-12-14 02:47:03 +00:00
|
|
|
|
2008-02-18 20:22:05 +00:00
|
|
|
void renderLevelVertex(const LevelVertex &vertex, bool selected, bool hovered, float scale);
|
|
|
|
void renderLevelEdge(const LevelEdge &edge, bool selected, bool hovered, float scale);
|
2008-02-09 12:21:00 +00:00
|
|
|
|
2008-02-18 20:22:05 +00:00
|
|
|
void renderRoom(const Room &room, bool selected, bool hovered, float scale);
|
|
|
|
void renderPlayerStart(const PlayerStart &start, bool selected, bool hovered, float scale);
|
|
|
|
void renderPortal(const Portal &portal, bool selected, bool hovered, float scale);
|
2007-10-23 19:08:04 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
Renderer(EditManager *editManager) {
|
|
|
|
this->editManager = editManager;
|
|
|
|
}
|
|
|
|
|
2007-12-24 00:04:02 +00:00
|
|
|
virtual ~Renderer() {}
|
|
|
|
|
|
|
|
virtual void render(const Level &level, const Rectangle &rect, float scale);
|
2007-10-23 19:08:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*RENDERER_H_*/
|