Mercurial > fife-parpg
annotate engine/core/view/renderers/genericrenderer.i @ 29:0cb049f291e1
make members private and prefix with m_
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 11 Jul 2008 13:00:10 +0000 |
parents | 788cb9525b2f |
children | 75b6394ced14 |
rev | line source |
---|---|
23 | 1 %module fife |
2 %{ | |
3 #include "view/renderers/genericrenderer.h" | |
4 %} | |
5 | |
6 namespace FIFE { | |
7 class RenderBackend; | |
8 | |
9 class GenericRendererNode { | |
10 public: | |
11 GenericRendererNode(Instance* attached_instance, Location* relative_location, const Point &relative_point = Point(0,0)); | |
12 GenericRendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0)); | |
13 GenericRendererNode(Location* attached_location, const Point &relative_point = Point(0,0)); | |
14 GenericRendererNode(const Point &attached_point); | |
15 ~GenericRendererNode(); | |
16 | |
26
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
17 void setAttached(Instance* attached_instance, Location* relative_location, const Point &relative_point); |
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
18 void setAttached(Instance* attached_instance, Location* relative_location); |
23 | 19 void setAttached(Instance* attached_instance, const Point &relative_point); |
20 void setAttached(Instance* attached_instance); | |
26
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
21 void setAttached(Location* attached_location, const Point &relative_point); |
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
22 void setAttached(Location* attached_location); |
23 | 23 void setAttached(const Point &attached_point); |
24 | |
26
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
25 void setRelative(Location* relative_location); |
70f41ea8e7db
fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
23
diff
changeset
|
26 void setRelative(Location* relative_location, Point relative_point); |
23 | 27 void setRelative(const Point &relative_point); |
28 | |
29 Instance* getAttachedInstance(); | |
30 Location* getAttachedLocation(); | |
31 Point getAttachedPoint(); | |
32 | |
33 Location* getOffsetLocation(); | |
34 Point getOffsetPoint(); | |
35 | |
36 Instance* getInstance(); | |
37 Location* getLocation(); | |
38 Point getPoint(); | |
39 | |
40 Point getCalculatedPoint(Camera* cam, Layer* layer, std::vector<Instance*>& instances); | |
41 private: | |
42 Instance* m_instance; | |
43 Location* m_location; | |
44 Point m_point; | |
45 }; | |
46 class GenericRendererElementInfo { | |
47 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
48 virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {}; |
23 | 49 virtual ~GenericRendererElementInfo() {}; |
50 }; | |
51 | |
52 class GenericRendererLineInfo : public GenericRendererElementInfo { | |
53 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
54 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 55 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); |
56 virtual ~GenericRendererLineInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
57 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
58 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
59 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
60 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
61 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
62 uint8_t m_blue; |
23 | 63 }; |
64 class GenericRendererPointInfo : public GenericRendererElementInfo { | |
65 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
66 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 67 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); |
68 virtual ~GenericRendererPointInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
69 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
70 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
71 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
72 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
73 uint8_t m_blue; |
23 | 74 }; |
75 class GenericRendererQuadInfo : public GenericRendererElementInfo { | |
76 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
77 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 78 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); |
79 virtual ~GenericRendererQuadInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
80 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
81 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
82 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
83 GenericRendererNode m_edge3; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
84 GenericRendererNode m_edge4; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
85 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
86 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
87 uint8_t m_blue; |
23 | 88 }; |
89 class GenericRendererImageInfo : public GenericRendererElementInfo { | |
90 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
91 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 92 GenericRendererImageInfo(GenericRendererNode n, int image); |
93 virtual ~GenericRendererImageInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
94 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
95 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
96 int m_image; |
23 | 97 }; |
98 class GenericRendererAnimationInfo : public GenericRendererElementInfo { | |
99 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
100 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 101 GenericRendererAnimationInfo(GenericRendererNode n, int animation); |
102 virtual ~GenericRendererAnimationInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
103 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
104 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
105 int m_animation; |
23 | 106 }; |
107 class GenericRendererTextInfo : public GenericRendererElementInfo { | |
108 public: | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
109 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 110 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); |
111 virtual ~GenericRendererTextInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
112 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
113 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
114 AbstractFont* m_font; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
115 std::string m_text; |
23 | 116 }; |
117 class GenericRenderer: public RendererBase { | |
118 public: | |
27
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
119 GenericRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool); |
23 | 120 ~GeometricRenderer(); |
121 std::string getName(); | |
122 static GenericRenderer* getInstance(IRendererContainer* cnt); | |
123 void addLine(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); | |
124 void addPoint(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); | |
125 void addQuad(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); | |
126 void addText(GenericRendererNode n, AbstractFont* font, std::string text); | |
127 void addImage(GenericRendererNode n, int image); | |
128 void addAnimation(GenericRendererNode n, int animation); | |
129 void removeAll(); | |
130 }; | |
131 } |