]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix two errors related to the R_FrameData_Alloc use in batching
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Jan 2011 06:38:59 +0000 (06:38 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 25 Jan 2011 06:38:59 +0000 (06:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10740 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 72cc262415a804d555c9b594aec39503d41390f8..d28907fe9c4c93b6f74582690f5068993637b6b0 100644 (file)
@@ -12223,9 +12223,9 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const
                break;
        case Q3TCGEN_ENVIRONMENT:
                // make environment reflections using a spheremap
-//             rsurface.batchtexcoordtexture2f = R_FrameData_Alloc(batchnumvertices * sizeof(float[2]));
-//             rsurface.batchtexcoordtexture2f_vertexbuffer = NULL;
-//             rsurface.batchtexcoordtexture2f_bufferoffset = 0;
+               rsurface.batchtexcoordtexture2f = R_FrameData_Alloc(batchnumvertices * sizeof(float[2]));
+               rsurface.batchtexcoordtexture2f_vertexbuffer = NULL;
+               rsurface.batchtexcoordtexture2f_bufferoffset = 0;
                for (j = 0;j < batchnumvertices;j++)
                {
                        // identical to Q3A's method, but executed in worldspace so
@@ -12452,10 +12452,11 @@ static void RSurf_DrawBatch_GL11_ApplyColor(float r, float g, float b, float a)
        float *c2;
        if (!rsurface.passcolor4f)
                return;
+       c = rsurface.passcolor4f + rsurface.batchfirstvertex * 4;
        rsurface.passcolor4f = (float *)R_FrameData_Alloc(rsurface.batchnumvertices * sizeof(float[4]));
        rsurface.passcolor4f_vertexbuffer = 0;
        rsurface.passcolor4f_bufferoffset = 0;
-       for (i = 0, c = rsurface.passcolor4f + rsurface.batchfirstvertex * 4, c2 = rsurface.passcolor4f + rsurface.batchfirstvertex * 4;i < rsurface.batchnumvertices;i++, c += 4, c2 += 4)
+       for (i = 0, c2 = rsurface.passcolor4f + rsurface.batchfirstvertex * 4;i < rsurface.batchnumvertices;i++, c += 4, c2 += 4)
        {
                c2[0] = c[0] * r;
                c2[1] = c[1] * g;