diff --git a/ref/soft/r_context.c b/ref/soft/r_context.c index 3004cb8e..c455fbbb 100644 --- a/ref/soft/r_context.c +++ b/ref/soft/r_context.c @@ -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 ); diff --git a/ref/soft/r_edge.c b/ref/soft/r_edge.c index e5b8e571..36f69b5d 100644 --- a/ref/soft/r_edge.c +++ b/ref/soft/r_edge.c @@ -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) } } -/* -============== -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; diff --git a/ref/soft/r_light.c b/ref/soft/r_light.c index 1e84d77d..aa341aff 100644 --- a/ref/soft/r_light.c +++ b/ref/soft/r_light.c @@ -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 diff --git a/ref/soft/r_local.h b/ref/soft/r_local.h index 277abaae..2940d6fe 100644 --- a/ref/soft/r_local.h +++ b/ref/soft/r_local.h @@ -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 ); 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 ); // // 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 ); 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 ); 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; 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); // // r_surf.c // +void GL_InitRandomTable( void ); void D_FlushCaches( void ); // diff --git a/ref/soft/r_main.c b/ref/soft/r_main.c index 243429ad..379c0dcc 100644 --- a/ref/soft/r_main.c +++ b/ref/soft/r_main.c @@ -1311,7 +1311,7 @@ void R_DrawBrushModel(cl_entity_t *pent) if (!topnode) return; // no part in a visible leaf - alphaspans = true; + alphaspans = true; VectorCopy (RI.currententity->origin, r_entorigin); VectorSubtract (RI.vieworg, r_entorigin, tr.modelorg); //VectorSubtract (r_origin, RI.currententity->origin, modelorg); @@ -1971,6 +1971,7 @@ qboolean GAME_EXPORT R_Init( void ) R_StudioInit(); R_SpriteInit(); R_InitTurb(); + GL_InitRandomTable(); return true; } diff --git a/ref/soft/r_math.c b/ref/soft/r_math.c index 4c835623..90600ead 100644 --- a/ref/soft/r_math.c +++ b/ref/soft/r_math.c @@ -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 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 ); -} diff --git a/ref/soft/r_misc.c b/ref/soft/r_misc.c index e984a27e..d385c167 100644 --- a/ref/soft/r_misc.c +++ b/ref/soft/r_misc.c @@ -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 diff --git a/ref/soft/r_polyse.c b/ref/soft/r_polyse.c index 0d36d386..93861f85 100644 --- a/ref/soft/r_polyse.c +++ b/ref/soft/r_polyse.c @@ -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 ; imodel != 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 diff --git a/ref/soft/r_surf.c b/ref/soft/r_surf.c index e1d44681..48b7fc31 100644 --- a/ref/soft/r_surf.c +++ b/ref/soft/r_surf.c @@ -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) 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 ) diff --git a/ref/soft/r_trialias.c b/ref/soft/r_trialias.c index 51e7bfdc..9595a6c4 100644 --- a/ref/soft/r_trialias.c +++ b/ref/soft/r_trialias.c @@ -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 #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 ) 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};