Debian Codegraph @

engine/core/view/renderers/lightrenderer.i

raw
1 /***************************************************************************
2 * Copyright (C) 2005-2019 by the FIFE team *
3 * http://www.fifengine.net *
4 * This file is part of FIFE. *
5 * *
6 * FIFE is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Lesser General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2.1 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Lesser General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Lesser General Public *
17 * License along with this library; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20 ***************************************************************************/
21
22 %module fife
23 %{
24 #include "view/renderers/lightrenderer.h"
25 %}
26
27 namespace FIFE {
28 class RenderBackend;
29
30 class LightRendererElementInfo {
31 public:
32 LightRendererElementInfo(RendererNode n, int32_t src, int32_t dst);
33 virtual ~LightRendererElementInfo();
34 virtual std::string getName() = 0;
35 RendererNode* getNode();
36 int32_t getSrcBlend();
37 int32_t getDstBlend();
38 void setStencil(uint8_t stencil_ref);
39 int32_t getStencil();
40 void removeStencil();
41 virtual std::vector<uint8_t> getColor();
42 virtual float getRadius();
43 virtual int32_t getSubdivisions();
44 virtual float getXStretch();
45 virtual float getYStretch();
46 };
47
48 class LightRendererImageInfo : public LightRendererElementInfo {
49 public:
50 LightRendererImageInfo(RendererNode n, ImagePtr image, int32_t src, int32_t dst);
51 virtual ~LightRendererImageInfo();
52
53 ImagePtr getImage();
54 };
55
56 class LightRendererAnimationInfo : public LightRendererElementInfo {
57 public:
58 LightRendererAnimationInfo(RendererNode n, AnimationPtr animation, int32_t src, int32_t dst);
59 virtual ~LightRendererAnimationInfo();
60
61 AnimationPtr getAnimation();
62 };
63
64 class LightRendererSimpleLightInfo : public LightRendererElementInfo {
65 public:
66 LightRendererSimpleLightInfo(RendererNode n, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int32_t src, int32_t dst);
67 virtual ~LightRendererSimpleLightInfo();
68 std::vector<uint8_t> getColor();
69 float getRadius();
70 int32_t getSubdivisions();
71 float getXStretch();
72 float getYStretch();
73 };
74
75 class LightRendererResizeInfo : public LightRendererElementInfo {
76 public:
77 LightRendererResizeInfo(RendererNode n, ImagePtr image, int32_t width, int32_t height, int32_t src, int32_t dst);
78 virtual ~LightRendererResizeInfo();
79
80 ImagePtr getImage();
81 };
82
83 class LightRenderer: public RendererBase {
84 public:
85 LightRenderer(RenderBackend* renderbackend, int32_t position);
86 ~LightRenderer();
87 std::string getName();
88 static LightRenderer* getInstance(IRendererContainer* cnt);
89 void addImage(const std::string &group, RendererNode n, ImagePtr image, int32_t src=-1, int32_t dst=-1);
90 void addAnimation(const std::string &group, RendererNode n, AnimationPtr animation, int32_t src=-1, int32_t dst=-1);
91 void addSimpleLight(const std::string &group, RendererNode n, uint8_t intensity, float radius, int32_t subdivisions, float xstretch, float ystretch, uint8_t r, uint8_t g, uint8_t b, int32_t src=-1, int32_t dst=-1);
92 void resizeImage(const std::string &group, RendererNode n, ImagePtr image, int32_t width, int32_t height, int32_t src=-1, int32_t dst=-1);
93 void addStencilTest(const std::string &group, uint8_t stencil_ref=0);
94 void removeStencilTest(const std::string &group);
95 std::list<std::string> getGroups();
96 std::vector<LightRendererElementInfo*> getLightInfo(const std::string &group);
97 void removeAll(const std::string &group);
98 void removeAll();
99 };
100 }
101
102 namespace std {
103 %template(LightRendererElementInfoVector) vector<FIFE::LightRendererElementInfo*>;
104 }