remove all aliases for vid.width

This commit is contained in:
Denis Pauk 2018-08-28 22:37:47 +03:00
parent 01ca7db6f4
commit aa3a688495
8 changed files with 23 additions and 32 deletions

View file

@ -375,7 +375,6 @@ extern int d_pix_min, d_pix_max, d_pix_mul;
extern pixel_t *d_viewbuffer;
extern zvalue_t *d_pzbuffer;
extern unsigned int d_zwidth;
extern int d_minmip;
extern float d_scalemip[NUM_MIPS-1];
@ -384,7 +383,6 @@ extern float d_scalemip[NUM_MIPS-1];
extern int cachewidth;
extern pixel_t *cacheblock;
extern int r_screenwidth;
extern int r_drawnpolycount;

View file

@ -786,7 +786,7 @@ D_FlatFillSurface (surf_t *surf, pixel_t color)
{
pixel_t *pdest;
pdest = d_viewbuffer + r_screenwidth*span->v + span->u;
pdest = d_viewbuffer + vid.width*span->v + span->u;
memset(pdest, color&0xFF, span->count * sizeof(pixel_t));
}
}

View file

@ -97,8 +97,6 @@ float xscaleinv, yscaleinv;
float xscaleshrink, yscaleshrink;
float aliasxscale, aliasyscale, aliasxcenter, aliasycenter;
int r_screenwidth;
mplane_t screenedge[4];
//
@ -193,7 +191,6 @@ pixel_t *cacheblock;
int cachewidth;
pixel_t *d_viewbuffer;
zvalue_t *d_pzbuffer;
unsigned int d_zwidth;
qboolean insubmodel;

View file

@ -47,8 +47,6 @@ D_ViewChanged (void)
if (yscale > xscale)
scale_for_mip = yscale;
d_zwidth = vid.width;
d_pix_min = r_refdef.vrect.height / 240;
if (d_pix_min < 1)
d_pix_min = 1;
@ -360,7 +358,6 @@ R_SetupFrame (void)
vrect.height = r_newrefdef.height;
d_viewbuffer = r_warpbuffer;
r_screenwidth = vid.width;
}
else
{
@ -370,7 +367,6 @@ R_SetupFrame (void)
vrect.height = r_newrefdef.height;
d_viewbuffer = vid_buffer;
r_screenwidth = vid.width;
}
R_ViewChanged (&vrect);

View file

