Clean up unused code

This commit is contained in:
Denis Pauk 2018-01-21 12:09:09 +02:00
parent 9d9dd6b02a
commit d3f93e6786
20 changed files with 448 additions and 691 deletions

View file

@ -39,7 +39,6 @@ byte *mod_base;
void LoadSP2(model_t *mod, void *buffer);
void Mod_LoadBrushModel(model_t *mod, void *buffer);
void LoadMD2(model_t *mod, void *buffer);
model_t *Mod_LoadModel(model_t *mod, qboolean crash);
void LM_BuildPolygonFromSurface(msurface_t *fa);
void LM_CreateSurfaceLightmap(msurface_t *surf);
void LM_EndBuildingLightmaps(void);

View file

@ -353,7 +353,6 @@ VARS
====================================================
*/
extern int d_spanpixcount;
extern int r_framecount; // sequence # of current frame since Quake
// started
extern float r_aliasuvscale; // scale-up factor for screen u and v
@ -362,11 +361,7 @@ extern qboolean r_dowarp;
extern affinetridesc_t r_affinetridesc;
extern vec3_t r_pright, r_pup, r_ppn;
void D_DrawSurfaces(void);
void R_DrawParticle(void);
void D_ViewChanged(void);
void D_WarpScreen(void);
void R_PolysetUpdateTables(void);
@ -376,26 +371,16 @@ void R_PolysetUpdateTables(void);
extern drawsurf_t r_drawsurf;
void R_DrawSurface(void);
extern int c_surf;
extern pixel_t *r_warpbuffer;
extern float scale_for_mip;
extern qboolean d_roverwrapped;
extern surfcache_t *sc_rover;
extern surfcache_t *d_initial_rover;
extern float d_sdivzstepu, d_tdivzstepu, d_zistepu;
extern float d_sdivzstepv, d_tdivzstepv, d_zistepv;
extern float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
extern int sadjust, tadjust;
extern int bbextents, bbextentt;
void D_DrawSpans16(espan_t *pspans);
void D_DrawZSpans(espan_t *pspans);
void Turbulent8(espan_t *pspan);
@ -409,7 +394,7 @@ extern int d_pix_min, d_pix_max, d_pix_shift;
extern pixel_t *d_viewbuffer;
extern zvalue_t *d_pzbuffer;
extern unsigned int d_zrowbytes, d_zwidth;
extern unsigned int d_zwidth;
extern int d_minmip;
extern float d_scalemip[3];
@ -440,50 +425,30 @@ extern surf_t *surfaces, *surface_p, *surf_max;
//===================================================================
extern vec3_t sxformaxis[4]; // s axis transformed into viewspace
extern vec3_t txformaxis[4]; // t axis transformed into viewspac
extern float xcenter, ycenter;
extern float xscale, yscale;
extern float xscaleinv, yscaleinv;
extern float xscaleshrink, yscaleshrink;
extern void TransformVector(vec3_t in, vec3_t out);
extern void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
fixed8_t endvertu, fixed8_t endvertv);
extern int ubasestep, errorterm, erroradjustup, erroradjustdown;
//===========================================================================
extern cvar_t *sw_aliasstats;
extern cvar_t *sw_clearcolor;
extern cvar_t *sw_drawflat;
extern cvar_t *sw_draworder;
extern cvar_t *sw_maxedges;
extern cvar_t *sw_maxsurfs;
extern cvar_t *sw_mipcap;
extern cvar_t *sw_mipscale;
extern cvar_t *r_mode;
extern cvar_t *sw_reportsurfout;
extern cvar_t *sw_reportedgeout;
extern cvar_t *sw_stipplealpha;
extern cvar_t *sw_surfcacheoverride;
extern cvar_t *sw_waterwarp;
extern cvar_t *r_fullbright;
extern cvar_t *r_lefthand;
extern cvar_t *r_drawentities;
extern cvar_t *r_drawworld;
extern cvar_t *r_dspeeds;
extern cvar_t *r_lerpmodels;
extern cvar_t *r_speeds;
extern cvar_t *r_lightlevel;
extern cvar_t *r_modulate;
extern cvar_t *r_vsync;
extern cvar_t *vid_fullscreen;
extern cvar_t *vid_gamma;
extern clipplane_t view_clipplanes[4];
@ -506,18 +471,12 @@ extern entity_t *currententity;
extern vec3_t modelorg;
extern vec3_t r_entorigin;
extern float verticalFieldOfView;
extern float xOrigin, yOrigin;
extern int r_visframecount;
extern msurface_t *r_alpha_surfaces;
//=============================================================================
void R_ClearPolyList(void);
void R_DrawPolyList(void);
//
// current entity info
//
@ -526,59 +485,30 @@ extern qboolean insubmodel;
void R_DrawAlphaSurfaces(void);
void R_DrawSprite(void);
void R_DrawBeam(entity_t *e);
void R_RenderFace(msurface_t *fa, int clipflags);
void R_RenderBmodelFace(bedge_t *pedges, msurface_t *psurf);
void R_TransformPlane(mplane_t *p, float *normal, float *dist);
void R_TransformFrustum(void);
void R_DrawSurfaceBlock16(void);
void R_DrawSurfaceBlock8(void);
void R_GenSkyTile(void *pdest);
void R_GenSkyTile16(void *pdest);
void R_Surf8Patch(void);
void R_Surf16Patch(void);
void R_DrawSubmodelPolygons(model_t *pmodel, int clipflags, mnode_t *topnode);
void R_DrawSolidClippedSubmodelPolygons(model_t *pmodel, mnode_t *topnode);
void R_AddPolygonEdges(emitpoint_t *pverts, int numverts, int miplevel);
surf_t *R_GetSurf(void);
void R_AliasDrawModel(void);
void R_BeginEdgeFrame(void);
void R_ScanEdges(void);
void D_DrawSurfaces(void);
void R_InsertNewEdges(edge_t *edgestoadd, edge_t *edgelist);
void R_StepActiveU(edge_t *pedge);
void R_RemoveEdges(edge_t *pedge);
void R_PushDlights(model_t *model);
extern void R_Surf8Start(void);
extern void R_Surf8End(void);
extern void R_Surf16Start(void);
extern void R_Surf16End(void);
extern void R_EdgeCodeStart (void);
extern void R_EdgeCodeEnd (void);
extern void R_RotateBmodel (void);
extern int c_faceclip;
extern int r_polycount;
extern int r_wholepolycount;
extern int ubasestep, errorterm, erroradjustup, erroradjustdown;
extern int sadjust, tadjust;
extern int bbextents, bbextentt;
extern mvertex_t *r_ptverts, *r_ptvertsmax;
extern float entity_rotation[3][3];
extern int r_currentkey;
extern int r_currentbkey;
void R_InitTurb (void);
void R_DrawParticles (void);
extern int r_amodels_drawn;
@ -611,7 +541,6 @@ extern int r_outofsurfaces;
extern int r_outofedges;
extern mvertex_t *r_pcurrentvertbase;
extern int r_maxvalidedgeoffset;
typedef struct
{
@ -621,7 +550,6 @@ typedef struct
extern aliastriangleparms_t aliastriangleparms;
void R_DrawTriangle( void );
//void R_DrawTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
void R_AliasClipTriangle (finalvert_t *index0, finalvert_t *index1, finalvert_t *index2);
@ -629,16 +557,10 @@ extern float r_time1;
extern float da_time1, da_time2;
extern float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
extern float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
extern int r_frustum_indexes[4*6];
extern int r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
extern qboolean r_surfsonstack;
extern mleaf_t *r_viewleaf;
extern int r_viewcluster, r_oldviewcluster;
extern int r_clipflags;
extern int r_dlightframecount;
extern qboolean r_fov_greater_than_90;
extern image_t *r_notexture_mip;
extern model_t *r_worldmodel;
@ -646,40 +568,26 @@ extern model_t *r_worldmodel;
void R_PrintAliasStats (void);
void R_PrintTimes (void);
void R_PrintDSpeeds (void);
void R_AnimateLight (void);
void R_LightPoint (vec3_t p, vec3_t color);
void R_SetupFrame (void);
void R_cshift_f (void);
void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1);
void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip);
void R_SplitEntityOnNode2 (mnode_t *node);
extern refdef_t r_newrefdef;
extern surfcache_t *sc_rover, *sc_base;
extern surfcache_t *sc_base;
extern void *colormap;
//====================================================================
float R_DLightPoint (vec3_t p);
void R_NewMap (void);
void R_Register (void);
void R_UnRegister (void);
void Draw_InitLocal(void);
qboolean RE_Init(void);
void RE_Shutdown(void);
void R_InitCaches(void);
void D_FlushCaches(void);
void R_ScreenShot_f( void );
void RE_BeginRegistration (char *map);
struct model_s *RE_RegisterModel (char *name);
void RE_EndRegistration (void);
void RE_RenderFrame (refdef_t *fd);
struct image_s *RE_Draw_FindPic (char *name);
void RE_Draw_GetPicSize (int *w, int *h, char *name);
@ -691,17 +599,6 @@ void RE_Draw_TileClear (int x, int y, int w, int h, char *name);
void RE_Draw_Fill (int x, int y, int w, int h, int c);
void RE_Draw_FadeScreen (void);
void Draw_GetPalette (void);
void RE_BeginFrame( float camera_separation );
void RE_SetPalette( const unsigned char *palette );
extern unsigned d_8to24table[256]; // base
void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length);
void Sys_SetFPCW (void);
void LoadPCX (char *filename, byte **pic, byte **palette, int *width, int *height);
void R_InitImages(void);
@ -709,10 +606,6 @@ void R_ShutdownImages(void);
image_t *R_FindImage(char *name, imagetype_t type);
void R_FreeUnusedImages(void);
void R_GammaCorrectAndSetPalette(const unsigned char *pal);
extern mtexinfo_t *sky_texinfo[6];
void R_InitSkyBox(void);
typedef struct swstate_s
@ -727,8 +620,6 @@ typedef struct swstate_s
void R_IMFlatShadedQuad( vec3_t a, vec3_t b, vec3_t c, vec3_t d, int color, float alpha );
extern swstate_t sw_state;
/*
====================================================================
@ -738,18 +629,4 @@ IMPORTED FUNCTIONS
*/
extern refimport_t ri;
/*
====================================================================
IMPLEMENTATION FUNCTIONS
====================================================================
*/
void SWimp_BeginFrame(float camera_separation);
void RE_EndFrame(void);
int SWimp_Init(void);
void RE_SetPalette(const unsigned char *palette);
void SWimp_Shutdown(void );
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen);
#endif

