mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
Fix portal sprite clipping bugs
This commit is contained in:
parent
5948c7b0da
commit
388c511e11
4 changed files with 13 additions and 9 deletions
|
@ -78,6 +78,7 @@ namespace swrenderer
|
|||
void EnterSkybox();
|
||||
void LeaveSkybox();
|
||||
void SetFakeFloor(F3DFloor *fakeFloor);
|
||||
void ClearFakeFloors() { FakeFloors.clear(); }
|
||||
|
||||
RenderThread *Thread = nullptr;
|
||||
|
||||
|
|
|
@ -60,6 +60,8 @@ namespace swrenderer
|
|||
|
||||
void ResetFakingUnderwater() { r_fakingunderwater = false; }
|
||||
sector_t *FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel, seg_t *backline, int backx1, int backx2, double frontcz1, double frontcz2);
|
||||
|
||||
void ClearSeenSprites() { SeenSpriteSectors.clear(); SeenActors.clear(); }
|
||||
|
||||
short floorclip[MAXWIDTH];
|
||||
short ceilingclip[MAXWIDTH];
|
||||
|
|
|
@ -162,7 +162,8 @@ namespace swrenderer
|
|||
viewsector = port->mDestination;
|
||||
assert(viewsector != nullptr);
|
||||
R_SetViewAngle();
|
||||
validcount++; // Make sure we see all sprites
|
||||
Thread->OpaquePass->ClearSeenSprites();
|
||||
Thread->Clip3D->ClearFakeFloors();
|
||||
|
||||
planes->ClearKeepFakePlanes();
|
||||
Thread->ClipSegments->Clear(pl->left, pl->right);
|
||||
|
@ -185,6 +186,11 @@ namespace swrenderer
|
|||
}
|
||||
}
|
||||
|
||||
drawseglist->PushPortal();
|
||||
Thread->SpriteList->PushPortal();
|
||||
viewposStack.Push(ViewPos);
|
||||
visplaneStack.Push(pl);
|
||||
|
||||
// Create a drawseg to clip sprites to the sky plane
|
||||
DrawSegment *draw_segment = Thread->FrameMemory->NewObject<DrawSegment>();
|
||||
draw_segment->CurrentPortalUniq = CurrentPortalUniq;
|
||||
|
@ -207,11 +213,6 @@ namespace swrenderer
|
|||
memcpy(draw_segment->sprtopclip, ceilingclip + pl->left, (pl->right - pl->left) * sizeof(short));
|
||||
drawseglist->Push(draw_segment);
|
||||
|
||||
drawseglist->PushPortal();
|
||||
Thread->SpriteList->PushPortal();
|
||||
viewposStack.Push(ViewPos);
|
||||
visplaneStack.Push(pl);
|
||||
|
||||
Thread->OpaquePass->RenderScene();
|
||||
Thread->Clip3D->ResetClip(); // reset clips (floor/ceiling)
|
||||
planes->Render();
|
||||
|
@ -227,7 +228,7 @@ namespace swrenderer
|
|||
{
|
||||
// Masked textures and planes need the view coordinates restored for proper positioning.
|
||||
viewposStack.Pop(ViewPos);
|
||||
|
||||
|
||||
Thread->TranslucentPass->Render();
|
||||
|
||||
VisiblePlane *pl;
|
||||
|
@ -236,7 +237,7 @@ namespace swrenderer
|
|||
{
|
||||
pl->Render(Thread, pl->Alpha, pl->Additive, true);
|
||||
}
|
||||
|
||||
|
||||
Thread->SpriteList->PopPortal();
|
||||
drawseglist->PopPortal();
|
||||
}
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace swrenderer
|
|||
if (!r_scene_multithreaded)
|
||||
numThreads = 1;
|
||||
|
||||
if (numThreads != Threads.size())
|
||||
if (numThreads != (int)Threads.size())
|
||||
{
|
||||
StopThreads();
|
||||
StartThreads(numThreads);
|
||||
|
|
Loading…
Reference in a new issue