summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-05-30 18:20:51 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-05-30 18:21:04 -0400
commit57ee9bfb0dddba7ea06fd0e09c8aa2d80b8eb46d (patch)
treeb30dea9a9c82a7dcd47494cafcf43230dc05bed9 /libdimension/dimension
parentc2b4dcc7660407f687604afe2c03eff0a4ff3a16 (diff)
downloaddimension-57ee9bfb0dddba7ea06fd0e09c8aa2d80b8eb46d.tar.xz
light: Use pool.
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/light.h22
-rw-r--r--libdimension/dimension/lights.h5
2 files changed, 7 insertions, 20 deletions
diff --git a/libdimension/dimension/light.h b/libdimension/dimension/light.h
index aebb2d8..218611d 100644
--- a/libdimension/dimension/light.h
+++ b/libdimension/dimension/light.h
@@ -54,37 +54,23 @@ typedef dmnsn_color dmnsn_light_illumination_fn(const dmnsn_light *light,
*/
typedef bool dmnsn_light_shadow_fn(const dmnsn_light *light, double t);
-/**
- * Light destruction callback.
- * @param[in,out] light The light to free.
- */
-typedef void dmnsn_light_free_fn(dmnsn_light *light);
-
/** A light. */
struct dmnsn_light {
/* Callbacks */
- dmnsn_light_direction_fn *direction_fn; /**< Direction callback. */
+ dmnsn_light_direction_fn *direction_fn; /**< Direction callback. */
dmnsn_light_illumination_fn *illumination_fn; /**< Illumination callback. */
- dmnsn_light_shadow_fn *shadow_fn; /**< Shadow callback. */
- dmnsn_light_free_fn *free_fn; /**< Desctructor callback. */
-
- DMNSN_REFCOUNT; /**< Reference count. */
+ dmnsn_light_shadow_fn *shadow_fn; /**< Shadow callback. */
};
/**
* Create a dummy light.
+ * @param[in] pool The memory pool to allocate from.
* @return The allocated light.
*/
-dmnsn_light *dmnsn_new_light(void);
+dmnsn_light *dmnsn_new_light(dmnsn_pool *pool);
/**
* Initialize a dmnsn_light field.
* @param[out] light The light to initialize.
*/
void dmnsn_init_light(dmnsn_light *light);
-
-/**
- * Delete a light.
- * @param[in,out] light The light to delete.
- */
-void dmnsn_delete_light(dmnsn_light *light);
diff --git a/libdimension/dimension/lights.h b/libdimension/dimension/lights.h
index 41ffad9..e7de4cc 100644
--- a/libdimension/dimension/lights.h
+++ b/libdimension/dimension/lights.h
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2009-2010 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2009-2014 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Library. *
* *
@@ -25,8 +25,9 @@
/**
* A point light.
+ * @param[in] pool The memory pool to allocate from.
* @param[in] x0 The origin of the light.
* @param[in] color The color of the light.
* @return A point light.
*/
-dmnsn_light *dmnsn_new_point_light(dmnsn_vector x0, dmnsn_color color);
+dmnsn_light *dmnsn_new_point_light(dmnsn_pool *pool, dmnsn_vector x0, dmnsn_color color);