|
|
|
@ -507,7 +507,7 @@ void R_InitCaches (void)
@@ -507,7 +507,7 @@ void R_InitCaches (void)
|
|
|
|
|
sc_size = size; |
|
|
|
|
if( sc_base ) |
|
|
|
|
{ |
|
|
|
|
D_FlushCaches(); |
|
|
|
|
D_FlushCaches( false ); |
|
|
|
|
Mem_Free( sc_base ); |
|
|
|
|
} |
|
|
|
|
sc_base = (surfcache_t *)Mem_Calloc(r_temppool,size); |
|
|
|
@ -524,18 +524,19 @@ void R_InitCaches (void)
@@ -524,18 +524,19 @@ void R_InitCaches (void)
|
|
|
|
|
D_FlushCaches |
|
|
|
|
================== |
|
|
|
|
*/ |
|
|
|
|
void D_FlushCaches (void) |
|
|
|
|
void D_FlushCaches( qboolean newmap ) |
|
|
|
|
{ |
|
|
|
|
surfcache_t *c; |
|
|
|
|
|
|
|
|
|
if (!sc_base) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
// if newmap, surfaces already freed
|
|
|
|
|
if( !newmap ) |
|
|
|
|
{ |
|
|
|
|
for(c = sc_base ; c ; c = c->next ) |
|
|
|
|
{ |
|
|
|
|
if ( c->owner ) |
|
|
|
|
*c->owner = NULL; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sc_rover = sc_base; |
|
|
|
|
sc_base->next = NULL; |
|
|
|
|