Cleanup: remove BKE_ptcache_remove

No longer needed as the temporary directory is cleared on exit.
This commit is contained in:
Campbell Barton 2021-12-07 18:47:01 +11:00
parent a55d318d71
commit 512a560cde
2 changed files with 0 additions and 49 deletions

View File

@ -308,12 +308,6 @@ void BKE_ptcache_ids_from_object(struct ListBase *lb,
*/
bool BKE_ptcache_object_has(struct Scene *scene, struct Object *ob, int duplis);
/***************** Global funcs ****************************/
/**
* Use this when quitting Blender, with unsaved files.
*/
void BKE_ptcache_remove(void);
/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
bool BKE_ptcache_id_exist(PTCacheID *id, int cfra);

View File

@ -3008,49 +3008,6 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode)
return reset;
}
void BKE_ptcache_remove(void)
{
char path[MAX_PTCACHE_PATH];
char path_full[MAX_PTCACHE_PATH];
int rmdir = 1;
ptcache_path(NULL, path);
if (BLI_exists(path)) {
/* The pointcache dir exists? - remove all pointcache */
DIR *dir;
struct dirent *de;
dir = opendir(path);
if (dir == NULL) {
return;
}
while ((de = readdir(dir)) != NULL) {
if (FILENAME_IS_CURRPAR(de->d_name)) {
/* do nothing */
}
else if (strstr(de->d_name, PTCACHE_EXT)) { /* Do we have the right extension? */
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, false, false);
}
else {
rmdir = 0; /* unknown file, don't remove the dir */
}
}
closedir(dir);
}
else {
rmdir = 0; /* Path doesn't exist. */
}
if (rmdir) {
BLI_delete(path, true, false);
}
}
/* Point Cache handling */
PointCache *BKE_ptcache_add(ListBase *ptcaches)