From c31c4755faf41cc9e5cb5fff69968a0b1ceb43b0 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Nov 2010 16:11:42 +0000 Subject: [PATCH] - add an alpha parameter to R_FindPlane. - fixed: R_FindPlane must do a full visplane comparison for stacked sectors with a non-0 alpha for the sector plane. SVN r2991 (trunk) --- src/r_bsp.cpp | 2 ++ src/r_plane.cpp | 18 +++++++++++++++++- src/r_plane.h | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index e7ba7c116..b2060fd7e 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -1197,6 +1197,7 @@ void R_Subsector (subsector_t *sub) R_FindPlane(frontsector->ceilingplane, // killough 3/8/98 frontsector->GetTexture(sector_t::ceiling), ceilinglightlevel + r_actualextralight, // killough 4/11/98 + FRACUNIT, frontsector->GetXOffset(sector_t::ceiling), // killough 3/7/98 frontsector->GetYOffset(sector_t::ceiling), // killough 3/7/98 frontsector->GetXScale(sector_t::ceiling), @@ -1221,6 +1222,7 @@ void R_Subsector (subsector_t *sub) R_FindPlane(frontsector->floorplane, frontsector->GetTexture(sector_t::floor), floorlightlevel + r_actualextralight, // killough 3/16/98 + FRACUNIT, frontsector->GetXOffset(sector_t::floor), // killough 3/7/98 frontsector->GetYOffset(sector_t::floor), // killough 3/7/98 frontsector->GetXScale(sector_t::floor), diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 8fd055053..a5a40bc12 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -522,7 +522,7 @@ static visplane_t *new_visplane (unsigned hash) // killough 2/28/98: Add offsets //========================================================================== -visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightlevel, +visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightlevel, fixed_t alpha, fixed_t xoffs, fixed_t yoffs, fixed_t xscale, fixed_t yscale, angle_t angle, int sky, ASkyViewpoint *skybox) @@ -540,6 +540,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl xscale = 0; yscale = 0; angle = 0; + alpha = 0; plane.a = plane.b = plane.d = 0; // [RH] Map floor skies and ceiling skies to separate visplanes. This isn't // always necessary, but it is needed if a floor and ceiling sky are in the @@ -560,6 +561,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl plane = height; isskybox = false; sky = 0; // not skyflatnum so it can't be a sky + alpha = FRACUNIT; } // New visplane algorithm uses hash table -- killough @@ -579,6 +581,19 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl check->viewx == stacked_viewx && check->viewy == stacked_viewy && check->viewz == stacked_viewz && + check->alpha == alpha && + (alpha == 0 || // if alpha is > 0 everything needs to be checked + (plane == check->height && + picnum == check->picnum && + lightlevel == check->lightlevel && + xoffs == check->xoffs && // killough 2/28/98: Add offset checks + yoffs == check->yoffs && + basecolormap == check->colormap && // [RH] Add more checks + xscale == check->xscale && + yscale == check->yscale && + angle == check->angle + ) + ) && check->viewangle == stacked_angle) { return check; @@ -628,6 +643,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl check->viewy = stacked_viewy; check->viewz = stacked_viewz; check->viewangle = stacked_angle; + check->alpha = alpha; clearbufshort (check->top, viewwidth, 0x7fff); diff --git a/src/r_plane.h b/src/r_plane.h index 6dfd1e00d..2df6b1fda 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -93,6 +93,7 @@ visplane_t *R_FindPlane ( const secplane_t &height, FTextureID picnum, int lightlevel, + fixed_t alpha, fixed_t xoffs, // killough 2/28/98: add x-y offsets fixed_t yoffs, fixed_t xscale,