diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2014-05-30 18:20:51 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2014-05-30 18:21:04 -0400 |
commit | 57ee9bfb0dddba7ea06fd0e09c8aa2d80b8eb46d (patch) | |
tree | b30dea9a9c82a7dcd47494cafcf43230dc05bed9 /libdimension-python | |
parent | c2b4dcc7660407f687604afe2c03eff0a4ff3a16 (diff) | |
download | dimension-57ee9bfb0dddba7ea06fd0e09c8aa2d80b8eb46d.tar.xz |
light: Use pool.
Diffstat (limited to 'libdimension-python')
-rw-r--r-- | libdimension-python/dimension.pxd | 5 | ||||
-rw-r--r-- | libdimension-python/dimension.pyx | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd index 55c2ab8..55d47ab 100644 --- a/libdimension-python/dimension.pxd +++ b/libdimension-python/dimension.pxd @@ -360,10 +360,9 @@ cdef extern from "../libdimension/dimension.h": ctypedef struct dmnsn_light: dmnsn_vector x0 - dmnsn_light *dmnsn_new_light() - void dmnsn_delete_light(dmnsn_light *light) + dmnsn_light *dmnsn_new_light(dmnsn_pool *pool) - 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) ########### # Cameras # diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index 28392db..da45f32 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -1415,9 +1415,6 @@ cdef class Light: """A light.""" cdef dmnsn_light *_light - def __dealloc__(self): - dmnsn_delete_light(self._light) - cdef class PointLight(Light): """A point light.""" def __init__(self, location, color): @@ -1428,7 +1425,7 @@ cdef class PointLight(Light): location -- the origin of the light rays color -- the color and intensity of the light """ - self._light = dmnsn_new_point_light(Vector(location)._v, Color(color)._c) + self._light = dmnsn_new_point_light(_get_pool(), Vector(location)._v, Color(color)._c) Light.__init__(self) ########### @@ -1521,7 +1518,6 @@ cdef class Scene: cdef dmnsn_light *l for light in lights: l = (<Light?>light)._light - DMNSN_INCREF(l) dmnsn_array_push(self._scene.lights, &l) self._scene.camera = camera._camera |