Skip to content

Commit

Permalink
Drop support for q1 and q2 BSP formats
Browse files Browse the repository at this point in the history
  • Loading branch information
viciious committed Jun 18, 2017
1 parent af3d553 commit 5d9a38a
Show file tree
Hide file tree
Showing 28 changed files with 8 additions and 4,568 deletions.
8 changes: 0 additions & 8 deletions source/cgame/cg_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,6 @@ static int CG_GS_PointContents( vec3_t point, int timeDelta ) {
return CG_PointContents( point );
}

/*
* CG_GS_RoundUpToHullSize
*/
static void CG_GS_RoundUpToHullSize( vec3_t mins, vec3_t maxs ) {
trap_CM_RoundUpToHullSize( mins, maxs, NULL );
}

/*
* CG_GS_GetEntityState
*/
Expand Down Expand Up @@ -364,7 +357,6 @@ static void CG_InitGameShared( void ) {
module_Trace = CG_GS_Trace;
module_GetEntityState = CG_GS_GetEntityState;
module_PointContents = CG_GS_PointContents;
module_RoundUpToHullSize = CG_GS_RoundUpToHullSize;
module_PMoveTouchTriggers = CG_Predict_TouchTriggers;
module_GetConfigString = CG_GS_GetConfigString;

Expand Down
1 change: 0 additions & 1 deletion source/cgame/cg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ typedef struct {
struct cmodel_s *( *CM_OctagonModelForBBox )( vec3_t mins, vec3_t maxs );
void ( *CM_TransformedBoxTrace )( trace_t *tr, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel, int brushmask, vec3_t origin, vec3_t angles );
int ( *CM_TransformedPointContents )( vec3_t p, struct cmodel_s *cmodel, vec3_t origin, vec3_t angles );
void ( *CM_RoundUpToHullSize )( vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel );
void ( *CM_InlineModelBounds )( struct cmodel_s *cmodel, vec3_t mins, vec3_t maxs );
bool ( *CM_InPVS )( const vec3_t p1, const vec3_t p2 );

Expand Down
4 changes: 0 additions & 4 deletions source/cgame/cg_syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,6 @@ static inline int trap_CM_TransformedPointContents( vec3_t p, struct cmodel_s *c
return CGAME_IMPORT.CM_TransformedPointContents( p, cmodel, origin, angles );
}

static inline void trap_CM_RoundUpToHullSize( vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel ) {
CGAME_IMPORT.CM_RoundUpToHullSize( mins, maxs, cmodel );
}

static inline void trap_CM_InlineModelBounds( struct cmodel_s *cmodel, vec3_t mins, vec3_t maxs ) {
CGAME_IMPORT.CM_InlineModelBounds( cmodel, mins, maxs );
}
Expand Down
5 changes: 0 additions & 5 deletions source/client/cl_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ static inline void CL_GameModule_CM_TransformedBoxTrace( trace_t *tr, vec3_t sta
CM_TransformedBoxTrace( cl.cms, tr, start, end, mins, maxs, cmodel, brushmask, origin, angles );
}

static inline void CL_GameModule_CM_RoundUpToHullSize( vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel ) {
CM_RoundUpToHullSize( cl.cms, mins, maxs, cmodel );
}

static inline struct cmodel_s *CL_GameModule_CM_InlineModel( int num ) {
return CM_InlineModel( cl.cms, num );
}
Expand Down Expand Up @@ -460,7 +456,6 @@ void CL_GameModule_Init( void ) {
import.CM_NumInlineModels = CL_GameModule_CM_NumInlineModels;
import.CM_InlineModel = CL_GameModule_CM_InlineModel;
import.CM_TransformedBoxTrace = CL_GameModule_CM_TransformedBoxTrace;
import.CM_RoundUpToHullSize = CL_GameModule_CM_RoundUpToHullSize;
import.CM_TransformedPointContents = CL_GameModule_CM_TransformedPointContents;
import.CM_ModelForBBox = CL_GameModule_CM_ModelForBBox;
import.CM_OctagonModelForBBox = CL_GameModule_CM_OctagonModelForBBox;
Expand Down
8 changes: 0 additions & 8 deletions source/game/g_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@ static void G_GS_Trace( trace_t *tr, vec3_t start, vec3_t mins, vec3_t maxs, vec
G_Trace4D( tr, start, mins, maxs, end, passent, contentmask, timeDelta );
}

/*
* G_GS_RoundUpToHullSize
*/
static void G_GS_RoundUpToHullSize( vec3_t mins, vec3_t maxs ) {
trap_CM_RoundUpToHullSize( mins, maxs, NULL );
}

/*
* G_InitGameShared
* give gameshared access to some utilities
Expand All @@ -204,7 +197,6 @@ static void G_InitGameShared( void ) {
module_Trace = G_GS_Trace;
module_GetEntityState = G_GetEntityStateForDeltaTime;
module_PointContents = G_PointContents4D;
module_RoundUpToHullSize = G_GS_RoundUpToHullSize;
module_PMoveTouchTriggers = G_PMoveTouchTriggers;
module_GetConfigString = trap_GetConfigString;
}
Expand Down
1 change: 0 additions & 1 deletion source/game/g_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ typedef struct {
struct cmodel_s *( *CM_InlineModel )( int num );
int ( *CM_TransformedPointContents )( vec3_t p, struct cmodel_s *cmodel, vec3_t origin, vec3_t angles );
void ( *CM_TransformedBoxTrace )( trace_t *tr, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel, int brushmask, vec3_t origin, vec3_t angles );
void ( *CM_RoundUpToHullSize )( vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel );
void ( *CM_InlineModelBounds )( struct cmodel_s *cmodel, vec3_t mins, vec3_t maxs );
struct cmodel_s *( *CM_ModelForBBox )( vec3_t mins, vec3_t maxs );
struct cmodel_s *( *CM_OctagonModelForBBox )( vec3_t mins, vec3_t maxs );
Expand Down
4 changes: 0 additions & 4 deletions source/game/g_syscalls.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ static inline void trap_CM_TransformedBoxTrace( trace_t *tr, vec3_t start, vec3_
GAME_IMPORT.CM_TransformedBoxTrace( tr, start, end, mins, maxs, cmodel, brushmask, origin, angles );
}

static inline void trap_CM_RoundUpToHullSize( vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel ) {
GAME_IMPORT.CM_RoundUpToHullSize( mins, maxs, cmodel );
}

static inline int trap_CM_NumInlineModels( void ) {
return GAME_IMPORT.CM_NumInlineModels();
}
Expand Down
8 changes: 0 additions & 8 deletions source/game/p_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,6 @@ void G_GhostClient( edict_t *ent ) {
void G_ClientRespawn( edict_t *self, bool ghost ) {
int i;
edict_t *spawnpoint;
vec3_t hull_mins, hull_maxs;
vec3_t spawn_origin, spawn_angles;
gclient_t *client;
int old_team;
Expand Down Expand Up @@ -568,13 +567,6 @@ void G_ClientRespawn( edict_t *self, bool ghost ) {
VectorClear( self->velocity );
VectorClear( self->avelocity );

VectorCopy( self->r.mins, hull_mins );
VectorCopy( self->r.maxs, hull_maxs );
trap_CM_RoundUpToHullSize( hull_mins, hull_maxs, NULL );
if( self->r.maxs[2] > hull_maxs[2] ) {
self->viewheight -= ( self->r.maxs[2] - hull_maxs[2] );
}

client->ps.POVnum = ENTNUM( self );

// set movement info
Expand Down
1 change: 0 additions & 1 deletion source/gameshared/gs_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ entity_state_t *( *module_GetEntityState )( int entNum, int deltaTime );
int ( *module_PointContents )( vec3_t point, int timeDelta );
void ( *module_PredictedEvent )( int entNum, int ev, int parm );
void ( *module_PMoveTouchTriggers )( pmove_t *pm, vec3_t previous_origin );
void ( *module_RoundUpToHullSize )( vec3_t mins, vec3_t maxs );
const char *( *module_GetConfigString )( int index );

// TEMP MOVE ME
Expand Down
8 changes: 0 additions & 8 deletions source/gameshared/gs_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,6 @@ static void PM_AdjustBBox( void ) {
* PM_AdjustViewheight
*/
void PM_AdjustViewheight( void ) {
float height;
vec3_t pm_maxs, mins, maxs;

if( pm->playerState->pmove.pm_type == PM_SPECTATOR ) {
Expand All @@ -1663,14 +1662,7 @@ void PM_AdjustViewheight( void ) {
VectorCopy( pm->mins, mins );
VectorCopy( pm->maxs, maxs );
}

VectorCopy( maxs, pm_maxs );
module_RoundUpToHullSize( mins, maxs );

height = pm_maxs[2] - maxs[2];
if( height > 0 ) {
pm->playerState->viewheight -= height;
}
}

static void PM_UpdateDeltaAngles( void ) {
Expand Down
1 change: 0 additions & 1 deletion source/gameshared/gs_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extern entity_state_t *( *module_GetEntityState )( int entNum, int deltaTime );
extern int ( *module_PointContents )( vec3_t point, int timeDelta );
extern void ( *module_PredictedEvent )( int entNum, int ev, int parm );
extern void ( *module_PMoveTouchTriggers )( pmove_t *pm, vec3_t previous_origin );
extern void ( *module_RoundUpToHullSize )( vec3_t mins, vec3_t maxs );
extern const char *( *module_GetConfigString )( int index );

//===============================================================
Expand Down
22 changes: 0 additions & 22 deletions source/qcommon/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,6 @@ BSP FORMATS
==============================================================
*/

static const int mod_IBSPQ1Versions[] = { Q1_BSPVERSION, 0 };

const bspFormatDesc_t q1BSPFormats[] =
{
{ "", mod_IBSPQ1Versions, 0, 0, 0, Q1_LUMP_ENTITIES },

// trailing NULL
{ NULL, NULL, 0, 0, 0, 0 }

};

static const int mod_IBSPQ2Versions[] = { Q2_BSPVERSION, 0 };

const bspFormatDesc_t q2BSPFormats[] =
{
{ IDBSPHEADER, mod_IBSPQ2Versions, 0, 0, 0, Q2_LUMP_ENTITIES },

// trailing NULL
{ NULL, NULL, 0, 0, 0, 0 }

};

static const int mod_IBSPQ3Versions[] = { Q3BSPVERSION, RTCWBSPVERSION, 0 };
static const int mod_RBSPQ3Versions[] = { RBSPVERSION, 0 };
static const int mod_FBSPQ3Versions[] = { QFBSPVERSION, 0 };
Expand Down
2 changes: 0 additions & 2 deletions source/qcommon/bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ typedef struct {
} modelFormatDescr_t;

extern const bspFormatDesc_t q3BSPFormats[];
extern const bspFormatDesc_t q2BSPFormats[];
extern const bspFormatDesc_t q1BSPFormats[];

const bspFormatDesc_t *Q_FindBSPFormat( const bspFormatDesc_t *formats, const char *header, int version );
const modelFormatDescr_t *Q_FindFormatDescriptor( const modelFormatDescr_t *formats, const uint8_t *buf, const bspFormatDesc_t **bspFormat );
Expand Down
1 change: 0 additions & 1 deletion source/qcommon/cm_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ struct cmodel_state_s {
// optional special handling of line tracing and point contents
void ( *CM_TransformedBoxTrace )( struct cmodel_state_s *cms, trace_t *tr, vec3_t start, vec3_t end, vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel, int brushmask, vec3_t origin, vec3_t angles );
int ( *CM_TransformedPointContents )( struct cmodel_state_s *cms, vec3_t p, struct cmodel_s *cmodel, vec3_t origin, vec3_t angles );
void ( *CM_RoundUpToHullSize )( struct cmodel_state_s *cms, vec3_t mins, vec3_t maxs, struct cmodel_s *cmodel );
};

//=======================================================================
Expand Down
28 changes: 5 additions & 23 deletions source/qcommon/cm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ static const modelFormatDescr_t cm_supportedformats[] =
// Q3-alike .bsp models
{ "*", 4, q3BSPFormats, 0, ( const modelLoader_t )CM_LoadQ3BrushModel },

// Q2-alike .bsp models
{ "*", 4, q2BSPFormats, 0, ( const modelLoader_t )CM_LoadQ2BrushModel },

// Q1-alike .bsp models
{ "*", 0, q1BSPFormats, 0, ( const modelLoader_t )CM_LoadQ1BrushModel },

// trailing NULL
{ NULL, 0, NULL, 0, NULL }
};
Expand Down Expand Up @@ -157,7 +151,6 @@ static void CM_Clear( cmodel_state_t *cms ) {

cms->CM_TransformedBoxTrace = NULL;
cms->CM_TransformedPointContents = NULL;
cms->CM_RoundUpToHullSize = NULL;
}

/*
Expand Down Expand Up @@ -494,27 +487,16 @@ int CM_NumClusters( cmodel_state_t *cms ) {
}

/*
* CM_PVSData
* CM_ClusterPVS
*/
dvis_t *CM_PVSData( cmodel_state_t *cms ) {
return cms->map_pvs;
}
static inline uint8_t *CM_ClusterPVS( cmodel_state_t *cms, int cluster ) {
dvis_t *vis = cms->map_pvs;

/*
* CM_ClusterVS
*/
static inline uint8_t *CM_ClusterVS( int cluster, dvis_t *vis, uint8_t *nullrow ) {
if( cluster == -1 || !vis ) {
return nullrow;
return cms->nullrow;
}
return ( uint8_t * )vis->data + cluster * vis->rowsize;
}

/*
* CM_ClusterPVS
*/
static inline uint8_t *CM_ClusterPVS( cmodel_state_t *cms, int cluster ) {
return CM_ClusterVS( cluster, cms->map_pvs, cms->nullrow );
return ( uint8_t * )vis->data + cluster * vis->rowsize;
}

/*
Expand Down
Loading

0 comments on commit 5d9a38a

Please sign in to comment.