[sw] Clean up a bunch of unnecessary casts

They won't affect performance, but they cluttered the code making it
harder to read.
This commit is contained in:
Bill Currie 2022-03-21 23:15:14 +09:00
parent d54f146089
commit 4a917449b7
5 changed files with 8 additions and 11 deletions

View file

@ -81,7 +81,7 @@ D_DrawSolidSurface (surf_t *surf, int color)
pix = (color << 24) | (color << 16) | (color << 8) | color;
for (span = surf->spans; span; span = span->pnext) {
pdest = (byte *) d_viewbuffer + screenwidth * span->v;
pdest = d_viewbuffer + screenwidth * span->v;
u = span->u;
u2 = span->u + span->count - 1;
((byte *) pdest)[u] = pix;

View file

@ -767,7 +767,7 @@ D_RasterizeAliasPolySmooth (void)
d_pdestbasestep = screenwidth + ubasestep;
d_pdestextrastep = d_pdestbasestep + 1;
d_pdest = (byte *) d_viewbuffer + ystart * screenwidth + plefttop[0];
d_pdest = d_viewbuffer + ystart * screenwidth + plefttop[0];
#ifdef USE_INTEL_ASM
d_pzbasestep = (d_zwidth + ubasestep) << 1;
d_pzextrastep = d_pzbasestep + 2;

View file

@ -141,8 +141,7 @@ Turbulent (espan_t *pspan)
zi16stepu = d_zistepu * 16;
do {
r_turb_pdest = (byte *) d_viewbuffer + (screenwidth * pspan->v) +
pspan->u;
r_turb_pdest = d_viewbuffer + (screenwidth * pspan->v) + pspan->u;
count = pspan->count;
@ -251,7 +250,7 @@ void
D_DrawSpans8 (espan_t *pspan)
{
int count, spancount;
unsigned char *pbase, *pdest;
byte *pbase, *pdest;
fixed16_t s, t, snext, tnext, sstep, tstep;
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
float sdivz8stepu, tdivz8stepu, zi8stepu;
@ -266,8 +265,7 @@ D_DrawSpans8 (espan_t *pspan)
zi8stepu = d_zistepu * 8;
do {
pdest = (unsigned char *) ((byte *) d_viewbuffer +
(screenwidth * pspan->v) + pspan->u);
pdest = d_viewbuffer + (screenwidth * pspan->v) + pspan->u;
count = pspan->count;

View file

@ -68,7 +68,7 @@ void
D_DrawSkyScans (espan_t *pspan)
{
int count, spancount, u, v;
unsigned char *pdest;
byte *pdest;
fixed16_t s, t, snext, tnext, sstep, tstep;
int spancountminus1;
@ -78,8 +78,7 @@ D_DrawSkyScans (espan_t *pspan)
tnext = 0; // ditto
do {
pdest = (unsigned char *) ((byte *) d_viewbuffer +
(screenwidth * pspan->v) + pspan->u);
pdest = d_viewbuffer + (screenwidth * pspan->v) + pspan->u;
count = pspan->count;

View file

@ -69,7 +69,7 @@ D_SpriteDrawSpans (sspan_t *pspan)
izistep = (int) (d_zistepu * 0x8000 * 0x10000);
do {
pdest = (byte *) d_viewbuffer + (screenwidth * pspan->v) + pspan->u;
pdest = d_viewbuffer + (screenwidth * pspan->v) + pspan->u;
pz = d_zbuffer + (d_zwidth * pspan->v) + pspan->u;
count = pspan->count;