]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved Mod_LoadQ3Shaders() call from CL_BeginDownloads to Mod_LoadModel
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Dec 2007 08:45:02 +0000 (08:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Dec 2007 08:45:02 +0000 (08:45 +0000)
(but only when isworldmodel is true, which indicates a level change)
this fixes a bug where downloaded maps have missing shaders on the first
load, and also fixes a crash introduced by res on dedicated servers

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7818 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
model_shared.c

index 0cb0133e5fbc74f55f34adb4bef490bebdc7b225..bf0ba3eebc23b374827ea1c1a598fd9d3757ce10 100644 (file)
@@ -528,9 +528,6 @@ static void QW_CL_RequestNextDownload(void)
 
                cls.qw_downloadtype = dl_none;
 
-               // parse the Q3 shader files
-               Mod_LoadQ3Shaders();
-
                // touch all of the precached models that are still loaded so we can free
                // anything that isn't needed
                if (!sv.active)
@@ -997,10 +994,6 @@ void CL_BeginDownloads(qboolean aborteddownload)
        {
                // loading models
 
-               // parse the Q3 shader files
-               if (cl.loadmodel_current < 2)
-                       Mod_LoadQ3Shaders();
-
                for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
                {
                        if (cl.model_precache[cl.loadmodel_current] && cl.model_precache[cl.loadmodel_current]->Draw)
index d341e172bce049ba7d33f167348ecd7ea4fb7e5b..c376d4afa3ab3d2f527f59088d55859023b8ba45 100644 (file)
@@ -245,6 +245,12 @@ model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolea
        VectorSet(mod->rotatedmins, -mod->radius, -mod->radius, -mod->radius);
        VectorSet(mod->rotatedmaxs, mod->radius, mod->radius, mod->radius);
 
+       // if we're loading a worldmodel, then this is a level change, and we
+       // should reload all q3 shaders to make sure they are current (which will
+       // also be used by any other models loaded after this world model)
+       if (mod->isworldmodel)
+               Mod_LoadQ3Shaders();
+
        if (buf)
        {
                char *bufend = (char *)buf + filesize;