]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
also enter the event loop during Q3 map load... should prevent Vista's not responding...
[xonotic/darkplaces.git] / cl_parse.c
index d3df3867bec9f935b94fda6e0a5c20f24602b34e..26dba1d0efa45d435fe86b8c917835f7123e2cb0 100644 (file)
@@ -297,6 +297,8 @@ void CL_KeepaliveMessage (qboolean readmessages)
        qboolean oldbadread;
        sizebuf_t old;
 
+       SCR_UpdateLoadingScreenIfShown();
+
        // no need if server is local and definitely not if this is a demo
        if (!cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon >= SIGNONS)
                return;
@@ -992,6 +994,8 @@ void CL_BeginDownloads(qboolean aborteddownload)
 
        // if we got here...
        // curl is done, so let's start with the business
+       if(!cl.loadbegun)
+               SCR_PushLoadingScreen(false, "Loading precaches", 1);
        cl.loadbegun = true;
 
        // if already downloading something from the previous level, don't stop it
@@ -1043,6 +1047,13 @@ void CL_BeginDownloads(qboolean aborteddownload)
                                continue;
                        }
                        CL_KeepaliveMessage(true);
+
+                       if(cl.loadmodel_current == 1)
+                       {
+                               // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3
+                               Mod_FreeQ3Shaders();
+                       }
+
                        cl.model_precache[cl.loadmodel_current] = Mod_ForName(cl.model_name[cl.loadmodel_current], false, false, cl.model_name[cl.loadmodel_current][0] == '*' ? cl.model_name[1] : NULL);
                        SCR_PopLoadingScreen(false);
                        if (cl.model_precache[cl.loadmodel_current] && cl.model_precache[cl.loadmodel_current]->Draw && cl.loadmodel_current == 1)
@@ -1107,9 +1118,11 @@ void CL_BeginDownloads(qboolean aborteddownload)
                {
                        if (aborteddownload)
                        {
+
                                if (cl.downloadmodel_current == 1)
                                {
                                        // the worldmodel failed, but we need to set up anyway
+                                       Mod_FreeQ3Shaders();
                                        CL_SetupWorldModel();
                                        if (!cl.loadfinished && cl_joinbeforedownloadsfinish.integer)
                                        {
@@ -1139,6 +1152,13 @@ void CL_BeginDownloads(qboolean aborteddownload)
                                        return;
                                }
                        }
+
+                       if(cl.downloadmodel_current == 1)
+                       {
+                               // they'll be soon loaded, but make sure we apply freshly downloaded shaders from a curled pk3
+                               Mod_FreeQ3Shaders();
+                       }
+
                        cl.model_precache[cl.downloadmodel_current] = Mod_ForName(cl.model_name[cl.downloadmodel_current], false, false, cl.model_name[cl.downloadmodel_current][0] == '*' ? cl.model_name[1] : NULL);
                        if (cl.downloadmodel_current == 1)
                        {
@@ -1214,10 +1234,7 @@ void CL_BeginDownloads_f(void)
        if(cl.loadbegun)
                Con_Printf("cl_begindownloads is only valid once per match\n");
        else
-       {
-               SCR_PushLoadingScreen(false, "Loading precaches", 1);
                CL_BeginDownloads(false);
-       }
 }
 
 void CL_StopDownload(int size, int crc)