]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix a crash in RSurf_DrawBatch_GL11_MakeFogColor
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 27 Mar 2011 06:20:51 +0000 (06:20 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 30 Mar 2011 07:00:15 +0000 (09:00 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10970 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=5db3cb274a011fcba94fa0df402d76256e8526b3

gl_rmain.c

index 3cda32764ed684d0b59a9e4b17668e9abc9a5d05..3dd7eb25b17d7774162d3e2f051fc18fe16c2dca 100644 (file)
@@ -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);