Cleanup global symbols for the sw and sw32 renderers.

Names not mangled, but those symbols that could be made static have been.
Also, many dead variables have been removed.
This commit is contained in:
Bill Currie 2012-02-18 14:34:14 +09:00
parent ef37ed39a9
commit 72fb96245f
35 changed files with 120 additions and 213 deletions

View file

@ -133,8 +133,6 @@ typedef struct
// REFRESH ====================================================================
extern int reinit_surfcache;
extern refdef_t r_refdef;
extern vec3_t r_origin, vpn, vright, vup;

View file

@ -151,7 +151,6 @@ typedef struct
} zpointdesc_t;
extern struct cvar_s *r_drawflat;
extern int d_spanpixcount;
extern int r_framecount; // sequence # of current frame since Quake
// started
extern qboolean r_drawpolys; // 1 if driver wants clipped polygons
@ -168,15 +167,12 @@ extern qboolean r_recursiveaffinetriangles; // true if a driver wants to use
// a certain distance (normally
// used only by the software
// driver)
extern float r_aliasuvscale; // scale-up factor for screen u and v
// on Alias vertices passed to driver
extern int r_pixbytes;
extern qboolean r_dowarp;
extern affinetridesc_t r_affinetridesc;
extern spritedesc_t r_spritedesc;
extern zpointdesc_t r_zpointdesc;
extern polydesc_t r_polydesc;
extern int d_con_indirect; // if 0, Quake will draw console directly
// to vid.buffer; if 1, Quake will
@ -216,7 +212,6 @@ void D_UpdateRects (vrect_t *prect);
void D_PolysetUpdateTables (void);
// these are currently for internal use only, and should not be used by drivers
extern int r_skydirect;
extern byte *r_skysource;
// transparency types for D_DrawRect ()
@ -267,10 +262,9 @@ void R_GenTile (msurface_t *psurf, void *pdest);
extern float d_zitable[65536];
extern float skyspeed, skyspeed2;
extern float skyspeed;
extern float skytime;
extern int d_aflatcolor;
extern int c_surf;
extern vrect_t scr_vrect;

View file

@ -85,7 +85,6 @@
.extern C(sourcesstep)
.extern C(lightleft)
.extern C(blockdivshift)
.extern C(blockdivmask)
.extern C(lightleftstep)
.extern C(r_origin)
.extern C(r_ppn)

View file

@ -59,7 +59,6 @@ extern struct cvar_s *r_dlight_lightmap;
extern struct cvar_s *r_drawentities;
extern struct cvar_s *r_drawexplosions;
extern struct cvar_s *r_drawflat;
extern struct cvar_s *r_draworder;
extern struct cvar_s *r_drawviewmodel;
extern struct cvar_s *r_dspeeds;
extern struct cvar_s *r_dynamic;

View file

