mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- added vertex initialization for walls in the processing pass for core profile without persistent buffers.
This is slower than doing it in the render pass so it's only active when actually needed - it's also slower than using a client array so this code only gets used when there is no choice but to work with a 3.x core profile context.
This commit is contained in:
parent
8f331f56e2
commit
4598c4138c
3 changed files with 8 additions and 1 deletions
|
@ -325,6 +325,7 @@ void GLDrawList::SortWallIntoPlane(SortNode * head,SortNode * sort)
|
|||
if (gl.glslversion < 1.3f)
|
||||
{
|
||||
GLWall * ws1;
|
||||
ws->vertcount = 0; // invalidate current vertices.
|
||||
ws1=&walls[walls.Size()-1];
|
||||
ws=&walls[drawitems[sort->itemindex].index]; // may have been reallocated!
|
||||
float newtexv = ws->tcs[GLWall::UPLFT].v + ((ws->tcs[GLWall::LOLFT].v - ws->tcs[GLWall::UPLFT].v) / (ws->zbottom[0] - ws->ztop[0])) * (fh->z - ws->ztop[0]);
|
||||
|
@ -467,6 +468,7 @@ void GLDrawList::SortWallIntoWall(SortNode * head,SortNode * sort)
|
|||
float izt=(float)(ws->ztop[0]+r*(ws->ztop[1]-ws->ztop[0]));
|
||||
float izb=(float)(ws->zbottom[0]+r*(ws->zbottom[1]-ws->zbottom[0]));
|
||||
|
||||
ws->vertcount = 0; // invalidate current vertices.
|
||||
GLWall w=*ws;
|
||||
AddWall(&w);
|
||||
ws1=&walls[walls.Size()-1];
|
||||
|
|
|
@ -526,7 +526,7 @@ void gl_FillScreen()
|
|||
gl_RenderState.EnableTexture(false);
|
||||
gl_RenderState.Apply();
|
||||
// The fullscreen quad is stored at index 4 in the main vertex buffer.
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 4, 4);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::FULLSCREEN_INDEX, 4);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -135,6 +135,7 @@ void GLWall::PutWall(bool translucent)
|
|||
if (translucent) // translucent walls
|
||||
{
|
||||
ViewDistance = (ViewPos - (seg->linedef->v1->fPos() + seg->linedef->Delta() / 2)).XY().LengthSquared();
|
||||
if (gl.buffermethod == BM_DEFERRED) MakeVertices(true);
|
||||
gl_drawinfo->drawlists[GLDL_TRANSLUCENT].AddWall(this);
|
||||
}
|
||||
else
|
||||
|
@ -157,16 +158,19 @@ void GLWall::PutWall(bool translucent)
|
|||
{
|
||||
list = masked ? GLDL_MASKEDWALLS : GLDL_PLAINWALLS;
|
||||
}
|
||||
if (gl.buffermethod == BM_DEFERRED) MakeVertices(false);
|
||||
gl_drawinfo->drawlists[list].AddWall(this);
|
||||
|
||||
}
|
||||
lightlist = NULL;
|
||||
vertcount = 0; // make sure that following parts of the same linedef do not get this one's vertex info.
|
||||
}
|
||||
|
||||
void GLWall::PutPortal(int ptype)
|
||||
{
|
||||
GLPortal * portal;
|
||||
|
||||
if (gl.buffermethod == BM_DEFERRED) MakeVertices(false);
|
||||
switch (ptype)
|
||||
{
|
||||
// portals don't go into the draw list.
|
||||
|
@ -237,6 +241,7 @@ void GLWall::PutPortal(int ptype)
|
|||
portal->AddLine(this);
|
||||
break;
|
||||
}
|
||||
vertcount = 0;
|
||||
}
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue