From: divverent Date: Sun, 27 Mar 2011 06:20:51 +0000 (+0000) Subject: fix a crash in RSurf_DrawBatch_GL11_MakeFogColor X-Git-Tag: xonotic-v0.6.0~163^2~576 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5db3cb274a011fcba94fa0df402d76256e8526b3;p=xonotic%2Fdarkplaces.git fix a crash in RSurf_DrawBatch_GL11_MakeFogColor git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10970 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 3cda3276..3dd7eb25 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -9206,6 +9206,12 @@ static void RSurf_DrawBatch_GL11_MakeFogColor(float r, float g, float b, float a float f; const float *v; float *c; + + // fake shading + rsurface.passcolor4f = (float *)R_FrameData_Alloc(rsurface.batchnumvertices * sizeof(float[4])); + rsurface.passcolor4f_vertexbuffer = 0; + rsurface.passcolor4f_bufferoffset = 0; + for (i = 0, v = rsurface.batchvertex3f + rsurface.batchfirstvertex * 3, c = rsurface.passcolor4f + rsurface.batchfirstvertex * 4;i < rsurface.batchnumvertices;i++, v += 3, c += 4) { f = 1 - RSurf_FogVertex(v);