Browse Source

ref: soft: cleanup unused functions

pull/2/head
Alibek Omarov 2 years ago
parent
commit
fd795d5612
  1. 17
      ref/soft/r_context.c
  2. 38
      ref/soft/r_edge.c
  3. 23
      ref/soft/r_light.c
  4. 13
      ref/soft/r_local.h
  5. 1
      ref/soft/r_main.c
  6. 58
      ref/soft/r_math.c
  7. 16
      ref/soft/r_misc.c
  8. 22
      ref/soft/r_polyse.c
  9. 63
      ref/soft/r_scan.c
  10. 29
      ref/soft/r_studio.c
  11. 48
      ref/soft/r_surf.c
  12. 21
      ref/soft/r_trialias.c

17
ref/soft/r_context.c

@ -26,23 +26,6 @@ static void GAME_EXPORT R_ClearScreen( void ) @@ -26,23 +26,6 @@ static void GAME_EXPORT R_ClearScreen( void )
}
static qboolean GAME_EXPORT IsNormalPass( void )
{
return RP_NORMALPASS();
}
static void GAME_EXPORT R_IncrementSpeedsCounter( int type )
{
switch( type )
{
case RS_ACTIVE_TENTS:
r_stats.c_active_tents_count++;
break;
default:
gEngfuncs.Host_Error( "R_IncrementSpeedsCounter: unsupported type %d\n", type );
}
}
static const byte * GAME_EXPORT R_GetTextureOriginalBuffer( unsigned int idx )
{
image_t *glt = R_GetTexture( idx );

38
ref/soft/r_edge.c

@ -25,14 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -25,14 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void R_SurfacePatch (void)
{
}
void R_EdgeCodeStart (void)
{
}
void R_EdgeCodeEnd (void)
{
}
#endif
@ -973,36 +965,6 @@ void D_TurbulentSurf (surf_t *s) @@ -973,36 +965,6 @@ void D_TurbulentSurf (surf_t *s)
}
}
/*
==============
D_SkySurf
==============
*/
void D_SkySurf (surf_t *s)
{
pface = s->msurf;
miplevel = 0;
if (!pface->texinfo->texture)
return;
cacheblock = R_GetTexture(pface->texinfo->texture->gl_texturenum)->pixels[0];
cachewidth = 256;
d_zistepu = s->d_zistepu;
d_zistepv = s->d_zistepv;
d_ziorigin = s->d_ziorigin;
D_CalcGradients (pface);
D_DrawSpans16 (s->spans);
// set up a gradient for the background surface that places it
// effectively at infinity distance from the viewpoint
d_zistepu = 0;
d_zistepv = 0;
d_ziorigin = -0.9;
D_DrawZSpans (s->spans);
}
qboolean alphaspans;

23
ref/soft/r_light.c

