mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-13 07:57:52 +00:00
- Fix mid texture rendering for self-referencing sector lines
This commit is contained in:
parent
b6f184491b
commit
b1d33d1bba
1 changed files with 26 additions and 14 deletions
|
@ -264,28 +264,40 @@ namespace swrenderer
|
||||||
WallC.sx1 = ds->sx1;
|
WallC.sx1 = ds->sx1;
|
||||||
WallC.sx2 = ds->sx2;
|
WallC.sx2 = ds->sx2;
|
||||||
|
|
||||||
double top, bot;
|
// Unclipped vanilla Doom range for the wall. Relies on ceiling/floor clip to clamp the wall in range.
|
||||||
GetMaskedWallTopBottom(ds, top, bot);
|
double ceilZ = textop;
|
||||||
top -= Thread->Viewport->viewpoint.Pos.Z;
|
double floorZ = textop - texheight;
|
||||||
bot -= Thread->Viewport->viewpoint.Pos.Z;
|
|
||||||
|
|
||||||
|
// The 3D Floors implementation destroys the ceiling clip when doing its height passes..
|
||||||
|
if (m3DFloor.clipTop || m3DFloor.clipBottom)
|
||||||
|
{
|
||||||
|
// Use the actual correct wall range for the midtexture.
|
||||||
|
// This doesn't work for self-referenced sectors, which is why we only do it if we have 3D floors.
|
||||||
|
|
||||||
|
double top, bot;
|
||||||
|
GetMaskedWallTopBottom(ds, top, bot);
|
||||||
|
top -= Thread->Viewport->viewpoint.Pos.Z;
|
||||||
|
bot -= Thread->Viewport->viewpoint.Pos.Z;
|
||||||
|
|
||||||
|
ceilZ = MIN(ceilZ, top);
|
||||||
|
floorZ = MAX(floorZ, bot);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clip wall by the current 3D floor render range.
|
||||||
if (m3DFloor.clipTop)
|
if (m3DFloor.clipTop)
|
||||||
{
|
{
|
||||||
wallupper.Project(Thread->Viewport.get(), textop < m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z ? textop : m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z, &WallC);
|
double clipZ = m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z;
|
||||||
}
|
ceilZ = MIN(ceilZ, clipZ);
|
||||||
else
|
|
||||||
{
|
|
||||||
wallupper.Project(Thread->Viewport.get(), MIN(textop, top), &WallC);
|
|
||||||
}
|
}
|
||||||
if (m3DFloor.clipBottom)
|
if (m3DFloor.clipBottom)
|
||||||
{
|
{
|
||||||
walllower.Project(Thread->Viewport.get(), textop - texheight > m3DFloor.sclipBottom - Thread->Viewport->viewpoint.Pos.Z ? textop - texheight : m3DFloor.sclipBottom - Thread->Viewport->viewpoint.Pos.Z, &WallC);
|
double clipZ = m3DFloor.sclipBottom - Thread->Viewport->viewpoint.Pos.Z;
|
||||||
}
|
floorZ = MAX(floorZ, clipZ);
|
||||||
else
|
|
||||||
{
|
|
||||||
walllower.Project(Thread->Viewport.get(), MAX(textop - texheight, bot), &WallC);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wallupper.Project(Thread->Viewport.get(), ceilZ, &WallC);
|
||||||
|
walllower.Project(Thread->Viewport.get(), floorZ, &WallC);
|
||||||
|
|
||||||
for (int i = x1; i < x2; i++)
|
for (int i = x1; i < x2; i++)
|
||||||
{
|
{
|
||||||
if (wallupper.ScreenY[i] < mceilingclip[i])
|
if (wallupper.ScreenY[i] < mceilingclip[i])
|
||||||
|
|
Loading…
Reference in a new issue