Skip to content

Commit

Permalink
move renderzpass to renderstate for #241
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 28, 2022
1 parent 97485c0 commit e6c3b54
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions src/engine/render/renderva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,7 @@ namespace
void enablevattribs(bool all = true);
void disablevattribs(bool all = true);
void renderbatches(int pass);
void renderzpass(const vtxarray &va);

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 @@ -1242,34 +1243,34 @@ namespace
resetbatches();
}

void renderzpass(renderstate &cur, const vtxarray &va)
void renderstate::renderzpass(const vtxarray &va)
{
if(!cur.vattribs)
if(!vattribs)
{
if(cur.vquery)
if(vquery)
{
cur.disablevquery();
disablevquery();
}
cur.enablevattribs(false);
enablevattribs(false);
}
if(cur.vbuf!=va.vbuf)
if(vbuf!=va.vbuf)
{
changevbuf(cur, RenderPass_Z, va);
changevbuf(*this, RenderPass_Z, va);
}
if(!cur.depthmask)
if(!depthmask)
{
cur.depthmask = true;
depthmask = true;
glDepthMask(GL_TRUE);
}
if(cur.colormask)
if(colormask)
{
cur.colormask = false;
colormask = false;
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
}
int firsttex = 0,
numtris = va.tris,
offset = 0;
if(cur.alphaing)
if(alphaing)
{
firsttex += va.texs;
offset += 3*(va.tris);
Expand Down Expand Up @@ -1363,7 +1364,7 @@ namespace
{
STARTVAQUERY(va, );
}
renderzpass(cur, va);
cur.renderzpass(va);
if(doquery)
{
ENDVAQUERY(va, );
Expand Down

0 comments on commit e6c3b54

Please sign in to comment.