@ -174,29 +174,6 @@ void R_PushDlights( void ) @@ -174,29 +174,6 @@ void R_PushDlights( void )
}
}
/*
=============
R_CountDlights
=============
*/
int R_CountDlights( void )
{
dlight_t *l;
int i, numDlights = 0;
for( i = 0; i < MAX_DLIGHTS; i++ )
{
l = gEngfuncs.GetDynamicLight( i );
if( l->die < gpGlobals->time || !l->radius )
continue;
numDlights++;
}
return numDlights;
}
/*
=============
R_CountSurfaceDlights

13
ref/soft/r_local.h

@ -374,7 +374,6 @@ void GL_BackendStartFrame( void ); @@ -374,7 +374,6 @@ void GL_BackendStartFrame( void );
void GL_BackendEndFrame( void );
void GL_CleanUpTextureUnits( int last );
void GL_Bind( int tmu, unsigned int texnum );
void GL_LoadTexMatrix( const matrix4x4 m );
void GL_LoadTexMatrixExt( const float *glmatrix );
void GL_LoadMatrix( const matrix4x4 source );
void GL_TexGen( unsigned int coord, unsigned int mode );
@ -465,7 +464,6 @@ void R_MarkLights( dlight_t *light, int bit, mnode_t *node ); @@ -465,7 +464,6 @@ void R_MarkLights( dlight_t *light, int bit, mnode_t *node );
colorVec R_LightVec( const vec3_t start, const vec3_t end, vec3_t lightspot, vec3_t lightvec );
int R_CountSurfaceDlights( msurface_t *surf );
colorVec R_LightPoint( const vec3_t p0 );
int R_CountDlights( void );
#endif
//
// gl_rmain.c
@ -488,17 +486,11 @@ void R_DrawFog( void ); @@ -488,17 +486,11 @@ void R_DrawFog( void );
//
// gl_rmath.c
//
void Matrix4x4_ToArrayFloatGL( const matrix4x4 in, float out[16] );
void Matrix4x4_FromArrayFloatGL( matrix4x4 out, const float in[16] );
void Matrix4x4_Concat( matrix4x4 out, const matrix4x4 in1, const matrix4x4 in2 );
void Matrix4x4_ConcatTranslate( matrix4x4 out, float x, float y, float z );
void Matrix4x4_ConcatRotate( matrix4x4 out, float angle, float x, float y, float z );
void Matrix4x4_ConcatScale( matrix4x4 out, float x );
void Matrix4x4_ConcatScale3( matrix4x4 out, float x, float y, float z );
void Matrix4x4_CreateTranslate( matrix4x4 out, float x, float y, float z );
void Matrix4x4_CreateRotate( matrix4x4 out, float angle, float x, float y, float z );
void Matrix4x4_CreateScale( matrix4x4 out, float x );
void Matrix4x4_CreateScale3( matrix4x4 out, float x, float y, float z );
void Matrix4x4_CreateProjection(matrix4x4 out, float xMax, float xMin, float yMax, float yMin, float zNear, float zFar);
void Matrix4x4_CreateOrtho(matrix4x4 m, float xLeft, float xRight, float yBottom, float yTop, float zNear, float zFar);
void Matrix4x4_CreateModelview( matrix4x4 out );
@ -522,7 +514,6 @@ texture_t *R_TextureAnimation( msurface_t *s ); @@ -522,7 +514,6 @@ texture_t *R_TextureAnimation( msurface_t *s );
void GL_SetupFogColorForSurfaces( void );
void R_DrawAlphaTextureChains( void );
void GL_RebuildLightmaps( void );
void GL_InitRandomTable( void );
void GL_BuildLightmaps( void );
void GL_ResetFogColor( void );
void R_GenerateVBO();
@ -551,7 +542,6 @@ void R_DrawSpriteModel( cl_entity_t *e ); @@ -551,7 +542,6 @@ void R_DrawSpriteModel( cl_entity_t *e );
void R_StudioInit( void );
void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded );
void R_StudioLerpMovement( cl_entity_t *e, double time, vec3_t origin, vec3_t angles );
float CL_GetSequenceDuration( cl_entity_t *ent, int sequence );
struct mstudiotex_s *R_StudioGetTexture( cl_entity_t *e );
int R_GetEntityRenderMode( cl_entity_t *ent );
void R_DrawStudioModel( cl_entity_t *e );
@ -1009,8 +999,6 @@ extern affinetridesc_t r_affinetridesc; @@ -1009,8 +999,6 @@ extern affinetridesc_t r_affinetridesc;
void D_DrawSurfaces (void);
void R_DrawParticle( void );
void D_ViewChanged (void);
void D_WarpScreen (void);
void R_PolysetUpdateTables (void);
//=======================================================================//
@ -1198,6 +1186,7 @@ void R_ScanEdges (void); @@ -1198,6 +1186,7 @@ void R_ScanEdges (void);
//
// r_surf.c
//
void GL_InitRandomTable( void );
void D_FlushCaches( void );
//

1
ref/soft/r_main.c

@ -1971,6 +1971,7 @@ qboolean GAME_EXPORT R_Init( void ) @@ -1971,6 +1971,7 @@ qboolean GAME_EXPORT R_Init( void )
R_StudioInit();
R_SpriteInit();
R_InitTurb();
GL_InitRandomTable();
return true;
}

58
ref/soft/r_math.c

@ -99,46 +99,6 @@ void Matrix4x4_CreateModelview( matrix4x4 out ) @@ -99,46 +99,6 @@ void Matrix4x4_CreateModelview( matrix4x4 out )
out[1][2] = 1.0f;
}
void Matrix4x4_ToArrayFloatGL( const matrix4x4 in, float out[16] )
{
out[ 0] = in[0][0];
out[ 1] = in[1][0];
out[ 2] = in[2][0];
out[ 3] = in[3][0];
out[ 4] = in[0][1];
out[ 5] = in[1][1];
out[ 6] = in[2][1];
out[ 7] = in[3][1];
out[ 8] = in[0][2];
out[ 9] = in[1][2];
out[10] = in[2][2];
out[11] = in[3][2];
out[12] = in[0][3];
out[13] = in[1][3];
out[14] = in[2][3];
out[15] = in[3][3];
}
void Matrix4x4_FromArrayFloatGL( matrix4x4 out, const float in[16] )
{
out[0][0] = in[0];
out[1][0] = in[1];
out[2][0] = in[2];
out[3][0] = in[3];
out[0][1] = in[4];
out[1][1] = in[5];
out[2][1] = in[6];
out[3][1] = in[7];
out[0][2] = in[8];
out[1][2] = in[9];
out[2][2] = in[10];
out[3][2] = in[11];
out[0][3] = in[12];
out[1][3] = in[13];
out[2][3] = in[14];
out[3][3] = in[15];
}
void Matrix4x4_CreateTranslate( matrix4x4 out, float x, float y, float z )
{
out[0][0] = 1.0f;
@ -247,21 +207,3 @@ void Matrix4x4_ConcatRotate( matrix4x4 out, float angle, float x, float y, float @@ -247,21 +207,3 @@ void Matrix4x4_ConcatRotate( matrix4x4 out, float angle, float x, float y, float
Matrix4x4_CreateRotate( temp, angle, x, y, z );
Matrix4x4_Concat( out, base, temp );
}
void Matrix4x4_ConcatScale( matrix4x4 out, float x )
{
matrix4x4 base, temp;
Matrix4x4_Copy( base, out );
Matrix4x4_CreateScale( temp, x );
Matrix4x4_Concat( out, base, temp );
}
void Matrix4x4_ConcatScale3( matrix4x4 out, float x, float y, float z )
{
matrix4x4 base, temp;
Matrix4x4_Copy( base, out );
Matrix4x4_CreateScale3( temp, x, y, z );
Matrix4x4_Concat( out, base, temp );
}

16
ref/soft/r_misc.c

@ -157,22 +157,6 @@ void TransformVector (vec3_t in, vec3_t out) @@ -157,22 +157,6 @@ void TransformVector (vec3_t in, vec3_t out)
out[2] = DotProduct(in,RI.vforward);
}
/*
================
R_TransformPlane
================
*/
void R_TransformPlane (mplane_t *p, float *normal, float *dist)
{
float d;
d = DotProduct (RI.vieworg, p->normal);
*dist = p->dist - d;
// TODO: when we have rotating entities, this will need to use the view matrix
TransformVector (p->normal, normal);
}
/*
===============
R_SetUpFrustumIndexes

22
ref/soft/r_polyse.c

@ -123,28 +123,6 @@ void R_RasterizeAliasPolySmooth (void); @@ -123,28 +123,6 @@ void R_RasterizeAliasPolySmooth (void);
void R_PolysetScanLeftEdge(int height);
qboolean R_PolysetScanLeftEdge_C(int height);
/*
================
R_PolysetUpdateTables
================
*/
void R_PolysetUpdateTables (void)
{
int i;
byte *s;
if (r_affinetridesc.skinwidth != skinwidth ||
r_affinetridesc.pskin != skinstart)
{
skinwidth = r_affinetridesc.skinwidth;
skinstart = r_affinetridesc.pskin;
s = skinstart;
for (i=0 ; i<MAX_LBM_HEIGHT ; i++, s+=skinwidth)
skintable[i] = s;
}
}
/*
================
R_DrawTriangle

63
ref/soft/r_scan.c

@ -34,69 +34,6 @@ int alpha; @@ -34,69 +34,6 @@ int alpha;
void D_DrawTurbulent8Span (void);
/*
=============
D_WarpScreen
this performs a slight compression of the screen at the same time as
the sine warp, to keep the edges from wrapping
=============
*/
void D_WarpScreen (void)
{
#if 0
int w, h;
int u,v, u2, v2;
byte *dest;
int *turb;
int *col;
byte **row;
static int cached_width, cached_height;
static byte *rowptr[1200+AMP2*2];
static int column[1600+AMP2*2];
//
// these are constant over resolutions, and can be saved
//
w = r_newrefdef.width;
h = r_newrefdef.height;
if (w != cached_width || h != cached_height)
{
cached_width = w;
cached_height = h;
for (v=0 ; v<h+AMP2*2 ; v++)
{
v2 = (int)((float)v/(h + AMP2 * 2) * r_refdef.vrect.height);
rowptr[v] = r_warpbuffer + (WARP_WIDTH * v2);
}
for (u=0 ; u<w+AMP2*2 ; u++)
{
u2 = (int)((float)u/(w + AMP2 * 2) * r_refdef.vrect.width);
column[u] = u2;
}
}
turb = intsintable + ((int)(r_newrefdef.time*SPEED)&(CYCLE-1));
dest = vid.buffer + r_newrefdef.y * vid.rowbytes + r_newrefdef.x;
for (v=0 ; v<h ; v++, dest += vid.rowbytes)
{
col = &column[turb[v]];
row = &rowptr[v];
for (u=0 ; u<w ; u+=4)
{
dest[u+0] = row[turb[u+0]][col[u+0]];
dest[u+1] = row[turb[u+1]][col[u+1]];
dest[u+2] = row[turb[u+2]][col[u+2]];
dest[u+3] = row[turb[u+3]][col[u+3]];
}
}
#endif
}
#if !id386
/*

29
ref/soft/r_studio.c

@ -667,35 +667,6 @@ float R_StudioEstimateInterpolant( cl_entity_t *e ) @@ -667,35 +667,6 @@ float R_StudioEstimateInterpolant( cl_entity_t *e )
return dadt;
}
/*
====================
CL_GetSequenceDuration
====================
*/
float CL_GetSequenceDuration( cl_entity_t *ent, int sequence )
{
studiohdr_t *pstudiohdr;
mstudioseqdesc_t *pseqdesc;
if( ent->model != NULL && ent->model->type == mod_studio )
{
pstudiohdr = (studiohdr_t *)gEngfuncs.Mod_Extradata( mod_studio, ent->model );
if( pstudiohdr )
{
sequence = bound( 0, sequence, pstudiohdr->numseq - 1 );
pseqdesc = (mstudioseqdesc_t *)((byte *)pstudiohdr + pstudiohdr->seqindex) + sequence;
if( pseqdesc->numframes > 1 && pseqdesc->fps > 0 )
return (float)pseqdesc->numframes / (float)pseqdesc->fps;
}
}
return 0.1f;
}
/*
====================
StudioFxTransform

48
ref/soft/r_surf.c

@ -353,7 +353,7 @@ void R_BuildLightMap (void) @@ -353,7 +353,7 @@ void R_BuildLightMap (void)
#endif
void R_InitRandomTable( void )
void GL_InitRandomTable( void )
{
int tu, tv;
@ -1105,52 +1105,6 @@ surfcache_t *D_SCAlloc (int width, int size) @@ -1105,52 +1105,6 @@ surfcache_t *D_SCAlloc (int width, int size)
return new;
}
/*
=================
D_SCDump
=================
*/
void D_SCDump (void)
{
surfcache_t *test;
for (test = sc_base ; test ; test = test->next)
{
if (test == sc_rover)
gEngfuncs.Con_Printf ("ROVER:\n");
gEngfuncs.Con_Printf ("%p : %i bytes %i width\n",test, test->size, test->width);
}
}
//=============================================================================
// if the num is not a power of 2, assume it will not repeat
int MaskForNum (int num)
{
if (num==128)
return 127;
if (num==64)
return 63;
if (num==32)
return 31;
if (num==16)
return 15;
return 255;
}
int D_log2 (int num)
{
int c;
c = 0;
while (num>>=1)
c++;
return c;
}
//=============================================================================
void R_DecalComputeBasis( msurface_t *surf, int flags, vec3_t textureSpaceBasis[3] );
void R_DrawSurfaceDecals( void )

