- store the wall render nodes as pointers, not as objects.
This is mainly for future-proofing because storing these as objects in an array not only has a negative impact when using multithreading due to longer blocking time for the threads but also makes it hard to cache this data for reuse.
This commit is contained in:
parent
e15baa21cb
commit
e8eb8dd596
5 changed files with 60 additions and 48 deletions
|
|
@ -55,7 +55,8 @@ void FDrawInfo::AddWall(GLWall *wall)
|
|||
{
|
||||
wall->ViewDistance = (r_viewpoint.Pos - (wall->seg->linedef->v1->fPos() + wall->seg->linedef->Delta() / 2)).XY().LengthSquared();
|
||||
if (gl.buffermethod == BM_DEFERRED) wall->MakeVertices(true);
|
||||
drawlists[GLDL_TRANSLUCENT].AddWall(wall);
|
||||
auto newwall = drawlists[GLDL_TRANSLUCENT].NewWall();
|
||||
*newwall = *wall;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -77,8 +78,8 @@ void FDrawInfo::AddWall(GLWall *wall)
|
|||
list = masked ? GLDL_MASKEDWALLS : GLDL_PLAINWALLS;
|
||||
}
|
||||
if (gl.buffermethod == BM_DEFERRED) wall->MakeVertices(false);
|
||||
drawlists[list].AddWall(wall);
|
||||
|
||||
auto newwall = drawlists[list].NewWall();
|
||||
*newwall = *wall;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +173,8 @@ void GLWall::PutPortal(int ptype)
|
|||
{
|
||||
// draw a reflective layer over the mirror
|
||||
type=RENDERWALL_MIRRORSURFACE;
|
||||
gl_drawinfo->drawlists[GLDL_TRANSLUCENTBORDER].AddWall(this);
|
||||
auto newwall = gl_drawinfo->drawlists[GLDL_TRANSLUCENTBORDER].NewWall();
|
||||
*newwall = *this;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue