From df33e223baa85b600863fc1b38850a5c37680632 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 27 May 2014 13:46:51 -0400 Subject: pigment: Kill ->ptr field. --- libdimension/dimension/pigment.h | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'libdimension/dimension') diff --git a/libdimension/dimension/pigment.h b/libdimension/dimension/pigment.h index b046993..455ee72 100644 --- a/libdimension/dimension/pigment.h +++ b/libdimension/dimension/pigment.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. * * * @@ -41,21 +41,24 @@ typedef dmnsn_tcolor dmnsn_pigment_fn(const dmnsn_pigment *pigment, */ typedef void dmnsn_pigment_initialize_fn(dmnsn_pigment *pigment); +/** + * Pigment destructor callback. + * @param[in,out] pigment The pigment to destroy. + */ +typedef void dmnsn_pigment_free_fn(dmnsn_pigment *pigment); + /** A pigment. */ struct dmnsn_pigment { - dmnsn_pigment_fn *pigment_fn; /**< The pigment callback. */ + dmnsn_pigment_fn *pigment_fn; /**< The pigment callback. */ dmnsn_pigment_initialize_fn *initialize_fn; /**< The initializer callback. */ - dmnsn_free_fn *free_fn; /**< The destructor callback. */ + dmnsn_pigment_free_fn *free_fn; /**< The destructor callback. */ - dmnsn_matrix trans; /**< Transformation matrix. */ + dmnsn_matrix trans; /**< Transformation matrix. */ dmnsn_matrix trans_inv; /**< The inverse of the transformation matrix. */ /** Quick color -- used for low-quality renders. */ dmnsn_tcolor quick_color; - /** Generic pointer. */ - void *ptr; - DMNSN_REFCOUNT; /** Reference count. */ bool initialized; /** @internal Whether the pigment is initialized. */ }; @@ -66,6 +69,12 @@ struct dmnsn_pigment { */ dmnsn_pigment *dmnsn_new_pigment(void); +/** + * Initialize a dmnsn_pigment field. + * @param[out] pigment The pigment to initialize. + */ +void dmnsn_init_pigment(dmnsn_pigment *pigment); + /** * Delete a pigment. * @param[in,out] pigment The pigment to delete. -- cgit v1.2.3