- use wrapping fixed point conversion for SW rendering coordinates.

This commit is contained in:
Christoph Oelckers 2023-09-14 20:34:28 +02:00
parent 6847a9a5c1
commit 139d1a7eb6
2 changed files with 3 additions and 3 deletions

View file

@ -501,7 +501,7 @@ namespace swrenderer
double rowoffset = lineseg->sidedef->GetTextureYOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureYOffset(side_t::mid);
double planez = rover->model->GetPlaneTexZ(sector_t::ceiling);
fixed_t xoffset = FLOAT2FIXED(lineseg->sidedef->GetTextureXOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureXOffset(side_t::mid));
fixed_t xoffset = xs_Fix<16>::ToFix(lineseg->sidedef->GetTextureXOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureXOffset(side_t::mid));
if (rowoffset < 0)
{
rowoffset += pic->GetHeight();
@ -633,7 +633,7 @@ namespace swrenderer
fixed_t ProjectedWallTexcoords::GetXOffset(seg_t* lineseg, FSoftwareTexture* tex, side_t::ETexpart texpart)
{
fixed_t TextureOffsetU = FLOAT2FIXED(lineseg->sidedef->GetTextureXOffset(texpart));
fixed_t TextureOffsetU = xs_Fix<16>::ToFix(lineseg->sidedef->GetTextureXOffset(texpart));
double xscale = GetXScale(lineseg->sidedef, tex, texpart);
fixed_t xoffset;

View file

@ -186,7 +186,7 @@ namespace swrenderer
// to allow sky rotation as well as careful positioning.
// However, the offset is scaled very small, so that it
// allows a long-period of sky rotation.
skyangle += FLOAT2FIXED(s->GetTextureXOffset(pos));
skyangle += xs_Fix<16>::ToFix(s->GetTextureXOffset(pos));
// Vertical offset allows careful sky positioning.
skymid = s->GetTextureYOffset(pos) - 28.0;