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)
|
else if (drawtextured)
|
||||||
{
|
{
|
||||||
fixed_t texturevpeg;
|
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?
|
// Wow, how was this missing from OpenGL for so long?
|
||||||
// ...Oh well, anyway, Lower Unpegged now changes pegging of FOFs like in software
|
// ...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)
|
if (newline)
|
||||||
{
|
{
|
||||||
texturevpeg = sides[newline->sidenum[0]].rowoffset;
|
texturevpeg = sides[newline->sidenum[0]].rowoffset;
|
||||||
if (newline->flags & ML_DONTPEGBOTTOM)
|
attachtobottom = !!(newline->flags & ML_DONTPEGBOTTOM);
|
||||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
#ifdef ESLOPE
|
||||||
|
slopeskew = !!(newline->flags & ML_DONTPEGTOP);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
|
texturevpeg = sides[rover->master->sidenum[0]].rowoffset;
|
||||||
if (gr_linedef->flags & ML_DONTPEGBOTTOM)
|
attachtobottom = !!(gr_linedef->flags & ML_DONTPEGBOTTOM);
|
||||||
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
#ifdef ESLOPE
|
||||||
|
slopeskew = !!(rover->master->flags & ML_DONTPEGTOP);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
grTex = HWR_GetTexture(texnum);
|
grTex = HWR_GetTexture(texnum);
|
||||||
|
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
wallVerts[3].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
if (!slopeskew) // no skewing
|
||||||
wallVerts[2].t = (*rover->topheight - hS + texturevpeg) * grTex->scaleY;
|
{
|
||||||
wallVerts[0].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
if (attachtobottom)
|
||||||
wallVerts[1].t = (*rover->topheight - lS + texturevpeg) * grTex->scaleY;
|
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
|
#else
|
||||||
|
if (attachtobottom)
|
||||||
|
texturevpeg -= *rover->topheight - *rover->bottomheight;
|
||||||
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
wallVerts[3].t = wallVerts[2].t = (*rover->topheight - h + texturevpeg) * grTex->scaleY;
|
||||||
wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
wallVerts[0].t = wallVerts[1].t = (*rover->topheight - l + texturevpeg) * grTex->scaleY;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue