[Scummvm-cvs-logs] CVS: residual costume.cpp,1.34,1.35 costume.h,1.18,1.19

Erich Edgar Hoover compholio at users.sourceforge.net
Sat Dec 31 00:32:06 CET 2005


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29774

Modified Files:
	costume.cpp costume.h 
Log Message:
Fixes some invisible objects

Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- costume.cpp	10 Aug 2005 09:53:42 -0000	1.34
+++ costume.cpp	31 Dec 2005 08:31:23 -0000	1.35
@@ -267,7 +267,28 @@
 }
 
 void ModelComponent::setKey(int val) {
+	MainModelComponent *mmc;
+	ModelComponent *moc;
+	MeshComponent *mc;
+	
 	_hier->_hierVisible = (val != 0);
+	// If we're making a model component visible then assume
+	// that the parent mesh object should also become visible
+	if (_parent == NULL || val == 0)
+		return;
+	mc = dynamic_cast<MeshComponent *>(_parent);
+	if (mc == NULL)
+		return;
+	mc->node()->_meshVisible = true;
+	// Do the same thing with the parent of the mesh object
+	// but DO NOT handle the parent if it's a MMDL
+	if (mc->parent() == NULL)
+		return;
+	moc = dynamic_cast<ModelComponent *>(mc->parent());
+	mmc = dynamic_cast<MainModelComponent *>(mc->parent());
+	if (moc == NULL || mmc != NULL)
+		return;
+	moc->_hier->_hierVisible = true;
 }
 
 // Reset the hierarchy nodes for any keyframe animations (which

Index: costume.h
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- costume.h	10 Aug 2005 08:33:45 -0000	1.18
+++ costume.h	31 Dec 2005 08:31:23 -0000	1.19
@@ -68,6 +68,7 @@
 		Component(Component *parent, int parentID, char *tag);
 
 		char *tag() { return _tag; }
+		Component *parent() { return _parent; }
 		virtual void setMatrix(Matrix4) { };
 		virtual void init() { }
 		virtual void setKey(int) { }





More information about the Scummvm-git-logs mailing list