Cleanup: remove inline list-count
This commit is contained in:
parent
4a37269d0a
commit
893aac18c6
|
@ -110,7 +110,7 @@ char *BKE_scene_find_marker_name(struct Scene *scene, int frame);
|
|||
char *BKE_scene_find_last_marker_name(struct Scene *scene, int frame);
|
||||
|
||||
/* checks for cycle, returns 1 if it's all OK */
|
||||
int BKE_scene_validate_setscene(struct Main *bmain, struct Scene *sce);
|
||||
bool BKE_scene_validate_setscene(struct Main *bmain, struct Scene *sce);
|
||||
|
||||
float BKE_scene_frame_get(struct Scene *scene);
|
||||
float BKE_scene_frame_get_from_ctime(struct Scene *scene, const float frame);
|
||||
|
|
|
@ -1096,18 +1096,15 @@ void BKE_scene_base_select(Scene *sce, Base *selbase)
|
|||
}
|
||||
|
||||
/* checks for cycle, returns 1 if it's all OK */
|
||||
int BKE_scene_validate_setscene(Main *bmain, Scene *sce)
|
||||
bool BKE_scene_validate_setscene(Main *bmain, Scene *sce)
|
||||
{
|
||||
Scene *scene;
|
||||
Scene *sce_iter;
|
||||
int a, totscene;
|
||||
|
||||
|
||||
if (sce->set == NULL) return 1;
|
||||
totscene = BLI_countlist(&bmain->scene);
|
||||
|
||||
totscene = 0;
|
||||
for (scene = bmain->scene.first; scene; scene = scene->id.next)
|
||||
totscene++;
|
||||
|
||||
for (a = 0, scene = sce; scene->set; scene = scene->set, a++) {
|
||||
for (a = 0, sce_iter = sce; sce_iter->set; sce_iter = sce_iter->set, a++) {
|
||||
/* more iterations than scenes means we have a cycle */
|
||||
if (a > totscene) {
|
||||
/* the tested scene gets zero'ed, that's typically current scene */
|
||||
|
|
Loading…
Reference in New Issue