This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/engine/client/gl_rmisc.c

38 lines
1023 B
C
Raw Normal View History

2010-12-03 22:00:00 +01:00
//=======================================================================
// Copyright XashXT Group 2010 <20>
// gl_rmisc.c - renderer misceallaneous
//=======================================================================
#include "common.h"
#include "client.h"
#include "gl_local.h"
2011-04-06 22:00:00 +02:00
#include "mod_local.h"
2010-12-03 22:00:00 +01:00
void R_NewMap( void )
{
2010-12-06 22:00:00 +01:00
int i;
2010-12-23 22:00:00 +01:00
R_ClearDecals(); // clear all level decals
2010-12-06 22:00:00 +01:00
GL_BuildLightmaps ();
2010-12-03 22:00:00 +01:00
R_SetupSky( cl.refdef.movevars->skyName );
2010-12-06 22:00:00 +01:00
// clear out efrags in case the level hasn't been reloaded
for( i = 0; i < cl.worldmodel->numleafs; i++ )
cl.worldmodel->leafs[i].efrags = NULL;
tr.skytexturenum = -1;
r_viewleaf = r_oldviewleaf = NULL;
// clearing texture chains
for( i = 0; i < cl.worldmodel->numtextures; i++ )
{
if( !cl.worldmodel->textures[i] )
continue;
2011-03-09 22:00:00 +01:00
if( world.version == Q1BSP_VERSION && !Q_strncmp( cl.worldmodel->textures[i]->name, "sky", 3 ))
2010-12-06 22:00:00 +01:00
tr.skytexturenum = i;
cl.worldmodel->textures[i]->texturechain = NULL;
}
2010-12-03 22:00:00 +01:00
}