Skip to content

Commit

Permalink
triangle_wrappers: initialize 'g_GL_Modes' once at compile-time
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyAG authored Apr 21, 2024
1 parent 0c1dbc1 commit 452323d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions BunnymodXT/wrappers/triangle_wrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace TriangleWrappers
auto &hw = HwDLL::GetInstance();
auto &cl = ClientDLL::GetInstance();

static int g_GL_Modes[7] = {4, 6, 7, 9, 1, 5, 8}; // GL_TRIANGLES, GL_TRIANGLE_FAN, GL_QUADS, GL_POLYGON, GL_LINES, GL_TRIANGLE_STRIP, GL_QUAD_STRIP
static int gRenderMode;
static float gGlR, gGlG, gGlB, gGlW;

Expand Down Expand Up @@ -70,7 +71,6 @@ namespace TriangleWrappers
{
if (hw.ORIG_VGUI2_ResetCurrentTexture)
hw.ORIG_VGUI2_ResetCurrentTexture();
int g_GL_Modes[7] = {4, 6, 7, 9, 1, 5, 8}; // GL_TRIANGLES, GL_TRIANGLE_FAN, GL_QUADS, GL_POLYGON, GL_LINES, GL_TRIANGLE_STRIP, GL_QUAD_STRIP
glBegin(g_GL_Modes[primitiveCode]);
}
}
Expand Down Expand Up @@ -398,4 +398,4 @@ namespace TriangleWrappers
#undef MAT
#undef SWAP_ROWS
}
};
};

0 comments on commit 452323d

Please sign in to comment.