diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2018-05-18 13:51:05 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2018-05-18 13:58:08 -0700 |
commit | c984f4e13279a63391fef5137038e8243810847c (patch) | |
tree | 2d67c66c5cc2d4426ba448eb2c4f4306341d5489 /src | |
parent | bbda6b11ed13005a1927a4fd5896d7e87456b0e7 (diff) |
libix2: rename ix2_object_t functions
ix2_insert_object
ix2_remove_object
ix2_move_object
becomes
ix2_object_new
ix2_object_free
ix2_object_move
to be more consistent with the other libraries intended to be used
with this.
Diffstat (limited to 'src')
-rw-r--r-- | src/ix2.c | 8 | ||||
-rw-r--r-- | src/ix2.h | 6 |
2 files changed, 7 insertions, 7 deletions
@@ -417,8 +417,8 @@ void ix2_free(ix2_t *ix2) } -/* Insert object spatially described by object_aabb into the index ix2 */ -ix2_object_t * ix2_insert_object(ix2_t *ix2, float x, float y, aabb_t *object_aabb, void *object) +/* Create and insert object spatially described by x,y,object_aabb into the index ix2 */ +ix2_object_t * ix2_object_new(ix2_t *ix2, float x, float y, aabb_t *object_aabb, void *object) { unsigned depth = 0; ix2_object_t *o; @@ -452,7 +452,7 @@ ix2_object_t * ix2_insert_object(ix2_t *ix2, float x, float y, aabb_t *object_aa /* This may be either the object handle returned by ix2_node_insert(), or * the handle supplied to ix2_search_cb(). */ -void ix2_remove_object(ix2_t *ix2, ix2_object_t *object) +void ix2_object_free(ix2_t *ix2, ix2_object_t *object) { assert(ix2); assert(object); @@ -465,7 +465,7 @@ void ix2_remove_object(ix2_t *ix2, ix2_object_t *object) /* If object_aabb is omitted, only the x,y coordinates are updated */ /* Returns object on success, NULL on failure. */ /* On failure object is removed and freed. XXX: change to leave where it was? */ -ix2_object_t * ix2_move_object(ix2_t *ix2, ix2_object_t *object, float object_x, float object_y, aabb_t *object_aabb) +ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, float object_x, float object_y, aabb_t *object_aabb) { unsigned depth = 0; @@ -32,9 +32,9 @@ typedef ix2_search_status_t (*ix2_search_cb)(void *cb_context, ix2_object_t *ix2 ix2_t * ix2_new(aabb_t *aabb, unsigned max_per_node, unsigned max_depth); void ix2_free(ix2_t *ix2); -ix2_object_t * ix2_insert_object(ix2_t *ix2, float x, float y, aabb_t *aabb, void *object); -void ix2_remove_object(ix2_t *ix2, ix2_object_t *object); -ix2_object_t * ix2_move_object(ix2_t *ix2, ix2_object_t *object, float object_x, float object_y, aabb_t *object_aabb); +ix2_object_t * ix2_object_new(ix2_t *ix2, float x, float y, aabb_t *aabb, void *object); +void ix2_object_free(ix2_t *ix2, ix2_object_t *object); +ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, float object_x, float object_y, aabb_t *object_aabb); unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb cb, void *arg); unsigned ix2_search_by_aabb(ix2_t *ix2, float x, float y, aabb_t *aabb, ix2_search_cb cb, void *arg); unsigned ix2_search_by_ray(ix2_t *ix2, v2f_t *origin, v2f_t *direction, ix2_search_cb cb, void *arg); |