summaryrefslogtreecommitdiffstats
path: root/libdimension/cameras.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/cameras.c')
-rw-r--r--libdimension/cameras.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libdimension/cameras.c b/libdimension/cameras.c
index 1ab1360..dfe4708 100644
--- a/libdimension/cameras.c
+++ b/libdimension/cameras.c
@@ -39,8 +39,6 @@ dmnsn_new_perspective_camera(dmnsn_matrix trans)
dmnsn_matrix *ptr;
dmnsn_camera *camera = dmnsn_new_camera();
if (camera) {
- camera->ray_fn = &dmnsn_perspective_camera_ray_fn;
-
/* Allocate room for the transformation matrix */
ptr = malloc(sizeof(dmnsn_matrix));
if (!ptr) {
@@ -49,18 +47,11 @@ dmnsn_new_perspective_camera(dmnsn_matrix trans)
}
*ptr = trans;
camera->ptr = ptr;
- }
- return camera;
-}
-/* Delete a perspective camera */
-void
-dmnsn_delete_perspective_camera(dmnsn_camera *camera)
-{
- if (camera) {
- free(camera->ptr);
- dmnsn_delete_camera(camera);
+ camera->ray_fn = &dmnsn_perspective_camera_ray_fn;
+ camera->free_fn = &free;
}
+ return camera;
}
/* Get the transformation matrix */