- Don't add 3D floor dummy draw segments to the list

This commit is contained in:
Magnus Norddahl 2017-07-02 14:46:19 +02:00
parent e19c8eba62
commit efb1a8d113
6 changed files with 28 additions and 32 deletions

View file

@ -319,8 +319,14 @@ namespace swrenderer
side_t *sidedef = mLineSegment->sidedef;
RenderPortal *renderportal = Thread->Portal.get();
Clip3DFloors *clip3d = Thread->Clip3D.get();
DrawSegment *draw_segment = Thread->FrameMemory->NewObject<DrawSegment>();
// 3D floors code abuses the line render code to update plane clipping
// lists but doesn't actually draw anything.
bool onlyUpdatePlaneClip = (clip3d->fake3D & FAKE3D_FAKEMASK) ? true : false;
if (!onlyUpdatePlaneClip)
Thread->DrawSegments->Push(draw_segment);
draw_segment->CurrentPortalUniq = renderportal->CurrentPortalUniq;
@ -342,10 +348,6 @@ namespace swrenderer
draw_segment->bFakeBoundary = false;
draw_segment->foggy = foggy;
Clip3DFloors *clip3d = Thread->Clip3D.get();
if (clip3d->fake3D & FAKE3D_FAKEMASK) draw_segment->fake = 1;
else draw_segment->fake = 0;
draw_segment->sprtopclip = nullptr;
draw_segment->sprbottomclip = nullptr;
draw_segment->maskedtexturecol = nullptr;
@ -406,7 +408,9 @@ namespace swrenderer
}
}
if (!draw_segment->fake && r_3dfloors && mBackSector->e && mBackSector->e->XFloor.ffloors.Size()) {
if (!onlyUpdatePlaneClip && r_3dfloors)
{
if (mBackSector->e && mBackSector->e->XFloor.ffloors.Size()) {
for (i = 0; i < (int)mBackSector->e->XFloor.ffloors.Size(); i++) {
F3DFloor *rover = mBackSector->e->XFloor.ffloors[i];
if (rover->flags & FF_RENDERSIDES && (!(rover->flags & FF_INVERTSIDES) || rover->flags & FF_ALLSIDES)) {
@ -415,7 +419,7 @@ namespace swrenderer
}
}
}
if (!draw_segment->fake && r_3dfloors && mFrontSector->e && mFrontSector->e->XFloor.ffloors.Size()) {
if (mFrontSector->e && mFrontSector->e->XFloor.ffloors.Size()) {
for (i = 0; i < (int)mFrontSector->e->XFloor.ffloors.Size(); i++) {
F3DFloor *rover = mFrontSector->e->XFloor.ffloors[i];
if (rover->flags & FF_RENDERSIDES && (rover->flags & FF_ALLSIDES || rover->flags & FF_INVERTSIDES)) {
@ -424,8 +428,9 @@ namespace swrenderer
}
}
}
// kg3D - no for fakes
if (!draw_segment->fake)
}
if (!onlyUpdatePlaneClip)
// allocate space for masked texture tables, if needed
// [RH] Don't just allocate the space; fill it in too.
if ((TexMan(sidedef->GetTexture(side_t::mid), true)->UseType != FTexture::TEX_Null || draw_segment->bFakeBoundary || IsFogBoundary(mFrontSector, mBackSector)) &&
@ -508,7 +513,7 @@ namespace swrenderer
draw_segment->shade = LightVisibility::LightLevelToShade(mLineSegment->sidedef->GetLightLevel(foggy, mLineSegment->frontsector->lightlevel) + LightVisibility::ActualExtraLight(foggy, Thread->Viewport.get()), foggy);
}
if ((draw_segment->bFogBoundary || draw_segment->maskedtexturecol != nullptr) && !draw_segment->fake)
if (draw_segment->bFogBoundary || draw_segment->maskedtexturecol != nullptr)
{
Thread->DrawSegments->PushTranslucent(draw_segment);
}

View file

@ -217,7 +217,6 @@ namespace swrenderer
draw_segment->swall = nullptr;
draw_segment->bFogBoundary = false;
draw_segment->curline = nullptr;
draw_segment->fake = 0;
draw_segment->foggy = false;
memcpy(draw_segment->sprbottomclip, floorclip + pl->left, (pl->right - pl->left) * sizeof(short));
memcpy(draw_segment->sprtopclip, ceilingclip + pl->left, (pl->right - pl->left) * sizeof(short));

View file

@ -161,8 +161,6 @@ namespace swrenderer
// [ZZ] the same as above
if (ds->CurrentPortalUniq != renderportal->CurrentPortalUniq)
continue;
// kg3D - no fake segs
if (ds->fake) continue;
if (ds->maskedtexturecol != nullptr || ds->bFogBoundary)
{
RenderDrawSegment renderer(Thread);

View file

@ -131,9 +131,6 @@ namespace swrenderer
{
ds = Segment(groupIndex);
// kg3D - no clipping on fake segs
if (ds->fake) continue;
if (ds->silhouette & SIL_BOTTOM)
{
short *clip1 = clipbottom + ds->x1;

View file

@ -51,7 +51,6 @@ namespace swrenderer
FWallTmapVals tmapvals;
int fake; // ident fake drawseg, don't draw and clip sprites backups
int CurrentPortalUniq; // [ZZ] to identify the portal that this drawseg is in. used for sprite clipping.
};

View file

@ -365,8 +365,6 @@ namespace swrenderer
{
DrawSegment *ds = segmentlist->Segment(index);
// kg3D - no clipping on fake segs
if (ds->fake) continue;
// determine if the drawseg obscures the sprite
if (ds->x1 >= x2 || ds->x2 <= x1 ||
(!(ds->silhouette & SIL_BOTH) && ds->maskedtexturecol == nullptr &&