Mercurial > fife-parpg
comparison engine/core/view/renderers/genericrenderer.h @ 482:16c2b3ee59ce
* Merged the view performance branch back into trunk. fixes[ticket:419]
author | helios2000@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Thu, 29 Apr 2010 13:51:45 +0000 |
parents | f855809822cf |
children | 47b49b9b0c0a |
comparison
equal
deleted
inserted
replaced
481:1f37adc9a685 | 482:16c2b3ee59ce |
---|---|
74 Instance* getInstance(); | 74 Instance* getInstance(); |
75 Location* getLocation(); | 75 Location* getLocation(); |
76 Layer* getLayer(); | 76 Layer* getLayer(); |
77 Point getPoint(); | 77 Point getPoint(); |
78 | 78 |
79 Point getCalculatedPoint(Camera* cam, Layer* layer, std::vector<Instance*>& instances); | 79 Point getCalculatedPoint(Camera* cam, Layer* layer); |
80 private: | 80 private: |
81 Instance* m_instance; | 81 Instance* m_instance; |
82 Location* m_location; | 82 Location* m_location; |
83 Layer* m_layer; | 83 Layer* m_layer; |
84 Point m_point; | 84 Point m_point; |
85 }; | 85 }; |
86 class GenericRendererElementInfo { | 86 class GenericRendererElementInfo { |
87 public: | 87 public: |
88 virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {}; | 88 virtual void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {}; |
89 virtual ~GenericRendererElementInfo() {}; | 89 virtual ~GenericRendererElementInfo() {}; |
90 }; | 90 }; |
91 | 91 |
92 class GenericRendererLineInfo : public GenericRendererElementInfo { | 92 class GenericRendererLineInfo : public GenericRendererElementInfo { |
93 public: | 93 public: |
94 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 94 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
95 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); | 95 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); |
96 virtual ~GenericRendererLineInfo() {}; | 96 virtual ~GenericRendererLineInfo() {}; |
97 private: | 97 private: |
98 GenericRendererNode m_edge1; | 98 GenericRendererNode m_edge1; |
99 GenericRendererNode m_edge2; | 99 GenericRendererNode m_edge2; |
101 uint8_t m_green; | 101 uint8_t m_green; |
102 uint8_t m_blue; | 102 uint8_t m_blue; |
103 }; | 103 }; |
104 class GenericRendererPointInfo : public GenericRendererElementInfo { | 104 class GenericRendererPointInfo : public GenericRendererElementInfo { |
105 public: | 105 public: |
106 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 106 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
107 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); | 107 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); |
108 virtual ~GenericRendererPointInfo() {}; | 108 virtual ~GenericRendererPointInfo() {}; |
109 private: | 109 private: |
110 GenericRendererNode m_anchor; | 110 GenericRendererNode m_anchor; |
111 uint8_t m_red; | 111 uint8_t m_red; |
112 uint8_t m_green; | 112 uint8_t m_green; |
113 uint8_t m_blue; | 113 uint8_t m_blue; |
114 }; | 114 }; |
115 class GenericRendererQuadInfo : public GenericRendererElementInfo { | 115 class GenericRendererQuadInfo : public GenericRendererElementInfo { |
116 public: | 116 public: |
117 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 117 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
118 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); | 118 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); |
119 virtual ~GenericRendererQuadInfo() {}; | 119 virtual ~GenericRendererQuadInfo() {}; |
120 private: | 120 private: |
121 GenericRendererNode m_edge1; | 121 GenericRendererNode m_edge1; |
122 GenericRendererNode m_edge2; | 122 GenericRendererNode m_edge2; |
127 uint8_t m_blue; | 127 uint8_t m_blue; |
128 }; | 128 }; |
129 | 129 |
130 class GenericRendererVertexInfo : public GenericRendererElementInfo { | 130 class GenericRendererVertexInfo : public GenericRendererElementInfo { |
131 public: | 131 public: |
132 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 132 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
133 GenericRendererVertexInfo(GenericRendererNode center, int size, uint8_t r, uint8_t g, uint8_t b); | 133 GenericRendererVertexInfo(GenericRendererNode center, int size, uint8_t r, uint8_t g, uint8_t b); |
134 virtual ~GenericRendererVertexInfo() {}; | 134 virtual ~GenericRendererVertexInfo() {}; |
135 private: | 135 private: |
136 GenericRendererNode m_center; | 136 GenericRendererNode m_center; |
137 int m_size; | 137 int m_size; |
140 uint8_t m_blue; | 140 uint8_t m_blue; |
141 }; | 141 }; |
142 | 142 |
143 class GenericRendererImageInfo : public GenericRendererElementInfo { | 143 class GenericRendererImageInfo : public GenericRendererElementInfo { |
144 public: | 144 public: |
145 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 145 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
146 GenericRendererImageInfo(GenericRendererNode n, int image); | 146 GenericRendererImageInfo(GenericRendererNode n, int image); |
147 virtual ~GenericRendererImageInfo() {}; | 147 virtual ~GenericRendererImageInfo() {}; |
148 private: | 148 private: |
149 GenericRendererNode m_anchor; | 149 GenericRendererNode m_anchor; |
150 int m_image; | 150 int m_image; |
151 }; | 151 }; |
152 class GenericRendererAnimationInfo : public GenericRendererElementInfo { | 152 class GenericRendererAnimationInfo : public GenericRendererElementInfo { |
153 public: | 153 public: |
154 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 154 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
155 GenericRendererAnimationInfo(GenericRendererNode n, int animation); | 155 GenericRendererAnimationInfo(GenericRendererNode n, int animation); |
156 virtual ~GenericRendererAnimationInfo() {}; | 156 virtual ~GenericRendererAnimationInfo() {}; |
157 private: | 157 private: |
158 GenericRendererNode m_anchor; | 158 GenericRendererNode m_anchor; |
159 int m_animation; | 159 int m_animation; |
160 unsigned int m_start_time; | 160 unsigned int m_start_time; |
161 float m_time_scale; | 161 float m_time_scale; |
162 }; | 162 }; |
163 class GenericRendererTextInfo : public GenericRendererElementInfo { | 163 class GenericRendererTextInfo : public GenericRendererElementInfo { |
164 public: | 164 public: |
165 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 165 void render(Camera* cam, Layer* layer, RenderList& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
166 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); | 166 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); |
167 virtual ~GenericRendererTextInfo() {}; | 167 virtual ~GenericRendererTextInfo() {}; |
168 private: | 168 private: |
169 GenericRendererNode m_anchor; | 169 GenericRendererNode m_anchor; |
170 AbstractFont* m_font; | 170 AbstractFont* m_font; |
183 RendererBase* clone(); | 183 RendererBase* clone(); |
184 | 184 |
185 /** Destructor. | 185 /** Destructor. |
186 */ | 186 */ |
187 virtual ~GenericRenderer(); | 187 virtual ~GenericRenderer(); |
188 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances); | 188 void render(Camera* cam, Layer* layer, RenderList& instances); |
189 std::string getName() { return "GenericRenderer"; } | 189 std::string getName() { return "GenericRenderer"; } |
190 | 190 |
191 /** Gets instance for interface access | 191 /** Gets instance for interface access |
192 */ | 192 */ |
193 static GenericRenderer* getInstance(IRendererContainer* cnt); | 193 static GenericRenderer* getInstance(IRendererContainer* cnt); |