diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 13:24:13 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-08-21 13:24:13 -0600 |
commit | 942fd9ff8e267b361de580a95fa247e486120891 (patch) | |
tree | 683835731d05db901d98d10ba0023bb1ef3fb285 /libdimension-python/dimension.pyx | |
parent | 6b1fcde7af64ca81079dffe1d62096228693b5d6 (diff) | |
download | dimension-942fd9ff8e267b361de580a95fa247e486120891.tar.xz |
Replace sky_spheres with a single background pigment.
Diffstat (limited to 'libdimension-python/dimension.pyx')
-rw-r--r-- | libdimension-python/dimension.pyx | 53 |
1 files changed, 10 insertions, 43 deletions
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index d0bd4e7..a9ca3ac 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -1283,38 +1283,6 @@ cdef class PerspectiveCamera(Camera): # Move the camera into position self.transform(translate(Vector(location))) -############### -# Sky Spheres # -############### - -cdef class SkySphere: - """A scene background.""" - cdef dmnsn_sky_sphere *_sky_sphere - - def __init__(self, pigments): - """ - Create a SkySphere. - - Keyword arguments: - pigments -- the list of pigments that make up the background, in back-to- - front order - """ - self._sky_sphere = dmnsn_new_sky_sphere() - - cdef Pigment real_pigment - for pigment in pigments: - real_pigment = Pigment(pigment) - DMNSN_INCREF(real_pigment._pigment) - dmnsn_array_push(self._sky_sphere.pigments, &real_pigment._pigment) - - def __dealloc__(self): - dmnsn_delete_sky_sphere(self._sky_sphere) - - def transform(self, Matrix trans not None): - """Transform a sky sphere.""" - self._sky_sphere.trans = dmnsn_matrix_mul(trans._m, self._sky_sphere.trans) - return self - ########## # Scenes # ########## @@ -1400,18 +1368,17 @@ cdef class Scene: DMNSN_INCREF(self._scene.default_interior) property background: - """The solid background color of the scene (default: Black).""" + """The background pigment of the scene (default: Black).""" def __get__(self): - return _Color(self._scene.background) - def __set__(self, color): - self._scene.background = Color(color)._c - - property sky_sphere: - """The background sky pattern of the scene.""" - def __set__(self, SkySphere sky_sphere not None): - dmnsn_delete_sky_sphere(self._scene.sky_sphere) - self._scene.sky_sphere = sky_sphere._sky_sphere - DMNSN_INCREF(self._scene.sky_sphere) + if self._scene.background == NULL: + return None + else: + return _Pigment(self._scene.background) + def __set__(self, pigment): + dmnsn_delete_pigment(self._scene.background) + cdef Pigment real_pigment = Pigment(pigment) + self._scene.background = real_pigment._pigment + DMNSN_INCREF(self._scene.background) property adc_bailout: """The adaptive depth control bailout (default: 1/255).""" |