Fix surface midtexture yscale

This commit is contained in:
RaveYard 2023-09-20 21:30:49 +02:00 committed by Christoph Oelckers
parent 9d20bdef4f
commit 227634e9f9

View file

@ -799,8 +799,8 @@ void DoomLevelMesh::CreateSideSurfaces(FLevelLocals &doomMap, side_t *side)
auto gameTexture = TexMan.GetGameTexture(texture);
float mid1Top = gameTexture->GetDisplayHeight();
float mid2Top = gameTexture->GetDisplayHeight();
float mid1Top = gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale;
float mid2Top = gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale;
float mid1Bottom = 0;
float mid2Bottom = 0;
@ -812,7 +812,7 @@ void DoomLevelMesh::CreateSideSurfaces(FLevelLocals &doomMap, side_t *side)
}
else
{
yTextureOffset += side->sector->planes[sector_t::ceiling].TexZ - gameTexture->GetDisplayHeight();
yTextureOffset += side->sector->planes[sector_t::ceiling].TexZ - gameTexture->GetDisplayHeight() / side->textures[side_t::mid].yScale;
}
verts[0].Z = min(max(yTextureOffset + mid1Bottom, v1Bottom), v1Top);