21
ref/soft/r_trialias.c

@ -25,7 +25,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = { @@ -25,7 +25,6 @@ float r_avertexnormals[NUMVERTEXNORMALS][3] = {
void R_AliasSetUpTransform (void);
void R_AliasTransformVector (vec3_t in, vec3_t out, float m[3][4] );
void R_AliasProjectAndClipTestFinalVert (finalvert_t *fv);
void R_AliasTransformFinalVerts( int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv );
@ -42,19 +41,6 @@ R_AliasCheckBBox @@ -42,19 +41,6 @@ R_AliasCheckBBox
#define BBOX_MUST_CLIP_Z 2
#define BBOX_TRIVIAL_REJECT 8
/*
================
R_AliasTransformVector
================
*/
void R_AliasTransformVector(vec3_t in, vec3_t out, float xf[3][4] )
{
out[0] = DotProduct(in, xf[0]) + xf[0][3];
out[1] = DotProduct(in, xf[1]) + xf[1][3];
out[2] = DotProduct(in, xf[2]) + xf[2][3];
}
void VectorInverse (vec3_t v)
{
v[0] = -v[0];
@ -238,13 +224,6 @@ void R_AliasProjectAndClipTestFinalVert( finalvert_t *fv ) @@ -238,13 +224,6 @@ void R_AliasProjectAndClipTestFinalVert( finalvert_t *fv )
fv->flags |= ALIAS_BOTTOM_CLIP;
}
void R_AliasWorldToScreen( const float *v, float *out )
{
out[0] = DotProduct(v, aliastransform[0]) + aliastransform[0][3];
out[1] = DotProduct(v, aliastransform[1]) + aliastransform[1][3];
out[2] = DotProduct(v, aliastransform[2]) + aliastransform[2][3];
}
void R_SetupFinalVert( finalvert_t *fv, float x, float y, float z, int light, int s, int t )
{
vec3_t v = {x, y, z};

Loading…
Cancel
Save