]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_lightning.c
#ifdef 0'd out BoxOnPlaneSide_Separate as it is not used
[xonotic/darkplaces.git] / r_lightning.c
index 1f5f90ce27718d98a9421975eeca26f8b2c5d01c..9290d7a011a0c9f6dab914118f4d64872cc4b18e 100644 (file)
@@ -40,7 +40,11 @@ void r_lightningbeams_setuptexture(void)
        float particlex, particley, particlexv, particleyv, dx, dy, s, maxpathstrength;
        qbyte *pixels;
        int *image;
-       struct {float x, y, strength;} path[PATHPOINTS], temppath;
+       struct lightningpathnode_s
+       {
+               float x, y, strength;
+       }
+       path[PATHPOINTS], temppath;
 
        image = Mem_Alloc(tempmempool, BEAMWIDTH * BEAMHEIGHT * sizeof(int));
        pixels = Mem_Alloc(tempmempool, BEAMWIDTH * BEAMHEIGHT * sizeof(qbyte[4]));
@@ -114,9 +118,9 @@ void r_lightningbeams_setuptexture(void)
        int x, y;
        qbyte *data, *noise1, *noise2;
 
-       data = Mem_Alloc(tempmempool, BEAMWIDTH * BEAMHEIGHT * 4);
-       noise1 = Mem_Alloc(tempmempool, BEAMHEIGHT * BEAMHEIGHT);
-       noise2 = Mem_Alloc(tempmempool, BEAMHEIGHT * BEAMHEIGHT);
+       data = (qbyte *)Mem_Alloc(tempmempool, BEAMWIDTH * BEAMHEIGHT * 4);
+       noise1 = (qbyte *)Mem_Alloc(tempmempool, BEAMHEIGHT * BEAMHEIGHT);
+       noise2 = (qbyte *)Mem_Alloc(tempmempool, BEAMHEIGHT * BEAMHEIGHT);
        fractalnoise(noise1, BEAMHEIGHT, BEAMHEIGHT / 8);
        fractalnoise(noise2, BEAMHEIGHT, BEAMHEIGHT / 16);
 
@@ -229,7 +233,7 @@ float beamrepeatscale;
 
 void R_DrawLightningBeamCallback(const void *calldata1, int calldata2)
 {
-       const beam_t *b = calldata1;
+       const beam_t *b = (beam_t *)calldata1;
        rmeshstate_t m;
        vec3_t beamdir, right, up, offset;
        float length, t1, t2;
@@ -321,7 +325,7 @@ void R_DrawLightningBeamCallback(const void *calldata1, int calldata2)
 
        // draw the 3 polygons as one batch of 6 triangles using the 12 vertices
        GL_LockArrays(0, 12);
-       R_Mesh_Draw(12, 6, r_lightningbeamelements);
+       R_Mesh_Draw(0, 12, 6, r_lightningbeamelements);
        GL_LockArrays(0, 0);
 }