Skip to content

Commit

Permalink
move texgen* variables to be private within renderstate for #241
Browse files Browse the repository at this point in the history
  • Loading branch information
no-lex committed Feb 1, 2023
1 parent 978cc27 commit 41b3dbc
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/engine/render/renderva.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,6 @@ namespace
bool vattribs, vquery;
float alphascale;
int globals;
int texgenorient, texgenmillis;

void disablevquery();
void disablevbuf();
Expand All @@ -733,6 +732,8 @@ namespace
void disablevattribs(bool all = true);
void renderbatches(int pass);
void renderzpass(const vtxarray &va);
void invalidatetexgenorient();
void cleartexgenmillis();

renderstate() : colormask(true), depthmask(true), alphaing(0), vbuf(0), vattribs(false),
vquery(false), alphascale(0), globals(-1), texgenorient(-1),
Expand All @@ -746,6 +747,8 @@ namespace
}
}
private:

int texgenorient, texgenmillis;
int tmu;
GLuint textures[7];
vec colorscale;
Expand All @@ -765,6 +768,16 @@ namespace

};

void renderstate::invalidatetexgenorient()
{
texgenorient = -1;
}

void renderstate::cleartexgenmillis()
{
texgenmillis = 0;
}

void renderstate::disablevbuf()
{
gle::clearvbo();
Expand Down Expand Up @@ -2942,7 +2955,7 @@ void rendergeom()
multipassing = true;
glDepthFunc(GL_LEQUAL);
}
cur.texgenorient = -1;
cur.invalidatetexgenorient();
setupgeom();
resetbatches();
for(vtxarray *va = visibleva; va; va = va->next)
Expand Down Expand Up @@ -3430,7 +3443,7 @@ void renderrsmgeom(bool dyntex)
renderstate cur;
if(!dyntex)
{
cur.texgenmillis = 0;
cur.cleartexgenmillis();
}
setupgeom();
if(skyshadow)
Expand Down

0 comments on commit 41b3dbc

Please sign in to comment.