annotate engine/core/view/renderers/genericrenderer.i @ 487:7f1c42b66aa4

Moved the shooter demo Timer() class to helpers.py. Changed the formula that calculates the length of the audio clip to be correct. The shooter demo now demonstrates the use of the audio clip callbacks correctly. Fixed the fife_timer extension to actually work.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 03 May 2010 19:58:16 +0000
parents 16c2b3ee59ce
children 47b49b9b0c0a
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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 %module fife
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 %{
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24 #include "view/renderers/genericrenderer.h"
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 %}
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 namespace FIFE {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28 class RenderBackend;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 class GenericRendererNode {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 public:
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
32 GenericRendererNode(Instance* attached_instance, Location* relative_location, Layer* relative_layer, const Point &relative_point = Point(0,0));
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 GenericRendererNode(Instance* attached_instance, 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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 GenericRendererNode(Instance* attached_instance, 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
36 GenericRendererNode(Location* attached_location, Layer* relative_layer, const Point &relative_point = Point(0,0));
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 GenericRendererNode(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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39 GenericRendererNode(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40 ~GenericRendererNode();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
42 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
43 void setAttached(Instance* attached_instance, Location* relative_location);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 void setAttached(Instance* attached_instance, const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 void setAttached(Instance* attached_instance);
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
46 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
47 void setAttached(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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49 void setAttached(const Point &attached_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50
26
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
51 void setRelative(Location* relative_location);
70f41ea8e7db fix compile errors in node setters...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 23
diff changeset
52 void setRelative(Location* relative_location, Point relative_point);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53 void setRelative(const Point &relative_point);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 Instance* getAttachedInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 Point getAttachedPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60 Location* getOffsetLocation();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 Point getOffsetPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 Instance* getInstance();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 Point getPoint();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69 private:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 Instance* m_instance;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
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
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 Point m_point;
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 class GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 virtual ~GenericRendererElementInfo() {};
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80 class GenericRendererLineInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
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;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91 class GenericRendererPointInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 virtual ~GenericRendererPointInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
95 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
96 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
97 uint8_t m_red;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
98 uint8_t m_green;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
99 uint8_t m_blue;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 class GenericRendererQuadInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
103 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104 virtual ~GenericRendererQuadInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
105 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
106 GenericRendererNode m_edge1;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
107 GenericRendererNode m_edge2;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
108 GenericRendererNode m_edge3;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
109 GenericRendererNode m_edge4;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
110 uint8_t m_red;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
111 uint8_t m_green;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
112 uint8_t m_blue;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 };
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
114 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
115 public:
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
116 GenericRendererVertexInfo(GenericRendererNode center, int size, uint8_t r, uint8_t g, uint8_t b);
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
117 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
118 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
119 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
120 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
121 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
122 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
123 uint8_t m_blue;
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
124 };
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 class GenericRendererImageInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127 GenericRendererImageInfo(GenericRendererNode n, int image);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 virtual ~GenericRendererImageInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
129 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
130 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
131 int m_image;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 class GenericRendererAnimationInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 GenericRendererAnimationInfo(GenericRendererNode n, int animation);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 virtual ~GenericRendererAnimationInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
137 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
138 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
139 int m_animation;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
140 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
141 class GenericRendererTextInfo : public GenericRendererElementInfo {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
142 public:
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
143 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text);
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
144 virtual ~GenericRendererTextInfo() {};
29
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
145 private:
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
146 GenericRendererNode m_anchor;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
147 AbstractFont* m_font;
0cb049f291e1 make members private and prefix with m_
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 27
diff changeset
148 std::string m_text;
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
149 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
150 class GenericRenderer: public RendererBase {
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
151 public:
27
788cb9525b2f add image and text renderer to generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 26
diff changeset
152 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
153 ~GenericRenderer();
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
154 std::string getName();
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
155 static GenericRenderer* getInstance(IRendererContainer* cnt);
105
2241b0d5379e use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
156 void addLine(const std::string &group, GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
2241b0d5379e use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
157 void addPoint(const std::string &group, GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
2241b0d5379e use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
158 void addQuad(const std::string &group, GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
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
159 void addVertex(const std::string &group, GenericRendererNode n, int size, uint8_t r, uint8_t g, uint8_t b);
105
2241b0d5379e use strings as grouping in generic renderer, easier for the clients...
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents: 46
diff changeset
160 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
161 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
162 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
163 void removeAll(const std::string &group);
23
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164 };
e5e2fec68834 add generic renderer
spq@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 }