[Scummvm-cvs-logs] CVS: residual driver_gl.cpp,1.25,1.26 driver_gl.h,1.13,1.14 model.cpp,1.23,1.24

Pawel Kolodziejski aquadran at users.sourceforge.net
Tue Jan 11 11:47:13 CET 2005


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

Modified Files:
	driver_gl.cpp driver_gl.h model.cpp 
Log Message:
removed some non used code

Index: driver_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- driver_gl.cpp	10 Jan 2005 09:09:42 -0000	1.25
+++ driver_gl.cpp	11 Jan 2005 19:46:47 -0000	1.26
@@ -49,7 +49,6 @@
 	// Set perspective transformation
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
-	//gluPerspective(std::atan(std::tan(fov_ / 2 * (M_PI / 180)) * 0.75) * 2 * (180 / M_PI), 4.0f / 3, nclip_, fclip_);
 
 	float right = nclip * std::tan(fov / 2 * (M_PI / 180));
 	glFrustum(-right, right, -right * 0.75, right * 0.75, nclip, fclip);
@@ -99,81 +98,6 @@
 	glEnable(GL_DEPTH_TEST);
 }
 
-void Driver::drawModelNodeDebug(const Model::Mesh *model) {
-	// debug
-	// this draw the model node in red
-
-	GLdouble modelView[500];
-	GLdouble projection[500];
-	GLint viewPort[500];
-
-	glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
-	glGetDoublev(GL_PROJECTION_MATRIX, projection);
-	glGetIntegerv(GL_VIEWPORT, viewPort);
-
-	glPushMatrix();
-	glLoadIdentity();
-
-	glDisable(GL_DEPTH_TEST);
-	glPointSize(3.f);
-	glColor4f(1.f, 0.f, 0.f, 1.f);
-	glDisable(GL_TEXTURE_2D);
-
-	glBegin(GL_POINTS);
-	glVertex3f(model->_matrix._pos.x(), model->_matrix._pos.y(), model->_matrix._pos.z());
-	glEnd();
-
-	glEnable(GL_DEPTH_TEST);
-	glPopMatrix();
-	glEnable(GL_TEXTURE_2D);
-}
-
-void Driver::drawModelPolygonPointsDebug(const Model::Mesh *model) {
-	// debug
-	// this draw the poly points
-
-	GLdouble modelView[500];
-	GLdouble projection[500];
-	GLint viewPort[500];
-	int i, j;
-
-	glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
-	glGetDoublev(GL_PROJECTION_MATRIX, projection);
-	glGetIntegerv(GL_VIEWPORT, viewPort);
-
-	glPushMatrix();
-	glLoadIdentity();
-
-	glDisable(GL_DEPTH_TEST);
-	glPointSize(3.f);
-	glColor4f(0.f, 1.f, 0.f, 1.f);
-	glDisable(GL_TEXTURE_2D);
-
-	glBegin(GL_POINTS);
-
-	for (i = 0; i < model->_numFaces; i++) {
-		Vector3d v;
-		Matrix4 tempMatrix = model->_matrix;
-		float *pVertices;
-
-		for (j = 0; j < model->_faces[i]._numVertices; j++) {
-			pVertices = model->_vertices + 3 * model->_faces[i]._vertices[j];
-
-			v.set(*(pVertices), *(pVertices + 1), *(pVertices + 2));
-
-//			tempMatrix._rot.transform(&v);
-			v += tempMatrix._pos;
-
-			glVertex3f(v.x(), v.y(), v.z());
-		}
-	}
-
-	glEnd();
-	glEnable(GL_DEPTH_TEST);
-	glPopMatrix();
-	glEnable(GL_TEXTURE_2D);
-}
-
 void Driver::drawModelFace(const Model::Face *face, float *vertices, float *vertNormals, float *textureVerts) {
 	glNormal3fv(face->_normal._coords);
 	glBegin(GL_POLYGON);
@@ -217,36 +141,6 @@
 		node->_sibling->draw();
 }
 
