diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-05-31 15:06:09 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-05-31 15:06:09 -0400 |
commit | 74323fa54010d29737281579e4f3b4038da94989 (patch) | |
tree | cb0c97a58d5d103898b412be27f22f6893eb44ec /libdimension/texture.c | |
parent | c42fd6547afed0b65260ae6a8a07cf9dcf084b67 (diff) | |
download | dimension-74323fa54010d29737281579e4f3b4038da94989.tar.xz |
texture: Use pool.
Diffstat (limited to 'libdimension/texture.c')
-rw-r--r-- | libdimension/texture.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/libdimension/texture.c b/libdimension/texture.c index 0727ea1..515e260 100644 --- a/libdimension/texture.c +++ b/libdimension/texture.c @@ -25,29 +25,17 @@ #include "dimension-internal.h" -/* Allocate a dummy texture */ dmnsn_texture * -dmnsn_new_texture(void) +dmnsn_new_texture(dmnsn_pool *pool) { - dmnsn_texture *texture = DMNSN_MALLOC(dmnsn_texture); - texture->pigment = NULL; - texture->finish = dmnsn_new_finish(); - texture->trans = dmnsn_identity_matrix(); + dmnsn_texture *texture = DMNSN_PALLOC(pool, dmnsn_texture); + texture->pigment = NULL; + texture->finish = dmnsn_new_finish(); + texture->trans = dmnsn_identity_matrix(); texture->initialized = false; - DMNSN_REFCOUNT_INIT(texture); return texture; } -/* Free a texture */ -void -dmnsn_delete_texture(dmnsn_texture *texture) -{ - if (DMNSN_DECREF(texture)) { - dmnsn_free(texture); - } -} - -/* Calculate matrix inverses */ void dmnsn_texture_initialize(dmnsn_texture *texture) { @@ -63,14 +51,11 @@ dmnsn_texture_initialize(dmnsn_texture *texture) } } -/* Cascade a texture */ void -dmnsn_texture_cascade(dmnsn_texture *default_texture, - dmnsn_texture **texturep) +dmnsn_texture_cascade(dmnsn_texture *default_texture, dmnsn_texture **texturep) { if (!*texturep) { *texturep = default_texture; - DMNSN_INCREF(*texturep); } dmnsn_texture *texture = *texturep; |