Remove tons of OBACT

There are now only referenced in:
* drawobject.c
* particle_edit.c
* space_image.c (a single case to be handled on workspace branch)
* rigidbody_constraint.c (to be handled in the following commit)
This commit is contained in:
Dalai Felinto
2017-03-02 15:03:02 +01:00
parent 561d11c5e6
commit aa845eed1e
33 changed files with 129 additions and 103 deletions

View File

@@ -801,9 +801,9 @@ static LodLevel *lod_level_select(Object *ob, const float camera_position[3])
return current;
}
bool BKE_object_lod_is_usable(Object *ob, Scene *scene)
bool BKE_object_lod_is_usable(Object *ob, SceneLayer *sl)
{
bool active = (scene) ? ob == OBACT : false;
bool active = (sl) ? ob == OBACT_NEW : false;
return (ob->mode == OB_MODE_OBJECT || !active);
}
@@ -817,11 +817,11 @@ void BKE_object_lod_update(Object *ob, const float camera_position[3])
}
}
static Object *lod_ob_get(Object *ob, Scene *scene, int flag)
static Object *lod_ob_get(Object *ob, SceneLayer *sl, int flag)
{
LodLevel *current = ob->currentlod;
if (!current || !BKE_object_lod_is_usable(ob, scene))
if (!current || !BKE_object_lod_is_usable(ob, sl))
return ob;
while (current->prev && (!(current->flags & flag) || !current->source || current->source->type != OB_MESH)) {
@@ -831,14 +831,14 @@ static Object *lod_ob_get(Object *ob, Scene *scene, int flag)
return current->source;
}
struct Object *BKE_object_lod_meshob_get(Object *ob, Scene *scene)
struct Object *BKE_object_lod_meshob_get(Object *ob, SceneLayer *sl)
{
return lod_ob_get(ob, scene, OB_LOD_USE_MESH);
return lod_ob_get(ob, sl, OB_LOD_USE_MESH);
}
struct Object *BKE_object_lod_matob_get(Object *ob, Scene *scene)
struct Object *BKE_object_lod_matob_get(Object *ob, SceneLayer *sl)
{
return lod_ob_get(ob, scene, OB_LOD_USE_MAT);
return lod_ob_get(ob, sl, OB_LOD_USE_MAT);
}
#endif /* WITH_GAMEENGINE */