Fix the missing world on map reload.

If the map got reloaded but the current leaf didn't change the world (and
most entities) didn't get drawn. Forcing a vis update by first setting
r_viewleaf to null and marking surfaces does the trick :)
This commit is contained in:
Bill Currie 2012-01-29 16:09:35 +09:00
parent 462a9047c6
commit 8f869c001b
5 changed files with 15 additions and 0 deletions

View File

@ -192,7 +192,10 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
for (i = 0; i < r_worldentity.model->numleafs; i++)
r_worldentity.model->leafs[i].efrags = NULL;
// Force a vis update
r_viewleaf = NULL;
R_MarkLeaves ();
R_ClearParticles ();
GL_BuildLightmaps (models, num_models);

View File

@ -274,6 +274,10 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
memset (&r_worldentity, 0, sizeof (r_worldentity));
r_worldentity.model = worldmodel;
// Force a vis update
r_viewleaf = NULL;
R_MarkLeaves ();
R_FreeAllEntities ();
R_ClearParticles ();
R_RegisterTextures (models, num_models);

View File

@ -63,6 +63,8 @@ R_MarkLeaves (void)
r_visframecount++;
r_oldviewleaf = r_viewleaf;
if (!r_viewleaf)
return;
if (r_novis->int_val) {
r_oldviewleaf = 0; // so vis will be recalcualted when novis gets

View File

@ -199,7 +199,10 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
if (worldmodel->skytexture)
R_InitSky (worldmodel->skytexture);
// Force a vis update
r_viewleaf = NULL;
R_MarkLeaves ();
R_ClearParticles ();
r_cnumsurfs = r_maxsurfs->int_val;

View File

@ -227,7 +227,10 @@ R_NewMap (model_t *worldmodel, struct model_s **models, int num_models)
if (worldmodel->skytexture)
R_InitSky (worldmodel->skytexture);
// Force a vis update
r_viewleaf = NULL;
R_MarkLeaves ();
R_ClearParticles ();
r_cnumsurfs = r_maxsurfs->int_val;