mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-21 03:11:03 +00:00
Fix 3D floor sides not using the correct set of line flags
This commit is contained in:
parent
28c30a9294
commit
3e34c96165
2 changed files with 16 additions and 7 deletions
|
@ -1625,12 +1625,17 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
|
||||
side_t *side = &sides[rover->master->sidenum[0]];
|
||||
|
||||
INT16 lineflags;
|
||||
|
||||
if (rover->master->flags & ML_TFERLINE)
|
||||
{
|
||||
size_t linenum = gl_curline->linedef-gl_backsector->lines[0];
|
||||
newline = rover->master->frontsector->lines[0] + linenum;
|
||||
side = &sides[newline->sidenum[0]];
|
||||
lineflags = newline->flags;
|
||||
}
|
||||
else
|
||||
lineflags = gl_curline->linedef->flags;
|
||||
|
||||
texnum = R_GetTextureNum(side->midtexture);
|
||||
|
||||
|
@ -1669,13 +1674,13 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||
// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
|
||||
// -- Monster Iestyn 26/06/18
|
||||
fixed_t texturevpeg = side->rowoffset + side->offsety_mid;
|
||||
boolean attachtobottom = !!(rover->master->flags & ML_DONTPEGBOTTOM);
|
||||
boolean attachtobottom = !!(lineflags & ML_DONTPEGBOTTOM);
|
||||
|
||||
grTex = HWR_GetTexture(texnum);
|
||||
xscale = FixedToFloat(side->scalex_mid);
|
||||
yscale = FixedToFloat(side->scaley_mid);
|
||||
|
||||
if (!(rover->master->flags & ML_SKEWTD)) // no skewing
|
||||
if (!(lineflags & ML_SKEWTD)) // no skewing
|
||||
{
|
||||
if (attachtobottom)
|
||||
texturevpeg -= (*rover->topheight - *rover->bottomheight) * yscale;
|
||||
|
|
14
src/r_segs.c
14
src/r_segs.c
|
@ -553,7 +553,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
fixed_t left_top, left_bottom; // needed here for slope skewing
|
||||
pslope_t *skewslope = NULL;
|
||||
boolean do_texture_skew;
|
||||
UINT32 lineflags;
|
||||
INT16 lineflags;
|
||||
fixed_t wall_scalex, wall_scaley;
|
||||
|
||||
void (*colfunc_2s) (column_t *);
|
||||
|
@ -578,7 +578,7 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
lineflags = newline->flags;
|
||||
}
|
||||
else
|
||||
lineflags = pfloor->master->flags;
|
||||
lineflags = curline->linedef->flags;
|
||||
|
||||
texnum = R_GetTextureNum(sidedef->midtexture);
|
||||
|
||||
|
@ -757,10 +757,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
left_bottom = P_GetFFloorBottomZAt(pfloor, ds->leftpos.x, ds->leftpos.y) - viewz;
|
||||
|
||||
do_texture_skew = lineflags & ML_SKEWTD;
|
||||
skewslope = *pfloor->t_slope; // skew using top slope by default
|
||||
|
||||
if (do_texture_skew)
|
||||
{
|
||||
skewslope = *pfloor->t_slope; // skew using top slope by default
|
||||
dc_texturemid = FixedMul(left_top, wall_scaley);
|
||||
}
|
||||
else
|
||||
dc_texturemid = FixedMul(*pfloor->topheight - viewz, wall_scaley);
|
||||
|
||||
|
@ -768,14 +770,16 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor)
|
|||
|
||||
if (lineflags & ML_DONTPEGBOTTOM)
|
||||
{
|
||||
skewslope = *pfloor->b_slope; // skew using bottom slope
|
||||
if (do_texture_skew)
|
||||
{
|
||||
skewslope = *pfloor->b_slope; // skew using bottom slope
|
||||
dc_texturemid = FixedMul(left_bottom, wall_scaley);
|
||||
}
|
||||
else
|
||||
offsetvalue -= FixedMul(*pfloor->topheight - *pfloor->bottomheight, wall_scaley);
|
||||
}
|
||||
|
||||
if (do_texture_skew && skewslope)
|
||||
if (skewslope)
|
||||
{
|
||||
angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y);
|
||||
ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT));
|
||||
|
|
Loading…
Reference in a new issue