@ -78,7 +78,6 @@ typedef struct {
//===========================================================================
extern struct cvar_s *r_draworder;
extern struct cvar_s *r_speeds;
extern struct cvar_s *r_timegraph;
extern struct cvar_s *r_graphheight;
@ -135,10 +134,6 @@ extern vec3_t r_origin;
extern vec3_t r_entorigin;
extern float screenAspect;
extern float verticalFieldOfView;
extern float xOrigin, yOrigin;
extern int r_visframecount;
//=============================================================================
@ -150,7 +145,6 @@ void R_ClearPolyList (void);
void R_DrawPolyList (void);
// Surface cache related ==========
extern int reinit_surfcache; // if 1, surface cache is currently empty
extern qboolean r_cache_thrash; // set if thrashing the surface cache
extern qboolean r_inhibit_viewmodel;
extern qboolean r_force_fullscreen;
@ -210,7 +204,6 @@ extern void R_RotateBmodel (void);
extern int c_faceclip;
extern int r_polycount;
extern int r_wholepolycount;
extern model_t *cl_worldmodel;
@ -219,9 +212,6 @@ extern int *pfrustum_indexes[4];
// !!! if this is changed, it must be changed in asm_draw.h too !!!
#define NEAR_CLIP 0.01
extern int ubasestep, errorterm, erroradjustup, erroradjustdown;
extern int vstartscan;
extern fixed16_t sadjust, tadjust;
extern fixed16_t bbextents, bbextentt;
@ -230,9 +220,6 @@ extern fixed16_t bbextents, bbextentt;
extern mvertex_t *r_ptverts, *r_ptvertsmax;
extern vec3_t sbaseaxis[3], tbaseaxis[3];
extern float entity_rotation[3][3];
extern int reinit_surfcache;
extern int r_currentkey;
extern int r_currentbkey;
@ -256,10 +243,7 @@ void R_ZDrawSubmodelPolys (model_t *clmodel);
extern int numverts;
extern int a_skinwidth;
extern mtriangle_t *ptriangles;
extern int numtriangles;
extern aliashdr_t *paliashdr;
extern mdl_t *pmdl;
extern float leftclip, topclip, rightclip, bottomclip;
extern int r_acliptype;
extern finalvert_t *pfinalverts;
@ -296,10 +280,6 @@ extern edge_t *removeedges[MAXHEIGHT];
extern int screenwidth;
// FIXME: make stack vars when debugging done
extern edge_t edge_head;
extern edge_t edge_tail;
extern edge_t edge_aftertail;
extern int r_bmodelactive;
extern vrect_t *pconupdate;
@ -318,15 +298,13 @@ extern float r_time1;
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 int r_maxsurfsseen, r_maxedgesseen;
extern qboolean r_dowarpold, r_viewchanged;
extern mleaf_t *r_viewleaf;
extern int r_clipflags;
extern int r_dlightframecount;
extern qboolean r_fov_greater_than_90;
extern struct entity_s *r_ent_queue;
struct dlight_s;

View file

@ -137,14 +137,12 @@ extern void TransformVector (const vec3_t in, vec3_t out);
extern void SetUpForLineScan(fixed8_t startvertu, fixed8_t startvertv,
fixed8_t endvertu, fixed8_t endvertv);
extern int r_skymade;
extern int r_skymade;
extern void R_MakeSky (void);
extern int gl_solidskytexture;
extern int gl_alphaskytexture;
extern int ubasestep, errorterm, erroradjustup, erroradjustdown;
extern double r_realtime;
extern double r_frametime;

View file

@ -40,7 +40,6 @@ static __attribute__ ((used)) const char rcsid[] =
static int miplevel;
float scale_for_mip;
int ubasestep, errorterm, erroradjustup, erroradjustdown, vstartscan;
vec3_t transformed_modelorg;

View file

@ -54,12 +54,9 @@ void (*d_drawspans) (espan_t *pspan);
void
D_Init (void)
{
r_skydirect = 1;
r_drawpolys = false;
r_worldpolysbacktofront = false;
r_recursiveaffinetriangles = true;
r_aliasuvscale = 1.0;
vid.surf_cache_size = D_SurfaceCacheForRes;
vid.flush_caches = D_FlushCaches;
@ -110,8 +107,6 @@ D_SetupFrame (void)
d_scalemip[i] = basemip[i] * d_mipscale->value;
d_drawspans = D_DrawSpans8;
d_aflatcolor = 0;
}
void

View file

@ -37,6 +37,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "d_local.h"
#include "r_local.h"
int ubasestep, errorterm, erroradjustup, erroradjustdown;
// TODO: put in span spilling to shrink list size
// !!! if this is changed, it must be changed in d_polysa.s too !!!
#define DPS_MAXSPANS MAXHEIGHT+1 // +1 for spanpackage marking end
@ -66,12 +68,11 @@ int r_p0[6], r_p1[6], r_p2[6];
byte *d_pcolormap;
int d_aflatcolor;
int d_xdenom;
edgetable *pedgetable;
static edgetable *pedgetable;
edgetable edgetables[12] = {
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},

View file

@ -43,8 +43,9 @@ static __attribute__ ((used)) const char rcsid[] =
float surfscale;
int sc_size;
surfcache_t *sc_rover, *sc_base;
static int sc_size;
surfcache_t *sc_rover;
static surfcache_t *sc_base;
#define GUARDSIZE 4

View file

@ -58,8 +58,8 @@ typedef struct {
static rectdesc_t r_rectdesc;
qpic_t *draw_disc;
qpic_t *draw_backtile;
static qpic_t *draw_disc;
static qpic_t *draw_backtile;
/* Support Routines */
@ -70,8 +70,8 @@ typedef struct cachepic_s {
} cachepic_t;
#define MAX_CACHED_PICS 128
cachepic_t cachepics[MAX_CACHED_PICS];
int numcachepics;
static cachepic_t cachepics[MAX_CACHED_PICS];
static int numcachepics;
#define CLIP(x,y,w,h,mw,mh) \
do { \

View file

@ -44,7 +44,6 @@ static __attribute__ ((used)) const char rcsid[] =
// avoid the need for inner-loop light
// clamping
mtriangle_t *ptriangles;
affinetridesc_t r_affinetridesc;
void *acolormap; // FIXME: should go away
@ -52,11 +51,11 @@ void *acolormap; // FIXME: should go away
trivertx_t *r_apverts;
// TODO: these probably will go away with optimized rasterization
mdl_t *pmdl;
static mdl_t *pmdl;
vec3_t r_plightvec;
int r_ambientlight;
float r_shadelight;
aliashdr_t *paliashdr;
static aliashdr_t *paliashdr;
finalvert_t *pfinalverts;
auxvert_t *pauxverts;
static float ziscale;

View file

@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] =
// current entity info
qboolean insubmodel;
vec3_t r_worldmodelorg;
float entity_rotation[3][3];
static float entity_rotation[3][3];
int r_currentbkey;

View file

@ -47,11 +47,9 @@ int c_faceclip; // number of faces clipped
zpointdesc_t r_zpointdesc;
polydesc_t r_polydesc;
static polydesc_t r_polydesc;
clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16];
medge_t *r_pedge;

View file

@ -61,7 +61,8 @@ surf_t *surfaces, *surface_p, *surf_max;
edge_t *newedges[MAXHEIGHT];
edge_t *removeedges[MAXHEIGHT];
espan_t *span_p, *max_span_p;
espan_t *span_p;
static espan_t *max_span_p;
int r_currentkey;
@ -72,10 +73,11 @@ int edge_head_u_shift20, edge_tail_u_shift20;
static void (*pdrawfunc) (void);
// FIXME: make stack vars when debugging done
edge_t edge_head;
edge_t edge_tail;
edge_t edge_aftertail;
edge_t edge_sentinel;
static edge_t edge_sentinel;
float fv;

View file

@ -62,8 +62,8 @@ static __attribute__ ((used)) const char rcsid[] =
#endif
void *colormap;
vec3_t viewlightvec;
alight_t r_viewlighting = { 128, 192, viewlightvec };
static vec3_t viewlightvec;
static alight_t r_viewlighting = { 128, 192, viewlightvec };
int r_numallocatededges;
qboolean r_drawpolys;
qboolean r_drawculledpolys;
@ -80,15 +80,14 @@ int numbtofpolys;
btofpoly_t *pbtofpolys;
int c_surf;
int r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
qboolean r_surfsonstack;
int r_maxsurfsseen, r_maxedgesseen;
static int r_cnumsurfs;
static qboolean r_surfsonstack;
int r_clipflags;
byte *r_warpbuffer;
byte *r_stack_start;
qboolean r_fov_greater_than_90;
static byte *r_stack_start;
// screen size info
float xcenter, ycenter;
@ -100,25 +99,19 @@ float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
int screenwidth;
float pixelAspect;
float screenAspect;
float verticalFieldOfView;
float xOrigin, yOrigin;
static float screenAspect;
static float verticalFieldOfView;
static float xOrigin, yOrigin;
plane_t screenedge[4];
// refresh flags
int d_spanpixcount;
int r_polycount;
int r_drawnpolycount;
int r_wholepolycount;
int *pfrustum_indexes[4];
int r_frustum_indexes[4 * 6];
int reinit_surfcache = 1; // if 1, surface cache is currently empty
// and must be reinitialized for current
// cache size
float r_aliastransition, r_resfudge;
float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
@ -337,11 +330,6 @@ R_ViewChanged (float aspect)
r_aliastransition = r_aliastransbase->value * res_scale;
r_resfudge = r_aliastransadj->value * res_scale;
if (scr_fov->value <= 90.0)
r_fov_greater_than_90 = false;
else
r_fov_greater_than_90 = true;
// TODO: collect 386-specific code in one place
#ifdef USE_INTEL_ASM
Sys_MakeCodeWriteable ((long) R_Surf8Start,

View file

@ -332,10 +332,8 @@ 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;

View file

@ -51,9 +51,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "r_dynamic.h"
#include "r_local.h"
int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
static int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
//static int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
static int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
void

View file

@ -36,17 +36,16 @@ static __attribute__ ((used)) const char rcsid[] =
#include "r_local.h"
int iskyspeed = 8;
int iskyspeed2 = 2;
float skyspeed, skyspeed2;
static int iskyspeed = 8;
static int iskyspeed2 = 2;
float skyspeed;
static float skyspeed2;
float skytime;
byte *r_skysource;
int r_skymade;
int r_skydirect; // not used?
// TODO: clean up these routines

View file

@ -38,24 +38,27 @@ static __attribute__ ((used)) const char rcsid[] =
drawsurf_t r_drawsurf;
int lightleft, sourcesstep, blocksize, sourcetstep;
int sourcesstep, sourcetstep;
static int blocksize;
int lightdelta, lightdeltastep;
int lightright, lightleftstep, lightrightstep, blockdivshift;
unsigned int blockdivmask;
static unsigned int blockdivmask;
void *prowdestbase;
unsigned char *pbasesource;
int surfrowbytes; // used by ASM files
unsigned int *r_lightptr;
int r_stepback;
int r_lightwidth;
int r_numhblocks, r_numvblocks;
unsigned char *r_source, *r_sourcemax;
static int r_numhblocks;
int r_numvblocks;
static unsigned char *r_source;
unsigned char *r_sourcemax;
static void (*surfmiptable[4]) (void) = {
R_DrawSurfaceBlock_mip0, R_DrawSurfaceBlock_mip1,
R_DrawSurfaceBlock_mip2, R_DrawSurfaceBlock_mip3};
unsigned int blocklights[34 * 34]; //FIXME make dynamic
static unsigned int blocklights[34 * 34]; //FIXME make dynamic
static void

View file

@ -41,7 +41,6 @@ static __attribute__ ((used)) const char rcsid[] =
static int miplevel;
float scale_for_mip;
int ubasestep, errorterm, erroradjustup, erroradjustdown, vstartscan;
vec3_t transformed_modelorg;

View file

@ -54,11 +54,8 @@ float d_zitable[65536];
void
D_Init (void)
{
r_skydirect = 1;
r_drawpolys = false;
r_worldpolysbacktofront = false;
r_aliasuvscale = 1.0;
// LordHavoc: compute 1/zi table for use in rendering code everywhere
if (!d_zitable[1]) {
@ -115,8 +112,6 @@ D_SetupFrame (void)
for (i = 0; i < (NUM_MIPS - 1); i++)
d_scalemip[i] = basemip[i] * d_mipscale->value;
d_aflatcolor = 0;
}
void

View file

@ -37,6 +37,8 @@ static __attribute__ ((used)) const char rcsid[] =
#include "d_local.h"
#include "r_local.h"
static int ubasestep, errorterm, erroradjustup, erroradjustdown;
// TODO: put in span spilling to shrink list size
// !!! if this is changed, it must be changed in d_polysa.s too !!!
#define DPS_MAXSPANS MAXHEIGHT+1 // +1 for spanpackage marking end
@ -62,16 +64,13 @@ typedef struct {
int *prightedgevert2;
} edgetable;
int r_p0[6], r_p1[6], r_p2[6];
static int r_p0[6], r_p1[6], r_p2[6];
byte *d_pcolormap;
static int d_xdenom;
int d_aflatcolor;
int d_xdenom;
static edgetable *pedgetable;
edgetable *pedgetable;
edgetable edgetables[12] = {
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},
@ -86,25 +85,23 @@ edgetable edgetables[12] = {
{0, 1, r_p0, r_p2, NULL, 1, r_p0, r_p1, NULL},
};
// FIXME: some of these can become statics
int a_sstepxfrac, a_tstepxfrac, a_ststepxwhole;
int r_sstepx, r_tstepx, r_lstepx, r_lstepy, r_sstepy, r_tstepy;
int r_zistepx, r_zistepy;
int d_aspancount, d_countextrastep;
static int r_sstepx, r_tstepx, r_lstepx, r_lstepy, r_sstepy, r_tstepy;
static int r_zistepx, r_zistepy;
static int d_aspancount, d_countextrastep;
spanpackage_t *a_spans;
spanpackage_t *d_pedgespanpackage;
static spanpackage_t *a_spans;
static spanpackage_t *d_pedgespanpackage;
static int ystart;
int d_pdest;
byte *d_ptex;
short *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 int d_pdest;
static byte *d_ptex;
static short *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;

View file

@ -39,11 +39,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "d_local.h"
#include "r_local.h"
byte *r_turb_pbase;
void *r_turb_pdest;
fixed16_t r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
int *r_turb_turb;
int r_turb_spancount;
static byte *r_turb_pbase;
static void *r_turb_pdest;
static fixed16_t r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
static int *r_turb_turb;
static int r_turb_spancount;
/*
D_WarpScreen

View file

@ -41,10 +41,11 @@ static __attribute__ ((used)) const char rcsid[] =
#include "d_local.h"
#include "r_local.h"
float surfscale;
static float surfscale;
int sc_size;
surfcache_t *sc_rover, *sc_base;
static int sc_size;
surfcache_t *sc_rover;
static surfcache_t *sc_base;
#define GUARDSIZE 4

View file

@ -58,8 +58,8 @@ typedef struct {
static rectdesc_t r_rectdesc;
qpic_t *draw_disc;
qpic_t *draw_backtile;
static qpic_t *draw_disc;
static qpic_t *draw_backtile;
/* Support Routines */
@ -70,8 +70,8 @@ typedef struct cachepic_s {
} cachepic_t;
#define MAX_CACHED_PICS 128
cachepic_t cachepics[MAX_CACHED_PICS];
int numcachepics;
static cachepic_t cachepics[MAX_CACHED_PICS];
static int numcachepics;
#define CLIP(x,y,w,h,mw,mh) \
do { \

View file

@ -45,7 +45,6 @@ static __attribute__ ((used)) const char rcsid[] =
// avoid the need for inner-loop light
// clamping
mtriangle_t *ptriangles;
affinetridesc_t r_affinetridesc;
void *acolormap; // FIXME: should go away
@ -53,11 +52,11 @@ void *acolormap; // FIXME: should go away
trivertx_t *r_apverts;
// TODO: these probably will go away with optimized rasterization
mdl_t *pmdl;
static mdl_t *pmdl;
vec3_t r_plightvec;
int r_ambientlight;
float r_shadelight;
aliashdr_t *paliashdr;
static aliashdr_t *paliashdr;
finalvert_t *pfinalverts;
auxvert_t *pauxverts;
static float ziscale;
@ -69,9 +68,9 @@ static maliasskindesc_t *pskindesc;
int r_amodels_drawn;
int a_skinwidth;
int r_anumverts;
static int r_anumverts;
float aliastransform[3][4];
static float aliastransform[3][4];
typedef struct {
int index0;

View file

@ -41,7 +41,7 @@ static __attribute__ ((used)) const char rcsid[] =
// current entity info
qboolean insubmodel;
vec3_t r_worldmodelorg;
float entity_rotation[3][3];
static float entity_rotation[3][3];
int r_currentbkey;

View file

@ -48,11 +48,9 @@ int c_faceclip; // number of faces clipped
zpointdesc_t r_zpointdesc;
polydesc_t r_polydesc;
static polydesc_t r_polydesc;
clipplane_t *entity_clipplanes;
clipplane_t view_clipplanes[4];
clipplane_t world_clipplanes[16];
medge_t *r_pedge;

View file

@ -61,23 +61,23 @@ surf_t *surfaces, *surface_p, *surf_max;
edge_t *newedges[MAXHEIGHT];
edge_t *removeedges[MAXHEIGHT];
espan_t *span_p, *max_span_p;
static espan_t *span_p, *max_span_p;
int r_currentkey;
int current_iv;
static int current_iv;
int edge_head_u_shift20, edge_tail_u_shift20;
static int 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;
static edge_t edge_head;
static edge_t edge_tail;
static edge_t edge_aftertail;
static edge_t edge_sentinel;
float fv;
static float fv;
static void
R_DrawCulledPolys (void)

View file

@ -57,8 +57,8 @@ static __attribute__ ((used)) const char rcsid[] =
//define PASSAGES
void *colormap;
vec3_t viewlightvec;
alight_t r_viewlighting = { 128, 192, viewlightvec };
static vec3_t viewlightvec;
static alight_t r_viewlighting = { 128, 192, viewlightvec };
int r_numallocatededges;
qboolean r_drawpolys;
qboolean r_drawculledpolys;
@ -74,15 +74,14 @@ int numbtofpolys;
btofpoly_t *pbtofpolys;
int c_surf;
int r_maxsurfsseen, r_maxedgesseen, r_cnumsurfs;
qboolean r_surfsonstack;
int r_maxsurfsseen, r_maxedgesseen;
static int r_cnumsurfs;
static qboolean r_surfsonstack;
int r_clipflags;
byte *r_warpbuffer;
byte *r_stack_start;
qboolean r_fov_greater_than_90;
static byte *r_stack_start;
// screen size info
float xcenter, ycenter;
@ -94,33 +93,24 @@ float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
int screenwidth;
float pixelAspect;
float screenAspect;
float verticalFieldOfView;
float xOrigin, yOrigin;
static float screenAspect;
static float verticalFieldOfView;
static float xOrigin, yOrigin;
plane_t screenedge[4];
// refresh flags
int d_spanpixcount;
int r_polycount;
int r_drawnpolycount;
int r_wholepolycount;
int *pfrustum_indexes[4];
int r_frustum_indexes[4 * 6];
int reinit_surfcache = 1; // if 1, surface cache is currently empty
// and must be reinitialized for current
// cache size
float r_aliastransition, r_resfudge;
float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
cvar_t *r_draworder;
void
R_Textures_Init (void)
{
@ -184,17 +174,6 @@ R_Init (void)
D_Init ();
}
/*
void
R_Init_Cvars (void)
{
D_Init_Cvars ();
// r_draworder = Cvar_Get ("r_draworder", "0", CVAR_NONE, "Toggles drawing "
// "order");
}
*/
VISIBLE void
R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
{
@ -365,11 +344,6 @@ R_ViewChanged (float aspect)
r_aliastransition = r_aliastransbase->value * res_scale;
r_resfudge = r_aliastransadj->value * res_scale;
if (scr_fov->value <= 90.0)
r_fov_greater_than_90 = false;
else
r_fov_greater_than_90 = true;
D_ViewChanged ();
}
@ -724,7 +698,7 @@ R_EdgeDrawing (void)
}
// LordHavoc: took out of stack and made 4x size for 32bit capacity
byte warpbuffer[WARP_WIDTH * WARP_HEIGHT * 4];
static byte warpbuffer[WARP_WIDTH * WARP_HEIGHT * 4];
/*
R_RenderView

View file

@ -235,8 +235,6 @@ R_SetupFrame (void)
r_refdef.ambientlight = max (r_ambient->value, 0);
Cvar_SetValue (r_draworder, 0);
R_CheckVariables ();
R_AnimateLight ();
@ -333,10 +331,8 @@ 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;

View file

@ -51,9 +51,9 @@ static __attribute__ ((used)) const char rcsid[] =
#include "r_dynamic.h"
#include "r_local.h"
int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
static int ramp1[8] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
//static int ramp2[8] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
static int ramp3[8] = { 0x6d, 0x6b, 6, 5, 4, 3 };
void

View file

@ -44,17 +44,16 @@ static __attribute__ ((used)) const char rcsid[] =
#include "r_local.h"
int iskyspeed = 8;
int iskyspeed2 = 2;
float skyspeed, skyspeed2;
static int iskyspeed = 8;
static int iskyspeed2 = 2;
float skyspeed;
static float skyspeed2;
float skytime;
byte *r_skysource;
int r_skymade;
int r_skydirect; // not used?
// TODO: clean up these routines
@ -67,8 +66,8 @@ byte newsky[128 * 256]; // newsky and topsky both pack in here,
// the right, because the low-level
// drawers need 256-byte scan widths
*/
byte skydata[128*256]; // sky layers for making skytex
byte skytex[128*256*4]; // current sky texture
static byte skydata[128*256]; // sky layers for making skytex
static byte skytex[128*256*4]; // current sky texture
/*

View file

@ -39,18 +39,18 @@ static __attribute__ ((used)) const char rcsid[] =
drawsurf_t r_drawsurf;
int lightleft, sourcesstep, blocksize, sourcetstep;
static int lightleft, blocksize, sourcetstep;
int lightdelta, lightdeltastep;
int lightright, lightleftstep, lightrightstep, blockdivshift;
unsigned int blockdivmask;
static unsigned int blockdivmask;
byte *prowdestbase;
byte *psource;
int surfrowbytes; // used by ASM files
static byte *psource;
static int surfrowbytes;
int *r_lightptr;
int r_stepback;
int r_lightwidth;
int r_numhblocks, r_numvblocks;
byte *r_source, *r_sourcemax;
static int r_numhblocks, r_numvblocks;
static byte *r_source, *r_sourcemax;
static void (*surfmiptable8[4]) (void) = {
R_DrawSurfaceBlock8_mip0,
@ -73,7 +73,7 @@ static void (*surfmiptable32[4]) (void) = {
R_DrawSurfaceBlock32_mip3
};
int blocklights[34 * 34]; //FIXME make dynamic
static int blocklights[34 * 34]; //FIXME make dynamic
static void