From 33f959628eb761b62a1711c0461dca3226687829 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sun, 15 Oct 2023 19:32:18 -0500 Subject: [PATCH] Calculate slope vectors per tilted ripple span --- src/r_plane.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 74e0df65d..df13f95a3 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -126,6 +126,8 @@ static void R_UpdatePlaneRipple(drawspandata_t* ds) ds->planeripple.offset = (leveltime * 140); } +static void R_SetSlopePlaneVectors(drawspandata_t* ds, visplane_t *pl, INT32 y, fixed_t xoff, fixed_t yoff); + static void R_MapPlane(drawspandata_t *ds, spandrawfunc_t *spanfunc, INT32 y, INT32 x1, INT32 x2, boolean allow_parallel) { ZoneScoped; @@ -231,6 +233,9 @@ static void R_MapTiltedPlane(drawspandata_t *ds, void(*spanfunc)(drawspandata_t* R_SetTiltedSpan(ds, std::clamp(y, 0, viewheight)); + R_CalculatePlaneRipple(ds, ds->currentplane->viewangle + ds->currentplane->plangle); + R_SetSlopePlaneVectors(ds, ds->currentplane, x1, (ds->xoffs + ds->planeripple.xfrac), (ds->yoffs + ds->planeripple.yfrac)); + ds->bgofs >>= FRACBITS; if ((y + ds->bgofs) >= viewheight) @@ -567,6 +572,7 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop) static void R_MakeSpans(void (*mapfunc)(drawspandata_t* ds, void(*spanfunc)(drawspandata_t*), INT32, INT32, INT32, boolean), spandrawfunc_t* spanfunc, drawspandata_t* ds, INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2, boolean allow_parallel) { + ZoneScoped; // Alam: from r_splats's R_RasterizeFloorSplat if (t1 >= vid.height) t1 = vid.height-1; if (b1 >= vid.height) b1 = vid.height-1; @@ -941,6 +947,8 @@ void R_DrawSinglePlane(drawspandata_t *ds, visplane_t *pl, boolean allow_paralle ZoneScoped; + R_UpdatePlaneRipple(ds); + // sky flat if (pl->picnum == skyflatnum) {