From 9a02a6466cb5531ff6b249afb47d7f0f9df627e1 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 23 May 2022 00:09:03 +0100 Subject: [PATCH] Make all inline increments of `dest` and `dsrc` occur on seperate lines, for extra clarity and making it easier to identify future issues with these functions. --- src/r_draw8.c | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/r_draw8.c b/src/r_draw8.c index 48ba7f15c..8c65cf94a 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -836,13 +836,14 @@ void R_DrawSpan_8 (void) bit = (((UINT32)yposition >> nflatyshift) & nflatmask) | ((UINT32)xposition >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest++ = fullbright[source[bit]]; + *dest = fullbright[source[bit]]; } else { - *dest++ = colormap[source[bit]]; + *dest = colormap[source[bit]]; } + dest++; xposition += xstep; yposition += ystep; } @@ -1278,15 +1279,16 @@ void R_DrawTiltedTranslucentWaterSpan_8(void) bit = ((v >> nflatyshift) & nflatmask) | (u >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc); } else { colormap = planezlight[tiltlighting[ds_x1]] + (ds_colormap - colormaps); - *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc); } dest++; ds_x1++; + dsrc++; iz += ds_szp->x; uz += ds_sup->x; vz += ds_svp->x; @@ -1321,15 +1323,16 @@ void R_DrawTiltedTranslucentWaterSpan_8(void) bit = ((v >> nflatyshift) & nflatmask) | (u >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc); } else { colormap = planezlight[tiltlighting[ds_x1]] + (ds_colormap - colormaps); - *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc); } dest++; ds_x1++; + dsrc++; u += stepu; v += stepv; } @@ -1346,12 +1349,12 @@ void R_DrawTiltedTranslucentWaterSpan_8(void) bit = ((v >> nflatyshift) & nflatmask) | (u >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc); } else { colormap = planezlight[tiltlighting[ds_x1]] + (ds_colormap - colormaps); - *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc); } ds_x1++; } @@ -1376,15 +1379,16 @@ void R_DrawTiltedTranslucentWaterSpan_8(void) bit = ((v >> nflatyshift) & nflatmask) | (u >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (fullbright[source[bit]] << 8) + *dsrc); } else { colormap = planezlight[tiltlighting[ds_x1]] + (ds_colormap - colormaps); - *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc++); + *dest = *(ds_transmap + (colormap[source[bit]] << 8) + *dsrc); } dest++; ds_x1++; + dsrc++; u += stepu; v += stepv; } @@ -2354,17 +2358,18 @@ void R_DrawTranslucentWaterSpan_8(void) bit = ((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - dest[i] = fullbright[*(ds_transmap + (source[bit] << 8) + *dsrc++)]; + dest[i] = fullbright[*(ds_transmap + (source[bit] << 8) + dsrc[i])]; } else { - dest[i] = colormap[*(ds_transmap + (source[bit] << 8) + *dsrc++)]; + dest[i] = colormap[*(ds_transmap + (source[bit] << 8) + dsrc[i])]; } xposition += xstep; yposition += ystep; } dest += 8; + dsrc += 8; count -= 8; } while (count--) @@ -2372,12 +2377,14 @@ void R_DrawTranslucentWaterSpan_8(void) bit = ((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift); if (brightmap != NULL && brightmap[bit] == BRIGHTPIXEL) { - *dest++ = fullbright[*(ds_transmap + (source[bit] << 8) + *dsrc++)]; + *dest = fullbright[*(ds_transmap + (source[bit] << 8) + *dsrc)]; } else { - *dest++ = colormap[*(ds_transmap + (source[bit] << 8) + *dsrc++)]; + *dest = colormap[*(ds_transmap + (source[bit] << 8) + *dsrc)]; } + dest++; + dsrc++; xposition += xstep; yposition += ystep; }