diff --git a/src/r_draw.h b/src/r_draw.h index bcd734e50..232e6c8ce 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -252,6 +252,9 @@ void R_Draw2sMultiPatchTranslucentColumn(drawcolumndata_t* dc); void R_DrawFogColumn(drawcolumndata_t* dc); +void R_ResetColumnBuffer(void); +void R_DrawSkyColumn(drawcolumndata_t *dc); + // span drawers void R_DrawSpan(drawspandata_t* ds); diff --git a/src/r_draw_column.cpp b/src/r_draw_column.cpp index bae220e6d..ccb5c5403 100644 --- a/src/r_draw_column.cpp +++ b/src/r_draw_column.cpp @@ -21,6 +21,8 @@ // a has a constant z depth from top to bottom. // +#include "r_draw_flush.cpp" + enum DrawColumnType { DC_BASIC = 0x0000, @@ -69,7 +71,9 @@ static constexpr UINT8 R_DrawColumnPixel(drawcolumndata_t* dc, UINT8 * restrict } } - return R_GetColumnTranslucent(dc, dest, col, colormap); + //return R_GetColumnTranslucent(dc, dest, col, colormap); + // dont return any other shit for now + return col; } /** \brief The R_DrawColumn function @@ -150,6 +154,7 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) } R_DrawColumnTemplate(&dc_copy); + if (solid) { dc_copy.yl = bheight; @@ -184,16 +189,25 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) intptr_t frac; const intptr_t fracstep = dc->iscale; - const intptr_t heightmask = dc->sourcelength-1; + const intptr_t heightmask = dc->sourcelength-1; // CPhipps - specify type constexpr INT32 npow2min = -1; const INT32 npow2max = dc->sourcelength; - const INT32 stride = vid.width; const UINT8 * restrict source = dc->source; const lighttable_t * restrict colormap = dc->colormap; + UINT8 * restrict dest; + // Framebuffer destination address. - UINT8 * restrict dest = R_Address(dc->x, dc->yl); + // SoM: MAGIC + /*if constexpr (Type & (DrawColumnType::DC_COLORMAP | DrawColumnType::DC_TRANSMAP)) + dest = R_GetBufferColormapTrans(dc); + else if constexpr (Type & DrawColumnType::DC_TRANSMAP) + dest = R_GetBufferTrans(dc); + else if constexpr (Type & DrawColumnType::DC_COLORMAP) + dest = R_GetBufferColormap(dc); + else*/ + dest = R_GetBufferOpaque(dc); count++; @@ -205,15 +219,15 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) case 255: case 127: { - while(count--) + while (count--) { *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); - dest += stride; + dest += 4; frac += fracstep; } } break; - case -1: + case npow2min: { if (frac < 0) // adjust in case we underread @@ -223,7 +237,7 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) while (--count >= 0) { *dest = R_DrawColumnPixel(dc, dest, frac>>FRACBITS, source, colormap); - dest += stride; + dest += 4; frac += fracstep; } } @@ -235,11 +249,11 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) while ((count -= 2) >= 0) // texture height is a power of 2 -- killough { *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); - dest += stride; + dest += 4; frac += fracstep; *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); - dest += stride; + dest += 4; frac += fracstep; } @@ -277,7 +291,7 @@ static void R_DrawColumnTemplate(drawcolumndata_t *dc) // and a few bytes after as well *dest = R_DrawColumnPixel(dc, dest, CLAMP((frac >> FRACBITS), npow2min, npow2max), source, colormap); - dest += stride; + dest += 4; #if __SIZEOF_POINTER__ < 8 // 64-bit systems have large enough numbers for this to be a non-issue // Avoid overflow. @@ -354,3 +368,150 @@ void R_DrawFogColumn(drawcolumndata_t* dc) dest += stride; } while (count--); } + +// blunt copy paste for now +// cant share a global buffer between threads for obvious reasons lmao +void R_DrawSkyColumn(drawcolumndata_t *dc) +{ + INT32 count; + + count = dc->yh - dc->yl; + + if (count < 0) // Zero length, column does not exceed a pixel. + { + return; + } + + if ((unsigned)dc->x >= (unsigned)vid.width || dc->yl < 0 || dc->yh >= vid.height) + { + return; + } + + { + // Inner loop that does the actual texture mapping, + // e.g. a DDA-lile scaling. + // This is as fast as it gets. (Yeah, right!!! -- killough) + // + // killough 2/1/98: more performance tuning + + intptr_t frac; + const intptr_t fracstep = dc->iscale; + const intptr_t heightmask = dc->sourcelength-1; + constexpr INT32 npow2min = -1; + const INT32 npow2max = dc->sourcelength; + const INT32 stride = vid.width; + + const UINT8 * restrict source = dc->source; + const lighttable_t * restrict colormap = dc->colormap; + + // Framebuffer destination address. + UINT8 * restrict dest = R_Address(dc->x, dc->yl); + + count++; + + // Determine scaling, which is the only mapping to be done. + frac = (dc->texturemid + FixedMul((dc->yl << FRACBITS) - centeryfrac, fracstep)); + + switch (heightmask) + { + case 255: + case 127: + { + while(count--) + { + *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); + dest += stride; + frac += fracstep; + } + } + break; + case -1: + { + if (frac < 0) + // adjust in case we underread + frac += fracstep; + + // texture has no height, so just go + while (--count >= 0) + { + *dest = R_DrawColumnPixel(dc, dest, frac>>FRACBITS, source, colormap); + dest += stride; + frac += fracstep; + } + } + break; + default: + { + if (!(dc->sourcelength & heightmask)) // power of 2 -- killough + { + while ((count -= 2) >= 0) // texture height is a power of 2 -- killough + { + *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); + dest += stride; + frac += fracstep; + + *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); + dest += stride; + frac += fracstep; + } + + if (count & 1) + { + *dest = R_DrawColumnPixel(dc, dest, (frac>>FRACBITS) & heightmask, source, colormap); + } + } + else + { + const intptr_t fixed_heightmask = dc->texheight << FRACBITS; + + if (frac < 0) + { + while ((frac += fixed_heightmask) < 0) + { + ; + } + } + else + { + while (frac >= fixed_heightmask) + { + frac -= fixed_heightmask; + } + } + + do + { + // Re-map color indices from wall texture column + // using a lighting/special effects LUT. + // heightmask is the Tutti-Frutti fix + + // -1 is the lower clamp bound because column posts have a "safe" byte before the real data + // and a few bytes after as well + *dest = R_DrawColumnPixel(dc, dest, CLAMP((frac >> FRACBITS), npow2min, npow2max), source, colormap); + + dest += stride; + +#if __SIZEOF_POINTER__ < 8 // 64-bit systems have large enough numbers for this to be a non-issue + // Avoid overflow. + if (fracstep > 0x7FFFFFFF - frac) + { + frac += fracstep - fixed_heightmask; + } + else +#endif + { + frac += fracstep; + } + + while (frac >= fixed_heightmask) + { + frac -= fixed_heightmask; + } + } + while (--count); + } + } + break; + } + } +} diff --git a/src/r_draw_flush.cpp b/src/r_draw_flush.cpp new file mode 100644 index 000000000..657e185b5 --- /dev/null +++ b/src/r_draw_flush.cpp @@ -0,0 +1,599 @@ +// SONIC ROBO BLAST 2 KART +//----------------------------------------------------------------------------- +// Copyright (C) 2025 by Kart Krew. +// Copyright (C) 2020 by Sonic Team Junior. +// Copyright (C) 2000 by DooM Legacy Team. +// Copyright (C) 1996 by id Software, Inc. +// +// This program is free software distributed under the +// terms of the GNU General Public License, version 2. +// See the 'LICENSE' file for more details. +//----------------------------------------------------------------------------- +/// \file r_draw_flush.cpp +/// \brief column flush functions +/// \note no includes because this is included as part of r_draw.cpp + +enum ColumnFlushType +{ + FLUSH_NONE, + FLUSH_OPAQUE, + FLUSH_TRANS, + FLUSH_COLORMAP, + FLUSH_COLORMAP_TRANS +}; + +static int temp_x = 0; +static int tempyl[4], tempyh[4]; +static UINT8 tempbuf[MAXVIDWIDTH * 4]; +static int startx = 0; +static int commontop, commonbot; +static ColumnFlushType temptype = FLUSH_NONE; +static const UINT8 *temptranmap = NULL; +static const UINT8 *temptranslation = NULL; + +static void R_FlushColumns(void); + +static void R_FlushWholeError(void) +{ + I_Error("R_FlushWholeColumns called without being initialized.\n"); +} + +static void R_FlushHTError(void) +{ + I_Error("R_FlushHTColumns called without being initialized.\n"); +} + +static void R_QuadFlushError(void) +{ + I_Error("R_FlushQuadColumn called without being initialized.\n"); +} + +// +// R_FlushWholeOpaque +// +// Flushes the entire columns in the buffer, one at a time. +// This is used when a quad flush isn't possible. +// Opaque version -- no remapping whatsoever. +// +static void R_FlushWholeOpaque(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count, yl; + const restrict INT32 stride = vid.width; + + while (--temp_x >= 0) + { + yl = tempyl[temp_x]; + source = &tempbuf[temp_x + (yl << 2)]; + dest = R_Address(startx + temp_x, yl); + count = tempyh[temp_x] - yl + 1; + + while (--count >= 0) + { + *dest = *source; + source += 4; + dest += stride; + } + } +} + +// +// R_FlushHTOpaque +// +// Flushes the head and tail of columns in the buffer in +// preparation for a quad flush. +// Opaque version -- no remapping whatsoever. +// +static void R_FlushHTOpaque(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count, colnum = 0; + INT32 yl, yh; + const restrict INT32 stride = vid.width; + + while (colnum < 4) + { + yl = tempyl[colnum]; + yh = tempyh[colnum]; + + // flush column head + if (yl < commontop) + { + source = &tempbuf[colnum + (yl << 2)]; + dest = R_Address(startx + colnum, yl); + count = commontop - yl; + + while (--count >= 0) + { + *dest = *source; + source += 4; + dest += stride; + } + } + + // flush column tail + if (yh > commonbot) + { + source = &tempbuf[colnum + ((commonbot + 1) << 2)]; + dest = R_Address(startx + colnum, commonbot + 1); + count = yh - commonbot; + + while (--count >= 0) + { + *dest = *source; + source += 4; + dest += stride; + } + } + ++colnum; + } +} + +static void R_FlushQuadOpaque(void) +{ + UINT8 *source = &tempbuf[commontop << 2]; + UINT8 *dest = R_Address(startx, commontop); + INT32 count; + const restrict INT32 stride = vid.width; + + count = commonbot - commontop + 1; + + if ((sizeof(int) == 4) && (((intptr_t)source % 4) == 0) && (((intptr_t)dest % 4) == 0)) + { + while(--count >= 0) + { + *(int *)dest = *(int *)source; + source += 4 * sizeof(UINT8); + dest += stride * sizeof(UINT8); + } + } + else + { + while(--count >= 0) + { + dest[0] = source[0]; + dest[1] = source[1]; + dest[2] = source[2]; + dest[3] = source[3]; + source += 4 * sizeof(UINT8); + dest += stride * sizeof(UINT8); + } + } + + while(--count >= 0) + { + dest[0] = source[0]; + dest[1] = source[1]; + dest[2] = source[2]; + dest[3] = source[3]; + source += 4 * sizeof(UINT8); + dest += stride * sizeof(UINT8); + } +} + +static void R_FlushWholeTrans(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count, yl; + const restrict INT32 stride = vid.width; + + while (--temp_x >= 0) + { + yl = tempyl[temp_x]; + source = &tempbuf[temp_x + (yl << 2)]; + dest = R_Address(startx + temp_x, yl); + count = tempyh[temp_x] - yl + 1; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + *source]; + source += 4; + dest += stride; + } + } +} + +static void R_FlushHTTrans(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count; + INT32 colnum = 0, yl, yh; + const restrict INT32 stride = vid.width; + + while (colnum < 4) + { + yl = tempyl[colnum]; + yh = tempyh[colnum]; + + // flush column head + if (yl < commontop) + { + source = &tempbuf[colnum + (yl << 2)]; + dest = R_Address(startx + colnum, yl); + count = commontop - yl; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + *source]; + source += 4; + dest += stride; + } + } + + // flush column tail + if (yh > commonbot) + { + source = &tempbuf[colnum + ((commonbot + 1) << 2)]; + dest = R_Address(startx + colnum, commonbot + 1); + count = yh - commonbot; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + *source]; + source += 4; + dest += stride; + } + } + + ++colnum; + } +} + +static void R_FlushQuadTrans(void) +{ + UINT8 *source = &tempbuf[commontop << 2]; + UINT8 *dest = R_Address(startx, commontop); + INT32 count; + const restrict INT32 stride = vid.width; + + count = commonbot - commontop + 1; + + while (--count >= 0) + { + dest[0] = temptranmap[(dest[0] << 8) + source[0]]; + dest[1] = temptranmap[(dest[1] << 8) + source[1]]; + dest[2] = temptranmap[(dest[2] << 8) + source[2]]; + dest[3] = temptranmap[(dest[3] << 8) + source[3]]; + source += 4; + dest += stride; + } +} + +static void R_FlushWholeColormap(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count, yl; + const restrict INT32 stride = vid.width; + + while (--temp_x >= 0) + { + yl = tempyl[temp_x]; + source = &tempbuf[temp_x + (yl << 2)]; + dest = R_Address(startx + temp_x, yl); + count = tempyh[temp_x] - yl + 1; + + while (--count >= 0) + { + *dest = temptranslation[*source]; + source += 4; + dest += stride; + } + } +} + +static void R_FlushHTColormap(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count; + INT32 colnum = 0, yl, yh; + const restrict INT32 stride = vid.width; + + while (colnum < 4) + { + yl = tempyl[colnum]; + yh = tempyh[colnum]; + + // flush column head + if (yl < commontop) + { + source = &tempbuf[colnum + (yl << 2)]; + dest = R_Address(startx + colnum, yl); + count = commontop - yl; + + while (--count >= 0) + { + *dest = temptranslation[*source]; + source += 4; + dest += stride; + } + } + + // flush column tail + if (yh > commonbot) + { + source = &tempbuf[colnum + ((commonbot + 1) << 2)]; + dest = R_Address(startx + colnum, commonbot + 1); + count = yh - commonbot; + + while (--count >= 0) + { + *dest = temptranslation[*source]; + source += 4; + dest += stride; + } + } + + ++colnum; + } +} + +static void R_FlushQuadColormap(void) +{ + UINT8 *source = &tempbuf[commontop << 2]; + UINT8 *dest = R_Address(startx, commontop); + INT32 count; + const restrict INT32 stride = vid.width; + + count = commonbot - commontop + 1; + + while (--count >= 0) + { + dest[0] = temptranslation[source[0]]; + dest[1] = temptranslation[source[1]]; + dest[2] = temptranslation[source[2]]; + dest[3] = temptranslation[source[3]]; + source += 4; + dest += stride; + } +} + +static void R_FlushWholeColormapTrans(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count, yl; + const restrict INT32 stride = vid.width; + + while (--temp_x >= 0) + { + yl = tempyl[temp_x]; + source = &tempbuf[temp_x + (yl << 2)]; + dest = R_Address(startx + temp_x, yl); + count = tempyh[temp_x] - yl + 1; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + temptranslation[*source]]; + source += 4; + dest += stride; + } + } +} + +static void R_FlushHTColormapTrans(void) +{ + UINT8 *source; + UINT8 *dest; + INT32 count; + INT32 colnum = 0, yl, yh; + const restrict INT32 stride = vid.width; + + while (colnum < 4) + { + yl = tempyl[colnum]; + yh = tempyh[colnum]; + + // flush column head + if (yl < commontop) + { + source = &tempbuf[colnum + (yl << 2)]; + dest = R_Address(startx + colnum, yl); + count = commontop - yl; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + temptranslation[*source]]; + source += 4; + dest += stride; + } + } + + // flush column tail + if (yh > commonbot) + { + source = &tempbuf[colnum + ((commonbot + 1) << 2)]; + dest = R_Address(startx + colnum, commonbot + 1); + count = yh - commonbot; + + while (--count >= 0) + { + *dest = temptranmap[(*dest << 8) + temptranslation[*source]]; + source += 4; + dest += stride; + } + } + + ++colnum; + } +} + +static void R_FlushQuadColormapTrans(void) +{ + UINT8 *source = &tempbuf[commontop << 2]; + UINT8 *dest = R_Address(startx, commontop); + INT32 count; + const restrict INT32 stride = vid.width; + + count = commonbot - commontop + 1; + + while (--count >= 0) + { + dest[0] = temptranmap[(dest[0] << 8) + temptranslation[source[0]]]; + dest[1] = temptranmap[(dest[1] << 8) + temptranslation[source[1]]]; + dest[2] = temptranmap[(dest[2] << 8) + temptranslation[source[2]]]; + dest[3] = temptranmap[(dest[3] << 8) + temptranslation[source[3]]]; + source += 4; + dest += stride; + } +} + +static void (*R_FlushWholeColumns)(void) = R_FlushWholeError; +static void (*R_FlushHTColumns)(void) = R_FlushHTError; +static void (*R_FlushQuadColumn)(void) = R_QuadFlushError; + +static void R_FlushColumns(void) +{ + if (temp_x != 4 || commontop >= commonbot) + R_FlushWholeColumns(); + else + { + R_FlushHTColumns(); + R_FlushQuadColumn(); + } + + temp_x = 0; +} + +// +// R_ResetColumnBuffer +// +void R_ResetColumnBuffer(void) +{ + if (temp_x) + R_FlushColumns(); + + temptype = FLUSH_NONE; + R_FlushWholeColumns = R_FlushWholeError; + R_FlushHTColumns = R_FlushHTError; + R_FlushQuadColumn = R_QuadFlushError; +} + +static UINT8 *R_GetBufferOpaque(drawcolumndata_t *dc) +{ + if (temp_x == 4 || + (temp_x && (temptype != FLUSH_OPAQUE || temp_x + startx != dc->x))) + R_FlushColumns(); + + if (!temp_x) + { + startx = dc->x; + tempyl[0] = commontop = dc->yl; + tempyh[0] = commonbot = dc->yh; + temptype = FLUSH_OPAQUE; + R_FlushWholeColumns = R_FlushWholeOpaque; + R_FlushHTColumns = R_FlushHTOpaque; + R_FlushQuadColumn = R_FlushQuadOpaque; + temp_x += 1; + return &tempbuf[dc->yl << 2]; + } + + tempyl[temp_x] = dc->yl; + tempyh[temp_x] = dc->yh; + + if (dc->yl > commontop) + commontop = dc->yl; + if (dc->yh < commonbot) + commonbot = dc->yh; + + return &tempbuf[(dc->yl << 2) + temp_x++]; +} + +static UINT8 *R_GetBufferTrans(drawcolumndata_t *dc) +{ + if (temp_x == 4 || dc->transmap != temptranmap || + (temp_x && (temptype != FLUSH_TRANS || temp_x + startx != dc->x))) + R_FlushColumns(); + + if (!temp_x) + { + startx = dc->x; + tempyl[0] = commontop = dc->yl; + tempyh[0] = commonbot = dc->yh; + temptype = FLUSH_TRANS; + temptranmap = dc->transmap; + R_FlushWholeColumns = R_FlushWholeTrans; + R_FlushHTColumns = R_FlushHTTrans; + R_FlushQuadColumn = R_FlushQuadTrans; + temp_x += 1; + return &tempbuf[dc->yl << 2]; + } + + tempyl[temp_x] = dc->yl; + tempyh[temp_x] = dc->yh; + + if (dc->yl > commontop) + commontop = dc->yl; + if (dc->yh < commonbot) + commonbot = dc->yh; + + return &tempbuf[(dc->yl << 2) + temp_x++]; +} + +static UINT8 *R_GetBufferColormap(drawcolumndata_t *dc) +{ + if (temp_x == 4 || dc->translation != temptranslation || + (temp_x && (temptype != FLUSH_COLORMAP || temp_x + startx != dc->x))) + R_FlushColumns(); + + if (!temp_x) + { + startx = dc->x; + tempyl[0] = commontop = dc->yl; + tempyh[0] = commonbot = dc->yh; + temptype = FLUSH_COLORMAP; + temptranslation = dc->translation; + R_FlushWholeColumns = R_FlushWholeColormap; + R_FlushHTColumns = R_FlushHTColormap; + R_FlushQuadColumn = R_FlushQuadColormap; + temp_x += 1; + return &tempbuf[dc->yl << 2]; + } + + tempyl[temp_x] = dc->yl; + tempyh[temp_x] = dc->yh; + + if (dc->yl > commontop) + commontop = dc->yl; + if (dc->yh < commonbot) + commonbot = dc->yh; + + return &tempbuf[(dc->yl << 2) + temp_x++]; +} + +static UINT8 *R_GetBufferColormapTrans(drawcolumndata_t *dc) +{ + if (temp_x == 4 || dc->translation != temptranslation || dc->transmap != temptranmap || + (temp_x && (temptype != FLUSH_COLORMAP_TRANS || temp_x + startx != dc->x))) + R_FlushColumns(); + + if (!temp_x) + { + startx = dc->x; + tempyl[0] = commontop = dc->yl; + tempyh[0] = commonbot = dc->yh; + temptype = FLUSH_COLORMAP_TRANS; + temptranslation = dc->translation; + temptranmap = dc->transmap; + R_FlushWholeColumns = R_FlushWholeColormapTrans; + R_FlushHTColumns = R_FlushHTColormapTrans; + R_FlushQuadColumn = R_FlushQuadColormapTrans; + temp_x += 1; + return &tempbuf[dc->yl << 2]; + } + + tempyl[temp_x] = dc->yl; + tempyh[temp_x] = dc->yh; + + if (dc->yl > commontop) + commontop = dc->yl; + if (dc->yh < commonbot) + commonbot = dc->yh; + + return &tempbuf[(dc->yl << 2) + temp_x++]; +} diff --git a/src/r_main.cpp b/src/r_main.cpp index 08f1e68a1..132349a82 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -1409,7 +1409,9 @@ void R_RenderPlayerView(player_t *player) R_ClipSprites(drawsegs, NULL); R_DrawSkyPlanes(); // draw the fucker again to prevent some artifacts R_DrawPlanes(); + //R_ResetColumnBuffer(); R_DrawMasked(masks, nummasks); + //R_ResetColumnBuffer(); } PS_STOP_TIMING(ps_skyboxtime); @@ -1493,6 +1495,7 @@ void R_RenderPlayerView(player_t *player) PS_START_TIMING(ps_sw_planetime); if (!skybox) R_DrawSkyPlanes(); + R_ResetColumnBuffer(); R_DrawPlanes(); PS_STOP_TIMING(ps_sw_planetime); // draw mid texture and sprite @@ -1500,6 +1503,7 @@ void R_RenderPlayerView(player_t *player) PS_START_TIMING(ps_sw_maskedtime); R_DrawMasked(masks, nummasks); PS_STOP_TIMING(ps_sw_maskedtime); + R_ResetColumnBuffer(); free(masks); diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 475e8a44d..16e344bdf 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -716,13 +716,10 @@ void R_DrawPlanes(void) visplane_t *pl; INT32 i; drawspandata_t ds = {}; -#ifdef HAVE_THREADS - srb2::ThreadPool::Sema tp_sema; -#endif - R_UpdatePlaneRipple(&ds); #ifdef HAVE_THREADS + srb2::ThreadPool::Sema tp_sema; srb2::g_main_threadpool->begin_sema(); #endif for (i = 0; i < MAXVISPLANES; i++, pl++) @@ -837,7 +834,8 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), b dc.x = x + i; dc.source = R_GetColumn(texture, -angle); // get negative of angle for each column to display sky correct way round! --Monster Iestyn 27/01/18 - colfunc2(&dc); + //colfunc2(&dc); + R_DrawSkyColumn(&dc); } }; @@ -874,7 +872,8 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), b R_GetColumn(texturetranslation[skytexture], -angle); // get negative of angle for each column to display sky correct way round! --Monster Iestyn 27/01/18 - colfunc2(&dc); + //colfunc2(&dc); + R_DrawSkyColumn(&dc); } #endif }