]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rmain.c
fix two errors related to the R_FrameData_Alloc use in batching
[xonotic/darkplaces.git] / gl_rmain.c
index 5d2b724fda5e58ed7b3921c2f431f2c408c18954..d28907fe9c4c93b6f74582690f5068993637b6b0 100644 (file)
@@ -9823,9 +9823,13 @@ r_refdef_scene_t * R_GetScenePointer( r_refdef_scene_type_t scenetype )
 R_RenderView
 ================
 */
+int dpsoftrast_test;
 void R_RenderView(void)
 {
        matrix4x4_t originalmatrix = r_refdef.view.matrix, offsetmatrix;
+
+       dpsoftrast_test = r_test.integer;
+
        if (r_timereport_active)
                R_TimeReport("start");
        r_textureframe++; // used only by R_GetCurrentTexture
@@ -11905,9 +11909,9 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const
                                                        }
                                                }
                                        }
-                                       c[0] >>= 15;
-                                       c[1] >>= 15;
-                                       c[2] >>= 15;
+                                       c[0] >>= 7;
+                                       c[1] >>= 7;
+                                       c[2] >>= 7;
                                        Vector4Set(rsurface.batchlightmapcolor4f + 4*numvertices, min(c[0], 255) * (1.0f / 255.0f), min(c[1], 255) * (1.0f / 255.0f), min(c[2], 255) * (1.0f / 255.0f), 1);
                                        numvertices++;
                                }
@@ -12219,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
@@ -12448,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;