Skip to content

Commit

Permalink
move enablevattribs() to renderstate for #241
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Nov 9, 2022
1 parent e23a169 commit 10e4d98
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/engine/render/renderva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ namespace
void disablevbuf();
void enablevquery();
void cleanupgeom();
void enablevattribs(bool all = true);
void disablevattribs(bool all = true);

renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false),
Expand Down Expand Up @@ -910,7 +911,7 @@ namespace
} while(++curtex < numtexs);
}

void enablevattribs(renderstate &cur, bool all = true)
void renderstate::enablevattribs(bool all)
{
gle::enablevertex();
if(all)
Expand All @@ -919,7 +920,7 @@ namespace
gle::enablenormal();
gle::enabletangent();
}
cur.vattribs = true;
vattribs = true;
}

void renderstate::disablevattribs(bool all)
Expand Down Expand Up @@ -1188,7 +1189,7 @@ namespace
{
cur.disablevquery();
}
enablevattribs(cur);
cur.enablevattribs();
}
}
while(curbatch >= 0)
Expand Down Expand Up @@ -1236,7 +1237,7 @@ namespace
{
cur.disablevquery();
}
enablevattribs(cur, false);
cur.enablevattribs(false);
}
if(cur.vbuf!=va->vbuf)
{
Expand Down Expand Up @@ -1334,7 +1335,7 @@ namespace
case RenderPass_Caustics:
if(!cur.vattribs)
{
enablevattribs(cur, false);
cur.enablevattribs(false);
}
if(cur.vbuf!=va->vbuf)
{
Expand Down Expand Up @@ -3413,7 +3414,7 @@ void renderrsmgeom(bool dyntex)
setupgeom();
if(skyshadow)
{
enablevattribs(cur, false);
cur.enablevattribs(false);
SETSHADER(rsmsky);
vtxarray *prev = nullptr;
for(vtxarray *va = shadowva; va; va = va->rnext)
Expand Down

0 comments on commit 10e4d98

Please sign in to comment.