View file

@ -233,7 +233,6 @@ typedef struct model_s
void Mod_Init(void);
void Mod_ClearAll(void);
model_t *Mod_ForName(char *name, qboolean crash);
void *Mod_Extradata(model_t *mod); // handles caching
void Mod_TouchModel(char *name);

View file

@ -24,15 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static finalvert_t fv[2][8];
void R_AliasProjectAndClipTestFinalVert (finalvert_t *fv);
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out);
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out);
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out);
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out);
static void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out);
static void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out);
static void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out);
static void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out);
/*
================
@ -41,7 +36,8 @@ R_Alias_clip_z
pfv0 is the unclipped vertex, pfv1 is the z-clipped vertex
================
*/
void R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
static void
R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
float scale;
@ -59,7 +55,8 @@ void R_Alias_clip_z (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
R_AliasProjectAndClipTestFinalVert (out);
}
void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
static void
R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
float scale;
@ -87,7 +84,8 @@ void R_Alias_clip_left (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
static void
R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
float scale;
@ -115,8 +113,8 @@ void R_Alias_clip_right (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
}
void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
static void
R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
{
float scale;
@ -145,7 +143,8 @@ void R_Alias_clip_top (finalvert_t *pfv0, finalvert_t *pfv1, finalvert_t *out)
}
void R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
static void
R_Alias_clip_bottom (finalvert_t *pfv0, finalvert_t *pfv1,
finalvert_t *out)
{
float scale;

View file

@ -28,29 +28,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define LIGHT_MIN 5 // lowest light value we'll allow, to avoid the
// need for inner-loop light clamping
//PGM
extern byte iractive;
//PGM
int r_amodels_drawn;
affinetridesc_t r_affinetridesc;
vec3_t r_plightvec;
vec3_t r_lerped[1024];
vec3_t r_lerp_frontv, r_lerp_backv, r_lerp_move;
static vec3_t r_plightvec;
static vec3_t r_lerp_frontv, r_lerp_backv, r_lerp_move;
int r_ambientlight;
int r_aliasblendcolor;
float r_shadelight;
static int r_ambientlight;
int r_aliasblendcolor;
static float r_shadelight;
daliasframe_t *r_thisframe, *r_lastframe;
dmdl_t *s_pmdl;
static daliasframe_t *r_thisframe, *r_lastframe;
static dmdl_t *s_pmdl;
float aliastransform[3][4];
float aliasworldtransform[3][4];
float aliasoldworldtransform[3][4];
static float aliastransform[3][4];
static float aliasworldtransform[3][4];
static float aliasoldworldtransform[3][4];
static float s_ziscale;
static vec3_t s_alias_forward, s_alias_right, s_alias_up;
@ -58,19 +53,16 @@ static vec3_t s_alias_forward, s_alias_right, s_alias_up;
#define NUMVERTEXNORMALS 162
float r_avertexnormals[NUMVERTEXNORMALS][3] = {
static float r_avertexnormals[NUMVERTEXNORMALS][3] = {
#include "../constants/anorms.h"
};
void R_AliasSetUpLerpData( dmdl_t *pmdl, float backlerp );
void R_AliasSetUpTransform (void);
void R_AliasTransformVector (vec3_t in, vec3_t out, float m[3][4] );
void R_AliasProjectAndClipTestFinalVert (finalvert_t *fv);
static void R_AliasTransformVector(vec3_t in, vec3_t out, float m[3][4]);
static void R_AliasTransformFinalVerts(int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv );
void R_AliasTransformFinalVerts( int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv );
void R_AliasProjectAndClipTestFinalVert(finalvert_t *fv);
void R_AliasLerpFrames( dmdl_t *paliashdr, float backlerp );
/*
================
@ -88,7 +80,8 @@ R_AliasCheckBBox
**
** Checks a specific alias frame bounding box
*/
unsigned long R_AliasCheckFrameBBox( daliasframe_t *frame, float worldxf[3][4] )
static unsigned long
R_AliasCheckFrameBBox( daliasframe_t *frame, float worldxf[3][4] )
{
unsigned long aggregate_and_clipcode = ~0U,
aggregate_or_clipcode = 0;
@ -176,7 +169,8 @@ unsigned long R_AliasCheckFrameBBox( daliasframe_t *frame, float worldxf[3][4] )
return BBOX_MUST_CLIP_XY;
}
qboolean R_AliasCheckBBox (void)
static qboolean
R_AliasCheckBBox (void)
{
unsigned long ccodes[2] = { 0, 0 };
@ -211,7 +205,8 @@ qboolean R_AliasCheckBBox (void)
R_AliasTransformVector
================
*/
void R_AliasTransformVector(vec3_t in, vec3_t out, float xf[3][4] )
static 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];
@ -234,10 +229,11 @@ typedef struct
finalvert_t *dest_verts; // destination for transformed verts
} aliasbatchedtransformdata_t;
aliasbatchedtransformdata_t aliasbatchedtransformdata;
static aliasbatchedtransformdata_t aliasbatchedtransformdata;
finalvert_t *finalverts;
void R_AliasPreparePoints (void)
static void
R_AliasPreparePoints (void)
{
int i;
dstvert_t *pstverts;
@ -245,13 +241,6 @@ void R_AliasPreparePoints (void)
finalvert_t *pfv[3];
finalvert_t *pfinalverts;
// PGM
iractive = (r_newrefdef.rdflags & RDF_IRGOGGLES && currententity->flags & RF_IR_VISIBLE);
// iractive = 0;
// if(r_newrefdef.rdflags & RDF_IRGOGGLES && currententity->flags & RF_IR_VISIBLE)
// iractive = 1;
// PGM
// put work vertexes on stack, cache aligned
pfinalverts = finalverts;
@ -348,7 +337,8 @@ void R_AliasPreparePoints (void)
R_AliasSetUpTransform
================
*/
void R_AliasSetUpTransform (void)
static void
R_AliasSetUpTransform (void)
{
int i;
static float viewmatrix[3][4];
@ -416,7 +406,8 @@ void R_AliasSetUpTransform (void)
R_AliasTransformFinalVerts
================
*/
void R_AliasTransformFinalVerts( int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv )
static void
R_AliasTransformFinalVerts( int numpoints, finalvert_t *fv, dtrivertx_t *oldv, dtrivertx_t *newv )
{
int i;
@ -550,7 +541,8 @@ R_AliasSetupLighting
FIXME: put lighting into tables
================
*/
void R_AliasSetupLighting (void)
static void
R_AliasSetupLighting (void)
{
alight_t lighting;
float lightvec[3] = {-1, 0, 0};
@ -641,7 +633,8 @@ R_AliasSetupFrames
=================
*/
void R_AliasSetupFrames( dmdl_t *pmdl )
static void
R_AliasSetupFrames( dmdl_t *pmdl )
{
int thisframe = currententity->frame;
int lastframe = currententity->oldframe;
@ -671,7 +664,8 @@ void R_AliasSetupFrames( dmdl_t *pmdl )
**
** Precomputes lerp coefficients used for the whole frame.
*/
void R_AliasSetUpLerpData( dmdl_t *pmdl, float backlerp )
static void
R_AliasSetUpLerpData( dmdl_t *pmdl, float backlerp )
{
float frontlerp;
vec3_t translation, vectors[3];

View file

@ -31,7 +31,7 @@ vec3_t modelorg; // modelorg is the viewpoint reletive to
vec3_t r_entorigin; // the currently rendering entity in world
// coordinates
float entity_rotation[3][3];
static float entity_rotation[3][3];
int r_currentbkey;
@ -58,7 +58,8 @@ static qboolean makeclippededge;
R_EntityRotate
================
*/
void R_EntityRotate (vec3_t vec)
static void
R_EntityRotate (vec3_t vec)
{
vec3_t tvec;
@ -155,7 +156,8 @@ R_RecursiveClipBPoly
Clip a bmodel poly down the world bsp tree
================
*/
void R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
static void
R_RecursiveClipBPoly (bedge_t *pedges, mnode_t *pnode, msurface_t *psurf)
{
bedge_t *psideedges[2], *pnextedge, *ptedge;
int i, side, lastside;
@ -336,7 +338,8 @@ R_DrawSolidClippedSubmodelPolygons
Bmodel crosses multiple leafs
================
*/
void R_DrawSolidClippedSubmodelPolygons (model_t *pmodel, mnode_t *topnode)
void
R_DrawSolidClippedSubmodelPolygons (model_t *pmodel, mnode_t *topnode)
{
int i, j, lindex;
vec_t dot;
@ -414,7 +417,8 @@ R_DrawSubmodelPolygons
All in one leaf
================
*/
void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, mnode_t *topnode)
void
R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, mnode_t *topnode)
{
int i;
vec_t dot;
@ -446,14 +450,15 @@ void R_DrawSubmodelPolygons (model_t *pmodel, int clipflags, mnode_t *topnode)
}
int c_drawnode;
static int c_drawnode;
/*
================
R_RecursiveWorldNode
================
*/
void R_RecursiveWorldNode (mnode_t *node, int clipflags)
static void
R_RecursiveWorldNode (mnode_t *node, int clipflags)
{
int c;
vec3_t acceptpt, rejectpt;

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "header/local.h"
image_t *draw_chars; // 8*8 graphic characters
static image_t *draw_chars; // 8*8 graphic characters
//=============================================================================

View file

@ -41,38 +41,36 @@ surf_t *surfaces, *surface_p, *surf_max;
edge_t **newedges;
edge_t **removeedges;
espan_t *edge_basespans;
espan_t *span_p, *max_span_p;
static espan_t *span_p, *max_span_p;
int r_currentkey;
shift20_t current_iv;
shift20_t edge_head_u_shift20, edge_tail_u_shift20;
static shift20_t current_iv;
static shift20_t edge_head_u_shift20, edge_tail_u_shift20;
static void (*pdrawfunc)(void);
edge_t edge_head;
edge_t edge_tail;
edge_t edge_aftertail;
edge_t edge_sentinel;
float fv;
static edge_t edge_head;
static edge_t edge_tail;
static edge_t edge_aftertail;
static edge_t edge_sentinel;
static float fv;
static int miplevel;
float scale_for_mip;
int ubasestep, errorterm, erroradjustup, erroradjustdown;
// FIXME: should go away
extern void R_RotateBmodel (void);
extern void R_TransformFrustum (void);
void R_GenerateSpans (void);
void R_GenerateSpansBackward (void);
static void R_GenerateSpans (void);
static void R_GenerateSpansBackward (void);
void R_LeadingEdge (edge_t *edge);
void R_LeadingEdgeBackwards (edge_t *edge);
void R_TrailingEdge (surf_t *surf, edge_t *edge);
static void R_LeadingEdge (edge_t *edge);
static void R_LeadingEdgeBackwards (edge_t *edge);
static void R_TrailingEdge (surf_t *surf, edge_t *edge);
/*
===============================================================================
@ -130,7 +128,8 @@ sentinel at the end (actually, this is the active edge table starting at
edge_head.next).
==============
*/
void R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
static void
R_InsertNewEdges (edge_t *edgestoadd, edge_t *edgelist)
{
edge_t *next_edge;
@ -166,7 +165,7 @@ addedge:
R_RemoveEdges
==============
*/
void R_RemoveEdges (edge_t *pedge)
static void R_RemoveEdges (edge_t *pedge)
{
do
@ -181,7 +180,8 @@ void R_RemoveEdges (edge_t *pedge)
R_StepActiveU
==============
*/
void R_StepActiveU (edge_t *pedge)
static void
R_StepActiveU (edge_t *pedge)
{
edge_t *pnext_edge, *pwedge;
@ -235,7 +235,8 @@ void R_StepActiveU (edge_t *pedge)
R_CleanupSpan
==============
*/
void R_CleanupSpan (void)
static void
R_CleanupSpan (void)
{
surf_t *surf;
shift20_t iu;
@ -269,7 +270,8 @@ void R_CleanupSpan (void)
R_LeadingEdgeBackwards
==============
*/
void R_LeadingEdgeBackwards (edge_t *edge)
static void
R_LeadingEdgeBackwards (edge_t *edge)
{
espan_t *span;
surf_t *surf, *surf2;
@ -348,7 +350,8 @@ gotposition:
R_TrailingEdge
==============
*/
void R_TrailingEdge (surf_t *surf, edge_t *edge)
static void
R_TrailingEdge (surf_t *surf, edge_t *edge)
{
espan_t *span;
@ -387,7 +390,8 @@ void R_TrailingEdge (surf_t *surf, edge_t *edge)
R_LeadingEdge
==============
*/
void R_LeadingEdge (edge_t *edge)
static void
R_LeadingEdge (edge_t *edge)
{
if (edge->surfs[1])
{
@ -511,7 +515,8 @@ gotposition:
R_GenerateSpans
==============
*/
void R_GenerateSpans (void)
static void
R_GenerateSpans (void)
{
edge_t *edge;
surf_t *surf;
@ -545,7 +550,8 @@ void R_GenerateSpans (void)
R_GenerateSpansBackward
==============
*/
void R_GenerateSpansBackward (void)
static void
R_GenerateSpansBackward (void)
{
edge_t *edge;
@ -566,6 +572,8 @@ void R_GenerateSpansBackward (void)
R_CleanupSpan ();
}
static void D_DrawSurfaces (void);
/*
==============
R_ScanEdges
@ -687,18 +695,19 @@ SURFACE FILLING
=========================================================================
*/
msurface_t *pface;
surfcache_t *pcurrentcache;
vec3_t transformed_modelorg;
vec3_t world_transformed_modelorg;
vec3_t local_modelorg;
static msurface_t *pface;
static surfcache_t *pcurrentcache;
static vec3_t transformed_modelorg;
static vec3_t world_transformed_modelorg;
static vec3_t local_modelorg;
/*
=============
D_MipLevelForScale
=============
*/
int D_MipLevelForScale (float scale)
static int
D_MipLevelForScale (float scale)
{
int lmiplevel;
@ -725,7 +734,8 @@ D_FlatFillSurface
Simple single color fill with no texture mapping
==============
*/
void D_FlatFillSurface (surf_t *surf, int color)
static void
D_FlatFillSurface (surf_t *surf, int color)
{
espan_t *span;
@ -748,7 +758,8 @@ void D_FlatFillSurface (surf_t *surf, int color)
D_CalcGradients
==============
*/
void D_CalcGradients (msurface_t *pface)
static void
D_CalcGradients (msurface_t *pface)
{
float mipscale;
vec3_t p_temp1;
@ -808,7 +819,8 @@ D_BackgroundSurf
The grey background filler seen when there is a hole in the map
==============
*/
void D_BackgroundSurf (surf_t *s)
static void
D_BackgroundSurf (surf_t *s)
{
// set up a gradient for the background surface that places it
// effectively at infinity distance from the viewpoint
@ -825,7 +837,8 @@ void D_BackgroundSurf (surf_t *s)
D_TurbulentSurf
=================
*/
void D_TurbulentSurf (surf_t *s)
static void
D_TurbulentSurf (surf_t *s)
{
d_zistepu = s->d_zistepu;
d_zistepv = s->d_zistepv;
@ -886,7 +899,8 @@ void D_TurbulentSurf (surf_t *s)
D_SkySurf
==============
*/
void D_SkySurf (surf_t *s)
static void
D_SkySurf (surf_t *s)
{
pface = s->msurf;
miplevel = 0;
@ -919,7 +933,8 @@ D_SolidSurf
Normal surface cached, texture mapped surface
==============
*/
void D_SolidSurf (surf_t *s)
static void
D_SolidSurf (surf_t *s)
{
d_zistepu = s->d_zistepu;
d_zistepv = s->d_zistepv;
@ -979,7 +994,8 @@ D_DrawflatSurfaces
To allow developers to see the polygon carving of the world
=============
*/
void D_DrawflatSurfaces (void)
static void
D_DrawflatSurfaces (void)
{
surf_t *s;
int color = 0;
@ -1010,7 +1026,8 @@ Rasterize all the span lists. Guaranteed zero overdraw.
May be called more than once a frame if the surf list overflows (higher res)
==============
*/
void D_DrawSurfaces (void)
static void
D_DrawSurfaces (void)
{
// currententity = NULL;
// &r_worldentity;

View file

@ -22,8 +22,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define MAX_RIMAGES 1024
image_t r_images[MAX_RIMAGES];
int numr_images;
static image_t r_images[MAX_RIMAGES];
static int numr_images;
/*
@ -72,7 +72,8 @@ void R_ImageList_f (void)
//=======================================================
image_t *R_FindFreeImage (void)
static image_t
*R_FindFreeImage (void)
{
image_t *image;
int i;
@ -100,7 +101,8 @@ R_LoadPic
================
*/
image_t *R_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type)
static image_t*
R_LoadPic (char *name, byte *pic, int width, int height, imagetype_t type)
{
image_t *image;
int i, c;
@ -136,7 +138,8 @@ image_t *R_LoadPic (char *name, byte *pic, int width, int height, imagetype_t ty
R_LoadWal
================
*/
image_t *R_LoadWal (char *name)
static image_t *
R_LoadWal (char *name)
{
miptex_t *mt;
int ofs;
@ -239,19 +242,6 @@ image_t *R_FindImage (char *name, imagetype_t type)
return image;
}
/*
===============
RE_RegisterSkin
===============
*/
struct image_s *RE_RegisterSkin (char *name)
{
return R_FindImage (name, it_skin);
}
/*
================
R_FreeUnusedImages

View file

@ -37,7 +37,8 @@ DYNAMIC LIGHTS
R_MarkLights
=============
*/
void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
static void
R_MarkLights (dlight_t *light, int bit, mnode_t *node)
{
mplane_t *splitplane;
float dist;
@ -113,11 +114,11 @@ LIGHT SAMPLING
=============================================================================
*/
vec3_t pointcolor;
mplane_t *lightplane; // used as shadow plane
vec3_t lightspot;
static vec3_t pointcolor;
static vec3_t lightspot;
int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
static int
RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
{
float front, back, frac;
qboolean side;
@ -164,7 +165,6 @@ int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
// check for impact on this node
VectorCopy (mid, lightspot);
lightplane = plane;
surf = r_worldmodel->surfaces + node->firstsurface;
for (i=0 ; i<node->numsurfaces ; i++, surf++)
@ -280,7 +280,8 @@ unsigned blocklights[1024]; // allow some very large lightmaps
R_AddDynamicLights
===============
*/
void R_AddDynamicLights (void)
static void
R_AddDynamicLights (void)
{
msurface_t *surf;
int lnum;

View file

@ -39,14 +39,12 @@ pixel_t *vid_alphamap = NULL;
refimport_t ri;
unsigned d_8to24table[256];
static unsigned d_8to24table[256];
entity_t r_worldentity;
char skyname[MAX_QPATH];
float skyrotate;
vec3_t skyaxis;
image_t *sky_images[6];
refdef_t r_newrefdef;
model_t *currentmodel;
@ -55,11 +53,9 @@ model_t *r_worldmodel;
pixel_t *r_warpbuffer;
swstate_t sw_state;
static swstate_t sw_state;
void *colormap;
vec3_t viewlightvec;
alight_t r_viewlighting = {128, 192, viewlightvec};
float r_time1;
int r_numallocatededges;
float r_aliasuvscale = 1.0;
@ -71,9 +67,9 @@ qboolean r_dowarp;
mvertex_t *r_pcurrentvertbase;
int c_surf;
int r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
qboolean r_surfsonstack;
int r_clipflags;
static int r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
static qboolean r_surfsonstack;
int r_clipflags;
//
// view origin
@ -87,7 +83,6 @@ vec3_t r_origin;
// screen size info
//
oldrefdef_t r_refdef;
float xcenter, ycenter;
float xscale, yscale;
float xscaleinv, yscaleinv;
float xscaleshrink, yscaleshrink;
@ -95,9 +90,6 @@ float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
int r_screenwidth;
float verticalFieldOfView;
float xOrigin, yOrigin;
mplane_t screenedge[4];
//
@ -105,15 +97,10 @@ mplane_t screenedge[4];
//
int r_framecount = 1; // so frame counts initialized to 0 don't match
int r_visframecount;
int d_spanpixcount;
int r_polycount;
int r_drawnpolycount;
int r_wholepolycount;
int *pfrustum_indexes[4];
int r_frustum_indexes[4*6];
mleaf_t *r_viewleaf;
int *pfrustum_indexes[4];
int r_viewcluster, r_oldviewcluster;
image_t *r_notexture_mip;
@ -121,43 +108,40 @@ image_t *r_notexture_mip;
float da_time1, da_time2, dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
float se_time1, se_time2, de_time1, de_time2;
void R_MarkLeaves (void);
cvar_t *r_lefthand;
cvar_t *sw_aliasstats;
cvar_t *sw_allow_modex;
static cvar_t *sw_aliasstats;
cvar_t *sw_clearcolor;
cvar_t *sw_drawflat;
cvar_t *sw_draworder;
cvar_t *sw_maxedges;
cvar_t *sw_maxsurfs;
cvar_t *r_mode;
cvar_t *sw_reportedgeout;
cvar_t *sw_reportsurfout;
static cvar_t *sw_maxedges;
static cvar_t *sw_maxsurfs;
static cvar_t *r_mode;
static cvar_t *sw_reportedgeout;
static cvar_t *sw_reportsurfout;
cvar_t *sw_stipplealpha;
cvar_t *sw_surfcacheoverride;
cvar_t *sw_waterwarp;
cvar_t *sw_overbrightbits;
static cvar_t *sw_overbrightbits;
cvar_t *r_drawworld;
cvar_t *r_drawentities;
cvar_t *r_dspeeds;
static cvar_t *r_drawentities;
static cvar_t *r_dspeeds;
cvar_t *r_fullbright;
cvar_t *r_lerpmodels;
cvar_t *r_novis;
static cvar_t *r_novis;
cvar_t *r_modulate;
cvar_t *r_vsync;
cvar_t *r_customwidth;
cvar_t *r_customheight;
static cvar_t *r_vsync;
static cvar_t *r_customwidth;
static cvar_t *r_customheight;
cvar_t *r_speeds;
static cvar_t *r_speeds;
cvar_t *r_lightlevel; //FIXME HACK
cvar_t *vid_fullscreen;
cvar_t *vid_gamma;
static cvar_t *vid_fullscreen;
static cvar_t *vid_gamma;
//PGM
cvar_t *r_lockpvs;
static cvar_t *r_lockpvs;
//PGM
#define STRINGER(x) "x"
@ -197,20 +181,26 @@ pixel_t *cacheblock;
int cachewidth;
pixel_t *d_viewbuffer;
zvalue_t *d_pzbuffer;
unsigned int d_zrowbytes;
unsigned int d_zwidth;
struct texture_buffer {
static struct texture_buffer {
image_t image;
byte buffer[1024];
} r_notexture_buffer;
static void Draw_GetPalette (void);
static void RE_BeginFrame( float camera_separation );
static void Draw_BuildGammaTable( void );
static void RE_EndFrame(void);
static void R_DrawBeam(entity_t *e);
/*
==================
R_InitTextures
==================
*/
void R_InitTextures (void)
static void
R_InitTextures (void)
{
int x,y, m;
@ -246,7 +236,8 @@ void R_InitTextures (void)
R_InitTurb
================
*/
void R_InitTurb (void)
static void
R_InitTurb (void)
{
int i;
@ -259,11 +250,12 @@ void R_InitTurb (void)
}
void R_ImageList_f( void );
static void R_ScreenShot_f( void );
void R_Register (void)
static void
R_Register (void)
{
sw_aliasstats = ri.Cvar_Get ("sw_polymodelstats", "0", 0);
sw_allow_modex = ri.Cvar_Get( "sw_allow_modex", "1", CVAR_ARCHIVE );
sw_clearcolor = ri.Cvar_Get ("sw_clearcolor", "2", 0);
sw_drawflat = ri.Cvar_Get ("sw_drawflat", "0", 0);
sw_draworder = ri.Cvar_Get ("sw_draworder", "0", 0);
@ -309,19 +301,24 @@ void R_Register (void)
//PGM
}
void R_UnRegister (void)
static void
R_UnRegister (void)
{
ri.Cmd_RemoveCommand( "screenshot" );
ri.Cmd_RemoveCommand ("modellist");
ri.Cmd_RemoveCommand( "imagelist" );
}
static int SWimp_Init(void);
static void SWimp_Shutdown(void );
/*
===============
R_Init
===============
*/
qboolean RE_Init(void)
static qboolean
RE_Init(void)
{
R_InitImages ();
Mod_Init ();
@ -358,7 +355,8 @@ qboolean RE_Init(void)
RE_Shutdown
===============
*/
void RE_Shutdown (void)
static void
RE_Shutdown (void)
{
// free z buffer
if (d_pzbuffer)
@ -449,7 +447,8 @@ Mark the leaves and nodes that are in the PVS for the current
cluster
===============
*/
void R_MarkLeaves (void)
static void
R_MarkLeaves (void)
{
byte *vis;
mnode_t *node;
@ -505,7 +504,8 @@ void R_MarkLeaves (void)
**
** IMPLEMENT THIS!
*/
void R_DrawNullModel( void )
static void
R_DrawNullModel( void )
{
}
@ -514,7 +514,8 @@ void R_DrawNullModel( void )
R_DrawEntitiesOnList
=============
*/
void R_DrawEntitiesOnList (void)
static void
R_DrawEntitiesOnList (void)
{
int i;
qboolean translucent_entities = false;
@ -620,7 +621,8 @@ void R_DrawEntitiesOnList (void)
R_BmodelCheckBBox
=============
*/
int R_BmodelCheckBBox (float *minmaxs)
static int
R_BmodelCheckBBox (float *minmaxs)
{
int i, clipflags;
@ -669,7 +671,8 @@ R_FindTopnode
Find the first node that splits the given box
===================
*/
mnode_t *R_FindTopnode (vec3_t mins, vec3_t maxs)
static mnode_t *
R_FindTopnode (vec3_t mins, vec3_t maxs)
{
mnode_t *node;
@ -713,7 +716,8 @@ RotatedBBox
Returns an axially aligned box that contains the input box at the given rotation
=============
*/
void RotatedBBox (vec3_t mins, vec3_t maxs, vec3_t angles, vec3_t tmins, vec3_t tmaxs)
static void
RotatedBBox (vec3_t mins, vec3_t maxs, vec3_t angles, vec3_t tmins, vec3_t tmaxs)
{
vec3_t tmp, v;
int i, j;
@ -771,7 +775,8 @@ void RotatedBBox (vec3_t mins, vec3_t maxs, vec3_t angles, vec3_t tmins, vec3_t
R_DrawBEntitiesOnList
=============
*/
void R_DrawBEntitiesOnList (void)
static void
R_DrawBEntitiesOnList (void)
{
int i, clipflags;
vec3_t oldorigin;
@ -850,15 +855,16 @@ void R_DrawBEntitiesOnList (void)
insubmodel = false;
}
edge_t *ledges;
surf_t *lsurfs;
static edge_t *ledges;
static surf_t *lsurfs;
/*
================
R_EdgeDrawing
================
*/
void R_EdgeDrawing (void)
static void
R_EdgeDrawing (void)
{
if ( r_newrefdef.rdflags & RDF_NOWORLDMODEL )
return;
@ -909,6 +915,7 @@ void R_EdgeDrawing (void)
//=======================================================================
static void R_GammaCorrectAndSetPalette(const unsigned char *pal);
/*
=============
@ -916,7 +923,8 @@ R_CalcPalette
=============
*/
void R_CalcPalette (void)
static void
R_CalcPalette (void)
{
static qboolean modified;
byte palette[256][4], *in, *out;
@ -966,7 +974,8 @@ void R_CalcPalette (void)
//=======================================================================
void R_SetLightLevel (void)
static void
R_SetLightLevel (void)
{
vec3_t light;
@ -988,7 +997,8 @@ RE_RenderFrame
================
*/
void RE_RenderFrame (refdef_t *fd)
static void
RE_RenderFrame (refdef_t *fd)
{
r_newrefdef = *fd;
@ -1062,7 +1072,8 @@ void RE_RenderFrame (refdef_t *fd)
/*
** R_InitGraphics
*/
void R_InitGraphics( int width, int height )
static void
R_InitGraphics( int width, int height )
{
vid.width = width;
vid.height = height;
@ -1089,13 +1100,14 @@ void R_InitGraphics( int width, int height )
R_GammaCorrectAndSetPalette((const unsigned char *)d_8to24table);
}
static rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen);
/*
** RE_BeginFrame
*/
void RE_BeginFrame( float camera_separation )
static void
RE_BeginFrame( float camera_separation )
{
extern void Draw_BuildGammaTable( void );
/*
** rebuild the gamma correction palette if necessary
*/
@ -1157,7 +1169,8 @@ void RE_BeginFrame( float camera_separation )
/*
** R_GammaCorrectAndSetPalette
*/
void R_GammaCorrectAndSetPalette( const unsigned char *palette )
static void
R_GammaCorrectAndSetPalette( const unsigned char *palette )
{
int i;
@ -1172,7 +1185,8 @@ void R_GammaCorrectAndSetPalette( const unsigned char *palette )
/*
** RE_SetPalette
*/
void RE_SetPalette(const unsigned char *palette)
static void
RE_SetPalette(const unsigned char *palette)
{
byte palette32[1024];
int i;
@ -1206,7 +1220,8 @@ void RE_SetPalette(const unsigned char *palette)
Draw_BuildGammaTable
================
*/
void Draw_BuildGammaTable (void)
static void
Draw_BuildGammaTable (void)
{
int i;
float g;
@ -1222,7 +1237,6 @@ void Draw_BuildGammaTable (void)
g = (2.1 - vid_gamma->value);
if (g == 1.0)
{
for (i=0 ; i<256 ; i++) {
@ -1255,7 +1269,8 @@ void Draw_BuildGammaTable (void)
/*
** R_DrawBeam
*/
void R_DrawBeam( entity_t *e )
static void
R_DrawBeam( entity_t *e )
{
#define NUM_BEAM_SEGS 6
@ -1312,15 +1327,16 @@ RE_SetSky
*/
// 3dstudio environment map names
char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
int r_skysideimage[6] = {5, 2, 4, 1, 0, 3};
static int r_skysideimage[6] = {5, 2, 4, 1, 0, 3};
extern mtexinfo_t r_skytexinfo[6];
void RE_SetSky (char *name, float rotate, vec3_t axis)
static void
RE_SetSky (char *name, float rotate, vec3_t axis)
{
int i;
char pathname[MAX_QPATH];
strncpy (skyname, name, sizeof(skyname)-1);
skyrotate = rotate;
VectorCopy (axis, skyaxis);
for (i=0 ; i<6 ; i++)
@ -1330,13 +1346,13 @@ void RE_SetSky (char *name, float rotate, vec3_t axis)
}
}
/*
===============
Draw_GetPalette
===============
*/
void Draw_GetPalette (void)
static void
Draw_GetPalette (void)
{
byte *pal, *out;
int i;
@ -1364,7 +1380,16 @@ void Draw_GetPalette (void)
free (pal);
}
struct image_s *RE_RegisterSkin (char *name);
/*
===============
RE_RegisterSkin
===============
*/
static struct image_s *
RE_RegisterSkin (char *name)
{
return R_FindImage (name, it_skin);
}
void R_Printf(int level, const char* msg, ...)
{
@ -1374,7 +1399,8 @@ void R_Printf(int level, const char* msg, ...)
va_end(argptr);
}
qboolean RE_IsVsyncActive(void)
static qboolean
RE_IsVsyncActive(void)
{
if (r_vsync->value)
{
@ -1450,7 +1476,8 @@ static qboolean X11_active = false;
** This routine is responsible for initializing the implementation
** specific stuff in a software rendering subsystem.
*/
int SWimp_Init(void)
static int
SWimp_Init(void)
{
if (!SDL_WasInit(SDL_INIT_VIDEO))
{
@ -1567,7 +1594,8 @@ SetSDLIcon()
}
#endif /* SDL 1.2 */
static int IsFullscreen()
static int
IsFullscreen()
{
#if SDL_VERSION_ATLEAST(2, 0, 0)
if (SDL_GetWindowFlags(window) & SDL_WINDOW_FULLSCREEN_DESKTOP) {
@ -1582,7 +1610,8 @@ static int IsFullscreen()
#endif
}
static qboolean GetWindowSize(int* w, int* h)
static qboolean
GetWindowSize(int* w, int* h)
{
if(window == NULL || w == NULL || h == NULL)
return false;
@ -1604,7 +1633,8 @@ static qboolean GetWindowSize(int* w, int* h)
return true;
}
int R_InitContext(void* win)
static int
R_InitContext(void* win)
{
char title[40] = {0};
@ -1804,7 +1834,8 @@ char shift_size;
** The necessary width and height parameters are grabbed from
** vid.width and vid.height.
*/
static qboolean SWimp_InitGraphics(qboolean fullscreen, int *pwidth, int *pheight)
static qboolean
SWimp_InitGraphics(qboolean fullscreen, int *pwidth, int *pheight)
{
int flags;
int curWidth, curHeight;
@ -1938,7 +1969,8 @@ static qboolean SWimp_InitGraphics(qboolean fullscreen, int *pwidth, int *pheigh
** on whether we're using DIB sections/GDI or DDRAW.
*/
void RE_EndFrame (void)
static void
RE_EndFrame (void)
{
int y,x, i;
const unsigned char *pallete = sw_state.currentpalette;
@ -1994,7 +2026,8 @@ void RE_EndFrame (void)
/*
** SWimp_SetMode
*/
rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen )
static rserr_t
SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen )
{
rserr_t retval = rserr_ok;
@ -2025,7 +2058,8 @@ rserr_t SWimp_SetMode(int *pwidth, int *pheight, int mode, qboolean fullscreen )
** DIBs or DDRAW surfaces as appropriate.
*/
void SWimp_Shutdown( void )
static void
SWimp_Shutdown( void )
{
SWimp_DestroyRender();
@ -2075,7 +2109,7 @@ SCREEN SHOTS
R_ScreenShot_f
==================
*/
void
static void
R_ScreenShot_f(void)
{
int x, y;

View file

@ -31,41 +31,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cvar_t *sw_mipcap;
cvar_t *sw_mipscale;
surfcache_t *d_initial_rover;
qboolean d_roverwrapped;
int d_minmip;
float d_scalemip[NUM_MIPS-1];
float verticalFieldOfView;
int d_minmip;
float d_scalemip[NUM_MIPS-1];
static mleaf_t *r_viewleaf;
static int r_frustum_indexes[4*6];
static float basemip[NUM_MIPS-1] = {1.0, 0.5*0.8, 0.25*0.8};
extern int d_aflatcolor;
int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
float xcenter, ycenter;
int d_pix_min, d_pix_max, d_pix_shift;
/*
================
D_Patch
================
*/
void D_Patch (void)
{
}
/*
================
D_ViewChanged
================
*/
unsigned char *alias_colormap;
void D_ViewChanged (void)
static void
D_ViewChanged (void)
{
scale_for_mip = xscale;
if (yscale > xscale)
scale_for_mip = yscale;
d_zrowbytes = vid.width * 2;
d_zwidth = vid.width;
d_pix_min = r_refdef.vrect.width / 320;
@ -91,10 +79,6 @@ void D_ViewChanged (void)
memset( d_pzbuffer, 0xff, vid.width * vid.height * sizeof(zvalue_t) );
RE_Draw_Fill( r_newrefdef.x, r_newrefdef.y, r_newrefdef.width, r_newrefdef.height,( int ) sw_clearcolor->value & 0xff );
}
alias_colormap = vid_colormap;
D_Patch ();
}
@ -194,28 +178,13 @@ void TransformVector (vec3_t in, vec3_t out)
out[2] = DotProduct(in,vpn);
}
/*
================
R_TransformPlane
================
*/
void R_TransformPlane (mplane_t *p, float *normal, float *dist)
{
float d;
d = DotProduct (r_origin, 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
===============
*/
void R_SetUpFrustumIndexes (void)
static void
R_SetUpFrustumIndexes (void)
{
int i, j, *pindex;
@ -251,9 +220,11 @@ Called every time the vid structure or r_refdef changes.
Guaranteed to be called before the first refresh
===============
*/
void R_ViewChanged (vrect_t *vr)
static void
R_ViewChanged (vrect_t *vr)
{
int i;
float xOrigin, yOrigin;
r_refdef.vrect = *vr;
@ -413,18 +384,13 @@ void R_SetupFrame (void)
// clear frame counts
c_faceclip = 0;
d_spanpixcount = 0;
r_polycount = 0;
r_drawnpolycount = 0;
r_wholepolycount = 0;
r_amodels_drawn = 0;
r_outofsurfaces = 0;
r_outofedges = 0;
// d_setup
d_roverwrapped = false;
d_initial_rover = sc_rover;
d_minmip = sw_mipcap->value;
if (d_minmip > 3)
d_minmip = 3;
@ -433,6 +399,4 @@ void R_SetupFrame (void)
for (i=0 ; i<(NUM_MIPS-1) ; i++)
d_scalemip[i] = basemip[i] * sw_mipscale->value;
d_aflatcolor = 0;
}

View file

@ -25,24 +25,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "header/local.h"
model_t *loadmodel;
char loadname[32]; // for hunk tags
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
void Mod_LoadBrushModel (model_t *mod, void *buffer);
void Mod_LoadAliasModel (model_t *mod, void *buffer);
model_t *Mod_LoadModel (model_t *mod, qboolean crash);
static void Mod_LoadSpriteModel (model_t *mod, void *buffer);
static void Mod_LoadBrushModel (model_t *mod, void *buffer);
static void Mod_LoadAliasModel (model_t *mod, void *buffer);
byte mod_novis[MAX_MAP_LEAFS/8];
static byte mod_novis[MAX_MAP_LEAFS/8];
#define MAX_MOD_KNOWN 256
model_t mod_known[MAX_MOD_KNOWN];
int mod_numknown;
static model_t mod_known[MAX_MOD_KNOWN];
static int mod_numknown;
// the inline * models from the current map are kept seperate
model_t mod_inline[MAX_MOD_KNOWN];
static model_t mod_inline[MAX_MOD_KNOWN];
int registration_sequence;
int modfilelen;
static int modfilelen;
//===============================================================================
@ -87,7 +85,8 @@ Mod_ForName
Loads in a model for the given name
==================
*/
model_t *Mod_ForName (char *name, qboolean crash)
static model_t *
Mod_ForName (char *name, qboolean crash)
{
model_t *mod;
unsigned *buf;
@ -217,7 +216,8 @@ mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
Mod_DecompressVis
===================
*/
byte *Mod_DecompressVis (byte *in, model_t *model)
static byte *
Mod_DecompressVis (byte *in, model_t *model)
{
static byte decompressed[MAX_MAP_LEAFS/8];
int c;
@ -290,7 +290,8 @@ Converts the 24 bit lighting down to 8 bit
by taking the brightest component
=================
*/
void Mod_LoadLighting (lump_t *l)
static void
Mod_LoadLighting (lump_t *l)
{
int i, size;
byte *in;
@ -315,9 +316,9 @@ void Mod_LoadLighting (lump_t *l)
}
int r_leaftovis[MAX_MAP_LEAFS];
int r_vistoleaf[MAX_MAP_LEAFS];
int r_numvisleafs;
static int r_leaftovis[MAX_MAP_LEAFS];
static int r_vistoleaf[MAX_MAP_LEAFS];
static int r_numvisleafs;
void R_NumberLeafs (mnode_t *node)
{
@ -346,7 +347,8 @@ void R_NumberLeafs (mnode_t *node)
Mod_LoadVisibility
=================
*/
void Mod_LoadVisibility (lump_t *l)
static void
Mod_LoadVisibility (lump_t *l)
{
int i;
@ -372,7 +374,8 @@ void Mod_LoadVisibility (lump_t *l)
Mod_LoadVertexes
=================
*/
void Mod_LoadVertexes (lump_t *l)
static void
Mod_LoadVertexes (lump_t *l)
{
dvertex_t *in;
mvertex_t *out;
@ -408,7 +411,8 @@ void Mod_LoadVertexes (lump_t *l)
Mod_LoadSubmodels
=================
*/
void Mod_LoadSubmodels (lump_t *l)
static void
Mod_LoadSubmodels (lump_t *l)
{
dmodel_t *in;
dmodel_t *out;
@ -442,7 +446,8 @@ void Mod_LoadSubmodels (lump_t *l)
Mod_LoadEdges
=================
*/
void Mod_LoadEdges (lump_t *l)
static void
Mod_LoadEdges (lump_t *l)
{
dedge_t *in;
medge_t *out;
@ -469,7 +474,8 @@ void Mod_LoadEdges (lump_t *l)
Mod_LoadTexinfo
=================
*/
void Mod_LoadTexinfo (lump_t *l)
static void
Mod_LoadTexinfo (lump_t *l)
{
texinfo_t *in;
mtexinfo_t *out, *step;
@ -549,7 +555,8 @@ CalcSurfaceExtents
Fills in s->texturemins[] and s->extents[]
================
*/
void CalcSurfaceExtents (msurface_t *s)
static void
CalcSurfaceExtents (msurface_t *s)
{
float mins[2], maxs[2], val;
int i;
@ -605,7 +612,8 @@ void CalcSurfaceExtents (msurface_t *s)
Mod_LoadFaces
=================
*/
void Mod_LoadFaces (lump_t *l)
static void
Mod_LoadFaces (lump_t *l)
{
dface_t *in;
msurface_t *out;
@ -696,7 +704,8 @@ void Mod_LoadFaces (lump_t *l)
Mod_SetParent
=================
*/
void Mod_SetParent (mnode_t *node, mnode_t *parent)
static void
Mod_SetParent (mnode_t *node, mnode_t *parent)
{
node->parent = parent;
if (node->contents != -1)
@ -710,7 +719,8 @@ void Mod_SetParent (mnode_t *node, mnode_t *parent)
Mod_LoadNodes
=================
*/
void Mod_LoadNodes (lump_t *l)
static void
Mod_LoadNodes (lump_t *l)
{
int i, count;
dnode_t *in;
@ -760,7 +770,8 @@ void Mod_LoadNodes (lump_t *l)
Mod_LoadLeafs
=================
*/
void Mod_LoadLeafs (lump_t *l)
static void
Mod_LoadLeafs (lump_t *l)
{
dleaf_t *in;
mleaf_t *out;
@ -799,7 +810,8 @@ void Mod_LoadLeafs (lump_t *l)
Mod_LoadMarksurfaces
=================
*/
void Mod_LoadMarksurfaces (lump_t *l)
static void
Mod_LoadMarksurfaces (lump_t *l)
{
int i, count;
short *in;
@ -829,7 +841,8 @@ void Mod_LoadMarksurfaces (lump_t *l)
Mod_LoadSurfedges
=================
*/
void Mod_LoadSurfedges (lump_t *l)
static void
Mod_LoadSurfedges (lump_t *l)
{
int i, count;
int *in, *out;
@ -852,7 +865,8 @@ void Mod_LoadSurfedges (lump_t *l)
Mod_LoadPlanes
=================
*/
void Mod_LoadPlanes (lump_t *l)
static void
Mod_LoadPlanes (lump_t *l)
{
int i;
mplane_t *out;
@ -892,7 +906,8 @@ void Mod_LoadPlanes (lump_t *l)
Mod_LoadBrushModel
=================
*/
void Mod_LoadBrushModel (model_t *mod, void *buffer)
static void
Mod_LoadBrushModel (model_t *mod, void *buffer)
{
int i;
dheader_t *header;
@ -971,7 +986,8 @@ ALIAS MODELS
Mod_LoadAliasModel
=================
*/
void Mod_LoadAliasModel (model_t *mod, void *buffer)
static void
Mod_LoadAliasModel (model_t *mod, void *buffer)
{
int i, j;
dmdl_t *pinmodel, *pheader;
@ -1096,7 +1112,8 @@ SPRITE MODELS
Mod_LoadSpriteModel
=================
*/
void Mod_LoadSpriteModel (model_t *mod, void *buffer)
static void
Mod_LoadSpriteModel (model_t *mod, void *buffer)
{
dsprite_t *sprin, *sprout;
int i;

View file

@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "header/local.h"
vec3_t r_pright, r_pup, r_ppn;
static vec3_t r_pright, r_pup, r_ppn;
#define PARTICLE_33 0
#define PARTICLE_66 1

View file

@ -34,7 +34,7 @@ typedef struct
unsigned u, v;
} spanletvars_t;
spanletvars_t s_spanletvars;
static spanletvars_t s_spanletvars;
static int r_polyblendcolor;
@ -46,7 +46,7 @@ extern int *r_turb_turb;
static int clip_current;
vec5_t r_clip_verts[2][MAXWORKINGVERTS+2];
emitpoint_t outverts[MAXWORKINGVERTS+3];
static emitpoint_t outverts[MAXWORKINGVERTS+3];
static int s_minindex, s_maxindex;
@ -55,7 +55,8 @@ static void R_DrawPoly(int iswater);
/*
** R_DrawSpanletOpaque
*/
void R_DrawSpanletOpaque( void )
static void
R_DrawSpanletOpaque( void )
{
do
{
@ -86,7 +87,8 @@ void R_DrawSpanletOpaque( void )
/*
** R_DrawSpanletTurbulentStipple33
*/
void R_DrawSpanletTurbulentStipple33( void )
static void
R_DrawSpanletTurbulentStipple33( void )
{
pixel_t *pdest = s_spanletvars.pdest;
zvalue_t *pz = s_spanletvars.pz;
@ -144,7 +146,8 @@ void R_DrawSpanletTurbulentStipple33( void )
/*
** R_DrawSpanletTurbulentStipple66
*/
void R_DrawSpanletTurbulentStipple66( void )
static void
R_DrawSpanletTurbulentStipple66( void )
{
unsigned btemp;
int sturb, tturb;
@ -231,7 +234,8 @@ void R_DrawSpanletTurbulentStipple66( void )
/*
** R_DrawSpanletTurbulentBlended
*/
void R_DrawSpanletTurbulentBlended66( void )
static void
R_DrawSpanletTurbulentBlended66( void )
{
do
{
@ -255,7 +259,8 @@ void R_DrawSpanletTurbulentBlended66( void )
} while ( --s_spanletvars.spancount > 0 );
}
void R_DrawSpanletTurbulentBlended33( void )
static void
R_DrawSpanletTurbulentBlended33( void )
{
do
{
@ -282,7 +287,8 @@ void R_DrawSpanletTurbulentBlended33( void )
/*
** R_DrawSpanlet33
*/
void R_DrawSpanlet33( void )
static void
R_DrawSpanlet33( void )
{
do
{
@ -310,7 +316,8 @@ void R_DrawSpanlet33( void )
} while (--s_spanletvars.spancount > 0);
}
void R_DrawSpanletConstant33( void )
static void
R_DrawSpanletConstant33( void )
{
do
{
@ -328,7 +335,8 @@ void R_DrawSpanletConstant33( void )
/*
** R_DrawSpanlet66
*/
void R_DrawSpanlet66( void )
static void
R_DrawSpanlet66( void )
{
do
{
@ -359,7 +367,8 @@ void R_DrawSpanlet66( void )
/*
** R_DrawSpanlet33Stipple
*/
void R_DrawSpanlet33Stipple( void )
static void
R_DrawSpanlet33Stipple( void )
{
pixel_t *pdest = s_spanletvars.pdest;
zvalue_t *pz = s_spanletvars.pz;
@ -418,7 +427,8 @@ void R_DrawSpanlet33Stipple( void )
/*
** R_DrawSpanlet66Stipple
*/
void R_DrawSpanlet66Stipple( void )
static void
R_DrawSpanlet66Stipple( void )
{
unsigned btemp;
pixel_t *pdest = s_spanletvars.pdest;
@ -505,7 +515,8 @@ void R_DrawSpanlet66Stipple( void )
** Clips the winding at clip_verts[clip_current] and changes clip_current
** Throws out the back side
*/
int R_ClipPolyFace (int nump, clipplane_t *pclipplane)
static int
R_ClipPolyFace (int nump, clipplane_t *pclipplane)
{
int i, outcount;
float dists[MAXWORKINGVERTS+3];
@ -581,7 +592,8 @@ int R_ClipPolyFace (int nump, clipplane_t *pclipplane)
** R_PolygonDrawSpans
*/
// PGM - iswater was qboolean. changed to allow passing more flags
void R_PolygonDrawSpans(espan_t *pspan, int iswater )
static void
R_PolygonDrawSpans(espan_t *pspan, int iswater )
{
int count;
int snext, tnext;
@ -747,7 +759,8 @@ void R_PolygonDrawSpans(espan_t *pspan, int iswater )
** Goes through the polygon and scans the left edge, filling in
** screen coordinate data for the spans
*/
void R_PolygonScanLeftEdge (espan_t *s_polygon_spans)
static void
R_PolygonScanLeftEdge (espan_t *s_polygon_spans)
{
int i, v, itop, ibottom, lmaxindex;
emitpoint_t *pvert, *pnext;
@ -812,7 +825,8 @@ void R_PolygonScanLeftEdge (espan_t *s_polygon_spans)
** Goes through the polygon and scans the right edge, filling in
** count values.
*/
void R_PolygonScanRightEdge(espan_t *s_polygon_spans)
static void
R_PolygonScanRightEdge(espan_t *s_polygon_spans)
{
int i, v, itop, ibottom;
emitpoint_t *pvert, *pnext;
@ -1007,7 +1021,8 @@ void R_ClipAndDrawPoly ( float alpha, int isturbulent, qboolean textured )
/*
** R_BuildPolygonFromSurface
*/
void R_BuildPolygonFromSurface(msurface_t *fa)
static void
R_BuildPolygonFromSurface(msurface_t *fa)
{
int i, lnumverts;
medge_t *pedges, *r_pedge;
@ -1092,7 +1107,8 @@ void R_BuildPolygonFromSurface(msurface_t *fa)
/*
** R_PolygonCalculateGradients
*/
void R_PolygonCalculateGradients (void)
static void
R_PolygonCalculateGradients (void)
{
vec3_t p_normal, p_saxis, p_taxis;
float distinv;

View file

@ -38,15 +38,15 @@ typedef struct {
aliastriangleparms_t aliastriangleparms;
int r_p0[6], r_p1[6], r_p2[6];
static int ubasestep, errorterm, erroradjustup, erroradjustdown;
byte *d_pcolormap;
int d_aflatcolor;
int d_xdenom;
static int r_p0[6], r_p1[6], r_p2[6];
edgetable *pedgetable;
static int d_xdenom;
edgetable edgetables[12] = {
static edgetable *pedgetable;
static edgetable edgetables[12] = {
{0, 1, r_p0, r_p2, NULL, 2, r_p0, r_p1, r_p2},
{0, 2, r_p1, r_p0, r_p2, 1, r_p1, r_p2, NULL},
{1, 1, r_p0, r_p2, NULL, 1, r_p1, r_p2, NULL},
@ -62,10 +62,10 @@ edgetable edgetables[12] = {
};
// FIXME: some of these can become statics
int a_sstepxfrac, a_tstepxfrac, r_lstepx, a_ststepxwhole;
int r_sstepx, r_tstepx, r_lstepy, r_sstepy, r_tstepy;
int r_zistepx, r_zistepy;
int d_aspancount, d_countextrastep;
static int a_sstepxfrac, a_tstepxfrac, r_lstepx, a_ststepxwhole;
static int r_sstepx, r_tstepx, r_lstepy, r_sstepy, r_tstepy;
static int r_zistepx, r_zistepy;
static int d_aspancount, d_countextrastep;
static spanpackage_t *a_spans;
static spanpackage_t *d_pedgespanpackage;
@ -73,15 +73,15 @@ static spanpackage_t *d_pedgespanpackage;
spanpackage_t *triangle_spans;
static int ystart;
pixel_t *d_pdest, *d_ptex;
zvalue_t *d_pz;
int d_sfrac, d_tfrac, d_light, d_zi;
int d_ptexextrastep, d_sfracextrastep;
int d_tfracextrastep, d_lightextrastep, d_pdestextrastep;
int d_lightbasestep, d_pdestbasestep, d_ptexbasestep;
int d_sfracbasestep, d_tfracbasestep;
int d_ziextrastep, d_zibasestep;
int d_pzextrastep, d_pzbasestep;
static pixel_t *d_pdest, *d_ptex;
static zvalue_t *d_pz;
static int d_sfrac, d_tfrac, d_light, d_zi;
static int d_ptexextrastep, d_sfracextrastep;
static int d_tfracextrastep, d_lightextrastep, d_pdestextrastep;
static int d_lightbasestep, d_pdestbasestep, d_ptexbasestep;
static int d_sfracbasestep, d_tfracbasestep;
static int d_ziextrastep, d_zibasestep;
static int d_pzextrastep, d_pzbasestep;
typedef struct {
int quotient;
@ -92,9 +92,9 @@ static adivtab_t adivtab[32*32] = {
#include "../constants/adivtab.h"
};
byte *skintable[MAX_LBM_HEIGHT];
static byte *skintable[MAX_LBM_HEIGHT];
int skinwidth;
byte *skinstart;
static byte *skinstart;
void (*d_pdrawspans)(spanpackage_t *pspanpackage);
@ -102,18 +102,14 @@ void R_PolysetDrawSpans8_33 (spanpackage_t *pspanpackage);
void R_PolysetDrawSpans8_66 (spanpackage_t *pspanpackage);
void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage);
void R_PolysetDrawThreshSpans8 (spanpackage_t *pspanpackage);
void R_PolysetCalcGradients (int skinwidth);
void R_DrawNonSubdiv (void);
void R_PolysetSetEdgeTable (void);
void R_RasterizeAliasPolySmooth (void);
void R_PolysetScanLeftEdge(int height);
void R_PolysetScanLeftEdge_C(int height);
static void R_PolysetCalcGradients (int skinwidth);
static void R_PolysetSetEdgeTable (void);
static void R_RasterizeAliasPolySmooth (void);
static void R_PolysetScanLeftEdge_C(int height);
// ======================
// PGM
// 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
byte iractive = 0;
byte irtable[256] = { 79, 78, 77, 76, 75, 74, 73, 72, // black/white
71, 70, 69, 68, 67, 66, 65, 64,
64, 65, 66, 67, 68, 69, 70, 71, // dark taupe
@ -243,7 +239,7 @@ void R_DrawTriangle( void )
R_PolysetScanLeftEdge_C
====================
*/
void R_PolysetScanLeftEdge_C(int height)
static void R_PolysetScanLeftEdge_C(int height)
{
do
{
@ -313,7 +309,8 @@ quotient must fit in 32 bits.
FIXME: GET RID OF THIS! (FloorDivMod)
====================
*/
void FloorDivMod (float numer, float denom, int *quotient,
static void
FloorDivMod (float numer, float denom, int *quotient,
int *rem)
{
int q, r;
@ -351,7 +348,8 @@ void FloorDivMod (float numer, float denom, int *quotient,
R_PolysetSetUpForLineScan
====================
*/
void R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
static void
R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
fixed8_t endvertu, fixed8_t endvertv)
{
int tm, tn;
@ -392,7 +390,7 @@ void R_PolysetSetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
R_PolysetCalcGradients
================
*/
void R_PolysetCalcGradients (int skinwidth)
static void R_PolysetCalcGradients (int skinwidth)
{
float xstepdenominv, ystepdenominv, t0, t1;
float p01_minus_p21, p11_minus_p21, p00_minus_p20, p10_minus_p20;
@ -445,72 +443,6 @@ void R_PolysetCalcGradients (int skinwidth)
a_ststepxwhole = skinwidth * (r_tstepx >> 16) + (r_sstepx >> 16);
}
/*
================
R_PolysetDrawThreshSpans8
Random fizzle fade rasterizer
================
*/
void R_PolysetDrawThreshSpans8 (spanpackage_t *pspanpackage)
{
byte *lpdest;
byte *lptex;
int lsfrac, ltfrac;
int llight;
int lzi;
zvalue_t *lpz;
do
{
int lcount;
lcount = d_aspancount - pspanpackage->count;
errorterm += erroradjustup;
if (errorterm >= 0)
{
d_aspancount += d_countextrastep;
errorterm -= erroradjustdown;
}
else
{
d_aspancount += ubasestep;
}
if (lcount)
{
lpdest = pspanpackage->pdest;
lptex = pspanpackage->ptex;
lpz = pspanpackage->pz;
lsfrac = pspanpackage->sfrac;
ltfrac = pspanpackage->tfrac;
llight = pspanpackage->light;
lzi = pspanpackage->zi;
do
{
lpdest++;
lzi += r_zistepx;
lpz++;
llight += r_lstepx;
lptex += a_ststepxwhole;
lsfrac += a_sstepxfrac;
lptex += lsfrac >> 16;
lsfrac &= 0xFFFF;
ltfrac += a_tstepxfrac;
if (ltfrac & 0x10000)
{
lptex += r_affinetridesc.skinwidth;
ltfrac &= 0xFFFF;
}
} while (--lcount);
}
pspanpackage++;
} while (pspanpackage->count != -999999);
}
/*
================
@ -807,48 +739,13 @@ void R_PolysetDrawSpans8_Opaque (spanpackage_t *pspanpackage)
} while (pspanpackage->count != -999999);
}
/*
================
R_PolysetFillSpans8
================
*/
void R_PolysetFillSpans8 (spanpackage_t *pspanpackage)
{
int color;
// FIXME: do z buffering
color = d_aflatcolor++;
while (1)
{
int lcount;
lcount = pspanpackage->count;
if (lcount == -1)
return;
if (lcount)
{
byte *lpdest;
lpdest = pspanpackage->pdest;
do
{
*lpdest++ = color;
} while (--lcount);
}
pspanpackage++;
}
}
/*
================
R_RasterizeAliasPolySmooth
================
*/
void R_RasterizeAliasPolySmooth (void)
static void
R_RasterizeAliasPolySmooth (void)
{
int initialleftheight, initialrightheight;
int *plefttop, *prighttop, *pleftbottom, *prightbottom;
@ -1086,7 +983,8 @@ void R_RasterizeAliasPolySmooth (void)
R_PolysetSetEdgeTable
================
*/
void R_PolysetSetEdgeTable (void)
static void
R_PolysetSetEdgeTable (void)
{
int edgetableindex;

View file

@ -29,53 +29,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define FULLY_CLIPPED_CACHED 0x80000000
#define FRAMECOUNT_MASK 0x7FFFFFFF
unsigned int cacheoffset;
static unsigned int cacheoffset;
int c_faceclip; // number of faces clipped
clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16];
medge_t *r_pedge;
qboolean r_leftclipped, r_rightclipped;
static qboolean r_leftclipped, r_rightclipped;
static qboolean makeleftedge, makerightedge;
qboolean r_nearzionly;
static qboolean r_nearzionly;
int *sintable;
int *intsintable;
int *blanktable; // PGM
mvertex_t r_leftenter, r_leftexit;
mvertex_t r_rightenter, r_rightexit;
static mvertex_t r_leftenter, r_leftexit;
static mvertex_t r_rightenter, r_rightexit;
int r_emitted;
float r_nearzi;
float r_u1, r_v1, r_lzi1;
int r_ceilv1;
static int r_emitted;
static float r_nearzi;
static float r_u1, r_v1, r_lzi1;
static int r_ceilv1;
qboolean r_lastvertvalid;
int r_skyframe;
static qboolean r_lastvertvalid;
static int r_skyframe;
msurface_t *r_skyfaces;
mplane_t r_skyplanes[6];
static msurface_t *r_skyfaces;
static mplane_t r_skyplanes[6];
mtexinfo_t r_skytexinfo[6];
mvertex_t *r_skyverts;
medge_t *r_skyedges;
int *r_skysurfedges;
static mvertex_t *r_skyverts;
static medge_t *r_skyedges;
static int *r_skysurfedges;
// I just copied this data from a box map...
int skybox_planes[12] = {2,-128, 0,-128, 2,128, 1,128, 0,128, 1,-128};
static int skybox_planes[12] = {2,-128, 0,-128, 2,128, 1,128, 0,128, 1,-128};
int box_surfedges[24] = { 1,2,3,4, -1,5,6,7, 8,9,-6,10, -2,-7,-9,11,
static int box_surfedges[24] = { 1,2,3,4, -1,5,6,7, 8,9,-6,10, -2,-7,-9,11,
12,-3,-11,-8, -12,-10,-5,-4};
int box_edges[24] = { 1,2, 2,3, 3,4, 4,1, 1,5, 5,6, 6,2, 7,8, 8,6, 5,7, 8,3, 7,4};
static int box_edges[24] = { 1,2, 2,3, 3,4, 4,1, 1,5, 5,6, 6,2, 7,8, 8,6, 5,7, 8,3, 7,4};
int box_faces[6] = {0,0,2,2,2,0};
static int box_faces[6] = {0,0,2,2,2,0};
vec3_t box_vecs[6][2] = {
static vec3_t box_vecs[6][2] = {
{ {0,-1,0}, {-1,0,0} },
{ {0,1,0}, {0,0,-1} },
{ {0,-1,0}, {1,0,0} },
@ -84,7 +81,7 @@ vec3_t box_vecs[6][2] = {
{ {-1,0,0}, {0,0,-1} }
};
float box_verts[8][3] = {
static float box_verts[8][3] = {
{-1,-1,-1},
{-1,1,-1},
{1,1,-1},
@ -161,7 +158,8 @@ void R_InitSkyBox (void)
R_EmitSkyBox
================
*/
void R_EmitSkyBox (void)
static void
R_EmitSkyBox (void)
{
int i, j;
int oldkey;
@ -207,7 +205,8 @@ void R_EmitSkyBox (void)
R_EmitEdge
================
*/
void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
static void
R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
{
edge_t *edge, *pcheck;
int u_check;
@ -386,7 +385,8 @@ void R_EmitEdge (mvertex_t *pv0, mvertex_t *pv1)
R_ClipEdge
================
*/
void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
static void
R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
{
if (clip)
{
@ -486,7 +486,8 @@ void R_ClipEdge (mvertex_t *pv0, mvertex_t *pv1, clipplane_t *clip)
R_EmitCachedEdge
================
*/
void R_EmitCachedEdge (void)
static void
R_EmitCachedEdge (void)
{
edge_t *pedge_t;

View file

@ -23,16 +23,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "header/local.h"
pixel_t *r_turb_pbase, *r_turb_pdest;
int r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
static pixel_t *r_turb_pbase, *r_turb_pdest;
static int r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
int *r_turb_turb;
int r_turb_spancount;
static int r_turb_spancount;
void D_DrawTurbulent8Span (void);
static void D_DrawTurbulent8Span (void);
byte **warp_rowptr;
int *warp_column;
espan_t *edge_basespans;
int *warp_column;
/*
=============
@ -99,7 +98,7 @@ void D_WarpScreen (void)
D_DrawTurbulent8Span
=============
*/
void D_DrawTurbulent8Span (void)
static void D_DrawTurbulent8Span (void)
{
do
{

View file

@ -22,11 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern polydesc_t r_polydesc;
void R_BuildPolygonFromSurface(msurface_t *fa);
void R_PolygonCalculateGradients (void);
extern void R_PolyChooseSpanletRoutine( float alpha, qboolean isturbulent );
extern vec5_t r_clip_verts[2][MAXWORKINGVERTS+2];
extern void R_ClipAndDrawPoly( float alpha, qboolean isturbulent, qboolean textured );

View file

@ -21,25 +21,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "header/local.h"
drawsurf_t r_drawsurf;
drawsurf_t r_drawsurf;
static int lightleft, blocksize, sourcetstep;
static int lightright, lightleftstep, lightrightstep, blockdivshift;
static void *prowdestbase;
static unsigned char *pbasesource;
static int surfrowbytes; // used by ASM files
static int r_stepback;
static int r_lightwidth;
static int r_numhblocks, r_numvblocks;
static unsigned char *r_source, *r_sourcemax;
static unsigned *r_lightptr;
int lightleft, sourcesstep, blocksize, sourcetstep;
int lightdelta, lightdeltastep;
int lightright, lightleftstep, lightrightstep, blockdivshift;
unsigned blockdivmask;
void *prowdestbase;
unsigned char *pbasesource;
int surfrowbytes; // used by ASM files
unsigned *r_lightptr;
int r_stepback;
int r_lightwidth;
int r_numhblocks, r_numvblocks;
unsigned char *r_source, *r_sourcemax;
void R_DrawSurfaceBlock8_mip0 (void);
void R_DrawSurfaceBlock8_mip1 (void);
void R_DrawSurfaceBlock8_mip2 (void);
void R_DrawSurfaceBlock8_mip3 (void);
static void R_DrawSurfaceBlock8_mip0 (void);
static void R_DrawSurfaceBlock8_mip1 (void);
static void R_DrawSurfaceBlock8_mip2 (void);
static void R_DrawSurfaceBlock8_mip3 (void);
static void (*surfmiptable[4])(void) = {
R_DrawSurfaceBlock8_mip0,
@ -51,11 +49,11 @@ static void (*surfmiptable[4])(void) = {
void R_BuildLightMap (void);
extern unsigned blocklights[1024]; // allow some very large lightmaps
float surfscale;
qboolean r_cache_thrash; // set if surface cache is thrashing
static float surfscale;
int sc_size;
surfcache_t *sc_rover, *sc_base;
static int sc_size;
static surfcache_t *sc_rover;
surfcache_t *sc_base;
/*
===============
@ -64,7 +62,7 @@ R_TextureAnimation
Returns the proper texture for a given time and base texture
===============
*/
image_t *R_TextureAnimation (mtexinfo_t *tex)
static image_t *R_TextureAnimation (mtexinfo_t *tex)
{
int c;
@ -87,7 +85,7 @@ image_t *R_TextureAnimation (mtexinfo_t *tex)
R_DrawSurface
===============
*/
void R_DrawSurface (void)
static void R_DrawSurface (void)
{
unsigned char *basetptr;
int smax, tmax, twidth;
@ -111,7 +109,6 @@ void R_DrawSurface (void)
blocksize = 16 >> r_drawsurf.surfmip;
blockdivshift = 4 - r_drawsurf.surfmip;
blockdivmask = (1 << blockdivshift) - 1;
r_lightwidth = (r_drawsurf.surf->extents[0]>>4)+1;
@ -168,7 +165,7 @@ void R_DrawSurface (void)
R_DrawSurfaceBlock8_mip0
================
*/
void R_DrawSurfaceBlock8_mip0 (void)
static void R_DrawSurfaceBlock8_mip0 (void)
{
int v, i, b, lightstep, lighttemp, light;
unsigned char pix, *psource, *prowdest;
@ -218,7 +215,7 @@ void R_DrawSurfaceBlock8_mip0 (void)
R_DrawSurfaceBlock8_mip1
================
*/
void R_DrawSurfaceBlock8_mip1 (void)
static void R_DrawSurfaceBlock8_mip1 (void)
{
int v, i, b, lightstep, lighttemp, light;
unsigned char pix, *psource, *prowdest;
@ -268,7 +265,7 @@ void R_DrawSurfaceBlock8_mip1 (void)
R_DrawSurfaceBlock8_mip2
================
*/
void R_DrawSurfaceBlock8_mip2 (void)
static void R_DrawSurfaceBlock8_mip2 (void)
{
int v, i, b, lightstep, lighttemp, light;
unsigned char pix, *psource, *prowdest;
@ -318,7 +315,7 @@ void R_DrawSurfaceBlock8_mip2 (void)
R_DrawSurfaceBlock8_mip3
================
*/
void R_DrawSurfaceBlock8_mip3 (void)
static void R_DrawSurfaceBlock8_mip3 (void)
{
int v, i, b, lightstep, lighttemp, light;
unsigned char pix, *psource, *prowdest;
@ -435,10 +432,9 @@ void D_FlushCaches (void)
D_SCAlloc
=================
*/
surfcache_t *D_SCAlloc (int width, int size)
static surfcache_t *D_SCAlloc (int width, int size)
{
surfcache_t *new;
qboolean wrapped_this_time;
if ((width < 0) || (width > 256))
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: bad cache width %d\n", width);
@ -453,14 +449,8 @@ surfcache_t *D_SCAlloc (int width, int size)
ri.Sys_Error (ERR_FATAL,"D_SCAlloc: %i > cache size of %i",size, sc_size);
// if there is not size bytes after the rover, reset to the start
wrapped_this_time = false;
if ( !sc_rover || (byte *)sc_rover - (byte *)sc_base > sc_size - size)
{
if (sc_rover)
{
wrapped_this_time = true;
}
sc_rover = sc_base;
}
@ -503,49 +493,11 @@ surfcache_t *D_SCAlloc (int width, int size)
new->owner = NULL; // should be set properly after return
if (d_roverwrapped)
{
if (wrapped_this_time || (sc_rover >= d_initial_rover))
r_cache_thrash = true;
}
else if (wrapped_this_time)
{
d_roverwrapped = true;
}
return new;
}
//=============================================================================
// 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;
}
//=============================================================================
/*
================
D_CacheSurface