From: havoc Date: Tue, 25 Jan 2011 06:38:59 +0000 (+0000) Subject: fix two errors related to the R_FrameData_Alloc use in batching X-Git-Tag: xonotic-v0.5.0~438^2~101 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03a5831a06a12e1c83fe42ffdc289c9dfe6ac6b4;p=xonotic%2Fdarkplaces.git fix two errors related to the R_FrameData_Alloc use in batching git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10740 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 72cc2624..d28907fe 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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;