]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
made darkplaces compile successfully with g++ to test for errors C doesn't care about...
[xonotic/darkplaces.git] / gl_draw.c
index 4edff7b977654a26b15a4de3143a99168c21d1a2..d6879c8b6f6fc27d6552bf551ea5ea470b6a306a 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -44,8 +44,6 @@ static qbyte concharimage[FONT_FILESIZE] =
 #include "lhfont.h"
 };
 
-extern qbyte *LoadTGA (qbyte *f, int matchwidth, int matchheight);
-
 static rtexture_t *draw_generateconchars(void)
 {
        int i;
@@ -100,8 +98,7 @@ static rtexture_t *draw_generateconchars(void)
        return R_LoadTexture2D(drawtexturepool, "conchars", 256, 256, &buffer[0][0], TEXTYPE_RGBA, TEXF_ALPHA | TEXF_PRECACHE, NULL);
 }
 
-static qbyte pointerimage[256] =
-{
+static char *pointerimage =
        "333333332......."
        "26777761........"
        "2655541........."
@@ -118,7 +115,7 @@ static qbyte pointerimage[256] =
        "................"
        "................"
        "................"
-};
+;
 
 static rtexture_t *draw_generatemousepointer(void)
 {
@@ -147,7 +144,7 @@ static rtexture_t *draw_generatemousepointer(void)
 // must match NUMCROSSHAIRS in r_crosshairs.c
 #define NUMCROSSHAIRS 6
 
-static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
+static char *crosshairtexdata[NUMCROSSHAIRS] =
 {
        "................"
        "................"
@@ -241,8 +238,8 @@ static qbyte *crosshairtexdata[NUMCROSSHAIRS] =
        "................"
        "................"
        "................"
-       "................"
-       "........7......."
+       ".......55......."
+       ".......55......."
        "................"
        "................"
        "................"
@@ -314,6 +311,7 @@ cachepic_t  *Draw_CachePic (const char *path, qboolean persistent)
        int flags;
 
        if (!strncmp(CLVIDEOPREFIX, path, sizeof(CLVIDEOPREFIX) - 1))
+
        {
                clvideo_t *video;
 
@@ -322,7 +320,7 @@ cachepic_t  *Draw_CachePic (const char *path, qboolean persistent)
                        return &video->cpif;
        }
 
-       crc = CRC_Block(path, strlen(path));
+       crc = CRC_Block((qbyte *)path, strlen(path));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
                if (!strcmp (path, pic->name))
@@ -353,7 +351,7 @@ cachepic_t  *Draw_CachePic (const char *path, qboolean persistent)
                // compatibility with older versions
                pic->tex = loadtextureimage(drawtexturepool, path + 4, 0, 0, false, flags);
                // failed to find gfx/whatever.tga or similar, try the wad
-               if (pic->tex == NULL && (p = W_GetLumpName (path + 4)))
+               if (pic->tex == NULL && (p = (qpic_t *)W_GetLumpName (path + 4)))
                {
                        if (!strcmp(path, "gfx/conchars"))
                        {
@@ -406,7 +404,7 @@ cachepic_t *Draw_NewPic(const char *picname, int width, int height, int alpha, q
        int crc, hashkey;
        cachepic_t *pic;
 
-       crc = CRC_Block(picname, strlen(picname));
+       crc = CRC_Block((qbyte *)picname, strlen(picname));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
                if (!strcmp (picname, pic->name))
@@ -452,7 +450,7 @@ void Draw_FreePic(const char *picname)
        int hashkey;
        cachepic_t *pic;
        // this doesn't really free the pic, but does free it's texture
-       crc = CRC_Block(picname, strlen(picname));
+       crc = CRC_Block((qbyte *)picname, strlen(picname));
        hashkey = ((crc >> 8) ^ crc) % CACHEPICHASHSIZE;
        for (pic = cachepichash[hashkey];pic;pic = pic->chain)
        {
@@ -638,7 +636,7 @@ void R_DrawQueue(void)
                        }
                        break;
                case DRAWQUEUE_MESH:
-                       mesh = (void *)(dq + 1);
+                       mesh = (drawqueuemesh_t *)(dq + 1);
                        m.pointer_vertex = mesh->data_vertex3f;
                        m.pointer_color = mesh->data_color4f;
                        m.pointer_texcoord[0] = mesh->data_texcoord2f;