make first loading.tga screen a special startup splash-screen,
that shows only once on client startup
From: nyov <nyov@nexnode.net>
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11754
d7cf8633-e32d-0410-b094-
e92efae38249
+ cl.loadsound_total * LOADPROGRESSWEIGHT_SOUND
)
);
+ cl.loadsound_total * LOADPROGRESSWEIGHT_SOUND
)
);
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);
}
for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
{
}
for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
{
// if server is active, we already began a loading plaque
if (!sv.active)
{
// if server is active, we already began a loading plaque
if (!sv.active)
{
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);
S_StopAllSounds();
// free q3 shaders so that any newly downloaded shaders will be active
Mod_FreeQ3Shaders();
S_StopAllSounds();
// free q3 shaders so that any newly downloaded shaders will be active
Mod_FreeQ3Shaders();
cvar_t scr_loadingscreen_scale_base = {0, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"};
cvar_t scr_loadingscreen_scale_limit = {0, "scr_loadingscreen_scale_limit","0", "0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
cvar_t scr_loadingscreen_count = {0, "scr_loadingscreen_count","1", "number of loading screen files to use randomly (named loading.tga, loading2.tga, loading3.tga, ...)"};
cvar_t scr_loadingscreen_scale_base = {0, "scr_loadingscreen_scale_base","0", "0 = console pixels, 1 = video pixels"};
cvar_t scr_loadingscreen_scale_limit = {0, "scr_loadingscreen_scale_limit","0", "0 = no limit, 1 = until first edge hits screen edge, 2 = until last edge hits screen edge, 3 = until width hits screen width, 4 = until height hits screen height"};
cvar_t scr_loadingscreen_count = {0, "scr_loadingscreen_count","1", "number of loading screen files to use randomly (named loading.tga, loading2.tga, loading3.tga, ...)"};
+cvar_t scr_loadingscreen_firstforstartup = {0, "scr_loadingscreen_firstforstartup","0", "remove loading.tga from random scr_loadingscreen_count selection and only display it on client startup, 0 = normal, 1 = firstforstartup"};
cvar_t scr_loadingscreen_barcolor = {0, "scr_loadingscreen_barcolor", "0 0 1", "rgb color of loadingscreen progress bar"};
cvar_t scr_loadingscreen_barheight = {0, "scr_loadingscreen_barheight", "8", "the height of the loadingscreen progress bar"};
cvar_t scr_infobar_height = {0, "scr_infobar_height", "8", "the height of the infobar items"};
cvar_t scr_loadingscreen_barcolor = {0, "scr_loadingscreen_barcolor", "0 0 1", "rgb color of loadingscreen progress bar"};
cvar_t scr_loadingscreen_barheight = {0, "scr_loadingscreen_barheight", "8", "the height of the loadingscreen progress bar"};
cvar_t scr_infobar_height = {0, "scr_infobar_height", "8", "the height of the infobar items"};
-void SCR_BeginLoadingPlaque (void)
+void SCR_BeginLoadingPlaque (qboolean startup)
{
// save console log up to this point to log_file if it was set by configs
Log_Start();
Host_StartVideo();
{
// save console log up to this point to log_file if it was set by configs
Log_Start();
Host_StartVideo();
- SCR_UpdateLoadingScreen(false);
+ SCR_UpdateLoadingScreen(false, startup);
}
//=============================================================================
}
//=============================================================================
Cvar_RegisterVariable (&scr_loadingscreen_scale_base);
Cvar_RegisterVariable (&scr_loadingscreen_scale_limit);
Cvar_RegisterVariable (&scr_loadingscreen_count);
Cvar_RegisterVariable (&scr_loadingscreen_scale_base);
Cvar_RegisterVariable (&scr_loadingscreen_scale_limit);
Cvar_RegisterVariable (&scr_loadingscreen_count);
+ Cvar_RegisterVariable (&scr_loadingscreen_firstforstartup);
Cvar_RegisterVariable (&scr_loadingscreen_barcolor);
Cvar_RegisterVariable (&scr_loadingscreen_barheight);
Cvar_RegisterVariable (&scr_infobar_height);
Cvar_RegisterVariable (&scr_loadingscreen_barcolor);
Cvar_RegisterVariable (&scr_loadingscreen_barheight);
Cvar_RegisterVariable (&scr_infobar_height);
void SCR_UpdateLoadingScreenIfShown(void)
{
if(loadingscreendone)
void SCR_UpdateLoadingScreenIfShown(void)
{
if(loadingscreendone)
- SCR_UpdateLoadingScreen(loadingscreencleared);
+ SCR_UpdateLoadingScreen(loadingscreencleared, false);
}
void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_parent)
}
void SCR_PushLoadingScreen (qboolean redraw, const char *msg, float len_in_parent)
-void SCR_UpdateLoadingScreen (qboolean clear)
+void SCR_UpdateLoadingScreen (qboolean clear, qboolean startup)
{
keydest_t old_key_dest;
int old_key_consoleactive;
{
keydest_t old_key_dest;
int old_key_consoleactive;
clear |= loadingscreencleared;
if(!loadingscreendone)
clear |= loadingscreencleared;
if(!loadingscreendone)
- loadingscreenpic_number = rand() % (scr_loadingscreen_count.integer > 1 ? scr_loadingscreen_count.integer : 1);
+ {
+ if(startup && scr_loadingscreen_firstforstartup.integer)
+ loadingscreenpic_number = 0;
+ else if(scr_loadingscreen_firstforstartup.integer)
+ if(scr_loadingscreen_count.integer > 1)
+ loadingscreenpic_number = rand() % (scr_loadingscreen_count.integer - 1) + 1;
+ else
+ loadingscreenpic_number = 0;
+ else
+ loadingscreenpic_number = rand() % (scr_loadingscreen_count.integer > 1 ? scr_loadingscreen_count.integer : 1);
+ }
if(clear)
SCR_ClearLoadingScreenTexture();
if(clear)
SCR_ClearLoadingScreenTexture();
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
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)
}
static void gl_draw_shutdown(void)
}
// put up the loading image so the user doesn't stare at a black screen...
}
// put up the loading image so the user doesn't stare at a black screen...
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(true);
if (cls.state != ca_dedicated)
{
if (cls.state != ca_dedicated)
{
void CL_UpdateScreen (void);
void SCR_CenterPrint(const char *str);
void CL_UpdateScreen (void);
void SCR_CenterPrint(const char *str);
-void SCR_BeginLoadingPlaque (void);
+void SCR_BeginLoadingPlaque (qboolean startup);
// invoke refresh of loading plaque (nothing else seen)
// invoke refresh of loading plaque (nothing else seen)
-void SCR_UpdateLoadingScreen(qboolean clear);
+void SCR_UpdateLoadingScreen(qboolean clear, qboolean startup);
void SCR_UpdateLoadingScreenIfShown(void);
// pushes an item on the loading screen
void SCR_UpdateLoadingScreenIfShown(void);
// pushes an item on the loading screen
if (cls.state != ca_dedicated)
{
if (cls.state != ca_dedicated)
{
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);