Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-10-08 02:43:34 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-08 02:43:34 +0300
commit04064fb186ae1089a2bf3006f120e68f789b5242 (patch)
treeb73156bffe9063da76a73ac6dab471ee40b7541d /source/blender/draw/intern
parentd022794cad977229386934e7d25365270671874f (diff)
Cleanup: use DRW_object_is_* for object checks
Also use const qualifier for object's.
Diffstat (limited to 'source/blender/draw/intern')
-rw-r--r--source/blender/draw/intern/DRW_render.h6
-rw-r--r--source/blender/draw/intern/draw_manager.c12
2 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index 193c2416215..2e91c8fd62d 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -507,11 +507,11 @@ DrawData *DRW_drawdata_ensure(
DrawDataFreeCb free_cb);
/* Settings */
-bool DRW_object_is_renderable(struct Object *ob);
-bool DRW_check_object_visible_within_active_context(struct Object *ob);
+bool DRW_object_is_renderable(const struct Object *ob);
+bool DRW_object_is_visible_in_active_context(const struct Object *ob);
bool DRW_object_is_flat_normal(const struct Object *ob);
-bool DRW_check_psys_visible_within_active_context(struct Object *object, struct ParticleSystem *psys);
+bool DRW_object_is_visible_psys_in_active_context(const struct Object *object, const struct ParticleSystem *psys);
/* Draw commands */
void DRW_draw_pass(DRWPass *pass);
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 0566abd3436..f987220e575 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -148,7 +148,7 @@ struct DRWTextStore *DRW_text_cache_ensure(void)
/** \name Settings
* \{ */
-bool DRW_object_is_renderable(Object *ob)
+bool DRW_object_is_renderable(const Object *ob)
{
BLI_assert(BKE_object_is_visible(ob, OB_VISIBILITY_CHECK_UNKNOWN_RENDER_MODE));
@@ -173,7 +173,7 @@ bool DRW_object_is_renderable(Object *ob)
* Return whether this object is visible depending if
* we are rendering or drawing in the viewport.
*/
-bool DRW_check_object_visible_within_active_context(Object *ob)
+bool DRW_object_is_visible_in_active_context(const Object *ob)
{
const eObjectVisibilityCheck mode = DRW_state_is_scene_render() ?
OB_VISIBILITY_CHECK_FOR_RENDER :
@@ -192,9 +192,9 @@ bool DRW_object_is_flat_normal(const Object *ob)
return true;
}
-bool DRW_check_psys_visible_within_active_context(
- Object *object,
- struct ParticleSystem *psys)
+bool DRW_object_is_visible_psys_in_active_context(
+ const Object *object,
+ const ParticleSystem *psys)
{
const DRWContextState *draw_ctx = DRW_context_state_get();
const Scene *scene = draw_ctx->scene;
@@ -1660,7 +1660,7 @@ static bool DRW_render_check_grease_pencil(Depsgraph *depsgraph)
{
DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN(depsgraph, ob)
{
- if ((ob->type == OB_GPENCIL) && (DRW_check_object_visible_within_active_context(ob))) {
+ if ((ob->type == OB_GPENCIL) && (DRW_object_is_visible_in_active_context(ob))) {
return true;
}
}