Mercurial > fife-parpg
comparison engine/core/view/renderers/genericrenderer.h @ 29:0cb049f291e1
make members private and prefix with m_
author | spq@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Fri, 11 Jul 2008 13:00:10 +0000 |
parents | 788cb9525b2f |
children | 9a9f4447af7c |
comparison
equal
deleted
inserted
replaced
28:1e3b68c260a6 | 29:0cb049f291e1 |
---|---|
75 Location* m_location; | 75 Location* m_location; |
76 Point m_point; | 76 Point m_point; |
77 }; | 77 }; |
78 class GenericRendererElementInfo { | 78 class GenericRendererElementInfo { |
79 public: | 79 public: |
80 virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) { }; | 80 virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {}; |
81 virtual ~GenericRendererElementInfo() {}; | 81 virtual ~GenericRendererElementInfo() {}; |
82 }; | 82 }; |
83 | 83 |
84 class GenericRendererLineInfo : public GenericRendererElementInfo { | 84 class GenericRendererLineInfo : public GenericRendererElementInfo { |
85 public: | 85 public: |
86 GenericRendererNode n1; | |
87 GenericRendererNode n2; | |
88 uint8_t r; | |
89 uint8_t g; | |
90 uint8_t b; | |
91 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 86 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
92 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); | 87 GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b); |
93 virtual ~GenericRendererLineInfo() {}; | 88 virtual ~GenericRendererLineInfo() {}; |
89 private: | |
90 GenericRendererNode m_edge1; | |
91 GenericRendererNode m_edge2; | |
92 uint8_t m_red; | |
93 uint8_t m_green; | |
94 uint8_t m_blue; | |
94 }; | 95 }; |
95 class GenericRendererPointInfo : public GenericRendererElementInfo { | 96 class GenericRendererPointInfo : public GenericRendererElementInfo { |
96 public: | 97 public: |
97 GenericRendererNode n; | |
98 uint8_t r; | |
99 uint8_t g; | |
100 uint8_t b; | |
101 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 98 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
102 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); | 99 GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b); |
103 virtual ~GenericRendererPointInfo() {}; | 100 virtual ~GenericRendererPointInfo() {}; |
101 private: | |
102 GenericRendererNode m_anchor; | |
103 uint8_t m_red; | |
104 uint8_t m_green; | |
105 uint8_t m_blue; | |
104 }; | 106 }; |
105 class GenericRendererQuadInfo : public GenericRendererElementInfo { | 107 class GenericRendererQuadInfo : public GenericRendererElementInfo { |
106 public: | 108 public: |
107 GenericRendererNode n1; | |
108 GenericRendererNode n2; | |
109 GenericRendererNode n3; | |
110 GenericRendererNode n4; | |
111 uint8_t r; | |
112 uint8_t g; | |
113 uint8_t b; | |
114 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 109 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
115 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); | 110 GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b); |
116 virtual ~GenericRendererQuadInfo() {}; | 111 virtual ~GenericRendererQuadInfo() {}; |
112 private: | |
113 GenericRendererNode m_edge1; | |
114 GenericRendererNode m_edge2; | |
115 GenericRendererNode m_edge3; | |
116 GenericRendererNode m_edge4; | |
117 uint8_t m_red; | |
118 uint8_t m_green; | |
119 uint8_t m_blue; | |
117 }; | 120 }; |
118 class GenericRendererImageInfo : public GenericRendererElementInfo { | 121 class GenericRendererImageInfo : public GenericRendererElementInfo { |
119 public: | 122 public: |
120 GenericRendererNode n; | |
121 int image; | |
122 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 123 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
123 GenericRendererImageInfo(GenericRendererNode n, int image); | 124 GenericRendererImageInfo(GenericRendererNode n, int image); |
124 virtual ~GenericRendererImageInfo() {}; | 125 virtual ~GenericRendererImageInfo() {}; |
126 private: | |
127 GenericRendererNode m_anchor; | |
128 int m_image; | |
125 }; | 129 }; |
126 class GenericRendererAnimationInfo : public GenericRendererElementInfo { | 130 class GenericRendererAnimationInfo : public GenericRendererElementInfo { |
127 public: | 131 public: |
128 GenericRendererNode n; | |
129 int animation; | |
130 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 132 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
131 GenericRendererAnimationInfo(GenericRendererNode n, int animation); | 133 GenericRendererAnimationInfo(GenericRendererNode n, int animation); |
132 virtual ~GenericRendererAnimationInfo() {}; | 134 virtual ~GenericRendererAnimationInfo() {}; |
135 private: | |
136 GenericRendererNode m_anchor; | |
137 int m_animation; | |
133 }; | 138 }; |
134 class GenericRendererTextInfo : public GenericRendererElementInfo { | 139 class GenericRendererTextInfo : public GenericRendererElementInfo { |
135 public: | 140 public: |
136 GenericRendererNode n; | |
137 AbstractFont* font; | |
138 std::string text; | |
139 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); | 141 void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool); |
140 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); | 142 GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text); |
141 virtual ~GenericRendererTextInfo() {}; | 143 virtual ~GenericRendererTextInfo() {}; |
144 private: | |
145 GenericRendererNode m_anchor; | |
146 AbstractFont* m_font; | |
147 std::string m_text; | |
142 }; | 148 }; |
143 class GenericRenderer: public RendererBase { | 149 class GenericRenderer: public RendererBase { |
144 public: | 150 public: |
145 /** constructor. | 151 /** constructor. |
146 * @param renderbackend to use | 152 * @param renderbackend to use |
169 void addImage(GenericRendererNode n, int image); | 175 void addImage(GenericRendererNode n, int image); |
170 void addAnimation(GenericRendererNode n, int animation); | 176 void addAnimation(GenericRendererNode n, int animation); |
171 void removeAll(); | 177 void removeAll(); |
172 | 178 |
173 private: | 179 private: |
174 std::vector<GenericRendererElementInfo*> m_infos; | |
175 ImagePool* m_imagepool; | 180 ImagePool* m_imagepool; |
176 AnimationPool* m_animationpool; | 181 AnimationPool* m_animationpool; |
182 std::vector<GenericRendererElementInfo*> m_infos; | |
177 }; | 183 }; |
178 | 184 |
179 } | 185 } |
180 | 186 |
181 #endif | 187 #endif |