summaryrefslogtreecommitdiffstats
path: root/libdimension/array.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-06-14 01:48:35 +0000
committerTavian Barnes <tavianator@gmail.com>2009-06-14 01:48:35 +0000
commit3ce0bfcd0e16d909b7495f07c9e8a82e4781ee88 (patch)
tree98ba25a085f0a06ab41a152fff3f065909611a91 /libdimension/array.c
parent9f8055ac23b829babe5ed469251435b64ac82831 (diff)
downloaddimension-3ce0bfcd0e16d909b7495f07c9e8a82e4781ee88.tar.xz
Make raytracing engine multi-threaded.
Diffstat (limited to 'libdimension/array.c')
-rw-r--r--libdimension/array.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdimension/array.c b/libdimension/array.c
index e6e4363..88eb88f 100644
--- a/libdimension/array.c
+++ b/libdimension/array.c
@@ -53,6 +53,15 @@ dmnsn_array_pop(dmnsn_array *array, void *obj)
dmnsn_array_resize(array, array->length - 1);
}
+void *
+dmnsn_array_at(dmnsn_array *array, size_t i)
+{
+ if (i >= array->length) {
+ dmnsn_error(DMNSN_SEVERITY_HIGH, "Array index out of bounds.");
+ }
+ return array->ptr + array->obj_size*i;
+}
+
void
dmnsn_array_get(const dmnsn_array *array, size_t i, void *obj)
{