- Fixed: The "clip midtexture" flag did not work as expected for stacked sectors. This is

because it was an extension of the normal wall clipping process. Since a stacked sector
  above you doesn't draw a floor, it wouldn't clip any midtextures to the floor either.
  R_RenderMaskedSegRange() now checks this directly when rendering inside a stacked sector.

SVN r3647 (trunk)
This commit is contained in:
Randy Heit 2012-05-13 02:01:54 +00:00
parent 44932a6c56
commit a8507d58bd
1 changed files with 42 additions and 0 deletions

View File

@ -213,6 +213,25 @@ static void BlastMaskedColumn (void (*blastfunc)(const BYTE *pixels, const FText
spryscale += rw_scalestep;
}
// Clip a midtexture to the floor and ceiling of the sector in front of it.
void ClipMidtex(int x1, int x2)
{
short most[MAXWIDTH];
WallMost(most, curline->frontsector->ceilingplane);
for (int i = x1; i <= x2; ++i)
{
if (wallupper[i] < most[i])
wallupper[i] = most[i];
}
WallMost(most, curline->frontsector->floorplane);
for (int i = x1; i <= x2; ++i)
{
if (walllower[i] > most[i])
walllower[i] = most[i];
}
}
void R_RenderFakeWallRange(drawseg_t *ds, int x1, int x2);
void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
@ -402,6 +421,18 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
if (walllower[i] > mfloorclip[i])
walllower[i] = mfloorclip[i];
}
if (CurrentSkybox)
{ // Midtex clipping doesn't work properly with skyboxes, since you're normally below the floor
// or above the ceiling, so the appropriate end won't be clipped automatically when adding
// this drawseg.
if ((curline->linedef->flags & ML_CLIP_MIDTEX) ||
(curline->sidedef->Flags & WALLF_CLIP_MIDTEX))
{
ClipMidtex(x1, x2);
}
}
mfloorclip = walllower;
mceilingclip = wallupper;
@ -454,6 +485,17 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
WallSX1 = ds->sx1;
WallSX2 = ds->sx2;
if (CurrentSkybox)
{ // Midtex clipping doesn't work properly with skyboxes, since you're normally below the floor
// or above the ceiling, so the appropriate end won't be clipped automatically when adding
// this drawseg.
if ((curline->linedef->flags & ML_CLIP_MIDTEX) ||
(curline->sidedef->Flags & WALLF_CLIP_MIDTEX))
{
ClipMidtex(x1, x2);
}
}
if (fake3D & FAKE3D_CLIPTOP)
{
OWallMost (wallupper, sclipTop - viewz);