summaryrefslogtreecommitdiffstats
path: root/Renderer.h
blob: 76221b8c8e8d53731a477e47e35ab2ee291e953f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef RENDERER_H_
#define RENDERER_H_

#include "Rectangle.h"
#include "Polygon.h"
#include "EditManager.h"
#include "Level.h"
#include "Room.h"
#include "PlayerStart.h"


class Renderer {
  private:
    EditManager *editManager;
    
    void drawGrid(const Rectangle &rect, float scale);
    
  protected:
    void fillPolygon(const Polygon &polygon);
    void drawPolygon(const Polygon &polygon, bool close = true);
    void drawCircle(const Vertex &m, float r, int n);
    void drawCross(const Vertex &m, float r);
    
    void renderObject(const LevelObject &object, bool selected, bool highlighted, float scale);
    
    void renderRoom(const Room &room, bool selected, bool highlighted, float scale);
    void renderPlayerStart(const PlayerStart &start, bool selected, bool highlighted, float scale);
    
  public:
    Renderer(EditManager *editManager) {
      this->editManager = editManager;
    }
    
    virtual ~Renderer() {}
    
    virtual void render(const Level &level, const Rectangle &rect, float scale);
};

#endif /*RENDERER_H_*/