summaryrefslogtreecommitdiff
path: root/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderer')
-rw-r--r--src/renderer/iqm.h20
-rw-r--r--src/renderer/tr_animation.c2
-rw-r--r--src/renderer/tr_main.c4
-rw-r--r--src/renderer/tr_mesh.c6
-rw-r--r--src/renderer/tr_model.c24
-rw-r--r--src/renderer/tr_model_iqm.c32
6 files changed, 65 insertions, 23 deletions
diff --git a/src/renderer/iqm.h b/src/renderer/iqm.h
index bbfc053f..f9ac3c83 100644
--- a/src/renderer/iqm.h
+++ b/src/renderer/iqm.h
@@ -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__
diff --git a/src/renderer/tr_animation.c b/src/renderer/tr_animation.c
index 513fc082..a9bcd507 100644
--- a/src/renderer/tr_animation.c
+++ b/src/renderer/tr_animation.c
@@ -327,7 +327,7 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
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;
diff --git a/src/renderer/tr_main.c b/src/renderer/tr_main.c
index ef096061..1a1bab8c 100644
--- a/src/renderer/tr_main.c
+++ b/src/renderer/tr_main.c
@@ -1261,8 +1261,8 @@ void R_AddEntitySurfaces (void) {
break;
#endif
case MOD_IQM:
- R_AddIQMSurfaces( ent );
- break;
+ R_AddIQMSurfaces( ent );
+ break;
case MOD_BRUSH:
R_AddBrushModelSurfaces( ent );
break;
diff --git a/src/renderer/tr_mesh.c b/src/renderer/tr_mesh.c
index 38c58ed2..ddcc62f7 100644
--- a/src/renderer/tr_mesh.c
+++ b/src/renderer/tr_mesh.c
@@ -186,12 +186,10 @@ int R_ComputeLOD( trRefEntity_t *ent ) {
// 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);
diff --git a/src/renderer/tr_model.c b/src/renderer/tr_model.c
index 2933e7e0..7f61cb08 100644
--- a/src/renderer/tr_model.c
+++ b/src/renderer/tr_model.c
@@ -82,7 +82,7 @@ qhandle_t R_RegisterMD3(const char *name, model_t *mod)
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);
@@ -110,7 +110,7 @@ qhandle_t R_RegisterMD3(const char *name, model_t *mod)
}
#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;
@@ -148,7 +148,7 @@ qhandle_t R_RegisterMDR(const char *name, model_t *mod)
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;
}
@@ -184,7 +184,7 @@ qhandle_t R_RegisterIQM(const char *name, model_t *mod)
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;
}
@@ -203,12 +203,12 @@ typedef struct
// 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);
@@ -547,7 +547,7 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
{
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;
@@ -599,7 +599,7 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
}
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.
@@ -1208,10 +1208,10 @@ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFram
}
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 );
diff --git a/src/renderer/tr_model_iqm.c b/src/renderer/tr_model_iqm.c
index 2a0b1aad..0a615f46 100644
--- a/src/renderer/tr_model_iqm.c
+++ b/src/renderer/tr_model_iqm.c
@@ -1,4 +1,25 @@
-/* copyright */
+/*
+===========================================================================
+Copyright (C) 2011 Thilo Schulz <thilo@tjps.eu>
+Copyright (C) 2011 Matthias Bentrup <matthias.bentrup@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"
@@ -50,8 +71,9 @@ static void InterpolateMatrix( float *a, float *b, float lerp, float *mat ) {
/*
=================
R_LoadIQM
-=================
+
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 @@ qboolean R_LoadIQM( model_t *mod, void *buffer, int filesize, const char *mod_na
/*
=================
R_AddIQMSurfaces
-=================
+
Add all surfaces of this model
+=================
*/
void R_AddIQMSurfaces( trRefEntity_t *ent ) {
iqmData_t *data;
@@ -689,8 +712,9 @@ static void ComputeJointMats( iqmData_t *data, int frame, int oldframe,
/*
=================
RB_AddIQMSurfaces
-=================
+
Compute vertices for this model surface
+=================
*/
void RB_IQMSurfaceAnim( surfaceType_t *surface ) {
srfIQModel_t *surf = (srfIQModel_t *)surface;