[quake3-commits] r1958 - trunk/code/renderer

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon May 2 16:30:14 EDT 2011


Author: thilo
Date: 2011-05-02 16:30:14 -0400 (Mon, 02 May 2011)
New Revision: 1958

Modified:
   trunk/code/renderer/iqm.h
   trunk/code/renderer/tr_animation.c
   trunk/code/renderer/tr_main.c
   trunk/code/renderer/tr_mesh.c
   trunk/code/renderer/tr_model.c
   trunk/code/renderer/tr_model_iqm.c
Log:
- Add licence headers to new files
- Add patch from Zack Middleton which fixes a few issues still


Modified: trunk/code/renderer/iqm.h
===================================================================
--- trunk/code/renderer/iqm.h	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/iqm.h	2011-05-02 20:30:14 UTC (rev 1958)
@@ -1,3 +1,23 @@
+/*
+===========================================================================
+This file is part of Quake III Arena source code.
+
+Quake III Arena source code is free software; you can redistribute it
+and/or modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the License,
+or (at your option) any later version.
+
+Quake III Arena source code is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Quake III Arena source code; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+===========================================================================
+*/
+
 #ifndef __IQM_H__
 #define __IQM_H__
 

Modified: trunk/code/renderer/tr_animation.c
===================================================================
--- trunk/code/renderer/tr_animation.c	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/tr_animation.c	2011-05-02 20:30:14 UTC (rev 1958)
@@ -326,7 +326,7 @@
 	int				cull;
 	qboolean	personalModel;
 
-	header = (mdrHeader_t *) tr.currentModel->md4;
+	header = (mdrHeader_t *) tr.currentModel->modelData;
 	
 	personalModel = (ent->e.renderfx & RF_THIRD_PERSON) && !tr.viewParms.isPortal;
 	

Modified: trunk/code/renderer/tr_main.c
===================================================================
--- trunk/code/renderer/tr_main.c	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/tr_main.c	2011-05-02 20:30:14 UTC (rev 1958)
@@ -1260,8 +1260,8 @@
 					break;
 #endif
 				case MOD_IQM:
-                                        R_AddIQMSurfaces( ent );
-                                        break;
+					R_AddIQMSurfaces( ent );
+					break;
 				case MOD_BRUSH:
 					R_AddBrushModelSurfaces( ent );
 					break;

Modified: trunk/code/renderer/tr_mesh.c
===================================================================
--- trunk/code/renderer/tr_mesh.c	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/tr_mesh.c	2011-05-02 20:30:14 UTC (rev 1958)
@@ -185,12 +185,10 @@
 		// and use that as a criteria for selecting LOD
 
 #ifdef RAVENMD4
-		// This is an MDR model.
-		
-		if(tr.currentModel->md4)
+		if(tr.currentModel->type == MOD_MDR)
 		{
 			int frameSize;
-			mdr = (mdrHeader_t *) tr.currentModel->md4;
+			mdr = (mdrHeader_t *) tr.currentModel->modelData;
 			frameSize = (size_t) (&((mdrFrame_t *)0)->bones[mdr->numBones]);
 			
 			mdrframe = (mdrFrame_t *) ((byte *) mdr + mdr->ofsFrames + frameSize * ent->e.frame);

Modified: trunk/code/renderer/tr_model.c
===================================================================
--- trunk/code/renderer/tr_model.c	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/tr_model.c	2011-05-02 20:30:14 UTC (rev 1958)
@@ -81,7 +81,7 @@
 			if (ident == MD3_IDENT)
 				loaded = R_LoadMD3(mod, lod, buf.u, name);
 			else
-				ri.Printf(PRINT_WARNING,"RE_RegisterMD3: unknown fileid for %s\n", name);
+				ri.Printf(PRINT_WARNING,"R_RegisterMD3: unknown fileid for %s\n", name);
 		}
 		
 		ri.FS_FreeFile(buf.v);
@@ -109,7 +109,7 @@
 	}
 
 #ifdef _DEBUG
-	ri.Printf(PRINT_WARNING,"RE_RegisterMD3: couldn't load %s\n", name);
+	ri.Printf(PRINT_WARNING,"R_RegisterMD3: couldn't load %s\n", name);
 #endif
 
 	mod->type = MOD_BAD;
