diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-01 21:45:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-01 21:45:02 +0300 |
commit | f688e3cc3130e70e77f0bb050cd71cf1549c765c (patch) | |
tree | cb70e8529ac06af6303d8fef5bdf0d294d573a1d /source/blender/draw/engines/overlay | |
parent | 999f6526b1bc049cdccad3c7a8e165ab342f82d9 (diff) |
Cleanup: Use const for bounding boxes where possible
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_extra.c | 7 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/overlay_outline.c | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c index 9953480e7fa..4f0bf0b8048 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.c +++ b/source/blender/draw/engines/overlay/overlay_extra.c @@ -345,18 +345,17 @@ static void OVERLAY_bounds(OVERLAY_ExtraCallBuffers *cb, bool around_origin) { float center[3], size[3], tmp[4][4], final_mat[4][4]; - BoundBox bb_local; if (ob->type == OB_MBALL && !BKE_mball_is_basis(ob)) { return; } - BoundBox *bb = BKE_object_boundbox_get(ob); - + const BoundBox *bb = BKE_object_boundbox_get(ob); + BoundBox bb_local; if (bb == NULL) { const float min[3] = {-1.0f, -1.0f, -1.0f}, max[3] = {1.0f, 1.0f, 1.0f}; + BKE_boundbox_init_from_minmax(&bb_local, min, max); bb = &bb_local; - BKE_boundbox_init_from_minmax(bb, min, max); } BKE_boundbox_calc_size_aabb(bb, size); diff --git a/source/blender/draw/engines/overlay/overlay_outline.c b/source/blender/draw/engines/overlay/overlay_outline.c index cb94008f53f..8010319e3fa 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.c +++ b/source/blender/draw/engines/overlay/overlay_outline.c @@ -32,7 +32,7 @@ static void gpencil_depth_plane(Object *ob, float r_plane[4]) * strokes not aligned with the object axes. Maybe we could try to * compute the minimum axis of all strokes. But this would be more * computationally heavy and should go into the GPData evaluation. */ - BoundBox *bbox = BKE_object_boundbox_get(ob); + const BoundBox *bbox = BKE_object_boundbox_get(ob); /* Convert bbox to matrix */ float mat[4][4], size[3], center[3]; BKE_boundbox_calc_size_aabb(bbox, size); |