[Scummvm-cvs-logs] CVS: residual driver_gl.cpp,1.21,1.22 screen.cpp,1.17,1.18

Pawel Kolodziejski aquadran at users.sourceforge.net
Wed Jan 5 13:27:14 CET 2005


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

Modified Files:
	driver_gl.cpp screen.cpp 
Log Message:
get debug code work again

Index: driver_gl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_gl.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- driver_gl.cpp	1 Jan 2005 12:27:55 -0000	1.21
+++ driver_gl.cpp	5 Jan 2005 21:20:01 -0000	1.22
@@ -107,6 +107,7 @@
 	GLdouble modelView[500];
 	GLdouble projection[500];
 	GLint viewPort[500];
+	int i, j;
 
 	glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
 	glGetDoublev(GL_PROJECTION_MATRIX, projection);
@@ -114,14 +115,10 @@
 
 	// Yaz: debug
 	// this draw the model node in red
-	//glMatrixMode(GL_PROJECTION);
-	/*glPushMatrix();
+/*
+	glPushMatrix();
 	glLoadIdentity();
 
-	GLdouble modelView[500];
-	GLdouble projection[500];
-	GLint viewPort[500];
-
 	glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
 	glGetDoublev(GL_PROJECTION_MATRIX, projection);
 	glGetIntegerv(GL_VIEWPORT, viewPort);
@@ -131,40 +128,34 @@
 	glColor4f(1.f, 0.f, 0.f, 1.f);
 	glDisable(GL_TEXTURE_2D );
 	glBegin(GL_POINTS);
-	glVertex3f(_matrix._pos.x(), _matrix._pos.y(), _matrix._pos.z());
+	glVertex3f(model->_matrix._pos.x(), model->_matrix._pos.y(), model->_matrix._pos.z());
 	glEnd();
 	glEnable(GL_DEPTH_TEST);
 	glPopMatrix();
-	glEnable(GL_TEXTURE_2D);*/
-
+	glEnable(GL_TEXTURE_2D);
+*/
 	// Yaz: debug
 	// this draw the poly points
-
-	/*glPushMatrix();
+/*
+	glPushMatrix();
 	glLoadIdentity();
 	glPointSize(3.f);
 	glColor4f(0.f, 1.f, 0.f, 1.f);
 	glDisable(GL_TEXTURE_2D);
-	{
-		GLdouble modelView[500];
-		GLdouble projection[500];
-		GLint viewPort[500];
 
-		glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
-		glGetDoublev(GL_PROJECTION_MATRIX, projection);
-		glGetIntegerv(GL_VIEWPORT, viewPort);
-	}
+	glGetDoublev(GL_MODELVIEW_MATRIX, modelView);
+	glGetDoublev(GL_PROJECTION_MATRIX, projection);
+	glGetIntegerv(GL_VIEWPORT, viewPort);
 
-	glBegin( GL_POINTS );
+	glBegin(GL_POINTS);
 
-	for (int i = 0; i < _numFaces; i++) {
+	for (i = 0; i < model->_numFaces; i++) {
 		Vector3d v;
-		Matrix4 tempMatrix = _matrix;
+		Matrix4 tempMatrix = model->_matrix;
 		float* pVertices;
-		int j;
 
-		for( j =0; j< faces_[i].numVertices_; j++ ) {
-			pVertices = vertices_ + 3 * faces_[i].vertices_[j];
+		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));
 
@@ -178,7 +169,8 @@
 	glEnd();
 	glEnable(GL_DEPTH_TEST);
 	glPopMatrix();
-	glEnable(GL_TEXTURE_2D ); */
+	glEnable(GL_TEXTURE_2D );
+*/
 
 	// Ender: HACK HACK HACK
 	// Mannys head isn't computed correctly, so bail out to prevent memory corruption.
@@ -196,11 +188,10 @@
 	GLdouble left = 1000;
 	GLdouble bottom = -1000;
 
-	for (int i = 0; i < model->_numFaces; i++) {
+	for (i = 0; i < model->_numFaces; i++) {
 		Vector3d v;
 		Matrix4 tempMatrix = model->_matrix;
 		float* pVertices;
-		int j;
 		float bestDepth = 0;
 
 		for (j = 0; j < model->_faces[i]._numVertices; j++) {
@@ -241,7 +232,8 @@
 		if (SCREENBLOCKS_GLOBAL)
 			screenBlocksAddRectangle((int)top, (int)right, (int)left, (int)bottom, (int)bestDepth);
 	}
-	/*
+
+/*
 	glDisable(GL_DEPTH_TEST);
 	glPointSize(3.f);
 	glColor4f(1.f, 1.f, 0.f, 1.f);
@@ -281,7 +273,8 @@
 	glEnable(GL_DEPTH_TEST);
 	glEnable(GL_TEXTURE_2D); 
 */
- 	glPopMatrix();
+
+	glPopMatrix();
 }
 
 void Driver::updateMesh(const Model::Mesh *mesh) {

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/screen.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- screen.cpp	1 Jan 2005 12:27:56 -0000	1.17
+++ screen.cpp	5 Jan 2005 21:20:02 -0000	1.18
@@ -127,7 +127,7 @@
 
 	for (int i = firstLeft; i < firstLeft + width; i++) {
 		for (int j = firstTop; j < firstTop + height; j++) {
-			if(screenBlockData[i][j].depth < depth)
+			if (screenBlockData[i][j].depth < depth)
 				screenBlockData[i][j].isDirty = true;
 		}
 	}
@@ -188,7 +188,7 @@
 				}
 				for (int y = 0; y < 16; y++) {
 					glRasterPos2i(start * 16, j * 16 + y + 1);
-					glDrawPixels(16 * width, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, dataTemp + ((j * 16 + y) * 640)+(start * 16));
+					glDrawPixels(16 * width, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, dataTemp + ((j * 16 + y) * 640) + (start * 16));
 				}
 			}
 		}





More information about the Scummvm-git-logs mailing list