Skip to content

Commit

Permalink
move cleanupgeom() to renderstate for #241
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 8, 2022
1 parent 66bc83a commit f309e1c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/engine/render/renderva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ namespace
void disablevquery();
void disablevbuf();
void enablevquery();
void cleanupgeom();

renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false),
vquery(false), colorscale(1, 1, 1), alphascale(0), refractscale(0),
Expand Down Expand Up @@ -1381,15 +1382,15 @@ namespace
GLOBALPARAMF(colorparams, 1, 1, 1, 1);
}

void cleanupgeom(renderstate &cur)
void renderstate::cleanupgeom()
{
if(cur.vattribs)
if(vattribs)
{
disablevattribs(cur);
disablevattribs(*this);
}
if(cur.vbuf)
if(vbuf)
{
cur.disablevbuf();
disablevbuf();
}
}

Expand Down Expand Up @@ -2819,7 +2820,7 @@ void renderalphageom(int side)
glCullFace(GL_BACK);
}

cleanupgeom(cur);
cur.cleanupgeom();
}

void rendergeom()
Expand Down Expand Up @@ -2985,7 +2986,7 @@ void rendergeom()
{
glDepthFunc(GL_LESS);
}
cleanupgeom(cur);
cur.cleanupgeom();
if(!doOQ)
{
glFlush();
Expand Down Expand Up @@ -3447,7 +3448,7 @@ void renderrsmgeom(bool dyntex)
{
renderbatches(cur, RenderPass_ReflectiveShadowMap);
}
cleanupgeom(cur);
cur.cleanupgeom();
}

int dynamicshadowvabounds(int mask, vec &bbmin, vec &bbmax)
Expand Down

0 comments on commit f309e1c

Please sign in to comment.