]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_screen.c
draw loading bar at 100% alpha again
[xonotic/darkplaces.git] / cl_screen.c
index 790887330f41d4d72d1f532caa10c480a8d863f2..dfe310d014207efa162a67a16b997def268f5e9c 100644 (file)
@@ -791,7 +791,7 @@ void R_TimeReport_EndFrame(void)
                                lines++;
                y = vid_conheight.integer - sb_lines - lines * 8;
                i = j = 0;
-               DrawQ_Fill(0, y, vid_conwidth.integer, lines * 8, 0, 0, 0, 0.5, 0);
+               DrawQ_Fill(0, y, vid_conwidth.integer, lines * 8, 0, 0, 0, 1, 0);
                while (string[i])
                {
                        j = i;
@@ -1707,6 +1707,13 @@ void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_paren
 void SCR_PopLoadingScreen (qboolean redraw)
 {
        loadingscreenstack_t *s = loadingscreenstack;
+
+       if(!s)
+       {
+               Con_DPrintf("Popping a loading screen item from an empty stack!\n");
+               return;
+       }
+
        loadingscreenstack = s->prev;
        if(s->prev)
                s->prev->relative_completion = (s->absolute_loading_amount_min + s->absolute_loading_amount_len - s->prev->absolute_loading_amount_min) / s->prev->absolute_loading_amount_len;
@@ -1716,6 +1723,12 @@ void SCR_PopLoadingScreen (qboolean redraw)
                SCR_UpdateLoadingScreenIfShown();
 }
 
+void SCR_ClearLoadingScreen (qboolean redraw)
+{
+       while(loadingscreenstack)
+               SCR_PopLoadingScreen(redraw && !loadingscreenstack->prev);
+}
+
 static float SCR_DrawLoadingStack_r(loadingscreenstack_t *s, float y)
 {
        float size = 8;
@@ -1745,7 +1758,7 @@ static float SCR_DrawLoadingStack_r(loadingscreenstack_t *s, float y)
                len = strlen(s->msg);
                x = (vid_conwidth.integer - DrawQ_TextWidth_Font(s->msg, len, true, FONT_INFOBAR) * size) / 2;
                y -= size;
-               DrawQ_Fill(0, y, vid_conwidth.integer, size, 0, 0, 0, 1, 0);
+               DrawQ_Fill(0, y, vid_conwidth.integer, size, 0, 0, 0, 0.5, 0);
                DrawQ_String_Font(x, y, s->msg, len, size, size, 1, 1, 1, 1, 0, NULL, true, FONT_INFOBAR);
                total += size;
        }
@@ -1778,9 +1791,9 @@ static void SCR_DrawLoadingStack()
                verts[7] = verts[10] = vid_conheight.integer;
 
                for(i = 0; i < 16; ++i)
-                       colors[i] = (i % 4 == 3) || (i >= 8 && i % 4 == 2);
-                       //                                     ^^^^^^^^^^ blue component
-                       //                           ^^^^^^ bottom row
+                       colors[i] = (i % 4 == 3) ? 1 : (i >= 8 && i % 4 == 2) ? 1 : 0;
+                       //                                        ^^^^^^^^^^ blue component
+                       //                              ^^^^^^ bottom row
                        //          ^^^^^^^^^^^^ alpha is always on
                R_Mesh_Draw(0, 4, 0, 2, NULL, polygonelements, 0, 0);
 
@@ -1872,10 +1885,13 @@ void SCR_UpdateLoadingScreen (qboolean clear)
        if (vid_hidden || !scr_refresh.integer || cls.state == ca_dedicated)
                return;
        
+       if(loadingscreentime == realtime)
+               clear |= loadingscreencleared;
+
        if(clear)
-               SCR_ClearLoadingScreenTexture();
+               SCR_ClearLoadingScreenTexture();
        else if(loadingscreentime != realtime)
-               SCR_SetLoadingScreenTexture();
+               SCR_SetLoadingScreenTexture();
 
        if(loadingscreentime != realtime)
        {