loadingscreentexture = NULL;
}
-extern rtexturepool_t r_main_texturepool;
+extern rtexturepool_t *r_main_texturepool;
static void SCR_SetLoadingScreenTexture()
{
int w, h;
loadingscreentexture_h = vid.height / (float) h;
}
- loadingscreentexture = R_LoadTexture2D(&r_main_texturepool, "loadingscreentexture", w, h, NULL, TEXTYPE_BGRA, TEXF_FORCENEAREST | TEXF_CLAMP | TEXF_ALWAYSPRECACHE, NULL);
+ loadingscreentexture = R_LoadTexture2D(r_main_texturepool, "loadingscreentexture", w, h, NULL, TEXTYPE_BGRA, TEXF_FORCENEAREST | TEXF_CLAMP | TEXF_ALWAYSPRECACHE, NULL);
R_Mesh_TexBind(0, R_GetTexture(loadingscreentexture));
GL_ActiveTexture(0);
CHECKGLERROR
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;
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;
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);
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)
{