From 5daeaf529fc26fac71e36fb821bbd9eea3c99bd7 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 9 Aug 2018 16:56:43 +0100 Subject: [PATCH 1/2] Apply the double-colormap ordering fix to R_DrawTiltedTranslucentSpan_8 as well. --- src/r_draw8.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/r_draw8.c b/src/r_draw8.c index 9240cc3f..d4aaf5cf 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -735,8 +735,7 @@ void R_DrawTiltedTranslucentSpan_8(void) v = (INT64)(vz*z) + viewy; colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps); - - *dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])]; + *dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest); dest++; iz += ds_sz.x; uz += ds_su.x; @@ -773,7 +772,7 @@ void R_DrawTiltedTranslucentSpan_8(void) for (i = SPANSIZE-1; i >= 0; i--) { colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps); - *dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])]; + *dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest); dest++; u += stepu; v += stepv; @@ -789,7 +788,7 @@ void R_DrawTiltedTranslucentSpan_8(void) u = (INT64)(startu); v = (INT64)(startv); colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps); - *dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])]; + *dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest); } else { @@ -810,7 +809,7 @@ void R_DrawTiltedTranslucentSpan_8(void) for (; width != 0; width--) { colormap = planezlight[tiltlighting[ds_x1++]] + (ds_colormap - colormaps); - *dest = colormap[*(ds_transmap + (source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)] << 8) + dest[0])]; + *dest = *(ds_transmap + (colormap[source[((v >> nflatyshift) & nflatmask) | (u >> nflatxshift)]] << 8) + *dest); dest++; u += stepu; v += stepv; From 145c050e14e55f1053d8a33b92e1b7792398944d Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 9 Aug 2018 17:08:20 +0100 Subject: [PATCH 2/2] ...and R_DrawTranslucentSplat_8, even though it isn't used! --- src/r_draw8.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/r_draw8.c b/src/r_draw8.c index d4aaf5cf..800f28b6 100644 --- a/src/r_draw8.c +++ b/src/r_draw8.c @@ -1120,49 +1120,49 @@ void R_DrawTranslucentSplat_8 (void) // need! val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[0] = colormap[*(ds_transmap + (val << 8) + dest[0])]; + dest[0] = *(ds_transmap + (colormap[val] << 8) + dest[0]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[1] = colormap[*(ds_transmap + (val << 8) + dest[1])]; + dest[1] = *(ds_transmap + (colormap[val] << 8) + dest[1]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[2] = colormap[*(ds_transmap + (val << 8) + dest[2])]; + dest[2] = *(ds_transmap + (colormap[val] << 8) + dest[2]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[3] = colormap[*(ds_transmap + (val << 8) + dest[3])]; + dest[3] = *(ds_transmap + (colormap[val] << 8) + dest[3]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[4] = colormap[*(ds_transmap + (val << 8) + dest[4])]; + dest[4] = *(ds_transmap + (colormap[val] << 8) + dest[4]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[5] = colormap[*(ds_transmap + (val << 8) + dest[5])]; + dest[5] = *(ds_transmap + (colormap[val] << 8) + dest[5]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[6] = colormap[*(ds_transmap + (val << 8) + dest[6])]; + dest[6] = *(ds_transmap + (colormap[val] << 8) + dest[6]); xposition += xstep; yposition += ystep; val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - dest[7] = colormap[*(ds_transmap + (val << 8) + dest[7])]; + dest[7] = *(ds_transmap + (colormap[val] << 8) + dest[7]); xposition += xstep; yposition += ystep; @@ -1173,7 +1173,7 @@ void R_DrawTranslucentSplat_8 (void) { val = source[((yposition >> nflatyshift) & nflatmask) | (xposition >> nflatxshift)]; if (val != TRANSPARENTPIXEL) - *dest = colormap[*(ds_transmap + (val << 8) + *dest)]; + *dest = *(ds_transmap + (colormap[val] << 8) + *dest); dest++; xposition += xstep;