From ecd50f01c209d4507aee826436d09a1ccd894a4c Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 18 Mar 2013 19:02:29 +0000 Subject: [PATCH] Remove RAVENMD4 #define --- build-test.sh | 4 +--- code/qcommon/qfiles.h | 7 ------- code/renderergl1/tr_animation.c | 3 --- code/renderergl1/tr_local.h | 8 -------- code/renderergl1/tr_main.c | 2 -- code/renderergl1/tr_mesh.c | 4 ---- code/renderergl1/tr_model.c | 19 +------------------ code/renderergl1/tr_surface.c | 2 -- code/renderergl2/tr_animation.c | 2 -- code/renderergl2/tr_local.h | 8 -------- code/renderergl2/tr_main.c | 4 ---- code/renderergl2/tr_mesh.c | 4 ---- code/renderergl2/tr_model.c | 19 +------------------ code/renderergl2/tr_surface.c | 2 -- 14 files changed, 3 insertions(+), 85 deletions(-) diff --git a/build-test.sh b/build-test.sh index 98848d28..d3b7f656 100755 --- a/build-test.sh +++ b/build-test.sh @@ -16,9 +16,7 @@ fi # Test additional options if [ $haveExternalLibs -eq 1 ]; then - ($MAKE clean release USE_CODEC_VORBIS=1 USE_FREETYPE=1 CFLAGS=-DRAVENMD4) || failed=1; -else - ($MAKE clean release CFLAGS=-DRAVENMD4) || failed=1; + ($MAKE clean release USE_CODEC_VORBIS=1 USE_FREETYPE=1) || failed=1; fi if [ $failed -eq 1 ]; then diff --git a/code/qcommon/qfiles.h b/code/qcommon/qfiles.h index 7f1ef965..78b06da1 100644 --- a/code/qcommon/qfiles.h +++ b/code/qcommon/qfiles.h @@ -281,12 +281,6 @@ typedef struct { * - Thilo Schulz (arny@ats.s.bawue.de) */ -// If you want to enable support for Raven's .mdr / md4 format, uncomment the next -// line. -//#define RAVENMD4 - -#ifdef RAVENMD4 - #define MDR_IDENT (('5'<<24)+('M'<<16)+('D'<<8)+'R') #define MDR_VERSION 2 #define MDR_MAX_BONES 128 @@ -389,7 +383,6 @@ typedef struct { int ofsEnd; // end of file } mdrHeader_t; -#endif /* ============================================================================== diff --git a/code/renderergl1/tr_animation.c b/code/renderergl1/tr_animation.c index c123e9ef..ad54dd63 100644 --- a/code/renderergl1/tr_animation.c +++ b/code/renderergl1/tr_animation.c @@ -168,8 +168,6 @@ void RB_SurfaceAnim( md4Surface_t *surface ) { } -#ifdef RAVENMD4 - // copied and adapted from tr_mesh.c /* @@ -655,4 +653,3 @@ void MC_UnCompress(float mat[3][4],const unsigned char * comp) val-=1<<(MC_BITS_VECT-1); mat[2][2]=((float)(val))*MC_SCALE_VECT; } -#endif diff --git a/code/renderergl1/tr_local.h b/code/renderergl1/tr_local.h index 1847afa9..de75c0b0 100644 --- a/code/renderergl1/tr_local.h +++ b/code/renderergl1/tr_local.h @@ -495,9 +495,7 @@ typedef enum { SF_POLY, SF_MD3, SF_MD4, -#ifdef RAVENMD4 SF_MDR, -#endif SF_IQM, SF_FLARE, SF_ENTITY, // beams, rails, lightning, etc that can be determined by entity @@ -747,9 +745,7 @@ typedef enum { MOD_BRUSH, MOD_MESH, MOD_MD4, -#ifdef RAVENMD4 MOD_MDR, -#endif MOD_IQM } modtype_t; @@ -1378,7 +1374,6 @@ void RE_AddLightToScene( const vec3_t org, float intensity, float r, float g, fl void RE_AddAdditiveLightToScene( const vec3_t org, float intensity, float r, float g, float b ); void RE_RenderScene( const refdef_t *fd ); -#ifdef RAVENMD4 /* ============================================================= @@ -1397,7 +1392,6 @@ UNCOMPRESSING BONES #define MC_SCALE_Z (1.0f/64) void MC_UnCompress(float mat[3][4],const unsigned char * comp); -#endif /* ============================================================= @@ -1410,10 +1404,8 @@ ANIMATED MODELS // void R_MakeAnimModel( model_t *model ); haven't seen this one really, so not needed I guess. void R_AddAnimSurfaces( trRefEntity_t *ent ); void RB_SurfaceAnim( md4Surface_t *surfType ); -#ifdef RAVENMD4 void R_MDRAddAnimSurfaces( trRefEntity_t *ent ); void RB_MDRSurfaceAnim( md4Surface_t *surface ); -#endif qboolean R_LoadIQM (model_t *mod, void *buffer, int filesize, const char *name ); void R_AddIQMSurfaces( trRefEntity_t *ent ); void RB_IQMSurfaceAnim( surfaceType_t *surface ); diff --git a/code/renderergl1/tr_main.c b/code/renderergl1/tr_main.c index 233bbd2e..9573fdd8 100644 --- a/code/renderergl1/tr_main.c +++ b/code/renderergl1/tr_main.c @@ -1249,11 +1249,9 @@ void R_AddEntitySurfaces (void) { case MOD_MD4: R_AddAnimSurfaces( ent ); break; -#ifdef RAVENMD4 case MOD_MDR: R_MDRAddAnimSurfaces( ent ); break; -#endif case MOD_IQM: R_AddIQMSurfaces( ent ); break; diff --git a/code/renderergl1/tr_mesh.c b/code/renderergl1/tr_mesh.c index 0883088f..d0be29bc 100644 --- a/code/renderergl1/tr_mesh.c +++ b/code/renderergl1/tr_mesh.c @@ -168,10 +168,8 @@ int R_ComputeLOD( trRefEntity_t *ent ) { float flod, lodscale; float projectedRadius; md3Frame_t *frame; -#ifdef RAVENMD4 mdrHeader_t *mdr; mdrFrame_t *mdrframe; -#endif int lod; if ( tr.currentModel->numLods < 2 ) @@ -184,7 +182,6 @@ int R_ComputeLOD( trRefEntity_t *ent ) { // multiple LODs exist, so compute projected bounding sphere // and use that as a criteria for selecting LOD -#ifdef RAVENMD4 if(tr.currentModel->type == MOD_MDR) { int frameSize; @@ -196,7 +193,6 @@ int R_ComputeLOD( trRefEntity_t *ent ) { radius = RadiusFromBounds(mdrframe->bounds[0], mdrframe->bounds[1]); } else -#endif { frame = ( md3Frame_t * ) ( ( ( unsigned char * ) tr.currentModel->md3[0] ) + tr.currentModel->md3[0]->ofsFrames ); diff --git a/code/renderergl1/tr_model.c b/code/renderergl1/tr_model.c index a6f79265..5565de83 100644 --- a/code/renderergl1/tr_model.c +++ b/code/renderergl1/tr_model.c @@ -27,9 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA static qboolean R_LoadMD3(model_t *mod, int lod, void *buffer, const char *name ); static qboolean R_LoadMD4(model_t *mod, void *buffer, const char *name ); -#ifdef RAVENMD4 static qboolean R_LoadMDR(model_t *mod, void *buffer, int filesize, const char *name ); -#endif /* ==================== @@ -116,7 +114,6 @@ qhandle_t R_RegisterMD3(const char *name, model_t *mod) return 0; } -#ifdef RAVENMD4 /* ==================== R_RegisterMDR @@ -154,7 +151,6 @@ qhandle_t R_RegisterMDR(const char *name, model_t *mod) return mod->index; } -#endif /* ==================== @@ -203,9 +199,7 @@ typedef struct static modelExtToLoaderMap_t modelLoaders[ ] = { { "iqm", R_RegisterIQM }, -#ifdef RAVENMD4 { "mdr", R_RegisterMDR }, -#endif { "md4", R_RegisterMD3 }, { "md3", R_RegisterMD3 } }; @@ -536,7 +530,6 @@ static qboolean R_LoadMD3 (model_t *mod, int lod, void *buffer, const char *mod_ } -#ifdef RAVENMD4 /* ================= @@ -875,7 +868,6 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char return qtrue; } -#endif /* ================= @@ -1136,7 +1128,6 @@ static md3Tag_t *R_GetTag( md3Header_t *mod, int frame, const char *tagName ) { return NULL; } -#ifdef RAVENMD4 void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, md3Tag_t * dest) { int i, j, k; @@ -1180,7 +1171,6 @@ void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, md3Tag_t VectorClear( dest->origin ); strcpy(dest->name,""); } -#endif /* ================ @@ -1190,9 +1180,7 @@ R_LerpTag int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFrame, float frac, const char *tagName ) { md3Tag_t *start, *end; -#ifdef RAVENMD4 md3Tag_t start_space, end_space; -#endif int i; float frontLerp, backLerp; model_t *model; @@ -1200,7 +1188,6 @@ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFram model = R_GetModelByHandle( handle ); if ( !model->md3[0] ) { -#ifdef RAVENMD4 if(model->type == MOD_MDR) { start = &start_space; @@ -1208,9 +1195,7 @@ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFram R_GetAnimTag((mdrHeader_t *) model->modelData, startFrame, tagName, start); R_GetAnimTag((mdrHeader_t *) model->modelData, endFrame, tagName, end); } - else -#endif - if( model->type == MOD_IQM ) { + else if( model->type == MOD_IQM ) { return R_IQMLerpTag( tag, model->modelData, startFrame, endFrame, frac, tagName ); @@ -1286,7 +1271,6 @@ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { VectorCopy( frame->bounds[1], maxs ); return; -#ifdef RAVENMD4 } else if (model->type == MOD_MDR) { mdrHeader_t *header; mdrFrame_t *frame; @@ -1298,7 +1282,6 @@ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { VectorCopy( frame->bounds[1], maxs ); return; -#endif } else if(model->type == MOD_IQM) { iqmData_t *iqmData; diff --git a/code/renderergl1/tr_surface.c b/code/renderergl1/tr_surface.c index 99b0d805..4108f443 100644 --- a/code/renderergl1/tr_surface.c +++ b/code/renderergl1/tr_surface.c @@ -1234,9 +1234,7 @@ void (*rb_surfaceTable[SF_NUM_SURFACE_TYPES])( void *) = { (void(*)(void*))RB_SurfacePolychain, // SF_POLY, (void(*)(void*))RB_SurfaceMesh, // SF_MD3, (void(*)(void*))RB_SurfaceAnim, // SF_MD4, -#ifdef RAVENMD4 (void(*)(void*))RB_MDRSurfaceAnim, // SF_MDR, -#endif (void(*)(void*))RB_IQMSurfaceAnim, // SF_IQM, (void(*)(void*))RB_SurfaceFlare, // SF_FLARE, (void(*)(void*))RB_SurfaceEntity, // SF_ENTITY diff --git a/code/renderergl2/tr_animation.c b/code/renderergl2/tr_animation.c index 794111c6..c4c9debb 100644 --- a/code/renderergl2/tr_animation.c +++ b/code/renderergl2/tr_animation.c @@ -168,7 +168,6 @@ void RB_SurfaceAnim( md4Surface_t *surface ) { } -#ifdef RAVENMD4 // copied and adapted from tr_mesh.c @@ -655,4 +654,3 @@ void MC_UnCompress(float mat[3][4],const unsigned char * comp) val-=1<<(MC_BITS_VECT-1); mat[2][2]=((float)(val))*MC_SCALE_VECT; } -#endif diff --git a/code/renderergl2/tr_local.h b/code/renderergl2/tr_local.h index 6fd3ec89..fbf60a4b 100644 --- a/code/renderergl2/tr_local.h +++ b/code/renderergl2/tr_local.h @@ -1000,9 +1000,7 @@ typedef enum { SF_POLY, SF_MDV, SF_MD4, -#ifdef RAVENMD4 SF_MDR, -#endif SF_IQM, SF_FLARE, SF_ENTITY, // beams, rails, lightning, etc that can be determined by entity @@ -1505,9 +1503,7 @@ typedef enum { MOD_BRUSH, MOD_MESH, MOD_MD4, -#ifdef RAVENMD4 MOD_MDR, -#endif MOD_IQM } modtype_t; @@ -2467,7 +2463,6 @@ void RE_AddLightToScene( const vec3_t org, float intensity, float r, float g, fl void RE_AddAdditiveLightToScene( const vec3_t org, float intensity, float r, float g, float b ); void RE_RenderScene( const refdef_t *fd ); -#ifdef RAVENMD4 /* ============================================================= @@ -2486,7 +2481,6 @@ UNCOMPRESSING BONES #define MC_SCALE_Z (1.0f/64) void MC_UnCompress(float mat[3][4],const unsigned char * comp); -#endif /* ============================================================= @@ -2499,10 +2493,8 @@ ANIMATED MODELS // void R_MakeAnimModel( model_t *model ); haven't seen this one really, so not needed I guess. void R_AddAnimSurfaces( trRefEntity_t *ent ); void RB_SurfaceAnim( md4Surface_t *surfType ); -#ifdef RAVENMD4 void R_MDRAddAnimSurfaces( trRefEntity_t *ent ); void RB_MDRSurfaceAnim( md4Surface_t *surface ); -#endif qboolean R_LoadIQM (model_t *mod, void *buffer, int filesize, const char *name ); void R_AddIQMSurfaces( trRefEntity_t *ent ); void RB_IQMSurfaceAnim( surfaceType_t *surface ); diff --git a/code/renderergl2/tr_main.c b/code/renderergl2/tr_main.c index c1047437..17a7f1ba 100644 --- a/code/renderergl2/tr_main.c +++ b/code/renderergl2/tr_main.c @@ -2001,11 +2001,9 @@ static void R_AddEntitySurface (int entityNum) case MOD_MD4: R_AddAnimSurfaces( ent ); break; -#ifdef RAVENMD4 case MOD_MDR: R_MDRAddAnimSurfaces( ent ); break; -#endif case MOD_IQM: R_AddIQMSurfaces( ent ); break; @@ -2295,7 +2293,6 @@ void R_RenderPshadowMaps(const refdef_t *fd) radius = r_pshadowDist->value / 2.0f; } break; -#ifdef RAVENMD4 case MOD_MDR: { // FIXME: never actually tested this @@ -2306,7 +2303,6 @@ void R_RenderPshadowMaps(const refdef_t *fd) radius = frame->radius; } break; -#endif case MOD_IQM: { // FIXME: never actually tested this diff --git a/code/renderergl2/tr_mesh.c b/code/renderergl2/tr_mesh.c index 342854bf..28c2e5fb 100644 --- a/code/renderergl2/tr_mesh.c +++ b/code/renderergl2/tr_mesh.c @@ -168,10 +168,8 @@ int R_ComputeLOD( trRefEntity_t *ent ) { float flod, lodscale; float projectedRadius; mdvFrame_t *frame; -#ifdef RAVENMD4 mdrHeader_t *mdr; mdrFrame_t *mdrframe; -#endif int lod; if ( tr.currentModel->numLods < 2 ) @@ -184,7 +182,6 @@ int R_ComputeLOD( trRefEntity_t *ent ) { // multiple LODs exist, so compute projected bounding sphere // and use that as a criteria for selecting LOD -#ifdef RAVENMD4 if(tr.currentModel->type == MOD_MDR) { int frameSize; @@ -196,7 +193,6 @@ int R_ComputeLOD( trRefEntity_t *ent ) { radius = RadiusFromBounds(mdrframe->bounds[0], mdrframe->bounds[1]); } else -#endif { //frame = ( md3Frame_t * ) ( ( ( unsigned char * ) tr.currentModel->md3[0] ) + tr.currentModel->md3[0]->ofsFrames ); frame = tr.currentModel->mdv[0]->frames; diff --git a/code/renderergl2/tr_model.c b/code/renderergl2/tr_model.c index 69b5095e..37c12d4e 100644 --- a/code/renderergl2/tr_model.c +++ b/code/renderergl2/tr_model.c @@ -27,9 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA static qboolean R_LoadMD3(model_t *mod, int lod, void *buffer, int bufferSize, const char *modName); static qboolean R_LoadMD4(model_t *mod, void *buffer, const char *name ); -#ifdef RAVENMD4 static qboolean R_LoadMDR(model_t *mod, void *buffer, int filesize, const char *name ); -#endif /* ==================== @@ -117,7 +115,6 @@ qhandle_t R_RegisterMD3(const char *name, model_t *mod) return 0; } -#ifdef RAVENMD4 /* ==================== R_RegisterMDR @@ -155,7 +152,6 @@ qhandle_t R_RegisterMDR(const char *name, model_t *mod) return mod->index; } -#endif /* ==================== @@ -204,9 +200,7 @@ typedef struct static modelExtToLoaderMap_t modelLoaders[ ] = { { "iqm", R_RegisterIQM }, -#ifdef RAVENMD4 { "mdr", R_RegisterMDR }, -#endif { "md4", R_RegisterMD3 }, { "md3", R_RegisterMD3 } }; @@ -796,7 +790,6 @@ static qboolean R_LoadMD3(model_t * mod, int lod, void *buffer, int bufferSize, } -#ifdef RAVENMD4 /* ================= @@ -1135,7 +1128,6 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char return qtrue; } -#endif /* ================= @@ -1402,7 +1394,6 @@ static mdvTag_t *R_GetTag( mdvModel_t *mod, int frame, const char *_tagName ) { return NULL; } -#ifdef RAVENMD4 void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, mdvTag_t * dest) { int i, j, k; @@ -1443,7 +1434,6 @@ void R_GetAnimTag( mdrHeader_t *mod, int framenum, const char *tagName, mdvTag_t AxisClear( dest->axis ); VectorClear( dest->origin ); } -#endif /* ================ @@ -1453,9 +1443,7 @@ R_LerpTag int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFrame, float frac, const char *tagName ) { mdvTag_t *start, *end; -#ifdef RAVENMD4 mdvTag_t start_space, end_space; -#endif int i; float frontLerp, backLerp; model_t *model; @@ -1463,7 +1451,6 @@ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFram model = R_GetModelByHandle( handle ); if ( !model->mdv[0] ) { -#ifdef RAVENMD4 if(model->type == MOD_MDR) { start = &start_space; @@ -1471,9 +1458,7 @@ int R_LerpTag( orientation_t *tag, qhandle_t handle, int startFrame, int endFram R_GetAnimTag((mdrHeader_t *) model->modelData, startFrame, tagName, start); R_GetAnimTag((mdrHeader_t *) model->modelData, endFrame, tagName, end); } - else -#endif - if( model->type == MOD_IQM ) { + else if( model->type == MOD_IQM ) { return R_IQMLerpTag( tag, model->modelData, startFrame, endFrame, frac, tagName ); @@ -1549,7 +1534,6 @@ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { VectorCopy( frame->bounds[1], maxs ); return; -#ifdef RAVENMD4 } else if (model->type == MOD_MDR) { mdrHeader_t *header; mdrFrame_t *frame; @@ -1561,7 +1545,6 @@ void R_ModelBounds( qhandle_t handle, vec3_t mins, vec3_t maxs ) { VectorCopy( frame->bounds[1], maxs ); return; -#endif } else if(model->type == MOD_IQM) { iqmData_t *iqmData; diff --git a/code/renderergl2/tr_surface.c b/code/renderergl2/tr_surface.c index e7921c09..7162deab 100644 --- a/code/renderergl2/tr_surface.c +++ b/code/renderergl2/tr_surface.c @@ -1647,9 +1647,7 @@ void (*rb_surfaceTable[SF_NUM_SURFACE_TYPES])( void *) = { (void(*)(void*))RB_SurfacePolychain, // SF_POLY, (void(*)(void*))RB_SurfaceMesh, // SF_MDV, (void(*)(void*))RB_SurfaceAnim, // SF_MD4, -#ifdef RAVENMD4 (void(*)(void*))RB_MDRSurfaceAnim, // SF_MDR, -#endif (void(*)(void*))RB_IQMSurfaceAnim, // SF_IQM, (void(*)(void*))RB_SurfaceFlare, // SF_FLARE, (void(*)(void*))RB_SurfaceEntity, // SF_ENTITY