Skip to content

Commit

Permalink
- add an alpha parameter to R_FindPlane.
Browse files Browse the repository at this point in the history
- fixed: R_FindPlane must do a full visplane comparison for stacked sectors with a non-0 alpha for the sector plane.


git-svn-id: http://mancubus.net/svn/hosted/zdoom/zdoom/trunk@2991 a95907f1-e10c-0410-b46f-9e587ccb1026
  • Loading branch information
graf committed Nov 7, 2010
1 parent bc8c137 commit 7a3bba0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/r_bsp.cpp
Expand Up @@ -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),
Expand All @@ -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),
Expand Down
18 changes: 17 additions & 1 deletion src/r_plane.cpp
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions src/r_plane.h
Expand Up @@ -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,
Expand Down

0 comments on commit 7a3bba0

Please sign in to comment.