From: divverent Date: Fri, 10 Apr 2009 15:11:26 +0000 (+0000) Subject: less loading screen refreshs X-Git-Tag: xonotic-v0.1.0preview~1717 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=10e1054afd86d2b6994acffd2fa5ec4b4495a216 less loading screen refreshs git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8893 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 27446104..f05189e4 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1059,7 +1059,7 @@ void CL_BeginDownloads(qboolean aborteddownload) } for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++) { - SCR_PushLoadingScreen(true, cl.model_name[cl.loadmodel_current], + SCR_PushLoadingScreen(false, cl.model_name[cl.loadmodel_current], ( (cl.loadmodel_current == 1) ? LOADPROGRESSWEIGHT_WORLDMODEL : LOADPROGRESSWEIGHT_MODEL ) / ( @@ -1131,7 +1131,7 @@ void CL_BeginDownloads(qboolean aborteddownload) ); for (;cl.loadsound_current < cl.loadsound_total;cl.loadsound_current++) { - SCR_PushLoadingScreen(true, cl.sound_name[cl.loadsound_current], 1.0 / cl.loadsound_total); + SCR_PushLoadingScreen(false, cl.sound_name[cl.loadsound_current], 1.0 / cl.loadsound_total); if (cl.sound_precache[cl.loadsound_current] && S_IsSoundPrecached(cl.sound_precache[cl.loadsound_current])) { SCR_PopLoadingScreen(false); diff --git a/snd_3dras.c b/snd_3dras.c index 37661206..30b3c4df 100644 --- a/snd_3dras.c +++ b/snd_3dras.c @@ -588,6 +588,7 @@ sfx_t* S_FindName (const char *name){ return NULL; } int S_LoadSound(sfx_t *sfx, int complain){ + // TODO add SCR_PushLoadingScreen, SCR_PopLoadingScreen calls to this fs_offset_t filesize; char namebuffer[MAX_QPATH +16 ]; char filename [MAX_QPATH +16+4]; diff --git a/snd_mem.c b/snd_mem.c index 1c859515..d294b248 100644 --- a/snd_mem.c +++ b/snd_mem.c @@ -326,6 +326,8 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (developer_loading.integer) Con_Printf("loading sound %s\n", sfx->name); + SCR_PushLoadingScreen(true, sfx->name, 1); + // LordHavoc: if the sound filename does not begin with sound/, try adding it if (strncasecmp(sfx->name, "sound/", 6)) { @@ -334,18 +336,18 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav")) { if (S_LoadWavFile (namebuffer, sfx)) - return true; + goto loaded; memcpy (namebuffer + len - 3, "ogg", 4); } if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg")) { if (OGG_LoadVorbisFile (namebuffer, sfx)) - return true; + goto loaded; } else { if (ModPlug_LoadModPlugFile (namebuffer, sfx)) - return true; + goto loaded; } } @@ -358,23 +360,29 @@ qboolean S_LoadSound (sfx_t *sfx, qboolean complain) if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".wav")) { if (S_LoadWavFile (namebuffer, sfx)) - return true; + goto loaded; memcpy (namebuffer + len - 3, "ogg", 4); } if (len >= 4 && !strcasecmp (namebuffer + len - 4, ".ogg")) { if (OGG_LoadVorbisFile (namebuffer, sfx)) - return true; + goto loaded; } else { if (ModPlug_LoadModPlugFile (namebuffer, sfx)) - return true; + goto loaded; } // Can't load the sound! sfx->flags |= SFXFLAG_FILEMISSING; if (complain) Con_DPrintf("failed to load sound \"%s\"\n", sfx->name); + + SCR_PopLoadingScreen(false); return false; + +loaded: + SCR_PopLoadingScreen(false); + return true; }