@ -83,8 +83,8 @@ R_DrawParticle(particle_t *pparticle, int level)
** compute addresses of zbuffer, framebuffer, and
** compute the Z-buffer reference value.
*/
pz = d_pzbuffer + (d_zwidth * v) + u;
pdest = d_viewbuffer + r_screenwidth * v + u;
pz = d_pzbuffer + (vid.width * v) + u;
pdest = d_viewbuffer + vid.width * v + u;
izi = (int)(zi * 0x8000);
/*
@ -106,7 +106,7 @@ R_DrawParticle(particle_t *pparticle, int level)
{
switch (level) {
case PARTICLE_33 :
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
//FIXME--do it in blocks of 8?
for (i=0 ; i<pix ; i++)
@ -123,7 +123,7 @@ R_DrawParticle(particle_t *pparticle, int level)
case PARTICLE_66 :
{
int color_part = (color<<8);
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
for (i=0 ; i<pix ; i++)
{
@ -138,7 +138,7 @@ R_DrawParticle(particle_t *pparticle, int level)
}
default: //100
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
for (i=0 ; i<pix ; i++)
{
@ -160,7 +160,7 @@ R_DrawParticle(particle_t *pparticle, int level)
switch (level) {
case PARTICLE_33 :
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
//FIXME--do it in blocks of 8?
for (i=0 ; i<pix ; i++)
@ -178,7 +178,7 @@ R_DrawParticle(particle_t *pparticle, int level)
case PARTICLE_66 :
{
int color_part = (color<<8);
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
for (i=0 ; i<pix ; i++)
{
@ -194,7 +194,7 @@ R_DrawParticle(particle_t *pparticle, int level)
}
default: //100
for ( ; count ; count--, pz += d_zwidth, pdest += r_screenwidth)
for ( ; count ; count--, pz += vid.width, pdest += vid.width)
{
for (i=0 ; i<pix ; i++)
{

View file

@ -622,8 +622,8 @@ R_PolygonDrawSpans(espan_t *pspan, int iswater )
{
int count;
s_spanletvars.pdest = d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u;
s_spanletvars.pz = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u;
s_spanletvars.pdest = d_viewbuffer + (vid.width * pspan->v) + pspan->u;
s_spanletvars.pz = d_pzbuffer + (vid.width * pspan->v) + pspan->u;
s_spanletvars.u = pspan->u;
s_spanletvars.v = pspan->v;
count = pspan->count;

View file

@ -796,8 +796,8 @@ R_RasterizeAliasPolySmooth (void)
d_light = plefttop[4];
d_zi = plefttop[5];
d_pdest = d_viewbuffer + ystart * r_screenwidth + plefttop[0];
d_pz = d_pzbuffer + ystart * d_zwidth + plefttop[0];
d_pdest = d_viewbuffer + ystart * vid.width + plefttop[0];
d_pz = d_pzbuffer + ystart * vid.width + plefttop[0];
if (initialleftheight == 1)
{
@ -820,11 +820,11 @@ R_RasterizeAliasPolySmooth (void)
R_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
pleftbottom[0], pleftbottom[1]);
{
d_pzbasestep = d_zwidth + ubasestep;
d_pzbasestep = vid.width + ubasestep;
d_pzextrastep = d_pzbasestep + 1;
}
d_pdestbasestep = r_screenwidth + ubasestep;
d_pdestbasestep = vid.width + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
// TODO: can reuse partial expressions here
@ -886,8 +886,8 @@ R_RasterizeAliasPolySmooth (void)
d_light = plefttop[4];
d_zi = plefttop[5];
d_pdest = d_viewbuffer + ystart * r_screenwidth + plefttop[0];
d_pz = d_pzbuffer + ystart * d_zwidth + plefttop[0];
d_pdest = d_viewbuffer + ystart * vid.width + plefttop[0];
d_pz = d_pzbuffer + ystart * vid.width + plefttop[0];
if (height == 1)
{
@ -910,11 +910,11 @@ R_RasterizeAliasPolySmooth (void)
R_PolysetSetUpForLineScan(plefttop[0], plefttop[1],
pleftbottom[0], pleftbottom[1]);
d_pdestbasestep = r_screenwidth + ubasestep;
d_pdestbasestep = vid.width + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
{
d_pzbasestep = d_zwidth + ubasestep;
d_pzbasestep = vid.width + ubasestep;
d_pzextrastep = d_pzbasestep + 1;
}

View file

@ -184,7 +184,7 @@ TurbulentPow2 (espan_t *pspan)
float sdivz, tdivz, zi, z, du, dv;
pixel_t *r_turb_pdest;
r_turb_pdest = d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u;
r_turb_pdest = d_viewbuffer + (vid.width * pspan->v) + pspan->u;
count = pspan->count;
@ -335,7 +335,7 @@ NonTurbulentPow2 (espan_t *pspan)
float sdivz, tdivz, zi, z, dv, du;
pixel_t *r_turb_pdest;
r_turb_pdest = d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u;
r_turb_pdest = d_viewbuffer + (vid.width * pspan->v) + pspan->u;
count = pspan->count;
@ -588,7 +588,7 @@ D_DrawSpansPow2 (espan_t *pspan)
int count, s, t;
float sdivz, tdivz, zi, z, du, dv;
pdest = d_viewbuffer + (r_screenwidth * pspan->v) + pspan->u;
pdest = d_viewbuffer + (vid.width * pspan->v) + pspan->u;
count = pspan->count;
@ -730,7 +730,7 @@ D_DrawZSpans (espan_t *pspan)
float zi;
float du, dv;
pdest = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u;
pdest = d_pzbuffer + (vid.width * pspan->v) + pspan->u;
count = pspan->count;