summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-07 15:59:49 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-07 16:09:22 -0400
commit7b08644490cc1f897f4c327af839f0b2448351c0 (patch)
tree7d4fe3dbb0d2dbe8fef27a46f320eac40ecf7298 /libdimension/dimension
parent03c4f1bb394e6d0bee61a438937e068ccf57e09d (diff)
downloaddimension-7b08644490cc1f897f4c327af839f0b2448351c0.tar.xz
Don't use dynamic memory for dmnsn_intersection's.
Drops us from ~400,000 allocs to ~1000. Oops ><.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/object.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/libdimension/dimension/object.h b/libdimension/dimension/object.h
index 525c637..f0395cd 100644
--- a/libdimension/dimension/object.h
+++ b/libdimension/dimension/object.h
@@ -41,18 +41,14 @@ typedef struct dmnsn_intersection {
const dmnsn_interior *interior;
} dmnsn_intersection;
-/* Intersection allocation cannot fail */
-dmnsn_intersection *dmnsn_new_intersection();
-void dmnsn_delete_intersection(dmnsn_intersection *intersection);
-
/* Forward-declare dmnsn_object */
typedef struct dmnsn_object dmnsn_object;
/* Object callback types */
-typedef dmnsn_intersection *
-dmnsn_object_intersection_fn(const dmnsn_object *object, dmnsn_line line);
-
+typedef bool dmnsn_object_intersection_fn(const dmnsn_object *object,
+ dmnsn_line line,
+ dmnsn_intersection *intersection);
typedef bool dmnsn_object_inside_fn(const dmnsn_object *object,
dmnsn_vector point);