From b924a7d902c65990c2f480880acb306292ec53eb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 30 Mar 2017 21:57:36 +0100 Subject: [PATCH] Interesting consideration: flat angle wasn't used to determine seperate visplanes. This is obviously incorrect behaviour. Enabling this restriction makes flat alignment on slopes ALMOST work identically to normal, but not quite. Also, made the fudge a const, since it may as well be one. --- src/r_plane.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/r_plane.c b/src/r_plane.c index e882fa48c..534e78c26 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -486,6 +486,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, && !pfloor && !check->ffloor && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewangle == viewangle + && check->plangle == plangle #ifdef ESLOPE && check->slope == slope #endif @@ -954,10 +955,11 @@ void R_DrawSinglePlane(visplane_t *pl) floatv3_t p, m, n; float ang; float vx, vy, vz; - float fudge; // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // use this as a temp var to store P_GetZAt's return value each time fixed_t temp; + // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red + const float fudge = ((1<slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); - // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red - fudge = ((1<