changeset 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 1e3b68c260a6
children 9c3f37432a28
files engine/core/view/renderers/genericrenderer.cpp engine/core/view/renderers/genericrenderer.h engine/core/view/renderers/genericrenderer.i
diffstat 3 files changed, 108 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/view/renderers/genericrenderer.cpp	Fri Jul 11 12:56:25 2008 +0000
+++ b/engine/core/view/renderers/genericrenderer.cpp	Fri Jul 11 13:00:10 2008 +0000
@@ -183,56 +183,56 @@
 
 	GenericRendererLineInfo::GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b):
 		GenericRendererElementInfo(),
-		n1(n1),
-		n2(n2),
-		r(r),
-		g(g),
-		b(b) {
+		m_edge1(n1),
+		m_edge2(n2),
+		m_red(r),
+		m_green(g),
+		m_blue(b) {
 	}
 	void GenericRendererLineInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
-		Point p1 = n1.getCalculatedPoint(cam, layer, instances);
-		Point p2 = n2.getCalculatedPoint(cam, layer, instances);
-		renderbackend->drawLine(p1, p2, r, g, b);
+		Point p1 = m_edge1.getCalculatedPoint(cam, layer, instances);
+		Point p2 = m_edge2.getCalculatedPoint(cam, layer, instances);
+		renderbackend->drawLine(p1, p2, m_red, m_green, m_blue);
 	}
 	
-	GenericRendererPointInfo::GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b):
+	GenericRendererPointInfo::GenericRendererPointInfo(GenericRendererNode anchor, uint8_t r, uint8_t g, uint8_t b):
 		GenericRendererElementInfo(),
-		n(n),
-		r(r),
-		g(g),
-		b(b) {
+		m_anchor(anchor),
+		m_red(r),
+		m_green(g),
+		m_blue(b) {
 	}
 	void GenericRendererPointInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
-		Point p = n.getCalculatedPoint(cam, layer, instances);
-		renderbackend->putPixel(p.x, p.y, r, g, b);
+		Point p = m_anchor.getCalculatedPoint(cam, layer, instances);
+		renderbackend->putPixel(p.x, p.y, m_red, m_green, m_blue);
 	}
 	
 	GenericRendererQuadInfo::GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b):
 		GenericRendererElementInfo(),
-		n1(n1),
-		n2(n2),
-		n3(n3),
-		n4(n4),
-		r(r),
-		g(g),
-		b(b) {
+		m_edge1(n1),
+		m_edge2(n2),
+		m_edge3(n3),
+		m_edge4(n4),
+		m_red(r),
+		m_green(g),
+		m_blue(b) {
 	}
 	void GenericRendererQuadInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
-		Point p1 = n1.getCalculatedPoint(cam, layer, instances);
-		Point p2 = n2.getCalculatedPoint(cam, layer, instances);
-		Point p3 = n3.getCalculatedPoint(cam, layer, instances);
-		Point p4 = n4.getCalculatedPoint(cam, layer, instances);
-		renderbackend->drawQuad(p1, p2, p3, p4, r, g, b);
+		Point p1 = m_edge1.getCalculatedPoint(cam, layer, instances);
+		Point p2 = m_edge2.getCalculatedPoint(cam, layer, instances);
+		Point p3 = m_edge3.getCalculatedPoint(cam, layer, instances);
+		Point p4 = m_edge4.getCalculatedPoint(cam, layer, instances);
+		renderbackend->drawQuad(p1, p2, p3, p4, m_red, m_green, m_blue);
 	}
 	
-	GenericRendererImageInfo::GenericRendererImageInfo(GenericRendererNode n, int image):
+	GenericRendererImageInfo::GenericRendererImageInfo(GenericRendererNode anchor, int image):
 		GenericRendererElementInfo(),
-		n(n),
-		image(image) {
+		m_anchor(anchor),
+		m_image(image) {
 	}
 	void GenericRendererImageInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
-		Point p = n.getCalculatedPoint(cam, layer, instances);
-		Image* img = &imagepool->getImage(image);
+		Point p = m_anchor.getCalculatedPoint(cam, layer, instances);
+		Image* img = &imagepool->getImage(m_image);
 		Rect r;
 		r.x = p.x-img->getWidth()/2;
 		r.y = p.y-img->getHeight()/2;
@@ -241,24 +241,24 @@
 		img->render(r);
 	}
 	
-	GenericRendererAnimationInfo::GenericRendererAnimationInfo(GenericRendererNode n, int animation):
+	GenericRendererAnimationInfo::GenericRendererAnimationInfo(GenericRendererNode anchor, int animation):
 		GenericRendererElementInfo(),
-		n(n),
-		animation(animation) {
+		m_anchor(anchor),
+		m_animation(animation) {
 	}
 	void GenericRendererAnimationInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
 		return;
 	}
 	
-	GenericRendererTextInfo::GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text):
+	GenericRendererTextInfo::GenericRendererTextInfo(GenericRendererNode anchor, AbstractFont* font, std::string text):
 		GenericRendererElementInfo(),
