/* =================== R_FreeDerivedData ReloadModels and RegenerateWorld call this =================== */ void R_FreeDerivedData() { for( int j = 0; j < tr.worlds.Num(); j++ ) { idRenderWorldLocal* rw = tr.worlds[j]; for( int i = 0; i < rw->entityDefs.Num(); i++ ) { idRenderEntityLocal* def = rw->entityDefs[i]; if( def == NULL ) { continue; } R_FreeEntityDefDerivedData( def, false, false ); } for( int i = 0; i < rw->lightDefs.Num(); i++ ) { idRenderLightLocal* light = rw->lightDefs[i]; if( light == NULL ) { continue; } R_FreeLightDefDerivedData( light ); } } }
/* =================== R_CheckForEntityDefsUsingModel =================== */ void R_CheckForEntityDefsUsingModel( idRenderModel *model ) { for ( int j = 0; j < tr.worlds.Num(); j++ ) { idRenderWorldLocal * rw = tr.worlds[j]; for ( int i = 0; i < rw->entityDefs.Num(); i++ ) { idRenderEntityLocal * def = rw->entityDefs[i]; if ( !def ) { continue; } if ( def->parms.hModel == model ) { //assert( 0 ); // this should never happen but Radiant messes it up all the time so just free the derived data R_FreeEntityDefDerivedData( def, false, false ); } } } }