r702 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Apr 14 16:13:50 EDT 2006


Author: tma
Date: 2006-04-14 16:13:49 -0400 (Fri, 14 Apr 2006)
New Revision: 702

Modified:
   trunk/code/renderer/tr_model.c
Log:
* Fixes to MDR implementation from Thilo Schulz


Modified: trunk/code/renderer/tr_model.c
===================================================================
--- trunk/code/renderer/tr_model.c	2006-04-14 20:11:42 UTC (rev 701)
+++ trunk/code/renderer/tr_model.c	2006-04-14 20:13:49 UTC (rev 702)
@@ -660,19 +660,20 @@
 				curtri++;
 			}
 			
-			// tri and curtri now point to the end of their surfaces.
+			// tri now points to the end of the surface.
 			surf->ofsEnd = (byte *) tri - (byte *) surf;
-
-			// find the next surface
 			surf = (mdrSurface_t *) tri;
-			cursurf = (mdrSurface_t *) curtri;
+
+			// find the next surface.
+			cursurf = (mdrSurface_t *) ((byte *) cursurf + LittleLong(cursurf->ofsEnd));
 		}
 
 		// surf points to the next lod now.
 		lod->ofsEnd = (int)((byte *) surf - (byte *) lod);
-				
 		lod = (mdrLOD_t *) surf;
-		curlod = (mdrLOD_t *) cursurf;
+
+		// find the next LOD.
+		curlod = (mdrLOD_t *)((byte *) curlod + LittleLong(curlod->ofsEnd));
 	}
 	
 	// lod points to the first tag now, so update the offset too.
@@ -958,7 +959,7 @@
 #ifdef RAVENMD4
 void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, md3Tag_t * dest) 
 {
-	int				i;
+	int				i, j, k;
 	int				frameSize;
 	mdrFrame_t		*frame;
 	mdrTag_t		*tag;
@@ -980,20 +981,13 @@
 			//
 			frameSize = (long)( &((mdrFrame_t *)0)->bones[ mod->numBones ] );
 			frame = (mdrFrame_t *)((byte *)mod + mod->ofsFrames + framenum * frameSize );
-	#if 1
-			VectorCopy(&frame->bones[tag->boneIndex].matrix[0][0], dest->axis[0] );
-			VectorCopy(&frame->bones[tag->boneIndex].matrix[1][0], dest->axis[1] );
-			VectorCopy(&frame->bones[tag->boneIndex].matrix[2][0], dest->axis[2] );
-	#else
+
+			for (j = 0; j < 3; j++)
 			{
-				int j,k;
-				for (j=0;j<3;j++)
-				{
-					for (k=0;k<3;k++)
-						dest->axis[j][k]=frame->bones[tag->boneIndex].matrix[k][j];
-				}
+				for (k = 0; k < 3; k++)
+					dest->axis[j][k]=frame->bones[tag->boneIndex].matrix[k][j];
 			}
-	#endif
+
 			dest->origin[0]=frame->bones[tag->boneIndex].matrix[0][3];
 			dest->origin[1]=frame->bones[tag->boneIndex].matrix[1][3];
 			dest->origin[2]=frame->bones[tag->boneIndex].matrix[2][3];				




More information about the quake3-commits mailing list