summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libdimension/dimension/scene.h2
-rw-r--r--libdimension/prtree.c11
-rw-r--r--libdimension/raytrace.c6
3 files changed, 8 insertions, 11 deletions
diff --git a/libdimension/dimension/scene.h b/libdimension/dimension/scene.h
index 56addd0..6831048 100644
--- a/libdimension/dimension/scene.h
+++ b/libdimension/dimension/scene.h
@@ -25,6 +25,8 @@
#ifndef DIMENSION_SCENE_H
#define DIMENSION_SCENE_H
+#include <stdbool.h>
+
enum {
DMNSN_RENDER_NONE = 0,
DMNSN_RENDER_PIGMENT = 1 << 0,
diff --git a/libdimension/prtree.c b/libdimension/prtree.c
index a806850..b99c7e1 100644
--- a/libdimension/prtree.c
+++ b/libdimension/prtree.c
@@ -436,15 +436,6 @@ dmnsn_pseudo_prtree_leaves(const dmnsn_pseudo_prtree *pseudo)
return leaves;
}
-/* Pre-calculate bounding box transformations, etc. */
-static void
-dmnsn_precompute_objects(const dmnsn_array *objects)
-{
- DMNSN_ARRAY_FOREACH (dmnsn_object **, object, objects) {
- dmnsn_object_precompute(*object);
- }
-}
-
/* Split the unbounded objects into a new list */
static dmnsn_list *
dmnsn_split_unbounded(dmnsn_list *objects)
@@ -473,8 +464,6 @@ dmnsn_split_unbounded(dmnsn_list *objects)
dmnsn_prtree *
dmnsn_new_prtree(const dmnsn_array *objects)
{
- dmnsn_precompute_objects(objects);
-
dmnsn_list *leaves = dmnsn_list_from_array(objects);
dmnsn_list *unbounded = dmnsn_split_unbounded(leaves);
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c
index 2c389dc..8adde41 100644
--- a/libdimension/raytrace.c
+++ b/libdimension/raytrace.c
@@ -75,6 +75,12 @@ static int
dmnsn_raytrace_scene_thread(void *ptr)
{
dmnsn_raytrace_payload *payload = ptr;
+
+ /* Pre-calculate bounding box transformations, etc. */
+ DMNSN_ARRAY_FOREACH (dmnsn_object **, object, payload->scene->objects) {
+ dmnsn_object_precompute(*object);
+ }
+
payload->prtree = dmnsn_new_prtree(payload->scene->objects);
dmnsn_raytrace_payload *payloads;