From 97df55ba4a2b0d55a275f72e604e44c1328e2bab Mon Sep 17 00:00:00 2001
From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sun, 24 Aug 2008 14:57:06 +0000
Subject: [PATCH] add missing R_Mesh_ResetTextureState call (to fix CSQC
 polygon rendering)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8474 d7cf8633-e32d-0410-b094-e92efae38249
---
 clvm_cmds.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/clvm_cmds.c b/clvm_cmds.c
index 5ed6a046..fb5a7e59 100644
--- a/clvm_cmds.c
+++ b/clvm_cmds.c
@@ -2463,12 +2463,14 @@ static void VM_DrawPolygonCallback (const entity_render_t *ent, const rtlight_t
 {
 	int surfacelistindex;
 	vmpolygons_t* polys = vmpolygons + PRVM_GetProgNr();
+	R_Mesh_ResetTextureState();
 	R_Mesh_Matrix(&identitymatrix);
 	GL_CullFace(GL_NONE);
 	R_Mesh_VertexPointer(polys->data_vertex3f, 0, 0);
 	R_Mesh_ColorPointer(polys->data_color4f, 0, 0);
 	R_Mesh_TexCoordPointer(0, 2, polys->data_texcoord2f, 0, 0);
 	R_SetupGenericShader(true);
+
 	for (surfacelistindex = 0;surfacelistindex < numsurfaces;)
 	{
 		int numtriangles = 0;
-- 
2.39.5