From 3c2e6050b579c8e3c16d980e2ce70436d87e3a2d Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 26 May 2014 16:39:30 -0400 Subject: light: Get rid of ->ptr field. --- libdimension/dimension/light.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'libdimension/dimension/light.h') diff --git a/libdimension/dimension/light.h b/libdimension/dimension/light.h index a1f7ff2..aebb2d8 100644 --- a/libdimension/dimension/light.h +++ b/libdimension/dimension/light.h @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (C) 2009-2011 Tavian Barnes * + * Copyright (C) 2009-2014 Tavian Barnes * * * * This file is part of The Dimension Library. * * * @@ -54,16 +54,19 @@ 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_illumination_fn *illumination_fn; /**< Illumination callback. */ dmnsn_light_shadow_fn *shadow_fn; /**< Shadow callback. */ - dmnsn_free_fn *free_fn; /**< Desctructor callback. */ - - /** Generic pointer for light info. */ - void *ptr; + dmnsn_light_free_fn *free_fn; /**< Desctructor callback. */ DMNSN_REFCOUNT; /**< Reference count. */ }; @@ -74,6 +77,12 @@ struct dmnsn_light { */ dmnsn_light *dmnsn_new_light(void); +/** + * 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. -- cgit v1.2.3