]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
less loading screen refreshs
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 10 Apr 2009 15:11:26 +0000 (15:11 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 10 Apr 2009 15:11:26 +0000 (15:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8893 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
snd_3dras.c
snd_mem.c

index 27446104ed66a4ffea505710044903f0ac05df31..f05189e437cb4907bbd76ef02e7152840646f76c 100644 (file)
@@ -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);
index 376612060dcf1102005a9420017db70772d06987..30b3c4df9b595d1cc4bbc0ea83fa0785bf495d7a 100644 (file)
@@ -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];
index 1c85951504a891264eb9669c9b9dae471c68be12..d294b248c7d74c128d52602c8737539dbd4a1093 100644 (file)
--- 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;
 }