]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_draw.c
changed r_refdef.stats struct to be an array indexed by r_stat_* enums
[xonotic/darkplaces.git] / gl_draw.c
index 37126255d6a563a2ca4a52edfb0337224eae9086..88431d9a83e206deeb34ae1cc6d1467889d4e317 100644 (file)
--- a/gl_draw.c
+++ b/gl_draw.c
@@ -399,7 +399,7 @@ reload:
        pic->lastusedframe = draw_frame;
 
        // load a high quality image from disk if possible
-       if (!loaded && r_texture_dds_load.integer != 0 && (pic->tex = R_LoadTextureDDSFile(drawtexturepool, va(vabuf, sizeof(vabuf), "dds/%s.dds", pic->name), vid.sRGB2D, pic->texflags, &ddshasalpha, ddsavgcolor, 0)))
+       if (!loaded && r_texture_dds_load.integer != 0 && (pic->tex = R_LoadTextureDDSFile(drawtexturepool, va(vabuf, sizeof(vabuf), "dds/%s.dds", pic->name), vid.sRGB2D, pic->texflags, &ddshasalpha, ddsavgcolor, 0, false)))
        {
                // note this loads even if autoload is true, otherwise we can't get the width/height
                loaded = true;
@@ -446,7 +446,7 @@ reload:
        // show up the right size in the menu even if they were replaced with
        // higher or lower resolution versions
        dpsnprintf(lmpname, sizeof(lmpname), "%s.lmp", pic->name);
-       if (!strncmp(pic->name, "gfx/", 4) && (lmpdata = FS_LoadFile(lmpname, tempmempool, false, &lmpsize)))
+       if ((!strncmp(pic->name, "gfx/", 4) || (gamemode == GAME_BLOODOMNICIDE && !strncmp(pic->name, "locale/", 6))) && (lmpdata = FS_LoadFile(lmpname, tempmempool, false, &lmpsize)))
        {
                if (developer_loading.integer)
                        Con_Printf("loading lump \"%s\"\n", pic->name);
@@ -525,7 +525,7 @@ rtexture_t *Draw_GetPicTexture(cachepic_t *pic)
                {
                        qboolean ddshasalpha;
                        float ddsavgcolor[4];
-                       pic->tex = R_LoadTextureDDSFile(drawtexturepool, va(vabuf, sizeof(vabuf), "dds/%s.dds", pic->name), vid.sRGB2D, pic->texflags, &ddshasalpha, ddsavgcolor, 0);
+                       pic->tex = R_LoadTextureDDSFile(drawtexturepool, va(vabuf, sizeof(vabuf), "dds/%s.dds", pic->name), vid.sRGB2D, pic->texflags, &ddshasalpha, ddsavgcolor, 0, false);
                }
                if (pic->tex == NULL)
                {
@@ -1018,7 +1018,7 @@ static void gl_draw_start(void)
                        LoadFont(false, va(vabuf, sizeof(vabuf), "gfx/font_%s", dp_fonts.f[i].title), &dp_fonts.f[i], 1, 0);
 
        // draw the loading screen so people have something to see in the newly opened window
-       SCR_UpdateLoadingScreen(true);
+       SCR_UpdateLoadingScreen(true, true);
 }
 
 static void gl_draw_shutdown(void)
@@ -1387,7 +1387,8 @@ float DrawQ_TextWidth_UntilWidth_TrackColors_Scale(const char *text, size_t *max
        else
                width_of = fnt->width_of;
 
-       for (i = 0;((bytes_left = *maxlen - (text - text_start)) > 0) && *text;)
+       i = 0;
+       while (((bytes_left = *maxlen - (text - text_start)) > 0) && *text)
        {
                size_t i0 = i;
                nextch = ch = u8_getnchar(text, &text, bytes_left);
@@ -1616,7 +1617,7 @@ float DrawQ_String_Scale(float startx, float starty, const char *text, size_t ma
                        y += r_textshadow.value * vid.height / vid_conheight.value;
                }
                */
-               for (i = 0;((bytes_left = maxlen - (text - text_start)) > 0) && *text;)
+               while (((bytes_left = maxlen - (text - text_start)) > 0) && *text)
                {
                        nextch = ch = u8_getnchar(text, &text, bytes_left);
                        i = text - text_start;
@@ -1931,10 +1932,10 @@ void DrawQ_SuperPic(float x, float y, cachepic_t *pic, float width, float height
                        width = pic->width;
                if (height == 0)
                        height = pic->height;
-               R_SetupShader_Generic(Draw_GetPicTexture(pic), NULL, GL_MODULATE, 1, (flags & DRAWFLAGS_BLEND) ? false : true, true, false);
+               R_SetupShader_Generic(Draw_GetPicTexture(pic), NULL, GL_MODULATE, 1, (flags & (DRAWFLAGS_BLEND | DRAWFLAG_NOGAMMA)) ? false : true, true, false);
        }
        else
-               R_SetupShader_Generic_NoTexture((flags & DRAWFLAGS_BLEND) ? false : true, true);
+               R_SetupShader_Generic_NoTexture((flags & (DRAWFLAGS_BLEND | DRAWFLAG_NOGAMMA)) ? false : true, true);
 
        floats[2] = floats[5] = floats[8] = floats[11] = 0;
        floats[0] = floats[9] = x;
@@ -2061,14 +2062,8 @@ void DrawQ_Line (float width, float x1, float y1, float x2, float y2, float r, f
        }
 }
 
-void DrawQ_Lines (float width, int numlines, const float *vertex3f, const float *color4f, int flags)
+void DrawQ_Lines (float width, int numlines, int flags, qboolean hasalpha)
 {
-       int i;
-       qboolean hasalpha = false;
-       for (i = 0;i < numlines*2;i++)
-               if (color4f[i*4+3] < 1.0f)
-                       hasalpha = true;
-
        _DrawQ_SetupAndProcessDrawFlag(flags, NULL, hasalpha ? 0.5f : 1.0f);
 
        if(!r_draw2d.integer && !r_draw2d_force)
@@ -2086,7 +2081,6 @@ void DrawQ_Lines (float width, int numlines, const float *vertex3f, const float
                //qglLineWidth(width);CHECKGLERROR
 
                CHECKGLERROR
-               R_Mesh_PrepareVertices_Generic_Arrays(numlines*2, vertex3f, color4f, NULL);
                qglDrawArrays(GL_LINES, 0, numlines*2);
                CHECKGLERROR
                break;