mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +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.sx2 = ds->sx2;
|
||||
|
||||
double top, bot;
|
||||
GetMaskedWallTopBottom(ds, top, bot);
|
||||
top -= Thread->Viewport->viewpoint.Pos.Z;
|
||||
bot -= Thread->Viewport->viewpoint.Pos.Z;
|
||||
// Unclipped vanilla Doom range for the wall. Relies on ceiling/floor clip to clamp the wall in range.
|
||||
double ceilZ = textop;
|
||||
double floorZ = textop - texheight;
|
||||
|
||||
// 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)
|
||||
{
|
||||
wallupper.Project(Thread->Viewport.get(), textop < m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z ? textop : m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z, &WallC);
|
||||
}
|
||||
else
|
||||
{
|
||||
wallupper.Project(Thread->Viewport.get(), MIN(textop, top), &WallC);
|
||||
double clipZ = m3DFloor.sclipTop - Thread->Viewport->viewpoint.Pos.Z;
|
||||
ceilZ = MIN(ceilZ, clipZ);
|
||||
}
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
walllower.Project(Thread->Viewport.get(), MAX(textop - texheight, bot), &WallC);
|
||||
double clipZ = m3DFloor.sclipBottom - Thread->Viewport->viewpoint.Pos.Z;
|
||||
floorZ = MAX(floorZ, clipZ);
|
||||
}
|
||||
|
||||
wallupper.Project(Thread->Viewport.get(), ceilZ, &WallC);
|
||||
walllower.Project(Thread->Viewport.get(), floorZ, &WallC);
|
||||
|
||||
for (int i = x1; i < x2; i++)
|
||||
{
|
||||
if (wallupper.ScreenY[i] < mceilingclip[i])
|
||||
|
|
Loading…
Reference in a new issue