mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 21:01:04 +00:00
Merge branch 'fof-slope-skew-backport' of https://git.magicalgirl.moe/STJr/SRB2.git
This commit is contained in:
commit
45fc2c46e9
1 changed files with 38 additions and 8 deletions
|
@ -2190,6 +2190,10 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
else if (drawtextured)
|
||||
{
|
||||
fixed_t texturevpeg;
|
||||
boolean attachtobottom = false;
|
||||
#ifdef ESLOPE
|
||||
boolean slopeskew = false; // skew FOF walls with slopes?
|
||||
#endif
|
||||
|
||||
// Wow, how was this missing from OpenGL for so long?
|
||||
// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
|
||||
|
@ -2197,24 +2201,50 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
if (newline)
|
||||
{
|
||||
texturevpeg = sides[newline->sidenum[0]].rowoffset;
|
||||
if (newline->flags & ML_DONTPEGBOTTOM)
|
||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||
attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM);
|
||||
#ifdef ESLOPE
|
||||
slopeskew = !!(newline->flags & ML_DONTPEGTOP);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
|
||||
if (gr_linedef->flags & ML_DONTPEGBOTTOM)
|
||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||
attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM);
|
||||
#ifdef ESLOPE
|
||||
slopeskew = !!(rover->master->flags & ML_DONTPEGTOP);
|
||||
#endif
|
||||
}
|
||||
|
||||
grTex = HWR_GetTexture(texnum);
|
||||
|
||||
#ifdef ESLOPE
|
||||
wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY;
|
||||
if (!slopeskew) // no skewing
|
||||
{
|
||||
if (attachtobottom)
|
||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||
wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!attachtobottom) // skew by top
|
||||
{
|
||||
wallVerts[3].t = wallVerts[2].t = texturevpeg * grTex->scaleY;
|
||||
wallVerts[0].t = (h - l + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[1].t = (hS - lS + texturevpeg) * grTex->scaleY;
|
||||
}
|
||||
else // skew by bottom
|
||||
{
|
||||
wallVerts[0].t = wallVerts[1].t = texturevpeg * grTex->scaleY;
|
||||
wallVerts[3].t = wallVerts[0].t - (h - l) * grTex->scaleY;
|
||||
wallVerts[2].t = wallVerts[1].t - (hS - lS) * grTex->scaleY;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (attachtobottom)
|
||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||
wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue