r705 - trunk

lordhavoc at icculus.org lordhavoc at icculus.org
Fri May 5 15:09:19 EDT 2006


Author: lordhavoc
Date: 2006-05-05 15:09:19 -0400 (Fri, 05 May 2006)
New Revision: 705

Modified:
   trunk/r_main.c
   trunk/resource.c
Log:
some warning prints done by painQuin


Modified: trunk/r_main.c
===================================================================
--- trunk/r_main.c	2006-05-05 19:08:10 UTC (rev 704)
+++ trunk/r_main.c	2006-05-05 19:09:19 UTC (rev 705)
@@ -1914,17 +1914,29 @@
 		return;
 	// TODO: verify the resource type is RESOURCETYPE_MODEL
 	model = Resource_GetData(R.entitymodelresource);
-	if (!model)
-		return; // TODO: warning
+	if (!model) {
+		Console_Printf("R_DrawMesh failed to find model\n");
+		return;
+	}
 	// TODO: verify the resource type is RESOURCETYPE_MATERIAL
 	material = Resource_GetData(materialresource);
-	if (!material)
-		return; // TODO: warning
-	if (meshindex >= model->num_meshes)
-		return; // TODO: warning
+	if (!material) {
+		Console_Printf("R_DrawMesh failed to find material\n");
+		return;
+	}
+	if (meshindex >= model->num_meshes) {
+		Console_Printf("R_DrawMesh meshindex out of bounds\n");
+		return;
+	}
 	mesh = model->data_meshes + meshindex;
-	if (mesh->num_vertices < 1 || mesh->num_triangles < 1)
-		return; // TODO: warning
+	if (mesh->num_vertices < 1) {
+		Console_Printf("R_DrawMesh num_vertices out of range\n");
+		return;
+	}
+	if (mesh->num_triangles < 1) {
+		Console_Printf("R_DrawMesh num_triangles out of range\n");
+		return;
+	}
 	R.speeds_data.numdrawmesh_vertices += mesh->num_vertices;
 	R.speeds_data.numdrawmesh_triangles += mesh->num_triangles;
 	switch (R.drawmode)

Modified: trunk/resource.c
===================================================================
--- trunk/resource.c	2006-05-05 19:08:10 UTC (rev 704)
+++ trunk/resource.c	2006-05-05 19:09:19 UTC (rev 705)
@@ -178,7 +178,8 @@
 	switch(r->type)
 	{
 	case RESOURCETYPE_INVALID:
-		// TODO: error?
+		Console_Printf("Resource Load: Unknown Resource Type: %i\n",
+				r->type);
 		break;
 	case RESOURCETYPE_MODEL:
 		Model_Load(r);
@@ -220,7 +221,8 @@
 		switch(r->type)
 		{
 		case RESOURCETYPE_INVALID:
-			// TODO: error?
+			Console_Printf("Resource Unload: Unknown Resource Type: %i\n",
+					r->type);
 			break;
 		case RESOURCETYPE_MODEL:
 			Model_Unload(r);




More information about the neither-commits mailing list