-void Driver::updateHierachyNode1(const Model::HierNode *node) {
-	glMatrixMode(GL_MODELVIEW);
-	glPushMatrix();
-
-	glTranslatef(node->_animPos.x() / node->_totalWeight, node->_animPos.y() / node->_totalWeight, node->_animPos.z() / node->_totalWeight);
-	glRotatef(node->_animYaw / node->_totalWeight, 0, 0, 1);
-	glRotatef(node->_animPitch / node->_totalWeight, 1, 0, 0);
-	glRotatef(node->_animRoll / node->_totalWeight, 0, 1, 0);
-}
-
-void Driver::updateHierachyNode2(const Model::HierNode *node) {
-	if (node->_mesh != NULL) {
-		glPushMatrix();
-		glTranslatef(node->_pivot.x(), node->_pivot.y(), node->_pivot.z());
-		node->_mesh->_matrix = node->_pivotMatrix;
-		node->_mesh->update();
-
-		glMatrixMode(GL_MODELVIEW);
-		glPopMatrix();
-	}
-
-	if (node->_child != NULL ) {
-		node->_child->setMatrix(node->_matrix);
-		node->_child->update();
-		glMatrixMode(GL_MODELVIEW);
-	}
-
-	glPopMatrix();
-}
-
 void Driver::createBitmap(Bitmap *bitmap) {
 	if (bitmap->_format == 1) {
 		bitmap->_hasTransparency = false;

Index: driver_gl.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- driver_gl.h	10 Jan 2005 09:07:46 -0000	1.13
+++ driver_gl.h	11 Jan 2005 19:46:47 -0000	1.14
@@ -43,12 +43,7 @@
 	void set3DMode();
 
 	void drawHierachyNode(const Model::HierNode *node);
-	void drawModelFace(const Model::Face *face, float *vertices, float *vertNormals, float *textureVerts);
-	void drawModelNodeDebug(const Model::Mesh *model);
-	void drawModelPolygonPointsDebug(const Model::Mesh *model);
-
-	void updateHierachyNode1(const Model::HierNode *node);
-	void updateHierachyNode2(const Model::HierNode *node);
+ 	void drawModelFace(const Model::Face *face, float *vertices, float *vertNormals, float *textureVerts);
 
 	void createMaterial(Material *material, const char *data, const CMap *cmap);
 	void selectMaterial(const Material *material);

Index: model.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/model.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- model.cpp	10 Jan 2005 09:07:46 -0000	1.23
+++ model.cpp	11 Jan 2005 19:46:47 -0000	1.24
@@ -435,8 +435,6 @@
 }
 
 void Model::HierNode::update() {
-	g_driver->updateHierachyNode1(this);
-
 	_localMatrix._pos.set(_animPos.x() / _totalWeight, _animPos.y() / _totalWeight, _animPos.z() / _totalWeight);
 	_localMatrix._rot.buildFromPitchYawRoll(_animPitch / _totalWeight, _animYaw / _totalWeight, _animRoll / _totalWeight);
 
@@ -444,17 +442,21 @@
 
 	_pivotMatrix = _matrix;
 
-	_pivotMatrix.translate(_pivot.x(), _pivot.y(), _pivot.z() );
+	_pivotMatrix.translate(_pivot.x(), _pivot.y(), _pivot.z());
 
-	g_driver->updateHierachyNode2(this);
+	if (_mesh != NULL ) {
+		_mesh->_matrix = _pivotMatrix;
+	}
+
+	if (_child != NULL) {
+		_child->setMatrix(_matrix);
+		_child->update();
+	}
 }
 
 void Model::Mesh::draw() const {
 	for (int i = 0; i < _numFaces; i++)
 		_faces[i].draw(_vertices, _vertNormals, _textureVerts);
-
-//	g_driver->drawModelNodeDebug(this);
-//	g_driver->drawModelPolygonPointsDebug(this);
 }
 
 void Model::Face::draw(float *vertices, float *vertNormals, float *textureVerts) const {





More information about the Scummvm-git-logs mailing list