// Delete textures from the front end via SMP const void *RB_Clean( const void *data, qboolean save ) { const swapBuffersCommand_t *cmd; cmd = (const swapBuffersCommand_t *)data; R_PurgeShaders( 9999999 ); R_PurgeBackupImages( 9999999 ); R_PurgeModels( 9999999 ); if ( save && r_cache->integer ){ R_BackupModels(); R_BackupShaders(); R_BackupImages(); } else { R_DeleteTextures(); } return (const void *)( cmd + 1 ); }
void R_PurgeCache( void ) { R_PurgeShaders( 9999999 ); R_PurgeBackupImages( 9999999 ); R_PurgeModels( 9999999 ); }
/* =============== RE_Shutdown =============== */ void RE_Shutdown( qboolean destroyWindow ) { ri.Printf( PRINT_ALL, "RE_Shutdown( %i )\n", destroyWindow ); ri.Cmd_RemoveCommand( "modellist" ); ri.Cmd_RemoveCommand( "screenshotJPEG" ); ri.Cmd_RemoveCommand( "screenshot" ); ri.Cmd_RemoveCommand( "imagelist" ); ri.Cmd_RemoveCommand( "shaderlist" ); ri.Cmd_RemoveCommand( "skinlist" ); ri.Cmd_RemoveCommand( "gfxinfo" ); ri.Cmd_RemoveCommand( "modelist" ); ri.Cmd_RemoveCommand( "shaderstate" ); ri.Cmd_RemoveCommand( "taginfo" ); // Ridah ri.Cmd_RemoveCommand( "cropimages" ); // done. R_ShutdownCommandBuffers(); // Ridah, keep a backup of the current images if possible // clean out any remaining unused media from the last backup R_PurgeShaders( 9999999 ); R_PurgeBackupImages( 9999999 ); R_PurgeModels( 9999999 ); if ( r_cache->integer ) { if ( tr.registered ) { if ( destroyWindow ) { R_SyncRenderThread(); R_ShutdownCommandBuffers(); R_DeleteTextures(); } else { // backup the current media R_ShutdownCommandBuffers(); R_BackupModels(); R_BackupShaders(); R_BackupImages(); } } } else if ( tr.registered ) { R_SyncRenderThread(); R_ShutdownCommandBuffers(); R_DeleteTextures(); } R_DoneFreeType(); // shut down platform specific OpenGL stuff if ( destroyWindow ) { GLimp_Shutdown(); // Ridah, release the virtual memory R_Hunk_End(); R_FreeImageBuffer(); //ri.Tag_Free(); // wipe all render alloc'd zone memory } tr.registered = qfalse; }