Skip to content
slaeshjag edited this page Mar 23, 2013 · 19 revisions

DARNIT_BBOX

a DARNIT_BBOX is a statically allocated list of bounding boxes. These can quickly be matched against an area, with a list of bounding boxes overlapping that area being returned.

  • DARNIT_BBOX *d_bbox_new( unsigned int size);
  • DARNIT_BBOX *d_bbox_free(DARNIT_BBOX *bbox);
  • int d_bbox_test(DARNIT_BBOX *bbox, int x, int y, unsigned int w, unsigned int h, unsigned int *list, unsigned int listlen);
  • int d_bbox_add(DARNIT_BBOX *bbox, unsigned int x, unsigned int y, unsigned int w, unsigned int h);
  • void d_bbox_delete(DARNIT_BBOX *bbox, int key);
  • void d_bbox_move(DARNIT_BBOX *bbox, int key, unsigned int x, unsigned int y);
  • void d_bbox_resize(DARNIT_BBOX *bbox, int key, unsigned int w, unsigned int h);
  • void d_bbox_clear(DARNIT_BBOX *bbox);

d_bbox_new

DARNIT_BBOX *d_bbox_new(unsigned int size);

Returns a list with space for size bounding boxes.

Arguments

  • size - Number of bounding boxes to allocate space for

Return value

NULL on failure. Something else is a valid bounding box list.

d_bbox_free

DARNIT_BBOX *d_bbox_free(DARNIT_BBOX *bbox);

Frees a list of bounding boxes and returns a NULL-pointer.

Arguments

  • bbox - A valid list of bounding boxes

Return value

  • A NULL-pointer. Provided for compact NULL-ing of the pointer that used to point to the list.

Clone this wiki locally