summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-05-31 15:06:09 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-05-31 15:06:09 -0400
commit74323fa54010d29737281579e4f3b4038da94989 (patch)
treecb0c97a58d5d103898b412be27f22f6893eb44ec /libdimension-python
parentc42fd6547afed0b65260ae6a8a07cf9dcf084b67 (diff)
downloaddimension-74323fa54010d29737281579e4f3b4038da94989.tar.xz
texture: Use pool.
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pxd6
-rw-r--r--libdimension-python/dimension.pyx10
2 files changed, 3 insertions, 13 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd
index b822827..33f2300 100644
--- a/libdimension-python/dimension.pxd
+++ b/libdimension-python/dimension.pxd
@@ -295,11 +295,9 @@ cdef extern from "../libdimension/dimension.h":
dmnsn_finish finish
dmnsn_matrix trans
- dmnsn_texture *dmnsn_new_texture()
- void dmnsn_delete_texture(dmnsn_texture *texture)
+ dmnsn_texture *dmnsn_new_texture(dmnsn_pool *pool)
- void dmnsn_texture_cascade(dmnsn_texture *default_texture,
- dmnsn_texture **texture)
+ void dmnsn_texture_cascade(dmnsn_texture *default_texture, dmnsn_texture **texture)
#############
# Interiors #
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index 7c951d6..2ab683d 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -963,7 +963,7 @@ cdef class Texture(_Transformable):
pigment -- the Pigment for the texture, or a color (default: None)
finish -- the Finish for the texture (default: None)
"""
- self._texture = dmnsn_new_texture()
+ self._texture = dmnsn_new_texture(_get_pool())
if pigment is not None:
self.pigment = Pigment(pigment)
@@ -971,9 +971,6 @@ cdef class Texture(_Transformable):
if finish is not None:
self.finish = finish
- def __dealloc__(self):
- dmnsn_delete_texture(self._texture)
-
property pigment:
"""The texture's pigment."""
def __get__(self):
@@ -1005,7 +1002,6 @@ cdef Texture _Texture(dmnsn_texture *texture):
"""Wrap a Texture object around a dmnsn_texture *."""
cdef Texture self = Texture.__new__(Texture)
self._texture = texture
- DMNSN_INCREF(self._texture)
return self
#############
@@ -1095,12 +1091,10 @@ cdef class Object(_Transformable):
else:
return _Texture(self._object.texture)
def __set__(self, Texture texture):
- dmnsn_delete_texture(self._object.texture)
if texture is None:
self._object.texture = NULL
else:
self._object.texture = texture._texture
- DMNSN_INCREF(self._object.texture)
property interior:
"""The object's Interior."""
@@ -1526,9 +1520,7 @@ cdef class Scene:
def __get__(self):
return _Texture(self._scene.default_texture)
def __set__(self, Texture texture not None):
- dmnsn_delete_texture(self._scene.default_texture)
self._scene.default_texture = texture._texture
- DMNSN_INCREF(self._scene.default_texture)
property default_interior:
"""The default Interior for objects."""
def __get__(self):