]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lightning.c
added bufferobject and bufferoffset parameters to all R_Mesh_*Pointer functions and...
[xonotic/darkplaces.git] / r_lightning.c
index eabf768f2f6cc56e9a3cf235d094868d1a09748f..0d287946dd794dee0e62e691cdda64afc92f6f3b 100644 (file)
@@ -245,18 +245,19 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
        if (!r_lightningbeam_qmbtexture.integer && r_lightningbeamtexture == NULL)
                r_lightningbeams_setuptexture();
 
-       R_Mesh_VertexPointer(vertex3f);
+       R_Mesh_VertexPointer(vertex3f, 0, 0);
+       // FIXME: fixed function path can't properly handle r_view.colorscale > 1
        if (r_refdef.fogenabled)
        {
                // per vertex colors if fog is used
-               R_Mesh_ColorPointer(color4f);
-               R_FogLightningBeam_Vertex3f_Color4f(vertex3f, color4f, 12, r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
+               R_Mesh_ColorPointer(color4f, 0, 0);
+               R_FogLightningBeam_Vertex3f_Color4f(vertex3f, color4f, 12, r_lightningbeam_color_red.value * r_view.colorscale, r_lightningbeam_color_green.value * r_view.colorscale, r_lightningbeam_color_blue.value * r_view.colorscale, 1);
        }
        else
        {
                // solid color if fog is not used
-               R_Mesh_ColorPointer(NULL);
-               GL_Color(r_lightningbeam_color_red.value, r_lightningbeam_color_green.value, r_lightningbeam_color_blue.value, 1);
+               R_Mesh_ColorPointer(NULL, 0, 0);
+               GL_Color(r_lightningbeam_color_red.value * r_view.colorscale, r_lightningbeam_color_green.value * r_view.colorscale, r_lightningbeam_color_blue.value * r_view.colorscale, 1);
        }
        memset(&m, 0, sizeof(m));
        if (r_lightningbeam_qmbtexture.integer)
@@ -271,7 +272,7 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
                const beam_t *b = cl.beams + surfacelist[surfacelistindex];
                vec3_t beamdir, right, up, offset, start, end;
                float length, t1, t2;
-               
+
                CL_Beam_CalculatePositions(b, start, end);
 
                // calculate beam direction (beamdir) vector and beam length
@@ -335,7 +336,7 @@ void R_DrawLightningBeam_TransparentCallback(const entity_render_t *ent, const r
 
                // draw the 3 polygons as one batch of 6 triangles using the 12 vertices
                GL_LockArrays(0, 12);
-               R_Mesh_Draw(0, 12, 6, r_lightningbeamelements);
+               R_Mesh_Draw(0, 12, 6, r_lightningbeamelements, 0, 0);
                GL_LockArrays(0, 0);
        }
 }