- use the same formula for calculating 3DMidTex offsets as the renderer when per-sidedef scaling is used.

This reuses the FTexCoordInfo class the hardware renderer had been using to calculate wall texture offsetting.
The software renderers still need this sorted out to bring them in line with the rest of the code, though, but they do not have this code sufficiently well organized to make this a straightforward task.
This commit is contained in:
Christoph Oelckers 2018-11-17 18:24:14 +01:00
commit 08fe9c375b
5 changed files with 145 additions and 133 deletions

View file

@ -232,13 +232,12 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do
FTexture * tex= TexMan(texnum);
if (!tex) return false;
double totalscale = fabs(side->GetTextureYScale(side_t::mid)) * tex->GetScaleY();
double y_offset = side->GetTextureYOffset(side_t::mid);
double textureheight = tex->GetHeight() / totalscale;
if (totalscale != 1. && !tex->bWorldPanning)
{
y_offset /= totalscale;
}
FTexCoordInfo tci;
// We only need the vertical positioning info here.
tci.GetFromTexture(tex, 1., (float)side->GetTextureYScale(side_t::mid));
double y_offset = tci.RowOffset((float)side->GetTextureYOffset(side_t::mid));
double textureheight = tci.mRenderHeight;
if(line->flags & ML_DONTPEGBOTTOM)
{