Cleanup: Replace int with bool for pointcache function

Was using an int for boolean return value.
This commit is contained in:
Julian Eisel 2021-08-03 15:48:54 +02:00
parent 7724251af8
commit 391af6bea2
2 changed files with 7 additions and 7 deletions

View File

@ -302,7 +302,7 @@ void BKE_ptcache_remove(void);
/************ ID specific functions ************************/
void BKE_ptcache_id_clear(PTCacheID *id, int mode, unsigned int cfra);
int BKE_ptcache_id_exist(PTCacheID *id, int cfra);
bool BKE_ptcache_id_exist(PTCacheID *id, int cfra);
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *id, int mode);
void BKE_ptcache_id_time(PTCacheID *pid,
struct Scene *scene,

View File

@ -2753,18 +2753,18 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
pid->cache->flag |= PTCACHE_FLAG_INFO_DIRTY;
}
int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
bool BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
{
if (!pid->cache) {
return 0;
return false;
}
if (cfra < pid->cache->startframe || cfra > pid->cache->endframe) {
return 0;
return false;
}
if (pid->cache->cached_frames && pid->cache->cached_frames[cfra - pid->cache->startframe] == 0) {
return 0;
return false;
}
if (pid->cache->flag & PTCACHE_DISK_CACHE) {
@ -2779,10 +2779,10 @@ int BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
for (; pm; pm = pm->next) {
if (pm->frame == cfra) {
return 1;
return true;
}
}
return 0;
return false;
}
void BKE_ptcache_id_time(
PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)