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