@@ -147,7 +147,7 @@
 	
 	if(!loaded)
 	{
-		ri.Printf(PRINT_WARNING,"RE_RegisterMDR: couldn't load mdr file %s\n", name);
+		ri.Printf(PRINT_WARNING,"R_RegisterMDR: couldn't load mdr file %s\n", name);
 		mod->type = MOD_BAD;
 		return 0;
 	}
@@ -183,7 +183,7 @@
 	
 	if(!loaded)
 	{
-		ri.Printf(PRINT_WARNING,"RE_RegisterIQM: couldn't load mdr file %s\n", name);
+		ri.Printf(PRINT_WARNING,"R_RegisterIQM: couldn't load iqm file %s\n", name);
 		mod->type = MOD_BAD;
 		return 0;
 	}
@@ -202,12 +202,12 @@
 // when there are multiple models of different formats available
 static modelExtToLoaderMap_t modelLoaders[ ] =
 {
+	{ "iqm", R_RegisterIQM },
 #ifdef RAVENMD4
 	{ "mdr", R_RegisterMDR },
 #endif
 	{ "md4", R_RegisterMD3 },
-	{ "md3", R_RegisterMD3 },
-	{ "iqm", R_RegisterIQM }
+	{ "md3", R_RegisterMD3 }
 };
 
 static int numModelLoaders = ARRAY_LEN(modelLoaders);
@@ -546,7 +546,7 @@
 {
 	int					i, j, k, l;
 	mdrHeader_t			*pinmodel, *mdr;
-        mdrFrame_t			*frame;
+	mdrFrame_t			*frame;
 	mdrLOD_t			*lod, *curlod;
 	mdrSurface_t			*surf, *cursurf;
 	mdrTriangle_t			*tri, *curtri;
@@ -598,7 +598,7 @@
 	}
 
 	mod->dataSize += size;
-	mod->md4 = mdr = ri.Hunk_Alloc( size, h_low );
+	mod->modelData = mdr = ri.Hunk_Alloc( size, h_low );
 
 	// Copy all the values over from the file and fix endian issues in the process, if necessary.
 	
@@ -1207,10 +1207,10 @@
 		}
 		else
 #endif
-                if( model->type == MOD_IQM ) {
-                        return R_IQMLerpTag( tag, model->modelData,
-                                             startFrame, endFrame,
-                                             frac, tagName );
+		if( model->type == MOD_IQM ) {
+			return R_IQMLerpTag( tag, model->modelData,
+					startFrame, endFrame,
+					frac, tagName );
 		} else {
 
 			AxisClear( tag->axis );

Modified: trunk/code/renderer/tr_model_iqm.c
===================================================================
--- trunk/code/renderer/tr_model_iqm.c	2011-05-02 16:03:35 UTC (rev 1957)
+++ trunk/code/renderer/tr_model_iqm.c	2011-05-02 20:30:14 UTC (rev 1958)
@@ -1,5 +1,26 @@
-/* copyright */
+/*
+===========================================================================
+Copyright (C) 2011 Thilo Schulz <thilo at tjps.eu>
+Copyright (C) 2011 Matthias Bentrup <matthias.bentrup at googlemail.com>
 
+This file is part of Quake III Arena source code.
+
+Quake III Arena source code is free software; you can redistribute it
+and/or modify it under the terms of the GNU General Public License as
+published by the Free Software Foundation; either version 2 of the License,
+or (at your option) any later version.
+
+Quake III Arena source code is distributed in the hope that it will be
+useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Quake III Arena source code; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+===========================================================================
+*/
+
 #include "tr_local.h"
 
 #define	LL(x) x=LittleLong(x)
@@ -50,8 +71,9 @@
 /*
 =================
 R_LoadIQM
+
+Load an IQM model and compute the joint matrices for every frame.
 =================
-Load an IQM model and compute the joint matrices for every frame.
 */
 qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_name ) {
 	iqmHeader_t		*header;
@@ -628,8 +650,9 @@
 /*
 =================
 R_AddIQMSurfaces
+
+Add all surfaces of this model
 =================
-Add all surfaces of this model
 */
 void R_AddIQMSurfaces( trRefEntity_t *ent ) {
 	iqmData_t		*data;
@@ -689,8 +712,9 @@
 /*
 =================
 RB_AddIQMSurfaces
+
+Compute vertices for this model surface
 =================
-Compute vertices for this model surface
 */
 void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
 	srfIQModel_t	*surf = (srfIQModel_t *)surface;



More information about the quake3-commits mailing list