changeset 57:47979f9dce55

add possibility to hide instances/instance visuals; initialize instance visuals properly
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 14 Jul 2008 14:41:12 +0000
parents 73a9f7addd33
children 9ec572a5a944
files engine/core/view/camera.cpp engine/core/view/visual.cpp
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/view/camera.cpp	Sun Jul 13 23:15:32 2008 +0000
+++ b/engine/core/view/camera.cpp	Mon Jul 14 14:41:12 2008 +0000
@@ -503,6 +503,8 @@
 			for (;instance_it != allinstances.end(); ++instance_it) {
 				Instance* instance = *instance_it;
 				InstanceVisual* visual = instance->getVisual<InstanceVisual>();
+				if(!visual->isVisible())
+					continue;
 				InstanceVisualCacheItem& vc = visual->getCacheItem(this);
 				
 				// use cached values if there is no need to do full recalculation
--- a/engine/core/view/visual.cpp	Sun Jul 13 23:15:32 2008 +0000
+++ b/engine/core/view/visual.cpp	Mon Jul 14 14:41:12 2008 +0000
@@ -41,7 +41,7 @@
 
 	static Logger _log(LM_VIEW);
 	
-	Visual2DGfx::Visual2DGfx(): m_transparency(0) {
+	Visual2DGfx::Visual2DGfx(): m_transparency(0), m_visible(true) {
 	}
 	
 	Visual2DGfx::~Visual2DGfx() {