Commit 89a22666 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: reset less polymost/GL state between model and voxel draws

parent 8405e59b
......@@ -50,6 +50,7 @@ int32_t polymost_spriteIsModelOrVoxel(tspritetype const * const tspr);
void polymost_disableProgram(void);
char polymost_getClamp(void);
void polymost_resetState(void);
void polymost_resetProgram(void);
void polymost_resetVertexPointers(void);
void polymost_setClamp(char clamp);
......
......@@ -553,27 +553,31 @@ static void Polymost_DetermineTextureFormatSupport(void);
// reset vertex pointers to polymost default
void polymost_resetVertexPointers()
{
buildgl_outputDebugMessage(3, "polymost_resetVertexPointers()");
buildgl_resetStateAccounting();
buildgl_bindBuffer(GL_ARRAY_BUFFER, drawpolyVertsID);
glVertexPointer(3, GL_FLOAT, 5*sizeof(float), 0);
glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (3*sizeof(float)));
glVertexPointer(3, GL_FLOAT, 5 * sizeof(float), 0);
glTexCoordPointer(2, GL_FLOAT, 5 * sizeof(float), (GLvoid*)(3 * sizeof(float)));
#ifdef USE_GLEXT
if (r_detailmapping)
{
glClientActiveTexture(GL_TEXTURE3);
glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (3*sizeof(float)));
glTexCoordPointer(2, GL_FLOAT, 5 * sizeof(float), (GLvoid*)(3 * sizeof(float)));
}
if (r_glowmapping)
{
glClientActiveTexture(GL_TEXTURE4);
glTexCoordPointer(2, GL_FLOAT, 5*sizeof(float), (GLvoid*) (3*sizeof(float)));
glTexCoordPointer(2, GL_FLOAT, 5 * sizeof(float), (GLvoid*)(3 * sizeof(float)));
}
glClientActiveTexture(GL_TEXTURE0);
#endif
}
void polymost_resetState()
{
buildgl_outputDebugMessage(3, "polymost_resetState()");
buildgl_resetStateAccounting();
polymost_resetVertexPointers();
polymost_resetProgram();
}
......@@ -1170,7 +1174,7 @@ void polymost_glinit()
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
polymost_resetVertexPointers();
polymost_resetState();
texcache_init();
texcache_openfiles();
......@@ -1189,7 +1193,7 @@ void polymost_glinit()
void polymost_init()
{
lastbasepal = -1;
polymost_resetVertexPointers();
polymost_resetState();
}
////////// VISIBILITY FOG ROUTINES //////////
......
......@@ -2096,7 +2096,7 @@ void videoShowFrame(int32_t w)
if (w != -1)
{
if (bpp > 8)
polymost_resetVertexPointers();
polymost_resetState();
else
glsurface_refresh();
}
......
......@@ -1767,7 +1767,7 @@ void videoShowFrame(int32_t w)
SwapBuffers(hDC);
#ifdef USE_OPENGL
polymost_resetVertexPointers();
polymost_resetState();
#endif
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment