mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
- use more desctiptive names for the predefined vertex buffer indices.
This commit is contained in:
parent
4a822a8f50
commit
4ab8ca63ce
6 changed files with 19 additions and 2 deletions
|
@ -772,11 +772,13 @@ void GLWall::RenderLightsCompat(int pass)
|
|||
}
|
||||
if (PrepareLight(light, pass))
|
||||
{
|
||||
vertcount = 0;
|
||||
RenderWall(RWF_TEXTURED, NULL);
|
||||
}
|
||||
node = node->nextLight;
|
||||
}
|
||||
memcpy(tcs, save, sizeof(tcs));
|
||||
vertcount = 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -83,6 +83,13 @@ class FFlatVertexBuffer : public FVertexBuffer
|
|||
static const unsigned int BUFFER_SIZE_TO_USE = 1999500;
|
||||
|
||||
public:
|
||||
enum
|
||||
{
|
||||
QUAD_INDEX = 0,
|
||||
FULLSCREEN_INDEX = 4,
|
||||
PRESENT_INDEX = 8
|
||||
};
|
||||
|
||||
TArray<FFlatVertex> vbo_shadowdata; // this is kept around for updating the actual (non-readable) buffer and as stand-in for pre GL 4.x
|
||||
|
||||
FFlatVertexBuffer(int width, int height);
|
||||
|
|
|
@ -114,7 +114,7 @@ void FGLRenderer::RenderScreenQuad()
|
|||
{
|
||||
mVBO->BindVBO();
|
||||
gl_RenderState.ResetVertexBuffer();
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, 8, 4);
|
||||
glDrawArrays(GL_TRIANGLE_STRIP, FFlatVertexBuffer::PRESENT_INDEX, 4);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -81,6 +81,6 @@ void FQuadDrawer::DoRender(int type)
|
|||
glUniformMatrix4fv(shader->vertexmatrix_index, 1, false, matV);
|
||||
glUniformMatrix4fv(shader->texcoordmatrix_index, 1, false, matT);
|
||||
glUniform1i(shader->quadmode_index, 1);
|
||||
GLRenderer->mVBO->RenderArray(type, 0, 4);
|
||||
GLRenderer->mVBO->RenderArray(type, FFlatVertexBuffer::QUAD_INDEX, 4);
|
||||
glUniform1i(shader->quadmode_index, 0);
|
||||
}
|
||||
|
|
|
@ -172,6 +172,9 @@ public:
|
|||
float zceil[2];
|
||||
float zfloor[2];
|
||||
|
||||
unsigned int vertindex;
|
||||
unsigned int vertcount;
|
||||
|
||||
public:
|
||||
seg_t * seg; // this gives the easiest access to all other structs involved
|
||||
subsector_t * sub; // For polyobjects
|
||||
|
|
|
@ -1467,6 +1467,8 @@ void GLWall::Process(seg_t *seg, sector_t * frontsector, sector_t * backsector)
|
|||
// note: we always have a valid sidedef and linedef reference when getting here.
|
||||
|
||||
this->seg = seg;
|
||||
vertindex = 0;
|
||||
vertcount = 0;
|
||||
|
||||
if ((seg->sidedef->Flags & WALLF_POLYOBJ) && seg->backsector)
|
||||
{
|
||||
|
@ -1760,6 +1762,9 @@ void GLWall::ProcessLowerMiniseg(seg_t *seg, sector_t * frontsector, sector_t *
|
|||
|
||||
float ffh = frontsector->GetPlaneTexZ(sector_t::floor);
|
||||
float bfh = backsector->GetPlaneTexZ(sector_t::floor);
|
||||
|
||||
vertindex = 0;
|
||||
vertcount = 0;
|
||||
if (bfh > ffh)
|
||||
{
|
||||
this->seg = seg;
|
||||
|
|
Loading…
Reference in a new issue