annotate engine/core/view/renderers/lightrenderer.i @ 697:ecaa4d98f05f tip

Abstracted the GUI code and refactored the GUIChan-specific code into its own module. * Most of the GUIChan code has been refactored into its own gui/guichan module. However, references to the GuiFont class still persist in the Engine and GuiManager code and these will need further refactoring. * GuiManager is now an abstract base class which specific implementations (e.g. GUIChan) should subclass. * The GUIChan GUI code is now a concrete implementation of GuiManager, most of which is in the new GuiChanGuiManager class. * The GUI code in the Console class has been refactored out of the Console and into the GUIChan module as its own GuiChanConsoleWidget class. The rest of the Console class related to executing commands was left largely unchanged. * Existing client code may need to downcast the GuiManager pointer received from FIFE::Engine::getGuiManager() to GuiChanGuiManager, since not all functionality is represented in the GuiManager abstract base class. Python client code can use the new GuiChanGuiManager.castTo static method for this purpose.
author M. George Hansen <technopolitica@gmail.com>
date Sat, 18 Jun 2011 00:28:40 -1000
parents e3140f01749d
children
rev   line source
661
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
1 /***************************************************************************
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
2 * Copyright (C) 2005-2008 by the FIFE team *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
3 * http://www.fifengine.de *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
4 * This file is part of FIFE. *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
5 * *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
6 * FIFE is free software; you can redistribute it and/or *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
8 * License as published by the Free Software Foundation; either *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version. *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
10 * *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
11 * This library is distributed in the hope that it will be useful, *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
14 * Lesser General Public License for more details. *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
15 * *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
17 * License along with this library; if not, write to the *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
18 * Free Software Foundation, Inc., *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
20 ***************************************************************************/
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
21
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
22 %module fife
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
23 %{
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
24 #include "view/renderers/lightrenderer.h"
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
25 %}
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
26
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
27 namespace FIFE {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
28 class RenderBackend;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
29
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
30 class LightRendererNode {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
31 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
32 LightRendererNode(Instance* attached_instance, const Location &relative_location, Layer* relative_layer, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
33 LightRendererNode(Instance* attached_instance, const Location &relative_location, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
34 LightRendererNode(Instance* attached_instance, Layer* relative_layer, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
35 LightRendererNode(Instance* attached_instance, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
36 LightRendererNode(const Location &attached_location, Layer* relative_layer, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
37 LightRendererNode(const Location &attached_location, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
38 LightRendererNode(Layer* attached_layer, const Point &relative_point = Point(0,0));
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
39 LightRendererNode(const Point &attached_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
40 ~LightRendererNode();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
41
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
42 void setAttached(Instance* attached_instance, const Location &relative_location, const Point &relative_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
43 void setAttached(Instance* attached_instance, const Location &relative_location);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
44 void setAttached(Instance* attached_instance, const Point &relative_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
45 void setAttached(Instance* attached_instance);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
46 void setAttached(const Location &attached_location, const Point &relative_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
47 void setAttached(const Location &attached_location);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
48 void setAttached(Layer* attached_layer);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
49 void setAttached(const Point &attached_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
50
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
51 void setRelative(const Location &relative_location);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
52 void setRelative(const Location &relative_location, Point relative_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
53 void setRelative(const Point &relative_point);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
54
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
55 Instance* getAttachedInstance();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
56 Location getAttachedLocation();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
57 Layer* getAttachedLayer();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
58 Point getAttachedPoint();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
59
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
60 Location getOffsetLocation();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
61 Point getOffsetPoint();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
62
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
63 Instance* getInstance();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
64 Location getLocation();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
65 Layer* getLayer();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
66 Point getPoint();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
67
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
68 Point getCalculatedPoint(Camera* cam, Layer* layer);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
69 private:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
70 Instance* m_instance;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
71 Location m_location;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
72 Layer* m_layer;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
73 Point m_point;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
74 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
75 class LightRendererElementInfo {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
76 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
77 virtual std::string getName() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
78 virtual LightRendererNode* getNode() { return NULL; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
79 virtual int getId() { return -1; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
80 virtual int getSrcBlend() { return -1; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
81 virtual int getDstBlend() { return -1; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
82 virtual void setStencil(uint8_t stencil_ref, float alpha_ref) {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
83 virtual int getStencil() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
84 virtual float getAlpha() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
85 virtual void removeStencil() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
86 virtual std::vector<uint8_t> getColor() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
87 virtual float getRadius() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
88 virtual int getSubdivisions() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
89 virtual float getXStretch() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
90 virtual float getYStretch() { return 0; };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
91 virtual ~LightRendererElementInfo() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
92 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
93
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
94 class LightRendererImageInfo : public LightRendererElementInfo {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
95 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
96 LightRendererImageInfo(LightRendererNode n, int image, int src, int dst);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
97 virtual ~LightRendererImageInfo() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
98 private:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
99 LightRendererNode m_anchor;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
100 int m_image;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
101 int m_src;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
102 int m_dst;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
103 bool m_stencil;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
104 uint8_t m_stencil_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
105 float m_alpha_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
106 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
107 class LightRendererAnimationInfo : public LightRendererElementInfo {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
108 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
109 LightRendererAnimationInfo(LightRendererNode n, int animation, int src, int dst);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
110 virtual ~LightRendererAnimationInfo() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
111 private:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
112 LightRendererNode m_anchor;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
113 int m_animation;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
114 int m_src;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
115 int m_dst;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
116 bool m_stencil;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
117 uint8_t m_stencil_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
118 float m_alpha_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
119 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
120 class LightRendererSimpleLightInfo : public LightRendererElementInfo {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
121 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
122 LightRendererSimpleLightInfo(LightRendererNode n, uint8_t intensity, float radius, int subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int src, int dst);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
123 virtual ~LightRendererSimpleLightInfo() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
124 private:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
125 LightRendererNode m_anchor;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
126 uint8_t m_intensity;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
127 float m_radius;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
128 int m_subdivisions;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
129 float m_xstretch;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
130 float m_ystretch;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
131 uint8_t m_red;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
132 uint8_t m_green;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
133 uint8_t m_blue;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
134 int m_src;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
135 int m_dst;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
136 bool m_stencil;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
137 uint8_t m_stencil_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
138 float m_alpha_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
139 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
140 class LightRendererResizeInfo : public LightRendererElementInfo {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
141 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
142 LightRendererResizeInfo(LightRendererNode n, int image, int width, int height, int src, int dst);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
143 virtual ~LightRendererResizeInfo() {};
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
144 private:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
145 LightRendererNode m_anchor;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
146 int m_image;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
147 int m_width;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
148 int m_height;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
149 int m_src;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
150 int m_dst;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
151 bool m_stencil;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
152 uint8_t m_stencil_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
153 float m_alpha_ref;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
154 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
155 class LightRenderer: public RendererBase {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
156 public:
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
157 LightRenderer(RenderBackend* renderbackend, int position, ImagePool* imagepool, AnimationPool* animpool);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
158 ~LightRenderer();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
159 std::string getName();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
160 static LightRenderer* getInstance(IRendererContainer* cnt);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
161 void addImage(const std::string &group, LightRendererNode n, int image, int src=-1, int dst=-1);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
162 void addAnimation(const std::string &group, LightRendererNode n, int animation, int src=-1, int dst=-1);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
163 void addSimpleLight(const std::string &group, LightRendererNode n, uint8_t intensity, float radius, int subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int src=-1, int dst=-1);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
164 void resizeImage(const std::string &group, LightRendererNode n, int image, int width, int height, int src=-1, int dst=-1);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
165 void addStencilTest(const std::string &group, uint8_t stencil_ref=0, float alpha_ref=0.0);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
166 void removeStencilTest(const std::string &group);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
167 std::list<std::string> getGroups();
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
168 std::vector<LightRendererElementInfo*> getLightInfo(const std::string &group);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
169 void removeAll(const std::string &group);
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
170 };
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
171 }
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
172
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
173 namespace std {
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
174 %template(LightRendererElementInfoVector) vector<FIFE::LightRendererElementInfo*>;
e3140f01749d * Merged the light branch back into trunk.
helios2000@33b003aa-7bff-0310-803a-e67f0ece8222
parents:
diff changeset
175 }