2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00

engine: merge PM_TraceTexture into PM_TraceTexturePmove

This commit is contained in:
Alibek Omarov 2023-01-05 23:59:31 +03:00
parent 4cb109abe0
commit e305b81df0
5 changed files with 12 additions and 24 deletions

View File

@ -2533,7 +2533,7 @@ CL_TraceTexture
*/
const char * GAME_EXPORT PM_CL_TraceTexture( int ground, float *vstart, float *vend )
{
return PM_TraceTexturePmove( clgame.pmove, ground, vstart, vend );
return PM_TraceTexture( clgame.pmove, ground, vstart, vend );
}
/*

View File

@ -42,7 +42,7 @@ float PM_TraceModel( playermove_t *pmove, physent_t *pe, float *start, float *en
pmtrace_t *PM_TraceLine( playermove_t *pmove, float *start, float *end, int flags, int usehull, int ignore_pe );
pmtrace_t *PM_TraceLineEx( playermove_t *pmove, float *start, float *end, int flags, int usehull, pfnIgnore pmFilter );
struct msurface_s *PM_TraceSurfacePmove( playermove_t *pmove, int ground, float *vstart, float *vend );
const char *PM_TraceTexturePmove( playermove_t *pmove, int ground, float *vstart, float *vend );
const char *PM_TraceTexture( playermove_t *pmove, int ground, float *vstart, float *vend );
int PM_PointContentsPmove( playermove_t *pmove, const float *p, int *truecontents );
void PM_StuckTouch( playermove_t *pmove, int hitent, pmtrace_t *tr );
void PM_ConvertTrace( trace_t *out, pmtrace_t *in, edict_t *ent );
@ -66,7 +66,6 @@ static inline void PM_InitPMTrace( pmtrace_t *trace, const vec3_t end )
//
// pm_surface.c
//
const char *PM_TraceTexture( physent_t *pe, vec3_t vstart, vec3_t vend );
msurface_t *PM_RecursiveSurfCheck( model_t *model, mnode_t *node, vec3_t p1, vec3_t p2 );
msurface_t *PM_TraceSurface( physent_t *pe, vec3_t start, vec3_t end );
int PM_TestLineExt( playermove_t *pmove, physent_t *ents, int numents, const vec3_t start, const vec3_t end, int flags );

View File

@ -214,24 +214,6 @@ msurface_t *PM_TraceSurface( physent_t *pe, vec3_t start, vec3_t end )
return PM_RecursiveSurfCheck( bmodel, &bmodel->nodes[hull->firstclipnode], start_l, end_l );
}
/*
==================
PM_TraceTexture
find the face where the traceline hit
assume physentity is valid
==================
*/
const char *PM_TraceTexture( physent_t *pe, vec3_t start, vec3_t end )
{
msurface_t *surf = PM_TraceSurface( pe, start, end );
if( !surf || !surf->texinfo || !surf->texinfo->texture )
return NULL;
return surf->texinfo->texture->name;
}
/*
==================
PM_TestLine_r

View File

@ -841,12 +841,19 @@ struct msurface_s *PM_TraceSurfacePmove( playermove_t *pmove, int ground, float
return PM_TraceSurface( &pmove->physents[ground], vstart, vend );
}
const char *PM_TraceTexturePmove( playermove_t *pmove, int ground, float *vstart, float *vend )
const char *PM_TraceTexture( playermove_t *pmove, int ground, float *vstart, float *vend )
{
msurface_t *surf;
if( ground < 0 || ground >= pmove->numphysent )
return NULL; // bad ground
return PM_TraceTexture( &pmove->physents[ground], vstart, vend );
surf = PM_TraceSurface( &pmove->physents[ground], vstart, vend );
if( !surf || !surf->texinfo || !surf->texinfo->texture )
return NULL;
return surf->texinfo->texture->name;
}
int PM_PointContentsPmove( playermove_t *pmove, const float *p, int *truecontents )

View File

@ -414,7 +414,7 @@ static float GAME_EXPORT pfnTraceModel( physent_t *pe, float *start, float *end,
static const char *pfnTraceTexture( int ground, float *vstart, float *vend )
{
return PM_TraceTexturePmove( svgame.pmove, ground, vstart, vend );
return PM_TraceTexture( svgame.pmove, ground, vstart, vend );
}
static void GAME_EXPORT pfnPlaySound( int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch )