Fix scaling of 3D floor wall textures.

The scale factors are now taken from the same part of the sidedef that
provides the texture.
This commit is contained in:
Eevee (Alex Munroe) 2015-06-06 18:26:13 -07:00
parent 8fa9aa2627
commit 15b97c1409

View file

@ -557,8 +557,25 @@ void R_RenderFakeWall(drawseg_t *ds, int x1, int x2, F3DFloor *rover)
MaskedSWall = (fixed_t *)(openings + ds->swall) - ds->x1; MaskedSWall = (fixed_t *)(openings + ds->swall) - ds->x1;
// find positioning // find positioning
xscale = FixedMul(rw_pic->xScale, curline->sidedef->GetTextureXScale(side_t::mid)); side_t *scaledside;
yscale = FixedMul(rw_pic->yScale, curline->sidedef->GetTextureYScale(side_t::mid)); side_t::ETexpart scaledpart;
if (rover->flags & FF_UPPERTEXTURE)
{
scaledside = curline->sidedef;
scaledpart = side_t::top;
}
else if (rover->flags & FF_LOWERTEXTURE)
{
scaledside = curline->sidedef;
scaledpart = side_t::bottom;
}
else
{
scaledside = rover->master->sidedef[0];
scaledpart = side_t::mid;
}
xscale = FixedMul(rw_pic->xScale, scaledside->GetTextureXScale(scaledpart));
yscale = FixedMul(rw_pic->yScale, scaledside->GetTextureYScale(scaledpart));
// encapsulate the lifetime of rowoffset // encapsulate the lifetime of rowoffset
fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureYOffset(side_t::mid); fixed_t rowoffset = curline->sidedef->GetTextureYOffset(side_t::mid) + rover->master->sidedef[0]->GetTextureYOffset(side_t::mid);
dc_texturemid = rover->model->GetPlaneTexZ(sector_t::ceiling); dc_texturemid = rover->model->GetPlaneTexZ(sector_t::ceiling);