-		n(n),
-		font(font),
-		text(text) {
+		m_anchor(anchor),
+		m_font(font),
+		m_text(text) {
 	}
 	void GenericRendererTextInfo::render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {
-		Point p = n.getCalculatedPoint(cam, layer, instances);
-		Image* img = font->getAsImageMultiline(text);
+		Point p = m_anchor.getCalculatedPoint(cam, layer, instances);
+		Image* img = m_font->getAsImageMultiline(m_text);
 		Rect r;
 		r.x = p.x-img->getWidth()/2;
 		r.y = p.y-img->getHeight()/2;
--- a/engine/core/view/renderers/genericrenderer.h	Fri Jul 11 12:56:25 2008 +0000
+++ b/engine/core/view/renderers/genericrenderer.h	Fri Jul 11 13:00:10 2008 +0000
@@ -77,68 +77,74 @@
 	};
 	class GenericRendererElementInfo {
 	public:
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) { };
+		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {};
 		virtual ~GenericRendererElementInfo() {};
 	};
 
 	class GenericRendererLineInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n1;
-		GenericRendererNode n2;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererLineInfo() {};
+	private:
+		GenericRendererNode m_edge1;
+		GenericRendererNode m_edge2;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererPointInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererPointInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererQuadInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n1;
-		GenericRendererNode n2;
-		GenericRendererNode n3;
-		GenericRendererNode n4;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererQuadInfo() {};
+	private:
+		GenericRendererNode m_edge1;
+		GenericRendererNode m_edge2;
+		GenericRendererNode m_edge3;
+		GenericRendererNode m_edge4;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererImageInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		int image;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererImageInfo(GenericRendererNode n, int image);
 		virtual ~GenericRendererImageInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		int m_image;
 	};
 	class GenericRendererAnimationInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		int animation;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererAnimationInfo(GenericRendererNode n, int animation);
 		virtual ~GenericRendererAnimationInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		int m_animation;
 	};
 	class GenericRendererTextInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		AbstractFont* font;
-		std::string text;
 		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text);
 		virtual ~GenericRendererTextInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		AbstractFont* m_font;
+		std::string m_text;
 	};
 	class GenericRenderer: public RendererBase {
 	public:
@@ -171,9 +177,9 @@
 		void removeAll();
 
 	private:
-		std::vector<GenericRendererElementInfo*> m_infos;
 		ImagePool* m_imagepool;
 		AnimationPool* m_animationpool;
+		std::vector<GenericRendererElementInfo*> m_infos;
 	};
 
 }
--- a/engine/core/view/renderers/genericrenderer.i	Fri Jul 11 12:56:25 2008 +0000
+++ b/engine/core/view/renderers/genericrenderer.i	Fri Jul 11 13:00:10 2008 +0000
@@ -45,68 +45,74 @@
 	};
 	class GenericRendererElementInfo {
 	public:
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) = 0;
+		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool) {};
 		virtual ~GenericRendererElementInfo() {};
 	};
 
 	class GenericRendererLineInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n1;
-		GenericRendererNode n2;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererLineInfo(GenericRendererNode n1, GenericRendererNode n2, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererLineInfo() {};
+	private:
+		GenericRendererNode m_edge1;
+		GenericRendererNode m_edge2;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererPointInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererPointInfo(GenericRendererNode n, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererPointInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererQuadInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n1;
-		GenericRendererNode n2;
-		GenericRendererNode n3;
-		GenericRendererNode n4;
-		uint8_t r;
-		uint8_t g;
-		uint8_t b;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererQuadInfo(GenericRendererNode n1, GenericRendererNode n2, GenericRendererNode n3, GenericRendererNode n4, uint8_t r, uint8_t g, uint8_t b);
 		virtual ~GenericRendererQuadInfo() {};
+	private:
+		GenericRendererNode m_edge1;
+		GenericRendererNode m_edge2;
+		GenericRendererNode m_edge3;
+		GenericRendererNode m_edge4;
+		uint8_t m_red;
+		uint8_t m_green;
+		uint8_t m_blue;
 	};
 	class GenericRendererImageInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		int image;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererImageInfo(GenericRendererNode n, int image);
 		virtual ~GenericRendererImageInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		int m_image;
 	};
 	class GenericRendererAnimationInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		int animation;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererAnimationInfo(GenericRendererNode n, int animation);
 		virtual ~GenericRendererAnimationInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		int m_animation;
 	};
 	class GenericRendererTextInfo : public GenericRendererElementInfo {
 	public:
-		GenericRendererNode n;
-		AbstractFont* font;
-		std::string text;
-		virtual void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
+		void render(Camera* cam, Layer* layer, std::vector<Instance*>& instances, RenderBackend* renderbackend, ImagePool* imagepool, AnimationPool* animpool);
 		GenericRendererTextInfo(GenericRendererNode n, AbstractFont* font, std::string text);
 		virtual ~GenericRendererTextInfo() {};
+	private:
+		GenericRendererNode m_anchor;
+		AbstractFont* m_font;
+		std::string m_text;
 	};
 	class GenericRenderer: public RendererBase {
 	public: