Mercurial > fife-parpg
annotate engine/core/view/renderers/genericrenderer.h @ 589:d1df6cf5ff23
* Fixed a bug in RenderBackendSDL, the clip area was not properly set.
* Renamed the backquad and border commands of the FloatingTextRenderer.
* Added the TransparentArea commands to the InstanceRenderer.
Note: with addTransparentArea(instance, string, width, height, transparent, front) you can enable an area, that make all instances in this zone and with the same namespace transparent. The string is for the namespace, so you can set one or more namespaces to be transparent. Width and height specifies the size of the area. Transparent defines the intensity of transparency, 255 = invisible. The bool front, enable or disable the z check, so that only instances in front of the source instance could be transparent.
author | helios2000@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 13 Aug 2010 16:33:36 +0000 |
parents | a2dde16ddc62 |
children | e3140f01749d |
rev | line source |
---|---|
23 | 1 /*************************************************************************** |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
2 * Copyright (C) 2005-2008 by the FIFE team * |
23 | 3 * http://www.fifengine.de * |
4 * This file is part of FIFE. * | |
5 * * | |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
6 * FIFE is free software; you can redistribute it and/or * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
7 * modify it under the terms of the GNU Lesser General Public * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
8 * License as published by the Free Software Foundation; either * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
9 * version 2.1 of the License, or (at your option) any later version. * |
23 | 10 * * |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
11 * This library is distributed in the hope that it will be useful, * |
23 | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
14 * Lesser General Public License for more details. * |
23 | 15 * * |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
16 * You should have received a copy of the GNU Lesser General Public * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
17 * License along with this library; if not, write to the * |
23 | 18 * Free Software Foundation, Inc., * |
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * |
23 | 20 ***************************************************************************/ |
21 | |
22 #ifndef FIFE_GENERICRENDERER_H | |
23 #define FIFE_GENERICRENDERER_H | |
24 | |
25 // Standard C++ library includes | |
26 | |
27 // 3rd party library includes | |
28 | |
29 // FIFE includes | |
30 // These includes are split up in two parts, separated by one empty line | |
31 // First block: files included from the FIFE root src directory | |
32 // Second block: files included from the same folder | |
33 #include "view/rendererbase.h" | |
34 | |
35 namespace FIFE { | |
36 class RenderBackend; | |
37 class AbstractFont; | |
27
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
38 class ImagePool; |
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
39 class AnimationPool; |
23 | 40 |
41 class GenericRendererNode { | |
42 public: | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
43 GenericRendererNode(Instance* attached_instance, const Location &relative_location, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
44 GenericRendererNode(Instance* attached_instance, const Location &relative_location, const Point &relative_point = Point(0,0)); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
45 GenericRendererNode(Instance* attached_instance, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
23 | 46 GenericRendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0)); |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
47 GenericRendererNode(const Location &attached_location, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
48 GenericRendererNode(const Location &attached_location, const Point &relative_point = Point(0,0)); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
49 GenericRendererNode(Layer* attached_layer, const Point &relative_point = Point(0,0)); |
23 | 50 GenericRendererNode(const Point &attached_point); |
51 ~GenericRendererNode(); | |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
52 |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
53 void setAttached(Instance* attached_instance, const Location &relative_location, const Point &relative_point); |
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
54 void setAttached(Instance* attached_instance, const Location &relative_location); |
23 | 55 void setAttached(Instance* attached_instance, const Point &relative_point); |
56 void setAttached(Instance* attached_instance); | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
57 void setAttached(const Location &attached_location, const Point &relative_point); |
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
58 void setAttached(const Location &attached_location); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
59 void setAttached(Layer* attached_layer); |
23 | 60 void setAttached(const Point &attached_point); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
61 |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
62 void setRelative(const Location &relative_location); |
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
63 void setRelative(const Location &relative_location, Point relative_point); |
23 | 64 void setRelative(const Point &relative_point); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
65 |
23 | 66 Instance* getAttachedInstance(); |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
67 Location getAttachedLocation(); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
68 Layer* getAttachedLayer(); |
23 | 69 Point getAttachedPoint(); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
70 |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
71 Location getOffsetLocation(); |
23 | 72 Point getOffsetPoint(); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
73 |
23 | 74 Instance* getInstance(); |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
75 Location getLocation(); |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
76 Layer* getLayer(); |
23 | 77 Point getPoint(); |
78 | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
79 Point getCalculatedPoint(Camera* cam, Layer* layer); |
23 | 80 private: |
81 Instance* m_instance; | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
82 Location m_location; |
445
f855809822cf
* Fixed GenericRenderer, now it only render to a specific layer. If the node is only a point then it used the last active layer. fixes #[ticket:458]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
430
diff
changeset
|
83 Layer* m_layer; |
23 | 84 Point m_point; |
85 }; | |
86 class GenericRendererElementInfo { | |
87 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
88 virtual void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {}; |
23 | 89 virtual ~GenericRendererElementInfo() {}; |
90 }; | |
91 | |
92 class GenericRendererLineInfo : public GenericRendererElementInfo { | |
93 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
94 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
95 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 96 virtual ~GenericRendererLineInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
97 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
98 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
99 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
100 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
101 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
102 uint8_t m_blue; |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
103 uint8_t m_alpha; |
23 | 104 }; |
105 class GenericRendererPointInfo : public GenericRendererElementInfo { | |
106 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
107 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
108 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 109 virtual ~GenericRendererPointInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
110 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
111 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
112 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
113 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
114 uint8_t m_blue; |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
115 uint8_t m_alpha; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
116 }; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
117 class GenericRendererTriangleInfo : public GenericRendererElementInfo { |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
118 public: |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
119 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
120 GenericRendererTriangleInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
121 virtual ~GenericRendererTriangleInfo() {}; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
122 private: |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
123 GenericRendererNode m_edge1; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
124 GenericRendererNode m_edge2; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
125 GenericRendererNode m_edge3; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
126 uint8_t m_red; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
127 uint8_t m_green; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
128 uint8_t m_blue; |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
129 uint8_t m_alpha; |
23 | 130 }; |
131 class GenericRendererQuadInfo : public GenericRendererElementInfo { | |
132 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
133 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
134 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 135 virtual ~GenericRendererQuadInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
136 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
137 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
138 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
139 GenericRendererNode m_edge3; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
140 GenericRendererNode m_edge4; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
141 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
142 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
143 uint8_t m_blue; |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
144 uint8_t m_alpha; |
23 | 145 }; |
430
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
146 |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
147 class GenericRendererVertexInfo : public GenericRendererElementInfo { |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
148 public: |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
149 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
150 GenericRendererVertexInfo(GenericRendererNode center, int size, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
430
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
151 virtual ~GenericRendererVertexInfo() {}; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
152 private: |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
153 GenericRendererNode m_center; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
154 int m_size; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
155 uint8_t m_red; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
156 uint8_t m_green; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
157 uint8_t m_blue; |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
158 uint8_t m_alpha; |
430
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
159 }; |
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
160 |
23 | 161 class GenericRendererImageInfo : public GenericRendererElementInfo { |
162 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
163 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 164 GenericRendererImageInfo(GenericRendererNode n, int image); |
165 virtual ~GenericRendererImageInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
166 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
167 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
168 int m_image; |
23 | 169 }; |
170 class GenericRendererAnimationInfo : public GenericRendererElementInfo { | |
171 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
172 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 173 GenericRendererAnimationInfo(GenericRendererNode n, int animation); |
174 virtual ~GenericRendererAnimationInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
175 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
176 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
177 int m_animation; |
31
9a9f4447af7c
add animation renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
29
diff
changeset
|
178 unsigned int m_start_time; |
9a9f4447af7c
add animation renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
29
diff
changeset
|
179 float m_time_scale; |
23 | 180 }; |
181 class GenericRendererTextInfo : public GenericRendererElementInfo { | |
182 public: | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
183 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
23 | 184 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); |
185 virtual ~GenericRendererTextInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
186 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
187 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
188 AbstractFont* m_font; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
189 std::string m_text; |
23 | 190 }; |
191 class GenericRenderer: public RendererBase { | |
192 public: | |
193 /** constructor. | |
194 * @param renderbackend to use | |
195 * @param position position for this renderer in rendering pipeline | |
196 */ | |
27
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
197 GenericRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool); |
430
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
198 |
23 | 199 GenericRenderer(const GenericRenderer& old); |
430
ad1f09d954f9
Added the ability to render a vertex on the screen. The vertex is represented by a small square. fixes[t:455]
prock@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
200 |
23 | 201 RendererBase* clone(); |
202 | |
203 /** Destructor. | |
204 */ | |
205 virtual ~GenericRenderer(); | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
206 void render(Camera* cam, Layer* layer, RenderList& instances); |
23 | 207 std::string getName() { return "GenericRenderer"; } |
208 | |
209 /** Gets instance for interface access | |
210 */ | |
211 static GenericRenderer* getInstance(IRendererContainer* cnt); | |
212 | |
583
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
213 void addLine(const std::string &group, GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
214 void addPoint(const std::string &group, GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
215 void addTriangle(const std::string &group, GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
216 void addQuad(const std::string &group, GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255); |
47b49b9b0c0a
* Improved the floatingtextrenderer. Now you can set an alpha value for font, background quad and border. Splited quad and border into own commands.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
482
diff
changeset
|
217 void addVertex(const std::string &group, GenericRendererNode n, int size, uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255); |
105
2241b0d5379e
use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
46
diff
changeset
|
218 void addText(const std::string &group, GenericRendererNode n, AbstractFont* font, const std::string &text); |
2241b0d5379e
use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
46
diff
changeset
|
219 void addImage(const std::string &group, GenericRendererNode n, int image); |
2241b0d5379e
use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
46
diff
changeset
|
220 void addAnimation(const std::string &group, GenericRendererNode n, int animation); |
2241b0d5379e
use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
46
diff
changeset
|
221 void removeAll(const std::string &group); |
23 | 222 |
223 private: | |
27
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
224 ImagePool* m_imagepool; |
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
225 AnimationPool* m_animationpool; |
105
2241b0d5379e
use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
46
diff
changeset
|
226 std::map<std::string, std::vector<GenericRendererElementInfo*> > m_groups; |
23 | 227 }; |
228 | |
229 } | |
230 | |
231 #endif |