- made wall draw code API independent.

This commit is contained in:
Christoph Oelckers 2018-10-21 13:53:50 +02:00
commit 8ffeb7812f
12 changed files with 275 additions and 264 deletions

View file

@ -209,8 +209,6 @@ void FDrawInfo::StartScene()
outer = gl_drawinfo;
gl_drawinfo = this;
for (int i = 0; i < GLDL_TYPES; i++) drawlists[i].Reset();
decals[0].Clear();
decals[1].Clear();
hudsprites.Clear();
vpIndex = 0;
@ -256,13 +254,6 @@ std::pair<FFlatVertex *, unsigned int> FDrawInfo::AllocVertices(unsigned int cou
return std::make_pair(p, index);
}
GLDecal *FDrawInfo::AddDecal(bool onmirror)
{
auto decal = (GLDecal*)RenderDataAllocator.Alloc(sizeof(GLDecal));
decals[onmirror ? 1 : 0].Push(decal);
return decal;
}
int FDrawInfo::UploadLights(FDynLightData &data)
{
return GLRenderer->mLights->UploadLights(data);
@ -312,6 +303,12 @@ void FDrawInfo::SetDepthMask(bool on)
glDepthMask(on);
}
void FDrawInfo::SetDepthFunc(int func)
{
static int df2gl[] = { GL_LESS, GL_LEQUAL, GL_ALWAYS };
glDepthFunc(df2gl[func]);
}
void FDrawInfo::EnableDrawBufferAttachments(bool on)
{
gl_RenderState.EnableDrawBuffers(on? gl_RenderState.GetPassDrawBufferCount() : 1);