commit 9eaaeea468b069471532ce69ac0dc66b8c57a7d9 parent 97c701db99d277ff604d5b76a740fb2475324ff1 Author: Vincent Forest <vincent.forest@meso-star.com> Date: Tue, 15 Jan 2019 14:41:28 +0100 Add an helper enclosure function Map an enclosure primitive id in scene space Diffstat:
| M | src/sdis_scene_c.h | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/sdis_scene_c.h b/src/sdis_scene_c.h @@ -132,6 +132,15 @@ enclosure_copy_and_release(struct enclosure* dst, struct enclosure* src) return RES_OK; } +static INLINE unsigned +enclosure_local2global_prim_id + (const struct enclosure* enc, + const size_t local_prim_id) +{ + ASSERT(enc && local_prim_id < darray_uint_size_get(&enc->local2global)); + return darray_uint_cdata_get(&enc->local2global)[local_prim_id]; +} + /* Declare the array of interfaces */ #define DARRAY_NAME interf #define DARRAY_DATA struct sdis_interface*