src/raytracermodule.cc
branchpyrit
changeset 20 f22952603f29
parent 19 4e0955fca797
child 21 79b516a3803d
--- a/src/raytracermodule.cc	Mon Nov 26 23:12:40 2007 +0100
+++ b/src/raytracermodule.cc	Thu Nov 29 18:30:16 2007 +0100
@@ -423,6 +423,7 @@
 	v->raytracer = new Raytracer();
 	v->children = new vector<PyObject*>();
 	v->raytracer->setCamera(new Camera());
+	v->raytracer->setTop(new KdTree());
 
 	return (PyObject*)v;
 }
@@ -453,7 +454,9 @@
 		return NULL;
 
 	printf("[pyrit] Raytracing...\n");
-	data = ((RaytracerObject *)self)->raytracer->render(w, h);
+	((RaytracerObject *)self)->raytracer->getTop()->optimize();
+	data = (float *) malloc(w*h*3*sizeof(float));
+	((RaytracerObject *)self)->raytracer->render(w, h, data);
 	if (!data) {
 		Py_INCREF(Py_None);
 		return Py_None;