Mercurial > fife-parpg
annotate engine/core/view/renderers/genericrenderer.i @ 604:da83338b6913
Fixed incorrect usage of the SWIG %apply directive. This is meant to be used to retrieve output values from arguments only. See http://www.swig.org/Doc1.3/Arguments.html
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 13 Sep 2010 17:22:24 +0000 |
parents | a2dde16ddc62 |
children | e3140f01749d |
rev | line source |
---|---|
46
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
1 /*************************************************************************** |
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 * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
3 * http://www.fifengine.de * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
4 * This file is part of FIFE. * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
5 * * |
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. * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
10 * * |
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, * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
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. * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
15 * * |
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 * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
18 * Free Software Foundation, Inc., * |
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 * |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
20 ***************************************************************************/ |
90005975cdbb
* Final LGPL switch step by adjusting the file headers
mvbarracuda@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
32
diff
changeset
|
21 |
23 | 22 %module fife |
23 %{ | |
24 #include "view/renderers/genericrenderer.h" | |
25 %} | |
26 | |
27 namespace FIFE { | |
28 class RenderBackend; | |
29 | |
30 class GenericRendererNode { | |
31 public: | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
32 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
|
33 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
|
34 GenericRendererNode(Instance* attached_instance, Layer* relative_layer, const Point &relative_point = Point(0,0)); |
23 | 35 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
|
36 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
|
37 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
|
38 GenericRendererNode(Layer* attached_layer, const Point &relative_point = Point(0,0)); |
23 | 39 GenericRendererNode(const Point &attached_point); |
40 ~GenericRendererNode(); | |
41 | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
42 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
|
43 void setAttached(Instance* attached_instance, const Location &relative_location); |
23 | 44 void setAttached(Instance* attached_instance, const Point &relative_point); |
45 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
|
46 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
|
47 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
|
48 void setAttached(Layer* attached_layer); |
23 | 49 void setAttached(const Point &attached_point); |
50 | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
51 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
|
52 void setRelative(const Location &relative_location, Point relative_point); |
23 | 53 void setRelative(const Point &relative_point); |
54 | |
55 Instance* getAttachedInstance(); | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
56 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
|
57 Layer* getAttachedLayer(); |
23 | 58 Point getAttachedPoint(); |
59 | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
60 Location getOffsetLocation(); |
23 | 61 Point getOffsetPoint(); |
62 | |
63 Instance* getInstance(); | |
584
a2dde16ddc62
* Fixed the location segfault of the genericrenderer. fixes[ticket:446]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
583
diff
changeset
|
64 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
|
65 Layer* getLayer(); |
23 | 66 Point getPoint(); |
67 | |
482
16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
445
diff
changeset
|
68 Point getCalculatedPoint(Camera* cam, Layer* layer); |
23 | 69 private: |
70 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
|
71 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
|
72 Layer* m_layer; |
23 | 73 Point m_point; |
74 }; | |
75 class GenericRendererElementInfo { | |
76 public: | |
77 virtual ~GenericRendererElementInfo() {}; | |
78 }; | |
79 | |
80 class GenericRendererLineInfo : public GenericRendererElementInfo { | |
81 public: | |
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
|
82 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 83 virtual ~GenericRendererLineInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
84 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
85 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
86 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
87 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
88 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
89 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
|
90 uint8_t m_alpha; |
23 | 91 }; |
92 class GenericRendererPointInfo : public GenericRendererElementInfo { | |
93 public: | |
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
|
94 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 95 virtual ~GenericRendererPointInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
96 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
97 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
98 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
99 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
100 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
|
101 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
|
102 }; |
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 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
|
104 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
|
105 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
|
106 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
|
107 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
|
108 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
|
109 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
|
110 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
|
111 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
|
112 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
|
113 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
|
114 uint8_t m_alpha; |
23 | 115 }; |
116 class GenericRendererQuadInfo : public GenericRendererElementInfo { | |
117 public: | |
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
|
118 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b, uint8_t a); |
23 | 119 virtual ~GenericRendererQuadInfo() {}; |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
120 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
121 GenericRendererNode m_edge1; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
122 GenericRendererNode m_edge2; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
123 GenericRendererNode m_edge3; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
124 GenericRendererNode m_edge4; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
125 uint8_t m_red; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
126 uint8_t m_green; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
127 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
|
128 uint8_t m_alpha; |
23 | 129 }; |
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:
422
diff
changeset
|
130 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:
422
diff
changeset
|
131 public: |
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
|
132 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:
422
diff
changeset
|
133 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:
422
diff
changeset
|
134 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:
422
diff
changeset
|
135 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:
422
diff
changeset
|
136 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:
422
diff
changeset
|
137 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:
422
diff
changeset
|
138 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:
422
diff
changeset
|
139 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
|
140 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:
422
diff
changeset
|
141 }; |
23 | 142 class GenericRendererImageInfo : public GenericRendererElementInfo { |
143 public: | |
144 GenericRendererImageInfo(GenericRendererNode n, int image); | |
145 virtual ~GenericRendererImageInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
146 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
147 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
148 int m_image; |
23 | 149 }; |
150 class GenericRendererAnimationInfo : public GenericRendererElementInfo { | |
151 public: | |
152 GenericRendererAnimationInfo(GenericRendererNode n, int animation); | |
153 virtual ~GenericRendererAnimationInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
154 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
155 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
156 int m_animation; |
23 | 157 }; |
158 class GenericRendererTextInfo : public GenericRendererElementInfo { | |
159 public: | |
160 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); | |
161 virtual ~GenericRendererTextInfo() {}; | |
29
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
162 private: |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
163 GenericRendererNode m_anchor; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
164 AbstractFont* m_font; |
0cb049f291e1
make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
27
diff
changeset
|
165 std::string m_text; |
23 | 166 }; |
167 class GenericRenderer: public RendererBase { | |
168 public: | |
27
788cb9525b2f
add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
26
diff
changeset
|
169 GenericRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool); |
422
9d94f4676d17
Moved the management of cameras into the Map class. The View class no longer exists since it now serves no purpose. The engine class itself holds the renderers and these get passed to each map that is loaded and then passed to each camera on each map. This change makes it possible for multiple maps to be loaded at the same time with the same camera id without a name clash. fixes[t:342]
vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
105
diff
changeset
|
170 ~GenericRenderer(); |
23 | 171 std::string getName(); |
172 static GenericRenderer* getInstance(IRendererContainer* cnt); | |
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
|
173 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
|
174 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
|
175 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
|
176 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
|
177 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
|
178 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
|
179 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
|
180 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
|
181 void removeAll(const std::string &group); |
23 | 182 }; |
183 } |