mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
- reuse the same vertex buffer data for all slices of a decal.
This commit is contained in:
parent
f11f86f05d
commit
9453a8a7e6
1 changed files with 11 additions and 14 deletions
|
@ -327,20 +327,23 @@ void GLWall::DrawDecal(DBaseDecal *decal)
|
|||
{
|
||||
gl_RenderState.SetFog(0,-1);
|
||||
}
|
||||
|
||||
|
||||
FFlatVertex *ptr = GLRenderer->mVBO->GetBuffer();
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ptr->Set(dv[i].x, dv[i].z, dv[i].y, dv[i].u, dv[i].v);
|
||||
ptr++;
|
||||
}
|
||||
|
||||
if (lightlist == NULL)
|
||||
{
|
||||
gl_RenderState.Apply();
|
||||
FFlatVertex *ptr = GLRenderer->mVBO->GetBuffer();
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ptr->Set(dv[i].x, dv[i].z, dv[i].y, dv[i].u, dv[i].v);
|
||||
ptr++;
|
||||
}
|
||||
GLRenderer->mVBO->RenderCurrent(ptr, GL_TRIANGLE_FAN);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int offset;
|
||||
unsigned int count = GLRenderer->mVBO->GetCount(ptr, &offset);
|
||||
for (unsigned k = 0; k < lightlist->Size(); k++)
|
||||
{
|
||||
secplane_t &lowplane = k == (*lightlist).Size() - 1 ? bottomplane : (*lightlist)[k + 1].plane;
|
||||
|
@ -360,13 +363,7 @@ void GLWall::DrawDecal(DBaseDecal *decal)
|
|||
gl_RenderState.SetSplitPlanes((*lightlist)[k].plane, lowplane);
|
||||
|
||||
gl_RenderState.Apply();
|
||||
FFlatVertex *ptr = GLRenderer->mVBO->GetBuffer();
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ptr->Set(dv[i].x, dv[i].z, dv[i].y, dv[i].u, dv[i].v);
|
||||
ptr++;
|
||||
}
|
||||
GLRenderer->mVBO->RenderCurrent(ptr, GL_TRIANGLE_FAN);
|
||||
GLRenderer->mVBO->RenderArray(GL_TRIANGLE_FAN, offset, count);
|
||||
}
|
||||
if (low1 <= dv[0].z && low2 <= dv[3].z) break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue